Skip to content
Permalink
Browse files

Update CAD maptools to implement new virtual methods

  • Loading branch information
m-kuhn authored and 3nids committed Sep 11, 2015
1 parent 3831668 commit 29d5f926c0bf675d79ff44c1fb7d8e71c5573279
@@ -24,8 +24,6 @@
#include "qgspointv2.h"
#include "qgisapp.h"

#include <QMouseEvent>

QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture* parentTool, QgsMapCanvas* canvas, CaptureMode mode )
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), mode )
, mParentTool( parentTool )
@@ -36,7 +36,7 @@ QgsMapToolAddPart::~QgsMapToolAddPart()
{
}

void QgsMapToolAddPart::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{
//check if we operate on a vector layer
QgsVectorLayer *vlayer = currentVectorLayer();
@@ -23,5 +23,5 @@ class APP_EXPORT QgsMapToolAddPart : public QgsMapToolCapture
public:
QgsMapToolAddPart( QgsMapCanvas* canvas );
virtual ~QgsMapToolAddPart();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};
@@ -35,7 +35,7 @@ QgsMapToolAddRing::~QgsMapToolAddRing()
{
}

void QgsMapToolAddRing::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolAddRing::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{

emit messageDiscarded();
@@ -23,5 +23,5 @@ class APP_EXPORT QgsMapToolAddRing: public QgsMapToolCapture
public:
QgsMapToolAddRing( QgsMapCanvas* canvas );
virtual ~QgsMapToolAddRing();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};
@@ -17,7 +17,7 @@ QgsMapToolCircularStringCurvePoint::~QgsMapToolCircularStringCurvePoint()
{
}

void QgsMapToolCircularStringCurvePoint::canvasReleaseEvent( QgsMapMouseEvent* e )
void QgsMapToolCircularStringCurvePoint::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
{
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );

@@ -76,7 +76,7 @@ void QgsMapToolCircularStringCurvePoint::canvasReleaseEvent( QgsMapMouseEvent* e
}
}

void QgsMapToolCircularStringCurvePoint::canvasMoveEvent( QgsMapMouseEvent* e )
void QgsMapToolCircularStringCurvePoint::cadCanvasMoveEvent( QgsMapMouseEvent* e )
{
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );
QgsVertexId idx; idx.part = 0; idx.ring = 0; idx.vertex = mPoints.size();
@@ -25,8 +25,8 @@ class QgsMapToolCircularStringCurvePoint: public QgsMapToolAddCircularString
QgsMapToolCircularStringCurvePoint( QgsMapToolCapture* parentTool, QgsMapCanvas* canvas, CaptureMode mode = CaptureLine );
~QgsMapToolCircularStringCurvePoint();

void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
void canvasMoveEvent( QgsMapMouseEvent* e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) override;
void cadCanvasMoveEvent( QgsMapMouseEvent* e ) override;
};

#endif // QGSMAPTOOLCIRCULARSTRINGCURVEPOINT_H
@@ -41,7 +41,7 @@ QgsMapToolCircularStringRadius::~QgsMapToolCircularStringRadius()

}

void QgsMapToolCircularStringRadius::canvasReleaseEvent( QgsMapMouseEvent* e )
void QgsMapToolCircularStringRadius::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
{
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );

@@ -115,7 +115,7 @@ void QgsMapToolCircularStringRadius::canvasReleaseEvent( QgsMapMouseEvent* e )
}
}

void QgsMapToolCircularStringRadius::canvasMoveEvent( QgsMapMouseEvent* e )
void QgsMapToolCircularStringRadius::cadCanvasMoveEvent( QgsMapMouseEvent* e )
{
if ( mPoints.size() > 0 && mRadiusMode )
{
@@ -29,8 +29,8 @@ class QgsMapToolCircularStringRadius: public QgsMapToolAddCircularString
QgsMapToolCircularStringRadius( QgsMapToolCapture* parentTool, QgsMapCanvas* canvas, CaptureMode mode = CaptureLine );
~QgsMapToolCircularStringRadius();

virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
virtual void canvasMoveEvent( QgsMapMouseEvent* e ) override;
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) override;
virtual void cadCanvasMoveEvent( QgsMapMouseEvent* e ) override;

private slots:
void updateRadiusFromSpinBox( double radius );
@@ -34,7 +34,7 @@ QgsMapToolFillRing::~QgsMapToolFillRing()
{
}

void QgsMapToolFillRing::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolFillRing::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{
//check if we operate on a vector layer
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
@@ -26,5 +26,5 @@ class APP_EXPORT QgsMapToolFillRing: public QgsMapToolCapture
public:
QgsMapToolFillRing( QgsMapCanvas* canvas );
virtual ~QgsMapToolFillRing();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};
@@ -30,7 +30,7 @@ QgsMapToolReshape::~QgsMapToolReshape()
{
}

void QgsMapToolReshape::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolReshape::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{
//check if we operate on a vector layer //todo: move this to a function in parent class to avoid duplication
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
@@ -27,7 +27,7 @@ class APP_EXPORT QgsMapToolReshape: public QgsMapToolCapture
public:
QgsMapToolReshape( QgsMapCanvas* canvas );
virtual ~QgsMapToolReshape();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};

#endif
@@ -34,7 +34,7 @@ QgsMapToolSplitFeatures::~QgsMapToolSplitFeatures()

}

void QgsMapToolSplitFeatures::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolSplitFeatures::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{
//check if we operate on a vector layer
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
@@ -26,7 +26,7 @@ class APP_EXPORT QgsMapToolSplitFeatures: public QgsMapToolCapture
public:
QgsMapToolSplitFeatures( QgsMapCanvas* canvas );
virtual ~QgsMapToolSplitFeatures();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};

#endif
@@ -34,7 +34,7 @@ QgsMapToolSplitParts::~QgsMapToolSplitParts()

}

void QgsMapToolSplitParts::canvasReleaseEvent( QgsMapMouseEvent * e )
void QgsMapToolSplitParts::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
{
//check if we operate on a vector layer
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
@@ -26,7 +26,7 @@ class QgsMapToolSplitParts: public QgsMapToolCapture
public:
QgsMapToolSplitParts( QgsMapCanvas* canvas );
virtual ~QgsMapToolSplitParts();
void canvasReleaseEvent( QgsMapMouseEvent * e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent * e ) override;
};

#endif

0 comments on commit 29d5f92

Please sign in to comment.
You can’t perform that action at this time.