Skip to content
Permalink
Browse files

Add reverse line maptools

  • Loading branch information
lbartoletti committed Aug 17, 2018
1 parent 6d1e420 commit 81974f9670477cde50c35235cdc7fbecf2a0d9d1
@@ -702,6 +702,7 @@
<file>themes/default/mIconGPU.svg</file>
<file>themes/default/mAddToProject.svg</file>
<file>themes/default/mDockify.svg</file>
<file>themes/default/mActionReverseLine.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
@@ -0,0 +1,142 @@
<?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="svg28"
sodipodi:docname="mActionReverseLine.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<metadata
id="metadata34">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs32" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1025"
id="namedview30"
showgrid="false"
inkscape:zoom="19.666667"
inkscape:cx="-2.3885008"
inkscape:cy="4.628421"
inkscape:window-x="-2"
inkscape:window-y="-3"
inkscape:window-maximized="1"
inkscape:current-layer="svg28" />
<linearGradient
gradientUnits="userSpaceOnUse"
x1="50.5"
x2="50.5"
y1="16.9999985"
y2="22.9999985"
id="linearGradient6">
<stop
offset="0"
stop-color="#555753"
id="stop2" />
<stop
offset="1"
stop-color="#555753"
stop-opacity="0"
id="stop4" />
</linearGradient>
<g
id="g908">
<path
d="M 2.5,2.5 9,15 15,5 h 6"
id="path8"
inkscape:connector-curvature="0"
style="fill:none;stroke:#8cbe8c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round" />
<path
d="m 1.5,1.5 h 3 v 3 h -3 z"
id="path10"
inkscape:connector-curvature="0"
style="fill:#bebebe;stroke:#8c8c8c;stroke-width:0.99999994" />
<path
d="m 7.5,13.5 h 3 v 3 h -3 z"
id="path12"
inkscape:connector-curvature="0"
style="fill:#bebebe;stroke:#8c8c8c;stroke-width:0.99999994" />
<path
d="m 13.5,3.5 h 3 v 3 h -3 z"
id="path14"
inkscape:connector-curvature="0"
style="fill:#bebebe;stroke:#8c8c8c;stroke-width:0.99999994" />
<path
d="m 19.5,3.5 h 3 v 3 h -3 z"
id="path16"
inkscape:connector-curvature="0"
style="fill:#bebebe;stroke:#8c8c8c;stroke-width:0.99999994" />
<rect
style="fill:#3c5a6e"
id="rect18"
y="13"
x="13"
width="11"
rx="2.0114901"
height="11" />
<path
style="opacity:0.3;fill:#fcffff;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path20"
d="M 14.000001,18.999999 23,18.9904 c 0,0 0,0 0,-2 C 23,14 22,14 18.5,14 15,14 14,14 14,17 c 0,2 0,2 10e-7,1.999999 z" />
<g
transform="translate(0.29660973,-0.33568939)"
id="g892">
<g
id="g863"
transform="translate(0.29652254,-0.63559322)">
<path
sodipodi:nodetypes="ccc"
d="m 21.73671,17.720509 c 0,-1.520773 -1.164073,-2.165959 -2.923152,-2.152625 -1.898205,-0.01537 -2.770607,0.433996 -2.770607,2.186312"
id="path14-3"
inkscape:connector-curvature="0"
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:square" />
<path
d="m 18.085585,17.851653 -2,1.5 -2,-1.5"
id="path16-7"
inkscape:connector-curvature="0"
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round" />
</g>
<g
transform="rotate(-180,18.055129,19.153486)"
id="g863-8">
<path
sodipodi:nodetypes="ccc"
d="m 21.73671,17.720509 c 0,-1.520773 -1.164073,-2.165959 -2.923152,-2.152625 -1.898205,-0.01537 -2.770607,0.433996 -2.770607,2.186312"
id="path14-3-5"
inkscape:connector-curvature="0"
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:square" />
<path
d="m 18.085585,17.851653 -2,1.5 -2,-1.5"
id="path16-7-2"
inkscape:connector-curvature="0"
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round" />
</g>
</g>
</g>
</svg>
@@ -97,6 +97,7 @@ SET(QGIS_APP_SRCS
qgsmaptooloffsetpointsymbol.cpp
qgsmaptoolpointsymbol.cpp
qgsmaptoolreshape.cpp
qgsmaptoolreverseline.cpp
qgsmaptoolrotatefeature.cpp
qgsmaptoolrotatelabel.cpp
qgsmaptoolrotatepointsymbols.cpp
@@ -318,6 +319,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptooloffsetpointsymbol.h
qgsmaptoolpointsymbol.h
qgsmaptoolreshape.h
qgsmaptoolreverseline.h
qgsmaptoolrotatefeature.h
qgsmaptoolrotatelabel.h
qgsmaptoolrotatepointsymbols.h
@@ -402,6 +402,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmaptoolmovelabel.h"
#include "qgsmaptoolrotatelabel.h"
#include "qgsmaptoolchangelabelproperties.h"
#include "qgsmaptoolreverseline.h"

#include "vertextool/qgsvertextool.h"

@@ -1465,6 +1466,7 @@ QgisApp::~QgisApp()
delete mMapTools.mOffsetCurve;
delete mMapTools.mPinLabels;
delete mMapTools.mReshapeFeatures;
delete mMapTools.mReverseLine;
delete mMapTools.mRotateFeature;
delete mMapTools.mRotateLabel;
delete mMapTools.mRotatePointSymbolsTool;
@@ -2056,6 +2058,7 @@ void QgisApp::createActions()
connect( mActionOffsetPointSymbol, &QAction::triggered, this, &QgisApp::offsetPointSymbol );
connect( mActionSnappingOptions, &QAction::triggered, this, &QgisApp::snappingOptions );
connect( mActionOffsetCurve, &QAction::triggered, this, &QgisApp::offsetCurve );
connect( mActionReverseLine, &QAction::triggered, this, &QgisApp::reverseLine );

// View Menu Items
connect( mActionPan, &QAction::triggered, this, &QgisApp::pan );
@@ -2347,6 +2350,7 @@ void QgisApp::createActionGroups()
mMapToolGroup->addAction( mActionMoveLabel );
mMapToolGroup->addAction( mActionRotateLabel );
mMapToolGroup->addAction( mActionChangeLabelProperties );
mMapToolGroup->addAction( mActionReverseLine );

//
// Preview Modes Group
@@ -3300,6 +3304,7 @@ void QgisApp::setTheme( const QString &themeName )
mActionDecorationNorthArrow->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/north_arrow.png" ) ) );
mActionDecorationScaleBar->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionScaleBar.svg" ) ) );
mActionDecorationGrid->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/transformed.svg" ) ) );
mActionReverseLine->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionReverseLine.svg" ) ) );

emit currentThemeChanged( themeName );
}
@@ -3511,6 +3516,8 @@ void QgisApp::createCanvasTools()
mMapTools.mOffsetCurve->setAction( mActionOffsetCurve );
mMapTools.mReshapeFeatures = new QgsMapToolReshape( mMapCanvas );
mMapTools.mReshapeFeatures->setAction( mActionReshapeFeatures );
mMapTools.mReverseLine = new QgsMapToolReverseLine( mMapCanvas );
mMapTools.mReverseLine->setAction( mActionReverseLine );
mMapTools.mSplitFeatures = new QgsMapToolSplitFeatures( mMapCanvas );
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
mMapTools.mSplitParts = new QgsMapToolSplitParts( mMapCanvas );
@@ -7664,6 +7671,11 @@ void QgisApp::deletePart()
mMapCanvas->setMapTool( mMapTools.mDeletePart );
}

void QgisApp::reverseLine()
{
mMapCanvas->setMapTool( mMapTools.mReverseLine );
}

QgsGeometry QgisApp::unionGeometries( const QgsVectorLayer *vl, QgsFeatureList &featureList, bool &canceled )
{
canceled = false;
@@ -12193,6 +12205,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionPasteStyle->setEnabled( false );
mActionCopyLayer->setEnabled( false );
mActionPasteLayer->setEnabled( false );
mActionReverseLine->setEnabled( false );

mUndoDock->widget()->setEnabled( false );
mActionUndo->setEnabled( false );
@@ -12267,6 +12280,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionZoomToSelected->setEnabled( isSpatial );
mActionLabeling->setEnabled( isSpatial );
mActionDiagramProperties->setEnabled( isSpatial );
mActionReverseLine->setEnabled( false );

mActionSelectFeatures->setEnabled( isSpatial );
mActionSelectPolygon->setEnabled( isSpatial );
@@ -12410,6 +12424,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionSplitParts->setEnabled( isEditable && canChangeGeometry && isMultiPart );
mActionSimplifyFeature->setEnabled( isEditable && canChangeGeometry );
mActionOffsetCurve->setEnabled( isEditable && canAddFeatures && canChangeAttributes );
mActionReverseLine->setEnabled( isEditable && canChangeGeometry );

mActionAddRing->setEnabled( false );
mActionFillRing->setEnabled( false );
@@ -1409,6 +1409,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void rotatePointSymbols();
//! activates the offset point symbol tool
void offsetPointSymbol();
//! activates the reverse line tool
void reverseLine();
//! activates the tool
void setMapTool( QgsMapTool *tool, bool clean = false );

@@ -2064,6 +2066,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool *mRotateFeature = nullptr;
QgsMapTool *mRotateLabel = nullptr;
QgsMapTool *mChangeLabelProperties = nullptr;
QgsMapTool *mReverseLine = nullptr ;
} mMapTools;

QgsMapTool *mNonEditMapTool = nullptr;

0 comments on commit 81974f9

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