171171#include " qgsmaptoolnodetool.h"
172172#include " qgsmaptoolpan.h"
173173#include " qgsmaptoolselect.h"
174+ #include " qgsmaptoolreshape.h"
174175#include " qgsmaptoolsplitfeatures.h"
175176#include " qgsmaptoolvertexedit.h"
176177#include " qgsmaptoolzoom.h"
@@ -473,6 +474,7 @@ QgisApp::~QgisApp()
473474 delete mMapTools .mCaptureLine ;
474475 delete mMapTools .mCapturePolygon ;
475476 delete mMapTools .mMoveFeature ;
477+ delete mMapTools .mReshapeFeatures ;
476478 delete mMapTools .mSplitFeatures ;
477479 delete mMapTools .mSelect ;
478480 delete mMapTools .mVertexAdd ;
@@ -660,6 +662,12 @@ void QgisApp::createActions()
660662 connect ( mActionMoveFeature , SIGNAL ( triggered () ), this , SLOT ( moveFeature () ) );
661663 mActionMoveFeature ->setEnabled ( false );
662664
665+ mActionReshapeFeatures = new QAction ( getThemeIcon ( " mActionReshape.png" ), tr ( " Reshape Features" ), this );
666+ shortcuts->registerAction ( mActionReshapeFeatures );
667+ mActionReshapeFeatures ->setStatusTip ( tr ( " Reshape Features" ) );
668+ connect ( mActionReshapeFeatures , SIGNAL ( triggered () ), this , SLOT ( reshapeFeatures () ) );
669+ mActionReshapeFeatures ->setEnabled ( false );
670+
663671 mActionSplitFeatures = new QAction ( getThemeIcon ( " mActionSplitFeatures.png" ), tr ( " Split Features" ), this );
664672 shortcuts->registerAction ( mActionSplitFeatures );
665673 mActionSplitFeatures ->setStatusTip ( tr ( " Split Features" ) );
@@ -1062,6 +1070,8 @@ void QgisApp::createActionGroups()
10621070 mMapToolGroup ->addAction ( mActionCapturePolygon );
10631071 mActionMoveFeature ->setCheckable ( true );
10641072 mMapToolGroup ->addAction ( mActionMoveFeature );
1073+ mActionReshapeFeatures ->setCheckable ( true );
1074+ mMapToolGroup ->addAction ( mActionReshapeFeatures );
10651075 mActionSplitFeatures ->setCheckable ( true );
10661076 mMapToolGroup ->addAction ( mActionSplitFeatures );
10671077 mMapToolGroup ->addAction ( mActionDeleteSelected );
@@ -1175,6 +1185,7 @@ void QgisApp::createMenus()
11751185 mEditMenu ->addAction ( mActionAddIsland );
11761186 mEditMenu ->addAction ( mActionDeleteRing );
11771187 mEditMenu ->addAction ( mActionDeletePart );
1188+ mEditMenu ->addAction ( mActionReshapeFeatures );
11781189 mEditMenu ->addAction ( mActionSplitFeatures );
11791190 mEditMenu ->addAction ( mActionMergeFeatures );
11801191 mEditMenu ->addAction ( mActionNodeTool );
@@ -1383,6 +1394,7 @@ void QgisApp::createToolBars()
13831394 mAdvancedDigitizeToolBar ->addAction ( mActionAddIsland );
13841395 mAdvancedDigitizeToolBar ->addAction ( mActionDeleteRing );
13851396 mAdvancedDigitizeToolBar ->addAction ( mActionDeletePart );
1397+ mAdvancedDigitizeToolBar ->addAction ( mActionReshapeFeatures );
13861398 mAdvancedDigitizeToolBar ->addAction ( mActionSplitFeatures );
13871399 mAdvancedDigitizeToolBar ->addAction ( mActionMergeFeatures );
13881400 mAdvancedDigitizeToolBar ->addAction ( mActionNodeTool );
@@ -1605,6 +1617,7 @@ void QgisApp::setTheme( QString theThemeName )
16051617 mActionCaptureLine ->setIcon ( getThemeIcon ( " /mActionCaptureLine.png" ) );
16061618 mActionCapturePolygon ->setIcon ( getThemeIcon ( " /mActionCapturePolygon.png" ) );
16071619 mActionMoveFeature ->setIcon ( getThemeIcon ( " /mActionMoveFeature.png" ) );
1620+ mActionReshapeFeatures ->setIcon ( getThemeIcon ( " /mActionReshape.png" ) );
16081621 mActionSplitFeatures ->setIcon ( getThemeIcon ( " /mActionSplitFeatures.png" ) );
16091622 mActionDeleteSelected ->setIcon ( getThemeIcon ( " /mActionDeleteSelected.png" ) );
16101623 mActionAddVertex ->setIcon ( getThemeIcon ( " /mActionAddVertex.png" ) );
@@ -1735,6 +1748,8 @@ void QgisApp::createCanvas()
17351748 mActionCapturePolygon ->setVisible ( false );
17361749 mMapTools .mMoveFeature = new QgsMapToolMoveFeature ( mMapCanvas );
17371750 mMapTools .mMoveFeature ->setAction ( mActionMoveFeature );
1751+ mMapTools .mReshapeFeatures = new QgsMapToolReshape ( mMapCanvas );
1752+ mMapTools .mReshapeFeatures ->setAction ( mActionReshapeFeatures );
17381753 mMapTools .mSplitFeatures = new QgsMapToolSplitFeatures ( mMapCanvas );
17391754 mMapTools .mSplitFeatures ->setAction ( mActionSplitFeatures );
17401755 mMapTools .mSelect = new QgsMapToolSelect ( mMapCanvas );
@@ -4337,6 +4352,11 @@ void QgisApp::splitFeatures()
43374352 mMapCanvas ->setMapTool ( mMapTools .mSplitFeatures );
43384353}
43394354
4355+ void QgisApp::reshapeFeatures ()
4356+ {
4357+ mMapCanvas ->setMapTool ( mMapTools .mReshapeFeatures );
4358+ }
4359+
43404360void QgisApp::capturePoint ()
43414361{
43424362 if ( mMapCanvas && mMapCanvas ->isDrawing () )
@@ -5634,6 +5654,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
56345654 mActionMoveVertex ->setEnabled ( false );
56355655 mActionAddRing ->setEnabled ( false );
56365656 mActionAddIsland ->setEnabled ( false );
5657+ mActionReshapeFeatures ->setEnabled ( false );
56375658 mActionSplitFeatures ->setEnabled ( false );
56385659 mActionSimplifyFeature ->setEnabled ( false );
56395660 mActionDeleteRing ->setEnabled ( false );
@@ -5650,6 +5671,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
56505671 {
56515672 mActionCaptureLine ->setEnabled ( true );
56525673 mActionCaptureLine ->setVisible ( true );
5674+ mActionReshapeFeatures ->setEnabled ( true );
56535675 mActionSplitFeatures ->setEnabled ( true );
56545676 mActionSimplifyFeature ->setEnabled ( true );
56555677 mActionDeletePart ->setEnabled ( true );
@@ -5659,6 +5681,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
56595681 {
56605682 mActionCaptureLine ->setEnabled ( false );
56615683 mActionCaptureLine ->setVisible ( false );
5684+ mActionReshapeFeatures ->setEnabled ( false );
56625685 mActionSplitFeatures ->setEnabled ( false );
56635686 mActionSimplifyFeature ->setEnabled ( false );
56645687 mActionDeletePart ->setEnabled ( false );
@@ -5679,6 +5702,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
56795702 mActionCapturePolygon ->setVisible ( true );
56805703 mActionAddRing ->setEnabled ( true );
56815704 mActionAddIsland ->setEnabled ( true );
5705+ mActionReshapeFeatures ->setEnabled ( true );
56825706 mActionSplitFeatures ->setEnabled ( true );
56835707 mActionSimplifyFeature ->setEnabled ( true );
56845708 mActionDeleteRing ->setEnabled ( true );
@@ -5690,6 +5714,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
56905714 mActionCapturePolygon ->setVisible ( false );
56915715 mActionAddRing ->setEnabled ( false );
56925716 mActionAddIsland ->setEnabled ( false );
5717+ mActionReshapeFeatures ->setEnabled ( false );
56935718 mActionSplitFeatures ->setEnabled ( false );
56945719 mActionSimplifyFeature ->setEnabled ( false );
56955720 mActionDeleteRing ->setEnabled ( false );
0 commit comments