Skip to content
Permalink
Browse files

feature scaler base

(cherry picked from commit a646509)
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 12, 2021
1 parent 3feda23 commit df526567c3744d525c91f8a2877407838abc01c6
@@ -399,6 +399,7 @@
<file>themes/default/mActionSaveEdits.svg</file>
<file>themes/default/mActionSaveMapAsImage.svg</file>
<file>themes/default/mActionScaleBar.svg</file>
<file>themes/default/mActionScaleFeature.svg</file>
<file>themes/default/mActionScriptOpen.svg</file>
<file>themes/default/mActionSelect.svg</file>
<file>themes/default/mActionSelectAll.svg</file>
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="24"
viewBox="0 0 24 24"
width="24"
version="1.1"
id="svg16"
sodipodi:docname="mActionScaleFeature.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata22">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs20" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="745"
id="namedview18"
showgrid="false"
inkscape:snap-global="false"
inkscape:zoom="11.313709"
inkscape:cx="5.7185255"
inkscape:cy="7.3666708"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g14" />
<g
transform="translate(0 -8)"
id="g14">
<path
d="m8.0275933 9.5013891c-2.8183472.0466368-5.2878242 1.2552559-6.2839838 4.1947259-.98846785 2.916771 1.1714865 8.182008 5.9325763 5.840503 7.9077412-3.889027 7.9038032.963382 9.8807382.963382 2.438571 0 4.94037-1.699566 4.94037-3.873599 0-1.944514.09638-3.806388-.992208-4.87712-1.976935-1.944514-2.973677.987396-8.289071-1.184158-1.694017-.6920746-3.4974127-1.0917169-5.1884217-1.0637339z"
fill="#8cbe8c"
fill-rule="evenodd"
stroke="#555753"
stroke-linecap="round"
stroke-linejoin="round"
id="path2" />
<rect
fill="#3c5a6e"
height="11"
rx="2.01149"
width="11"
x="13"
y="21"
id="rect4" />
<path
d="m14.000001 26.999999 8.999999-.009599s0 0 0-2c0-2.9904-1-2.9904-4.5-2.9904s-4.5 0-4.5 3c0 2 0 2 .000001 1.999999z"
fill="#fcffff"
fill-rule="evenodd"
opacity=".3"
id="path6" />
<path
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.64053571"
d="m 20.20315,23.377428 -0.04037,1.899596 -2.182423,-0.003 -0.05919,2.952822 2.178518,0.01863 -0.04038,1.899598 3.398691,-3.377342 z"
id="path4922"
sodipodi:nodetypes="cccccccc" />
<path
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.64632034"
d="m 16.780734,30.124787 0.01948,-1.898705 2.223023,0.01017 0.03824,-2.963147 -2.230837,-0.01408 0.01948,-1.898707 -3.423378,3.364856 z"
id="path4922-9"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>
@@ -91,6 +91,7 @@ set(QGIS_APP_SRCS
qgsmaptoolreverseline.cpp
qgsmaptoolrotatefeature.cpp
qgsmaptoolrotatepointsymbols.cpp
qgsmaptoolscalefeature.cpp
qgsmaptoolselect.cpp
qgsmaptoolselectionhandler.cpp
qgsmaptoolselectutils.cpp
@@ -467,6 +467,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmaptoolmeasureangle.h"
#include "qgsmaptoolmovefeature.h"
#include "qgsmaptoolrotatefeature.h"
#include "qgsmaptoolscalefeature.h"
#include "qgsmaptooloffsetcurve.h"
#include "qgsmaptooloffsetpointsymbol.h"
#include "qgsmaptoolpan.h"
@@ -1799,6 +1800,7 @@ QgisApp::~QgisApp()
delete mMapTools.mReshapeFeatures;
delete mMapTools.mReverseLine;
delete mMapTools.mRotateFeature;
delete mMapTools.mScaleFeature;
delete mMapTools.mRotateLabel;
delete mMapTools.mRotatePointSymbolsTool;
delete mMapTools.mOffsetPointSymbolTool;
@@ -2679,7 +2681,7 @@ void QgisApp::createActions()
connect( mActionMoveFeature, &QAction::triggered, this, &QgisApp::moveFeature );
connect( mActionMoveFeatureCopy, &QAction::triggered, this, &QgisApp::moveFeatureCopy );
connect( mActionRotateFeature, &QAction::triggered, this, &QgisApp::rotateFeature );

connect( mActionScaleFeature, &QAction::triggered, this, &QgisApp::scaleFeature );
connect( mActionReshapeFeatures, &QAction::triggered, this, &QgisApp::reshapeFeatures );
connect( mActionSplitFeatures, &QAction::triggered, this, &QgisApp::splitFeatures );
connect( mActionSplitParts, &QAction::triggered, this, &QgisApp::splitParts );
@@ -3052,6 +3054,7 @@ void QgisApp::createActionGroups()
mMapToolGroup->addAction( mActionMoveFeature );
mMapToolGroup->addAction( mActionMoveFeatureCopy );
mMapToolGroup->addAction( mActionRotateFeature );
mMapToolGroup->addAction( mActionScaleFeature );
mMapToolGroup->addAction( mActionOffsetCurve );
mMapToolGroup->addAction( mActionReshapeFeatures );
mMapToolGroup->addAction( mActionSplitFeatures );
@@ -3731,6 +3734,7 @@ void QgisApp::createToolBars()

// Cad toolbar
mAdvancedDigitizeToolBar->insertAction( mActionRotateFeature, mAdvancedDigitizingDockWidget->enableAction() );
mAdvancedDigitizeToolBar->insertAction( mActionScaleFeature, mAdvancedDigitizingDockWidget->enableAction() );

// move feature tool button
QToolButton *moveFeatureButton = new QToolButton( mAdvancedDigitizeToolBar );
@@ -4086,6 +4090,7 @@ void QgisApp::setTheme( const QString &themeName )
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeaturePoint.svg" ) ) );
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopyPoint.svg" ) ) );
mActionRotateFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionRotateFeature.svg" ) ) );
mActionScaleFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionScaleFeature.svg" ) ) );
mActionReshapeFeatures->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionReshape.svg" ) ) );
mActionSplitFeatures->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSplitFeatures.svg" ) ) );
mActionSplitParts->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSplitParts.svg" ) ) );
@@ -4415,6 +4420,8 @@ void QgisApp::createCanvasTools()
mMapTools.mMoveFeatureCopy->setAction( mActionMoveFeatureCopy );
mMapTools.mRotateFeature = new QgsMapToolRotateFeature( mMapCanvas );
mMapTools.mRotateFeature->setAction( mActionRotateFeature );
mMapTools.mScaleFeature = new QgsMapToolScaleFeature( mMapCanvas );
mMapTools.mScaleFeature->setAction( mActionScaleFeature );
mMapTools.mOffsetCurve = new QgsMapToolOffsetCurve( mMapCanvas );
mMapTools.mOffsetCurve->setAction( mActionOffsetCurve );
mMapTools.mReshapeFeatures = new QgsMapToolReshape( mMapCanvas );
@@ -9888,6 +9895,11 @@ void QgisApp::rotateFeature()
mMapCanvas->setMapTool( mMapTools.mRotateFeature );
}

void QgisApp::scaleFeature()
{
mMapCanvas->setMapTool( mMapTools.mScaleFeature );
}

void QgisApp::rotateLabel()
{
mMapCanvas->setMapTool( mMapTools.mRotateLabel );
mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionScaleFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionVertexTool->setEnabled( false );
mActionVertexToolActiveLayer->setEnabled( false );
mActionMoveFeature->setEnabled( isEditable && canChangeGeometry );
mActionMoveFeatureCopy->setEnabled( isEditable && canChangeGeometry );
mActionRotateFeature->setEnabled( isEditable && canChangeGeometry );
mActionScaleFeature->setEnabled( isEditable && canChangeGeometry );
mActionVertexTool->setEnabled( isEditable && canChangeGeometry );
mActionVertexToolActiveLayer->setEnabled( isEditable && canChangeGeometry );

mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionScaleFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionScaleFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionScaleFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionScaleFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
@@ -483,6 +483,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionMoveFeature() { return mActionMoveFeature; }
QAction *actionMoveFeatureCopy() { return mActionMoveFeatureCopy; }
QAction *actionRotateFeature() { return mActionRotateFeature;}
QAction *actionScaleFeature() { return mActionScaleFeature;}
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
QAction *actionSplitParts() { return mActionSplitParts; }
QAction *actionAddRing() { return mActionAddRing; }
@@ -1861,6 +1862,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void moveLabel();
//! Activates rotate feature tool
void rotateFeature();
//! Activates scale feature tool
void scaleFeature();
//! Activates rotate label tool
void rotateLabel();
//! Activates label property tool
@@ -2443,6 +2446,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool *mShowHideLabels = nullptr;
QgsMapTool *mMoveLabel = nullptr;
QgsMapTool *mRotateFeature = nullptr;
QgsMapTool *mScaleFeature = nullptr;
QgsMapTool *mRotateLabel = nullptr;
QgsMapTool *mChangeLabelProperties = nullptr;
QgsMapTool *mReverseLine = nullptr ;

0 comments on commit df52656

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