Skip to content

Commit

Permalink
Fully replace node* by vertex*
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Jan 31, 2018
1 parent 5461d3c commit 91a8075
Show file tree
Hide file tree
Showing 28 changed files with 214 additions and 212 deletions.
2 changes: 2 additions & 0 deletions doc/api_break.dox
Expand Up @@ -130,6 +130,8 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsMultiPolylineV2<td>QgsPolyline
<tr><td>QgsMultiSurfaceV2<td>QgsMultiSurface
<tr><td>QgsNMEAConnection<td>QgsNmeaConnection
<tr><td>QgsNodeEditor<td>QgsVertexEditor
<tr><td>QgsNodeTool<td>QgsVertexTool
<tr><td>QgsNumericScaleBarStyle<td>QgsNumericScaleBarRenderer
<tr><td>QgsPoint<td>QgsPointXY
<tr><td>QgsPointSequenceV2<td>QgsPointSequence
Expand Down
2 changes: 1 addition & 1 deletion images/images.qrc
Expand Up @@ -273,7 +273,7 @@
<file>themes/default/mActionNewSpatiaLiteLayer.svg</file>
<file>themes/default/mActionNewGeoPackageLayer.svg</file>
<file>themes/default/mActionNewVectorLayer.svg</file>
<file>themes/default/mActionNodeTool.svg</file>
<file>themes/default/mActionVertexTool.svg</file>
<file>themes/default/mActionOffsetCurve.svg</file>
<file>themes/default/mActionOpenTable.svg</file>
<file>themes/default/mActionAddTable.svg</file>
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion python/gui/qgisinterface.sip.in
Expand Up @@ -230,7 +230,7 @@ Show layout manager action
virtual QAction *actionSimplifyFeature() = 0;
virtual QAction *actionDeleteRing() = 0;
virtual QAction *actionDeletePart() = 0;
virtual QAction *actionNodeTool() = 0;
virtual QAction *actionVertexTool() = 0;

virtual QAction *actionPan() = 0;
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptooladvanceddigitizing.sip.in
Expand Up @@ -75,7 +75,7 @@ Unregisters this maptool from the cad dock widget
Returns whether functionality of advanced digitizing dock widget is currently allowed.

Tools may decide to switch this support on/off based on the current state of the map tool.
For example, in node tool before user picks a vertex to move, advanced digitizing dock
For example, in vertex tool before user picks a vertex to move, advanced digitizing dock
widget should be disabled and only enabled once a vertex is being moved. Other map tools
may keep advanced digitizing allowed all the time.

Expand Down
14 changes: 7 additions & 7 deletions src/app/CMakeLists.txt
Expand Up @@ -106,10 +106,10 @@ SET(QGIS_APP_SRCS
qgsmaptoolsvgannotation.cpp
qgsmaptooltextannotation.cpp

nodetool/qgsselectedfeature.cpp
nodetool/qgsvertexentry.cpp
nodetool/qgsnodeeditor.cpp
nodetool/qgsnodetool.cpp
vertextool/qgsselectedfeature.cpp
vertextool/qgsvertexentry.cpp
vertextool/qgsvertexeditor.cpp
vertextool/qgsvertextool.cpp

qgslayerstylingwidget.cpp
qgsmeasuredialog.cpp
Expand Down Expand Up @@ -337,9 +337,9 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolregularpolygoncenterpoint.h
qgsmaptoolregularpolygoncentercorner.h

nodetool/qgsselectedfeature.h
nodetool/qgsnodeeditor.h
nodetool/qgsnodetool.h
vertextool/qgsselectedfeature.h
vertextool/qgsvertexeditor.h
vertextool/qgsvertextool.h

qgslayerstylingwidget.h
qgsmeasuredialog.h
Expand Down
36 changes: 18 additions & 18 deletions src/app/qgisapp.cpp
Expand Up @@ -396,7 +396,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmaptoolrotatelabel.h"
#include "qgsmaptoolchangelabelproperties.h"

#include "nodetool/qgsnodetool.h"
#include "vertextool/qgsvertextool.h"

// Editor widgets
#include "qgseditorwidgetregistry.h"
Expand Down Expand Up @@ -1343,7 +1343,7 @@ QgisApp::~QgisApp()
delete mMapTools.mMoveFeature;
delete mMapTools.mMoveFeatureCopy;
delete mMapTools.mMoveLabel;
delete mMapTools.mNodeTool;
delete mMapTools.mVertexTool;
delete mMapTools.mOffsetCurve;
delete mMapTools.mPinLabels;
delete mMapTools.mReshapeFeatures;
Expand Down Expand Up @@ -1904,7 +1904,7 @@ void QgisApp::createActions()
connect( mActionMergeFeatures, &QAction::triggered, this, &QgisApp::mergeSelectedFeatures );
connect( mActionMergeFeatureAttributes, &QAction::triggered, this, &QgisApp::mergeAttributesOfSelectedFeatures );
connect( mActionMultiEditAttributes, &QAction::triggered, this, &QgisApp::modifyAttributesOfSelectedFeatures );
connect( mActionNodeTool, &QAction::triggered, this, &QgisApp::nodeTool );
connect( mActionVertexTool, &QAction::triggered, this, &QgisApp::vertexTool );
connect( mActionRotatePointSymbols, &QAction::triggered, this, &QgisApp::rotatePointSymbols );
connect( mActionOffsetPointSymbol, &QAction::triggered, this, &QgisApp::offsetPointSymbol );
connect( mActionSnappingOptions, &QAction::triggered, this, &QgisApp::snappingOptions );
Expand Down Expand Up @@ -2190,7 +2190,7 @@ void QgisApp::createActionGroups()
mMapToolGroup->addAction( mActionDeletePart );
mMapToolGroup->addAction( mActionMergeFeatures );
mMapToolGroup->addAction( mActionMergeFeatureAttributes );
mMapToolGroup->addAction( mActionNodeTool );
mMapToolGroup->addAction( mActionVertexTool );
mMapToolGroup->addAction( mActionRotatePointSymbols );
mMapToolGroup->addAction( mActionOffsetPointSymbol );
mMapToolGroup->addAction( mActionPinLabels );
Expand Down Expand Up @@ -2681,7 +2681,7 @@ void QgisApp::createToolBars()
tbAddCircularString->addAction( mActionCircularStringRadius );
tbAddCircularString->setDefaultAction( mActionCircularStringCurvePoint );
connect( tbAddCircularString, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddCircularString );
mRegularShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddCircularString );

//circle digitize tool button
QToolButton *tbAddCircle = new QToolButton( mRegularShapeDigitizeToolBar );
Expand All @@ -2693,7 +2693,7 @@ void QgisApp::createToolBars()
tbAddCircle->addAction( mActionCircleCenterPoint );
tbAddCircle->setDefaultAction( mActionCircle2Points );
connect( tbAddCircle, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddCircle );
mRegularShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddCircle );

//ellipse digitize tool button
QToolButton *tbAddEllipse = new QToolButton( mRegularShapeDigitizeToolBar );
Expand All @@ -2704,7 +2704,7 @@ void QgisApp::createToolBars()
tbAddEllipse->addAction( mActionEllipseFoci );
tbAddEllipse->setDefaultAction( mActionEllipseCenter2Points );
connect( tbAddEllipse, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddEllipse );
mRegularShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddEllipse );

//Rectangle digitize tool button
QToolButton *tbAddRectangle = new QToolButton( mRegularShapeDigitizeToolBar );
Expand All @@ -2714,7 +2714,7 @@ void QgisApp::createToolBars()
tbAddRectangle->addAction( mActionRectangle3Points );
tbAddRectangle->setDefaultAction( mActionRectangleCenterPoint );
connect( tbAddRectangle, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddRectangle );
mRegularShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddRectangle );

//Regular polygon digitize tool button
QToolButton *tbAddRegularPolygon = new QToolButton( mRegularShapeDigitizeToolBar );
Expand All @@ -2724,7 +2724,7 @@ void QgisApp::createToolBars()
tbAddRegularPolygon->addAction( mActionRegularPolygonCenterCorner );
tbAddRegularPolygon->setDefaultAction( mActionRegularPolygon2Points );
connect( tbAddRegularPolygon, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mRegularShapeDigitizeToolBar->insertWidget( mActionNodeTool, tbAddRegularPolygon );
mRegularShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddRegularPolygon );

// move feature tool button
QToolButton *moveFeatureButton = new QToolButton( mDigitizeToolBar );
Expand All @@ -2743,7 +2743,7 @@ void QgisApp::createToolBars()
};
moveFeatureButton->setDefaultAction( defAction );
connect( moveFeatureButton, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mDigitizeToolBar->insertWidget( mActionNodeTool, moveFeatureButton );
mDigitizeToolBar->insertWidget( mActionVertexTool, moveFeatureButton );

bt = new QToolButton();
bt->setPopupMode( QToolButton::MenuButtonPopup );
Expand Down Expand Up @@ -3051,7 +3051,7 @@ void QgisApp::setTheme( const QString &themeName )
mActionSplitFeatures->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSplitFeatures.svg" ) ) );
mActionSplitParts->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSplitParts.svg" ) ) );
mActionDeleteSelected->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteSelected.svg" ) ) );
mActionNodeTool->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNodeTool.svg" ) ) );
mActionVertexTool->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionVertexTool.svg" ) ) );
mActionSimplifyFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSimplify.svg" ) ) );
mActionUndo->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionUndo.svg" ) ) );
mActionRedo->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionRedo.svg" ) ) );
Expand Down Expand Up @@ -3341,8 +3341,8 @@ void QgisApp::createCanvasTools()
mMapTools.mDeleteRing->setAction( mActionDeleteRing );
mMapTools.mDeletePart = new QgsMapToolDeletePart( mMapCanvas );
mMapTools.mDeletePart->setAction( mActionDeletePart );
mMapTools.mNodeTool = new QgsNodeTool( mMapCanvas, mAdvancedDigitizingDockWidget );
mMapTools.mNodeTool->setAction( mActionNodeTool );
mMapTools.mVertexTool = new QgsVertexTool( mMapCanvas, mAdvancedDigitizingDockWidget );
mMapTools.mVertexTool->setAction( mActionVertexTool );
mMapTools.mRotatePointSymbolsTool = new QgsMapToolRotatePointSymbols( mMapCanvas );
mMapTools.mRotatePointSymbolsTool->setAction( mActionRotatePointSymbols );
mMapTools.mOffsetPointSymbolTool = new QgsMapToolOffsetPointSymbol( mMapCanvas );
Expand Down Expand Up @@ -7904,9 +7904,9 @@ void QgisApp::mergeSelectedFeatures()
vl->triggerRepaint();
}

void QgisApp::nodeTool()
void QgisApp::vertexTool()
{
mMapCanvas->setMapTool( mMapTools.mNodeTool );
mMapCanvas->setMapTool( mMapTools.mVertexTool );
}

void QgisApp::rotatePointSymbols()
Expand Down Expand Up @@ -11432,7 +11432,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionVertexTool->setEnabled( false );
mActionDeleteSelected->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
Expand Down Expand Up @@ -11609,7 +11609,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionMoveFeature->setEnabled( isEditable && canChangeGeometry );
mActionMoveFeatureCopy->setEnabled( isEditable && canChangeGeometry );
mActionRotateFeature->setEnabled( isEditable && canChangeGeometry );
mActionNodeTool->setEnabled( isEditable && canChangeGeometry );
mActionVertexTool->setEnabled( isEditable && canChangeGeometry );

if ( vlayer->geometryType() == QgsWkbTypes::PointGeometry )
{
Expand Down Expand Up @@ -11763,7 +11763,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionAddRing->setEnabled( false );
mActionFillRing->setEnabled( false );
mActionAddPart->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionVertexTool->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionMoveFeatureCopy->setEnabled( false );
mActionRotateFeature->setEnabled( false );
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgisapp.h
Expand Up @@ -448,7 +448,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
QAction *actionDeleteRing() { return mActionDeleteRing; }
QAction *actionDeletePart() { return mActionDeletePart; }
QAction *actionNodeTool() { return mActionNodeTool; }
QAction *actionVertexTool() { return mActionVertexTool; }
QAction *actionSnappingOptions() { return mActionSnappingOptions; }
QAction *actionOffsetCurve() { return mActionOffsetCurve; }
QAction *actionPan() { return mActionPan; }
Expand Down Expand Up @@ -1343,7 +1343,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! Modifies the attributes of selected features via feature form
void modifyAttributesOfSelectedFeatures();
//! provides operations with nodes
void nodeTool();
void vertexTool();
//! activates the rotate points tool
void rotatePointSymbols();
//! activates the offset point symbol tool
Expand Down Expand Up @@ -1939,7 +1939,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool *mSimplifyFeature = nullptr;
QgsMapTool *mDeleteRing = nullptr;
QgsMapTool *mDeletePart = nullptr;
QgsMapTool *mNodeTool = nullptr;
QgsMapTool *mVertexTool = nullptr;
QgsMapTool *mRotatePointSymbolsTool = nullptr;
QgsMapTool *mOffsetPointSymbolTool = nullptr;
QgsMapTool *mAnnotation = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.cpp
Expand Up @@ -603,7 +603,7 @@ QAction *QgisAppInterface::actionAddPart() { return qgis->actionAddPart(); }
QAction *QgisAppInterface::actionSimplifyFeature() { return qgis->actionSimplifyFeature(); }
QAction *QgisAppInterface::actionDeleteRing() { return qgis->actionDeleteRing(); }
QAction *QgisAppInterface::actionDeletePart() { return qgis->actionDeletePart(); }
QAction *QgisAppInterface::actionNodeTool() { return qgis->actionNodeTool(); }
QAction *QgisAppInterface::actionVertexTool() { return qgis->actionVertexTool(); }

QAction *QgisAppInterface::actionPan() { return qgis->actionPan(); }
QAction *QgisAppInterface::actionPanToSelected() { return qgis->actionPanToSelected(); }
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.h
Expand Up @@ -404,7 +404,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QAction *actionSimplifyFeature() override;
QAction *actionDeleteRing() override;
QAction *actionDeletePart() override;
QAction *actionNodeTool() override;
QAction *actionVertexTool() override;

//! View menu actions
QAction *actionPan() override;
Expand Down
@@ -1,5 +1,5 @@
/***************************************************************************
qgsselectedfeature.cpp - selected feature of nodetool
qgsselectedfeature.cpp - selected feature of vertextool
---------------------
begin : April 2009
copyright : (C) 2009 by Richard Kostecky
Expand All @@ -13,8 +13,8 @@
* *
***************************************************************************/

#include "nodetool/qgsselectedfeature.h"
#include "nodetool/qgsvertexentry.h"
#include "vertextool/qgsselectedfeature.h"
#include "vertextool/qgsvertexentry.h"

#include "qgsfeatureiterator.h"
#include "qgspoint.h"
Expand Down
@@ -1,5 +1,5 @@
/***************************************************************************
qgsselectedfeature.h - selected feature of nodetool
qgsselectedfeature.h - selected feature of vertextool
---------------------
begin : April 2009
copyright : (C) 2009 by Richard Kostecky
Expand Down

0 comments on commit 91a8075

Please sign in to comment.