Skip to content

Commit 5bbbbf9

Browse files
author
wonder
committed
Renamed delete hole tool to delete ring per suggestion by Borys.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10705 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 693f088 commit 5bbbbf9

9 files changed

+51
-52
lines changed

python/core/qgsgeometry.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ not disjoint with existing polygons of the feature*/
289289
// TODO: destruction of created geometries??
290290
QList<QgsGeometry*> asGeometryCollection() /Factory/;
291291

292-
/** delete a hole in polygon or multipolygon.
292+
/** delete a ring in polygon or multipolygon.
293293
Ring 0 is outer ring and can't be deleted.
294294
@return TRUE on success
295295
@note added in version 1.2 */
296-
bool deleteHole( int ringNum, int partNum = 0 );
296+
bool deleteRing( int ringNum, int partNum = 0 );
297297

298298
/** delete part identified by the part number
299299
@return TRUE on success

src/app/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SET(QGIS_APP_SRCS
2727
qgsmaptooladdisland.cpp
2828
qgsmaptooladdring.cpp
2929
qgsmaptoolcapture.cpp
30-
qgsmaptooldeletehole.cpp
30+
qgsmaptooldeletering.cpp
3131
qgsmaptooldeletepart.cpp
3232
qgsmaptooldeletevertex.cpp
3333
qgsmaptooledit.cpp

src/app/qgisapp.cpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
#include "qgsmaptooladdisland.h"
158158
#include "qgsmaptooladdring.h"
159159
#include "qgsmaptooladdvertex.h"
160-
#include "qgsmaptooldeletehole.h"
160+
#include "qgsmaptooldeletering.h"
161161
#include "qgsmaptooldeletepart.h"
162162
#include "qgsmaptooldeletevertex.h"
163163
#include "qgsmaptoolidentify.h"
@@ -469,7 +469,7 @@ QgisApp::~QgisApp()
469469
delete mMapTools.mVertexDelete;
470470
delete mMapTools.mAddRing;
471471
delete mMapTools.mSimplifyFeature;
472-
delete mMapTools.mDeleteHole;
472+
delete mMapTools.mDeleteRing;
473473
delete mMapTools.mDeletePart;
474474
delete mMapTools.mAddIsland;
475475

@@ -678,10 +678,10 @@ void QgisApp::createActions()
678678
connect( mActionSimplifyFeature, SIGNAL( triggered() ), this, SLOT( simplifyFeature() ) );
679679
mActionSimplifyFeature->setEnabled( false );
680680

681-
mActionDeleteHole = new QAction( getThemeIcon( "mActionDeleteHole.png" ), tr( "Delete Hole" ), this );
682-
mActionDeleteHole->setStatusTip( tr( "Delete Hole" ) );
683-
connect( mActionDeleteHole, SIGNAL( triggered() ), this, SLOT( deleteHole() ) );
684-
mActionDeleteHole->setEnabled( false );
681+
mActionDeleteRing = new QAction( getThemeIcon( "mActionDeleteRing.png" ), tr( "Delete Ring" ), this );
682+
mActionDeleteRing->setStatusTip( tr( "Delete Ring" ) );
683+
connect( mActionDeleteRing, SIGNAL( triggered() ), this, SLOT( deleteRing() ) );
684+
mActionDeleteRing->setEnabled( false );
685685

686686
mActionDeletePart = new QAction( getThemeIcon( "mActionDeletePart.png" ), tr( "Delete Part" ), this );
687687
mActionDeletePart->setStatusTip( tr( "Delete Part" ) );
@@ -1014,8 +1014,8 @@ void QgisApp::createActionGroups()
10141014
mMapToolGroup->addAction( mActionAddIsland );
10151015
mActionSimplifyFeature->setCheckable( true );
10161016
mMapToolGroup->addAction( mActionSimplifyFeature );
1017-
mActionDeleteHole->setCheckable( true );
1018-
mMapToolGroup->addAction( mActionDeleteHole );
1017+
mActionDeleteRing->setCheckable( true );
1018+
mMapToolGroup->addAction( mActionDeleteRing );
10191019
mActionDeletePart->setCheckable( true );
10201020
mMapToolGroup->addAction( mActionDeletePart );
10211021
}
@@ -1104,7 +1104,7 @@ void QgisApp::createMenus()
11041104
mEditMenu->addAction( mActionSimplifyFeature );
11051105
mEditMenu->addAction( mActionAddRing );
11061106
mEditMenu->addAction( mActionAddIsland );
1107-
mEditMenu->addAction( mActionDeleteHole );
1107+
mEditMenu->addAction( mActionDeleteRing );
11081108
mEditMenu->addAction( mActionDeletePart );
11091109

11101110
if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout )
@@ -1306,7 +1306,7 @@ void QgisApp::createToolBars()
13061306
mAdvancedDigitizeToolBar->addAction( mActionSimplifyFeature );
13071307
mAdvancedDigitizeToolBar->addAction( mActionAddRing );
13081308
mAdvancedDigitizeToolBar->addAction( mActionAddIsland );
1309-
mAdvancedDigitizeToolBar->addAction( mActionDeleteHole );
1309+
mAdvancedDigitizeToolBar->addAction( mActionDeleteRing );
13101310
mAdvancedDigitizeToolBar->addAction( mActionDeletePart );
13111311
mToolbarMenu->addAction( mAdvancedDigitizeToolBar->toggleViewAction() );
13121312

@@ -1534,7 +1534,7 @@ void QgisApp::setTheme( QString theThemeName )
15341534
mActionSimplifyFeature->setIcon( getThemeIcon( "/mActionSimplify.png" ) );
15351535
mActionAddRing->setIcon( getThemeIcon( "/mActionAddRing.png" ) );
15361536
mActionAddIsland->setIcon( getThemeIcon( "/mActionAddIsland.png" ) );
1537-
mActionDeleteHole->setIcon( getThemeIcon( "/mActionDeleteHole.png" ) );
1537+
mActionDeleteRing->setIcon( getThemeIcon( "/mActionDeleteRing.png" ) );
15381538
mActionDeletePart->setIcon( getThemeIcon( "/mActionDeletePart.png" ) );
15391539
mActionZoomIn->setIcon( getThemeIcon( "/mActionZoomIn.png" ) );
15401540
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
@@ -1655,8 +1655,8 @@ void QgisApp::createCanvas()
16551655
mMapTools.mAddIsland = new QgsMapToolAddIsland( mMapCanvas );
16561656
mMapTools.mSimplifyFeature = new QgsMapToolSimplify( mMapCanvas );
16571657
mMapTools.mSimplifyFeature->setAction( mActionSimplifyFeature );
1658-
mMapTools.mDeleteHole = new QgsMapToolDeleteHole( mMapCanvas );
1659-
mMapTools.mDeleteHole->setAction( mActionDeleteHole );
1658+
mMapTools.mDeleteRing = new QgsMapToolDeleteRing( mMapCanvas );
1659+
mMapTools.mDeleteRing->setAction( mActionDeleteRing );
16601660
mMapTools.mDeletePart = new QgsMapToolDeletePart( mMapCanvas );
16611661
mMapTools.mDeletePart->setAction( mActionDeletePart );
16621662
//ensure that non edit tool is initialised or we will get crashes in some situations
@@ -4037,9 +4037,9 @@ void QgisApp::simplifyFeature()
40374037
mMapCanvas->setMapTool( mMapTools.mSimplifyFeature );
40384038
}
40394039

4040-
void QgisApp::deleteHole()
4040+
void QgisApp::deleteRing()
40414041
{
4042-
mMapCanvas->setMapTool( mMapTools.mDeleteHole );
4042+
mMapCanvas->setMapTool( mMapTools.mDeleteRing );
40434043
}
40444044

40454045
void QgisApp::deletePart()
@@ -5302,7 +5302,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
53025302
mActionAddIsland->setEnabled( false );
53035303
mActionSplitFeatures->setEnabled( false );
53045304
mActionSimplifyFeature->setEnabled( false );
5305-
mActionDeleteHole->setEnabled( false );
5305+
mActionDeleteRing->setEnabled( false );
53065306

53075307
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
53085308
{
@@ -5334,7 +5334,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
53345334
mActionCapturePolygon->setVisible( false );
53355335
mActionAddRing->setEnabled( false );
53365336
mActionAddIsland->setEnabled( false );
5337-
mActionDeleteHole->setEnabled( false );
5337+
mActionDeleteRing->setEnabled( false );
53385338
}
53395339
else if ( vlayer->geometryType() == QGis::Polygon )
53405340
{
@@ -5346,7 +5346,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
53465346
mActionAddIsland->setEnabled( true );
53475347
mActionSplitFeatures->setEnabled( true );
53485348
mActionSimplifyFeature->setEnabled( true );
5349-
mActionDeleteHole->setEnabled( true );
5349+
mActionDeleteRing->setEnabled( true );
53505350
mActionDeletePart->setEnabled( true );
53515351
}
53525352
else
@@ -5357,7 +5357,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
53575357
mActionAddIsland->setEnabled( false );
53585358
mActionSplitFeatures->setEnabled( false );
53595359
mActionSimplifyFeature->setEnabled( false );
5360-
mActionDeleteHole->setEnabled( false );
5360+
mActionDeleteRing->setEnabled( false );
53615361
mActionDeletePart->setEnabled( false );
53625362
}
53635363
mActionCapturePoint->setEnabled( false );

src/app/qgisapp.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class QgisApp : public QMainWindow
223223
QAction *actionAddRing() { return mActionAddRing; }
224224
QAction *actionAddIsland() { return mActionAddIsland; }
225225
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
226-
QAction *actionDeleteHole() { return mActionDeleteHole; }
226+
QAction *actionDeleteRing() { return mActionDeleteRing; }
227227
QAction *actionDeletePart() { return mActionDeletePart; }
228228
QAction *actionEditSeparator2() { return mActionEditSeparator2; }
229229

@@ -502,8 +502,8 @@ class QgisApp : public QMainWindow
502502
void addIsland();
503503
//! simplifies feature
504504
void simplifyFeature();
505-
//! deletes hole in polygon
506-
void deleteHole();
505+
//! deletes ring in polygon
506+
void deleteRing();
507507
//! deletes part of polygon
508508
void deletePart();
509509

@@ -714,7 +714,7 @@ class QgisApp : public QMainWindow
714714
QAction *mActionAddIsland;
715715
QAction *mActionEditSeparator2;
716716
QAction *mActionSimplifyFeature;
717-
QAction *mActionDeleteHole;
717+
QAction *mActionDeleteRing;
718718
QAction *mActionDeletePart;
719719
QAction *mActionEditSeparator3;
720720

@@ -833,7 +833,7 @@ class QgisApp : public QMainWindow
833833
QgsMapTool* mAddRing;
834834
QgsMapTool* mAddIsland;
835835
QgsMapTool* mSimplifyFeature;
836-
QgsMapTool* mDeleteHole;
836+
QgsMapTool* mDeleteRing;
837837
QgsMapTool* mDeletePart;
838838
} mMapTools;
839839

src/app/qgsmaptooldeletehole.cpp src/app/qgsmaptooldeletering.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsmaptooldeletehole.h - delete a hole from polygon
2+
qgsmaptooldeletering.cpp - delete a ring from polygon
33
---------------------
44
begin : April 2009
55
copyright : (C) 2009 by Richard Kostecky
@@ -13,7 +13,7 @@
1313
* *
1414
***************************************************************************/
1515

16-
#include "qgsmaptooldeletehole.h"
16+
#include "qgsmaptooldeletering.h"
1717

1818
#include "qgsmapcanvas.h"
1919
#include "qgsvertexmarker.h"
@@ -22,22 +22,22 @@
2222
#include <QMouseEvent>
2323
#include <QMessageBox>
2424

25-
QgsMapToolDeleteHole::QgsMapToolDeleteHole( QgsMapCanvas* canvas )
25+
QgsMapToolDeleteRing::QgsMapToolDeleteRing( QgsMapCanvas* canvas )
2626
: QgsMapToolVertexEdit( canvas ), mCross( 0 )
2727
{
2828
}
2929

30-
QgsMapToolDeleteHole::~QgsMapToolDeleteHole()
30+
QgsMapToolDeleteRing::~QgsMapToolDeleteRing()
3131
{
3232
delete mCross;
3333
}
3434

35-
void QgsMapToolDeleteHole::canvasMoveEvent( QMouseEvent * e )
35+
void QgsMapToolDeleteRing::canvasMoveEvent( QMouseEvent * e )
3636
{
3737
//nothing to do
3838
}
3939

40-
void QgsMapToolDeleteHole::canvasPressEvent( QMouseEvent * e )
40+
void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent * e )
4141
{
4242
delete mCross;
4343
mCross = 0;
@@ -64,7 +64,7 @@ void QgsMapToolDeleteHole::canvasPressEvent( QMouseEvent * e )
6464
}
6565
}
6666

67-
void QgsMapToolDeleteHole::canvasReleaseEvent( QMouseEvent * e )
67+
void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent * e )
6868
{
6969
delete mCross;
7070
mCross = 0;
@@ -83,13 +83,13 @@ void QgsMapToolDeleteHole::canvasReleaseEvent( QMouseEvent * e )
8383
QList<QgsSnappingResult>::iterator sr_it = mRecentSnappingResults.begin();
8484
for ( ; sr_it != mRecentSnappingResults.end(); ++sr_it )
8585
{
86-
deleteHole( sr_it->snappedAtGeometry, sr_it->snappedVertexNr, vlayer);
86+
deleteRing( sr_it->snappedAtGeometry, sr_it->snappedVertexNr, vlayer);
8787
}
8888
}
8989
}
9090

9191

92-
void QgsMapToolDeleteHole::deleteHole( int fId, int beforeVertexNr, QgsVectorLayer* vlayer)
92+
void QgsMapToolDeleteRing::deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer)
9393
{
9494
QgsFeature f;
9595
vlayer->featureAtId( fId, f );
@@ -109,15 +109,15 @@ void QgsMapToolDeleteHole::deleteHole( int fId, int beforeVertexNr, QgsVectorLay
109109
else
110110
return;
111111

112-
if (g->deleteHole( ringNum, partNum ))
112+
if (g->deleteRing( ringNum, partNum ))
113113
{
114114
vlayer->changeGeometry( fId, g );
115115
mCanvas->refresh();
116116
}
117117

118118
}
119119

120-
int QgsMapToolDeleteHole::ringNumInPolygon( QgsGeometry* g, int vertexNr )
120+
int QgsMapToolDeleteRing::ringNumInPolygon( QgsGeometry* g, int vertexNr )
121121
{
122122
QgsPolygon polygon = g->asPolygon();
123123
for (int ring = 0; ring < polygon.count(); ring++)
@@ -130,7 +130,7 @@ int QgsMapToolDeleteHole::ringNumInPolygon( QgsGeometry* g, int vertexNr )
130130
return -1;
131131
}
132132

133-
int QgsMapToolDeleteHole::ringNumInMultiPolygon( QgsGeometry* g, int vertexNr, int& partNum )
133+
int QgsMapToolDeleteRing::ringNumInMultiPolygon( QgsGeometry* g, int vertexNr, int& partNum )
134134
{
135135
QgsMultiPolygon mpolygon = g->asMultiPolygon();
136136
for (int part = 0; part < mpolygon.count(); part++)
@@ -151,7 +151,7 @@ int QgsMapToolDeleteHole::ringNumInMultiPolygon( QgsGeometry* g, int vertexNr, i
151151
}
152152

153153

154-
void QgsMapToolDeleteHole::deactivate()
154+
void QgsMapToolDeleteRing::deactivate()
155155
{
156156
delete mCross;
157157
mCross = 0;

src/app/qgsmaptooldeletehole.h src/app/qgsmaptooldeletering.h

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsmaptooldeletehole.h - delete a hole from polygon
2+
qgsmaptooldeletering.h - delete a ring from polygon
33
---------------------
44
begin : April 2009
55
copyright : (C) 2009 by Richard Kostecky
@@ -13,20 +13,19 @@
1313
* *
1414
***************************************************************************/
1515

16-
#ifndef QGSMAPTOOLDELETEHOLE_H
17-
#define QGSMAPTOOLDELETEHOLE_H
16+
#ifndef QGSMAPTOOLDELETERING_H
17+
#define QGSMAPTOOLDELETERING_H
1818

1919
#include "qgsmaptoolvertexedit.h"
20-
#include <QUndoCommand>
2120

2221
class QgsVertexMarker;
2322
/**Map tool to delete vertices from line/polygon features*/
2423

25-
class QgsMapToolDeleteHole: public QgsMapToolVertexEdit
24+
class QgsMapToolDeleteRing : public QgsMapToolVertexEdit
2625
{
2726
public:
28-
QgsMapToolDeleteHole( QgsMapCanvas* canvas );
29-
virtual ~QgsMapToolDeleteHole();
27+
QgsMapToolDeleteRing( QgsMapCanvas* canvas );
28+
virtual ~QgsMapToolDeleteRing();
3029

3130
void canvasMoveEvent( QMouseEvent * e );
3231

@@ -40,8 +39,8 @@ class QgsMapToolDeleteHole: public QgsMapToolVertexEdit
4039
private:
4140
QgsVertexMarker* mCross;
4241

43-
//! delete hole from the geometry
44-
void deleteHole( int fId, int beforeVertexNr, QgsVectorLayer* vlayer);
42+
//! delete inner ring from the geometry
43+
void deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer);
4544

4645
//! return ring number in polygon
4746
int ringNumInPolygon( QgsGeometry* g, int vertexNr );

src/core/qgsgeometry.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5542,7 +5542,7 @@ QList<QgsGeometry*> QgsGeometry::asGeometryCollection()
55425542
}
55435543

55445544

5545-
bool QgsGeometry::deleteHole( int ringNum, int partNum )
5545+
bool QgsGeometry::deleteRing( int ringNum, int partNum )
55465546
{
55475547
if (ringNum <= 0 || partNum < 0)
55485548
return FALSE;

src/core/qgsgeometry.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ class CORE_EXPORT QgsGeometry
332332
@note added in version 1.1 */
333333
QList<QgsGeometry*> asGeometryCollection();
334334

335-
/** delete a hole in polygon or multipolygon.
335+
/** delete a ring in polygon or multipolygon.
336336
Ring 0 is outer ring and can't be deleted.
337337
@return TRUE on success
338338
@note added in version 1.2 */
339-
bool deleteHole( int ringNum, int partNum = 0 );
339+
bool deleteRing( int ringNum, int partNum = 0 );
340340

341341
/** delete part identified by the part number
342342
@return TRUE on success

0 commit comments

Comments
 (0)