1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<file>themes/default/mActionNewFolder.png</file>
<file>themes/default/mActionNewVectorLayer.png</file>
<file>themes/default/mActionNodeTool.png</file>
<file>themes/default/mActionOffsetCurve.png</file>
<file>themes/default/mActionOpenTable.png</file>
<file>themes/default/mActionOptions.png</file>
<file>themes/default/mActionPan.png</file>
Expand Down
Binary file added images/themes/default/mActionOffsetCurve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ SET(QGIS_APP_SRCS
qgsmaptoolmovefeature.cpp
qgsmaptoolmovelabel.cpp
qgsmaptoolmovevertex.cpp
qgsmaptooloffsetcurve.cpp
qgsmaptoolreshape.cpp
qgsmaptoolrotatelabel.cpp
qgsmaptoolrotatepointsymbols.cpp
Expand Down Expand Up @@ -201,6 +202,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolmovefeature.h
qgsmaptoolmovelabel.h
qgsmaptoolmovevertex.h
qgsmaptooloffsetcurve.h
qgsmaptoolreshape.h
qgsmaptoolrotatelabel.h
qgsmaptoolrotatepointsymbols.h
Expand Down
15 changes: 15 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
#include "qgsmaptoolmeasureangle.h"
#include "qgsmaptoolmovefeature.h"
#include "qgsmaptoolmovevertex.h"
#include "qgsmaptooloffsetcurve.h"
#include "qgsmaptoolpan.h"
#include "qgsmaptoolselect.h"
#include "qgsmaptoolselectrectangle.h"
Expand Down Expand Up @@ -814,6 +815,7 @@ void QgisApp::createActions()
connect( mActionNodeTool, SIGNAL( triggered() ), this, SLOT( nodeTool() ) );
connect( mActionRotatePointSymbols, SIGNAL( triggered() ), this, SLOT( rotatePointSymbols() ) );
connect( mActionSnappingOptions, SIGNAL( triggered() ), this, SLOT( snappingOptions() ) );
connect( mActionOffsetCurve, SIGNAL( triggered() ), this, SLOT( offsetCurve() ) );

// View Menu Items

Expand Down Expand Up @@ -1016,6 +1018,7 @@ void QgisApp::createActionGroups()
mMapToolGroup->addAction( mActionMeasureAngle );
mMapToolGroup->addAction( mActionAddFeature );
mMapToolGroup->addAction( mActionMoveFeature );
mMapToolGroup->addAction( mActionOffsetCurve );
mMapToolGroup->addAction( mActionReshapeFeatures );
mMapToolGroup->addAction( mActionSplitFeatures );
mMapToolGroup->addAction( mActionDeleteSelected );
Expand Down Expand Up @@ -1664,6 +1667,8 @@ void QgisApp::createCanvasTools()
mMapTools.mAddFeature->setAction( mActionAddFeature );
mMapTools.mMoveFeature = new QgsMapToolMoveFeature( mMapCanvas );
mMapTools.mMoveFeature->setAction( mActionMoveFeature );
mMapTools.mOffsetCurve = new QgsMapToolOffsetCurve( mMapCanvas );
mMapTools.mOffsetCurve->setAction( mActionOffsetCurve );
mMapTools.mReshapeFeatures = new QgsMapToolReshape( mMapCanvas );
mMapTools.mReshapeFeatures->setAction( mActionReshapeFeatures );
mMapTools.mSplitFeatures = new QgsMapToolSplitFeatures( mMapCanvas );
Expand Down Expand Up @@ -3588,6 +3593,11 @@ void QgisApp::moveFeature()
mMapCanvas->setMapTool( mMapTools.mMoveFeature );
}

void QgisApp::offsetCurve()
{
mMapCanvas->setMapTool( mMapTools.mOffsetCurve );
}

void QgisApp::simplifyFeature()
{
mMapCanvas->setMapTool( mMapTools.mSimplifyFeature );
Expand Down Expand Up @@ -6127,6 +6137,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionFeatureAction->setEnabled( false );
mActionAddFeature->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionDeleteSelected->setEnabled( false );
mActionCutFeatures->setEnabled( false );
Expand All @@ -6141,6 +6152,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionDeleteRing->setEnabled( false );
mActionDeletePart->setEnabled( false );
mActionReshapeFeatures->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionSplitFeatures->setEnabled( false );
mActionMergeFeatures->setEnabled( false );
mActionMergeFeatureAttributes->setEnabled( false );
Expand Down Expand Up @@ -6259,6 +6271,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionAddPart->setEnabled( false );
mActionDeletePart->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionNodeTool->setEnabled( false );
}

Expand Down Expand Up @@ -6291,6 +6304,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionReshapeFeatures->setEnabled( true );
mActionSplitFeatures->setEnabled( true );
mActionSimplifyFeature->setEnabled( true );
mActionOffsetCurve->setEnabled( dprovider->capabilities() & QgsVectorDataProvider::ChangeAttributeValues );
}
else
{
Expand Down Expand Up @@ -6370,6 +6384,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionAddPart->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionPasteFeatures->setEnabled( false );
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionDeletePart() { return mActionDeletePart; }
QAction *actionNodeTool() { return mActionNodeTool; }
QAction *actionSnappingOptions() { return mActionSnappingOptions; }
QAction *actionOffsetCurve() { return mActionOffsetCurve; }

QAction *actionPan() { return mActionPan; }
QAction *actionPanToSelected() { return mActionPanToSelected; }
Expand Down Expand Up @@ -673,6 +674,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void addFeature();
//! activates the move feature tool
void moveFeature();
//! activates the offset curve tool
void offsetCurve();
//! activates the reshape features tool
void reshapeFeatures();
//! activates the split features tool
Expand Down Expand Up @@ -991,6 +994,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool* mMeasureAngle;
QgsMapTool* mAddFeature;
QgsMapTool* mMoveFeature;
QgsMapTool* mOffsetCurve;
QgsMapTool* mReshapeFeatures;
QgsMapTool* mSplitFeatures;
QgsMapTool* mSelect;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmovefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
}

//find first geometry under mouse cursor and store iterator to it
QgsPoint layerCoords = toLayerCoordinates(( QgsMapLayer* )vlayer, e->pos() );
QgsPoint layerCoords = toLayerCoordinates( vlayer, e->pos() );
QSettings settings;
double searchRadius = QgsTolerance::vertexSearchRadius( mCanvas->currentLayer(), mCanvas->mapRenderer() );
QgsRectangle selectRect( layerCoords.x() - searchRadius, layerCoords.y() - searchRadius,
Expand Down
Loading