|
225 | 225 | #include "qgsmaptooladdfeature.h" |
226 | 226 | #include "qgsmaptooladdpart.h" |
227 | 227 | #include "qgsmaptooladdring.h" |
| 228 | +#include "qgsmaptoolfillring.h" |
228 | 229 | #include "qgsmaptoolannotation.h" |
229 | 230 | #include "qgsmaptooldeletering.h" |
230 | 231 | #include "qgsmaptooldeletepart.h" |
@@ -793,6 +794,7 @@ QgisApp::~QgisApp() |
793 | 794 | delete mMapTools.mAddFeature; |
794 | 795 | delete mMapTools.mAddPart; |
795 | 796 | delete mMapTools.mAddRing; |
| 797 | + delete mMapTools.mFillRing; |
796 | 798 | delete mMapTools.mAnnotation; |
797 | 799 | delete mMapTools.mChangeLabelProperties; |
798 | 800 | delete mMapTools.mDeletePart; |
@@ -982,6 +984,7 @@ void QgisApp::createActions() |
982 | 984 | connect( mActionSplitParts, SIGNAL( triggered() ), this, SLOT( splitParts() ) ); |
983 | 985 | connect( mActionDeleteSelected, SIGNAL( triggered() ), this, SLOT( deleteSelected() ) ); |
984 | 986 | connect( mActionAddRing, SIGNAL( triggered() ), this, SLOT( addRing() ) ); |
| 987 | + connect( mActionFillRing, SIGNAL( triggered() ), this, SLOT( fillRing() ) ); |
985 | 988 | connect( mActionAddPart, SIGNAL( triggered() ), this, SLOT( addPart() ) ); |
986 | 989 | connect( mActionSimplifyFeature, SIGNAL( triggered() ), this, SLOT( simplifyFeature() ) ); |
987 | 990 | connect( mActionDeleteRing, SIGNAL( triggered() ), this, SLOT( deleteRing() ) ); |
@@ -1253,6 +1256,7 @@ void QgisApp::createActionGroups() |
1253 | 1256 | mMapToolGroup->addAction( mActionSplitParts ); |
1254 | 1257 | mMapToolGroup->addAction( mActionDeleteSelected ); |
1255 | 1258 | mMapToolGroup->addAction( mActionAddRing ); |
| 1259 | + mMapToolGroup->addAction( mActionFillRing ); |
1256 | 1260 | mMapToolGroup->addAction( mActionAddPart ); |
1257 | 1261 | mMapToolGroup->addAction( mActionSimplifyFeature ); |
1258 | 1262 | mMapToolGroup->addAction( mActionDeleteRing ); |
@@ -1799,6 +1803,7 @@ void QgisApp::setTheme( QString theThemeName ) |
1799 | 1803 | mActionUndo->setIcon( QgsApplication::getThemeIcon( "/mActionUndo.png" ) ); |
1800 | 1804 | mActionRedo->setIcon( QgsApplication::getThemeIcon( "/mActionRedo.png" ) ); |
1801 | 1805 | mActionAddRing->setIcon( QgsApplication::getThemeIcon( "/mActionAddRing.png" ) ); |
| 1806 | + mActionFillRing->setIcon( QgsApplication::getThemeIcon( "/mActionFillRing.png" ) ); |
1802 | 1807 | mActionAddPart->setIcon( QgsApplication::getThemeIcon( "/mActionAddPart.png" ) ); |
1803 | 1808 | mActionDeleteRing->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteRing.png" ) ); |
1804 | 1809 | mActionDeletePart->setIcon( QgsApplication::getThemeIcon( "/mActionDeletePart.png" ) ); |
@@ -2030,6 +2035,8 @@ void QgisApp::createCanvasTools() |
2030 | 2035 | mMapTools.mSelectRadius->setAction( mActionSelectRadius ); |
2031 | 2036 | mMapTools.mAddRing = new QgsMapToolAddRing( mMapCanvas ); |
2032 | 2037 | mMapTools.mAddRing->setAction( mActionAddRing ); |
| 2038 | + mMapTools.mFillRing = new QgsMapToolFillRing( mMapCanvas ); |
| 2039 | + mMapTools.mFillRing->setAction( mActionFillRing ); |
2033 | 2040 | mMapTools.mAddPart = new QgsMapToolAddPart( mMapCanvas ); |
2034 | 2041 | mMapTools.mSimplifyFeature = new QgsMapToolSimplify( mMapCanvas ); |
2035 | 2042 | mMapTools.mSimplifyFeature->setAction( mActionSimplifyFeature ); |
@@ -5573,6 +5580,16 @@ void QgisApp::addRing() |
5573 | 5580 | mMapCanvas->setMapTool( mMapTools.mAddRing ); |
5574 | 5581 | } |
5575 | 5582 |
|
| 5583 | +void QgisApp::fillRing() |
| 5584 | +{ |
| 5585 | + if ( mMapCanvas && mMapCanvas->isDrawing() ) |
| 5586 | + { |
| 5587 | + return; |
| 5588 | + } |
| 5589 | + mMapCanvas->setMapTool( mMapTools.mFillRing ); |
| 5590 | +} |
| 5591 | + |
| 5592 | + |
5576 | 5593 | void QgisApp::addPart() |
5577 | 5594 | { |
5578 | 5595 | if ( mMapCanvas && mMapCanvas->isDrawing() ) |
@@ -8382,6 +8399,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer ) |
8382 | 8399 | mActionRedo->setEnabled( false ); |
8383 | 8400 | mActionSimplifyFeature->setEnabled( false ); |
8384 | 8401 | mActionAddRing->setEnabled( false ); |
| 8402 | + mActionFillRing->setEnabled( false ); |
8385 | 8403 | mActionAddPart->setEnabled( false ); |
8386 | 8404 | mActionDeleteRing->setEnabled( false ); |
8387 | 8405 | mActionDeletePart->setEnabled( false ); |
@@ -8514,6 +8532,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer ) |
8514 | 8532 | mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCapturePoint.png" ) ); |
8515 | 8533 |
|
8516 | 8534 | mActionAddRing->setEnabled( false ); |
| 8535 | + mActionFillRing->setEnabled( false ); |
8517 | 8536 | mActionReshapeFeatures->setEnabled( false ); |
8518 | 8537 | mActionSplitFeatures->setEnabled( false ); |
8519 | 8538 | mActionSplitParts->setEnabled( false ); |
@@ -8541,13 +8560,15 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer ) |
8541 | 8560 | mActionOffsetCurve->setEnabled( isEditable && canAddFeatures && canChangeAttributes ); |
8542 | 8561 |
|
8543 | 8562 | mActionAddRing->setEnabled( false ); |
| 8563 | + mActionFillRing->setEnabled( false ); |
8544 | 8564 | mActionDeleteRing->setEnabled( false ); |
8545 | 8565 | } |
8546 | 8566 | else if ( vlayer->geometryType() == QGis::Polygon ) |
8547 | 8567 | { |
8548 | 8568 | mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCapturePolygon.png" ) ); |
8549 | 8569 |
|
8550 | 8570 | mActionAddRing->setEnabled( isEditable && canAddFeatures ); |
| 8571 | + mActionFillRing->setEnabled( isEditable && canAddFeatures ); |
8551 | 8572 | mActionReshapeFeatures->setEnabled( isEditable && canAddFeatures ); |
8552 | 8573 | mActionSplitFeatures->setEnabled( isEditable && canAddFeatures ); |
8553 | 8574 | mActionSplitParts->setEnabled( isEditable && canAddFeatures ); |
@@ -8621,6 +8642,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer ) |
8621 | 8642 | mActionAddFeature->setEnabled( false ); |
8622 | 8643 | mActionDeleteSelected->setEnabled( false ); |
8623 | 8644 | mActionAddRing->setEnabled( false ); |
| 8645 | + mActionFillRing->setEnabled( false ); |
8624 | 8646 | mActionAddPart->setEnabled( false ); |
8625 | 8647 | mActionNodeTool->setEnabled( false ); |
8626 | 8648 | mActionMoveFeature->setEnabled( false ); |
|
0 commit comments