mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-28 00:04:04 -04:00
Visual indent part 2
This commit is contained in:
parent
e335e481fd
commit
dec09cf5bd
@ -24,7 +24,6 @@ QgsMapToolCircle2Points::QgsMapToolCircle2Points( QgsMapToolCapture *parentTool,
|
|||||||
QgsMapCanvas *canvas, CaptureMode mode )
|
QgsMapCanvas *canvas, CaptureMode mode )
|
||||||
: QgsMapToolAddCircle( parentTool, canvas, mode )
|
: QgsMapToolAddCircle( parentTool, canvas, mode )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsMapToolCircle2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
void QgsMapToolCircle2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
||||||
|
@ -70,10 +70,9 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e
|
|||||||
QgsMessageBar::CRITICAL, QgisApp::instance()->messageTimeout() );
|
QgsMessageBar::CRITICAL, QgisApp::instance()->messageTimeout() );
|
||||||
deactivate();
|
deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
createRadiusSpinBox();
|
createRadiusSpinBox();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( e->button() == Qt::RightButton )
|
else if ( e->button() == Qt::RightButton )
|
||||||
{
|
{
|
||||||
@ -222,8 +221,6 @@ void QgsMapToolCircle2TangentsPoint::getPossibleCenter( )
|
|||||||
mCenters.append( p4 );
|
mCenters.append( p4 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsMapToolCircle2TangentsPoint::createRadiusSpinBox()
|
void QgsMapToolCircle2TangentsPoint::createRadiusSpinBox()
|
||||||
@ -270,6 +267,5 @@ void QgsMapToolCircle2TangentsPoint::radiusSpinBoxChanged( int radius )
|
|||||||
tempRB->show();
|
tempRB->show();
|
||||||
mRubberBands.append( tempRB.release() );
|
mRubberBands.append( tempRB.release() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ class QgsMapToolCircle2TangentsPoint: public QgsMapToolAddCircle
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void radiusSpinBoxChanged( int radius );
|
void radiusSpinBoxChanged( int radius );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Return the point where segments are intersected. Method from QgsGeometryUtils doesn't work for special cases used by this tool.
|
//! Return the point where segments are intersected. Method from QgsGeometryUtils doesn't work for special cases used by this tool.
|
||||||
QgsPointXY intersect( QgsPointXY seg1_pt1, QgsPointXY seg1_pt2, QgsPointXY seg2_pt1, QgsPointXY seg2_pt2 );
|
QgsPointXY intersect( QgsPointXY seg1_pt1, QgsPointXY seg1_pt2, QgsPointXY seg2_pt1, QgsPointXY seg2_pt2 );
|
||||||
@ -50,7 +51,6 @@ class QgsMapToolCircle2TangentsPoint: public QgsMapToolAddCircle
|
|||||||
|
|
||||||
QSpinBox *mRadiusSpinBox = nullptr;
|
QSpinBox *mRadiusSpinBox = nullptr;
|
||||||
|
|
||||||
|
|
||||||
int mRadius = 0;
|
int mRadius = 0;
|
||||||
QVector<QgsPointXY> mCenters;
|
QVector<QgsPointXY> mCenters;
|
||||||
QVector<QgsGeometryRubberBand *> mRubberBands;
|
QVector<QgsGeometryRubberBand *> mRubberBands;
|
||||||
|
@ -35,7 +35,6 @@ void QgsMapToolCircle3Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
|||||||
{
|
{
|
||||||
if ( mPoints.size() < 2 )
|
if ( mPoints.size() < 2 )
|
||||||
mPoints.append( mapPoint );
|
mPoints.append( mapPoint );
|
||||||
|
|
||||||
if ( !mPoints.isEmpty() && !mTempRubberBand )
|
if ( !mPoints.isEmpty() && !mTempRubberBand )
|
||||||
{
|
{
|
||||||
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
|
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
|
||||||
|
@ -32,7 +32,6 @@ QgsMapToolCircle3Tangents::QgsMapToolCircle3Tangents( QgsMapToolCapture *parentT
|
|||||||
|
|
||||||
void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
||||||
{
|
{
|
||||||
|
|
||||||
QgsPoint mapPoint( e->mapPoint() );
|
QgsPoint mapPoint( e->mapPoint() );
|
||||||
EdgesOnlyFilter filter;
|
EdgesOnlyFilter filter;
|
||||||
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
|
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
|
||||||
@ -66,7 +65,6 @@ void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
|||||||
{
|
{
|
||||||
if ( match.isValid() && ( mPoints.size() == 4 ) )
|
if ( match.isValid() && ( mPoints.size() == 4 ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
match.edgePoints( p1, p2 );
|
match.edgePoints( p1, p2 );
|
||||||
mPoints.append( QgsPoint( p1 ) );
|
mPoints.append( QgsPoint( p1 ) );
|
||||||
mPoints.append( QgsPoint( p2 ) );
|
mPoints.append( QgsPoint( p2 ) );
|
||||||
|
@ -28,7 +28,6 @@ class QgsMapToolCircle3Tangents: public QgsMapToolAddCircle
|
|||||||
QgsMapToolCircle3Tangents( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode = CaptureLine );
|
QgsMapToolCircle3Tangents( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode = CaptureLine );
|
||||||
|
|
||||||
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
|
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QGSMAPTOOLCIRCLE3TANGENTS_H
|
#endif // QGSMAPTOOLCIRCLE3TANGENTS_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user