@@ -342,6 +342,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
342
342
#include " qgsmaptoolellipsefoci.h"
343
343
#include " qgsmaptoolrectanglecenter.h"
344
344
#include " qgsmaptoolrectangleextent.h"
345
+ #include " qgsmaptoolrectangle3points.h"
345
346
#include " qgsmaptoolsquarecenter.h"
346
347
#include " qgsmaptoolregularpolygon2points.h"
347
348
#include " qgsmaptoolregularpolygoncenterpoint.h"
@@ -1407,6 +1408,7 @@ QgisApp::~QgisApp()
1407
1408
delete mMapTools .mEllipseFoci ;
1408
1409
delete mMapTools .mRectangleCenterPoint ;
1409
1410
delete mMapTools .mRectangleExtent ;
1411
+ delete mMapTools .mRectangle3Points ;
1410
1412
delete mMapTools .mSquareCenter ;
1411
1413
delete mMapTools .mRegularPolygon2Points ;
1412
1414
delete mMapTools .mRegularPolygonCenterPoint ;
@@ -1866,6 +1868,7 @@ void QgisApp::createActions()
1866
1868
connect ( mActionEllipseFoci , &QAction::triggered, this , &QgisApp::ellipseFoci );
1867
1869
connect ( mActionRectangleCenterPoint , &QAction::triggered, this , &QgisApp::rectangleCenterPoint );
1868
1870
connect ( mActionRectangleExtent , &QAction::triggered, this , &QgisApp::rectangleExtent );
1871
+ connect ( mActionRectangle3Points , &QAction::triggered, this , &QgisApp::rectangle3Points );
1869
1872
connect ( mActionSquareCenter , &QAction::triggered, this , &QgisApp::squareCenter );
1870
1873
connect ( mActionRegularPolygon2Points , &QAction::triggered, this , &QgisApp::regularPolygon2Points );
1871
1874
connect ( mActionRegularPolygonCenterPoint , &QAction::triggered, this , &QgisApp::regularPolygonCenterPoint );
@@ -2153,6 +2156,7 @@ void QgisApp::createActionGroups()
2153
2156
mMapToolGroup ->addAction ( mActionEllipseFoci );
2154
2157
mMapToolGroup ->addAction ( mActionRectangleCenterPoint );
2155
2158
mMapToolGroup ->addAction ( mActionRectangleExtent );
2159
+ mMapToolGroup ->addAction ( mActionRectangle3Points );
2156
2160
mMapToolGroup ->addAction ( mActionSquareCenter );
2157
2161
mMapToolGroup ->addAction ( mActionRegularPolygon2Points );
2158
2162
mMapToolGroup ->addAction ( mActionRegularPolygonCenterPoint );
@@ -2693,6 +2697,7 @@ void QgisApp::createToolBars()
2693
2697
tbAddRectangle->setPopupMode ( QToolButton::MenuButtonPopup );
2694
2698
tbAddRectangle->addAction ( mActionRectangleCenterPoint );
2695
2699
tbAddRectangle->addAction ( mActionRectangleExtent );
2700
+ tbAddRectangle->addAction ( mActionRectangle3Points );
2696
2701
tbAddRectangle->addAction ( mActionSquareCenter );
2697
2702
tbAddRectangle->setDefaultAction ( mActionRectangleCenterPoint );
2698
2703
connect ( tbAddRectangle, &QToolButton::triggered, this , &QgisApp::toolButtonActionTriggered );
@@ -3296,6 +3301,8 @@ void QgisApp::createCanvasTools()
3296
3301
mMapTools .mRectangleCenterPoint ->setAction ( mActionRectangleCenterPoint );
3297
3302
mMapTools .mRectangleExtent = new QgsMapToolRectangleExtent ( dynamic_cast <QgsMapToolAddFeature *>( mMapTools .mAddFeature ), mMapCanvas );
3298
3303
mMapTools .mRectangleExtent ->setAction ( mActionRectangleExtent );
3304
+ mMapTools .mRectangle3Points = new QgsMapToolRectangle3Points ( dynamic_cast <QgsMapToolAddFeature *>( mMapTools .mAddFeature ), mMapCanvas );
3305
+ mMapTools .mRectangle3Points ->setAction ( mActionRectangle3Points );
3299
3306
mMapTools .mSquareCenter = new QgsMapToolSquareCenter ( dynamic_cast <QgsMapToolAddFeature *>( mMapTools .mAddFeature ), mMapCanvas );
3300
3307
mMapTools .mSquareCenter ->setAction ( mActionSquareCenter );
3301
3308
mMapTools .mRegularPolygon2Points = new QgsMapToolRegularPolygon2Points ( dynamic_cast <QgsMapToolAddFeature *>( mMapTools .mAddFeature ), mMapCanvas );
@@ -7917,6 +7924,11 @@ void QgisApp::rectangleExtent()
7917
7924
mMapCanvas ->setMapTool ( mMapTools .mRectangleExtent );
7918
7925
}
7919
7926
7927
+ void QgisApp::rectangle3Points ()
7928
+ {
7929
+ mMapCanvas ->setMapTool ( mMapTools .mRectangle3Points );
7930
+ }
7931
+
7920
7932
void QgisApp::squareCenter ()
7921
7933
{
7922
7934
mMapCanvas ->setMapTool ( mMapTools .mSquareCenter );
@@ -11397,6 +11409,8 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11397
11409
&& ( vlayer->geometryType () == QgsWkbTypes::LineGeometry || vlayer->geometryType () == QgsWkbTypes::PolygonGeometry ) );
11398
11410
mActionRectangleExtent ->setEnabled ( isEditable && ( canAddFeatures || canChangeGeometry )
11399
11411
&& ( vlayer->geometryType () == QgsWkbTypes::LineGeometry || vlayer->geometryType () == QgsWkbTypes::PolygonGeometry ) );
11412
+ mActionRectangle3Points ->setEnabled ( isEditable && ( canAddFeatures || canChangeGeometry )
11413
+ && ( vlayer->geometryType () == QgsWkbTypes::LineGeometry || vlayer->geometryType () == QgsWkbTypes::PolygonGeometry ) );
11400
11414
mActionSquareCenter ->setEnabled ( isEditable && ( canAddFeatures || canChangeGeometry )
11401
11415
&& ( vlayer->geometryType () == QgsWkbTypes::LineGeometry || vlayer->geometryType () == QgsWkbTypes::PolygonGeometry ) );
11402
11416
mActionRegularPolygon2Points ->setEnabled ( isEditable && ( canAddFeatures || canChangeGeometry )
0 commit comments