Skip to content
Permalink
Browse files

[FEATURE] Added a new "node" tool (in advanced digitizing toolbar).

Integrates add, move and delete vertex tools for faster editing.

Contributed by Richard Kostecky, qgis-mapper team.


git-svn-id: http://svn.osgeo.org/qgis/trunk@10890 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jun 6, 2009
1 parent 985e530 commit fb15622bc27061a4abe806ce32f06a9a32583cf3
@@ -23,6 +23,7 @@ Markus Neteler
Maurizio Napolitano
Paul Ramsey
Peter Ersts
Richard Kostecky
Stefanie Tellex
Tom Russo
Tyler Mitchell
Binary file not shown.
@@ -35,6 +35,7 @@ SET(QGIS_APP_SRCS
qgsmaptoolidentify.cpp
qgsmaptoolmovefeature.cpp
qgsmaptoolmovevertex.cpp
qgsmaptoolnodetool.cpp
qgsmaptoolselect.cpp
qgsmaptoolsimplify.cpp
qgsmaptoolsplitfeatures.cpp
@@ -166,6 +166,7 @@
#include "qgsmaptoolidentify.h"
#include "qgsmaptoolmovefeature.h"
#include "qgsmaptoolmovevertex.h"
#include "qgsmaptoolnodetool.h"
#include "qgsmaptoolpan.h"
#include "qgsmaptoolselect.h"
#include "qgsmaptoolsplitfeatures.h"
@@ -475,6 +476,7 @@ QgisApp::~QgisApp()
delete mMapTools.mDeleteRing;
delete mMapTools.mDeletePart;
delete mMapTools.mAddIsland;
delete mMapTools.mNodeTool;

delete mPythonConsole;
delete mPythonUtils;
@@ -710,6 +712,11 @@ void QgisApp::createActions()
connect( mActionMergeFeatures, SIGNAL(triggered()), this, SLOT(mergeSelectedFeatures()));
mActionMergeFeatures->setEnabled(false);

mActionNodeTool = new QAction( getThemeIcon( "mActionNodeTool.png" ), tr( "Node Tool" ), this );
shortcuts->registerAction( mActionNodeTool );
mActionNodeTool->setStatusTip( tr( "Node Tool" ) );
connect( mActionNodeTool, SIGNAL( triggered() ), this, SLOT( nodeTool() ) );
mActionNodeTool->setEnabled( false );

// View Menu Items

@@ -1061,6 +1068,9 @@ void QgisApp::createActionGroups()
mActionDeletePart->setCheckable( true );
mMapToolGroup->addAction( mActionDeletePart );
mMapToolGroup->addAction( mActionMergeFeatures);
mActionNodeTool->setCheckable( true );
mMapToolGroup->addAction( mActionNodeTool );

}

void QgisApp::createMenus()
@@ -1150,7 +1160,8 @@ void QgisApp::createMenus()
mEditMenu->addAction( mActionDeleteRing );
mEditMenu->addAction( mActionDeletePart );
mEditMenu->addAction( mActionMergeFeatures );

mEditMenu->addAction( mActionNodeTool );

if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout )
{
mActionEditSeparator3 = mEditMenu->addSeparator();
@@ -1355,6 +1366,7 @@ void QgisApp::createToolBars()
mAdvancedDigitizeToolBar->addAction( mActionDeleteRing );
mAdvancedDigitizeToolBar->addAction( mActionDeletePart );
mAdvancedDigitizeToolBar->addAction( mActionMergeFeatures );
mAdvancedDigitizeToolBar->addAction( mActionNodeTool );
mToolbarMenu->addAction( mAdvancedDigitizeToolBar->toggleViewAction() );


@@ -1707,6 +1719,8 @@ void QgisApp::createCanvas()
mMapTools.mDeleteRing->setAction( mActionDeleteRing );
mMapTools.mDeletePart = new QgsMapToolDeletePart( mMapCanvas );
mMapTools.mDeletePart->setAction( mActionDeletePart );
mMapTools.mNodeTool = new QgsMapToolNodeTool( mMapCanvas );
mMapTools.mNodeTool->setAction( mActionNodeTool );
//ensure that non edit tool is initialised or we will get crashes in some situations
mNonEditMapTool = mMapTools.mPan;
}
@@ -4228,6 +4242,11 @@ void QgisApp::mergeSelectedFeatures()
}
}

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

void QgisApp::splitFeatures()
{
mMapCanvas->setMapTool( mMapTools.mSplitFeatures );
@@ -5472,10 +5491,12 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
{
mActionMoveFeature->setEnabled( true );
mActionNodeTool->setEnabled( true );
}
else
{
mActionMoveFeature->setEnabled( false );
mActionNodeTool->setEnabled( false );
}

if ( vlayer->geometryType() == QGis::Point )
@@ -227,6 +227,7 @@ class QgisApp : public QMainWindow
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
QAction *actionDeleteRing() { return mActionDeleteRing; }
QAction *actionDeletePart() { return mActionDeletePart; }
QAction *actionNodeTool() { return mActionNodeTool; }
QAction *actionEditSeparator2() { return mActionEditSeparator2; }

QAction *actionPan() { return mActionPan; }
@@ -513,6 +514,8 @@ class QgisApp : public QMainWindow
void deletePart();
//! merges the selected features together
void mergeSelectedFeatures();
//! provides operations with nodes
void nodeTool();

//! activates the selection tool
void select();
@@ -727,6 +730,7 @@ class QgisApp : public QMainWindow
QAction *mActionDeleteRing;
QAction *mActionDeletePart;
QAction *mActionMergeFeatures;
QAction *mActionNodeTool;
QAction *mActionEditSeparator3;

QAction *mActionPan;
@@ -847,6 +851,7 @@ class QgisApp : public QMainWindow
QgsMapTool* mSimplifyFeature;
QgsMapTool* mDeleteRing;
QgsMapTool* mDeletePart;
QgsMapTool* mNodeTool;
} mMapTools;

QgsMapTool *mNonEditMapTool;

0 comments on commit fb15622

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