Skip to content

Commit 45a52df

Browse files
committed
Rename minimum area paremeter, fix docs for QgsCurvePolygon::removeInteriorRing
1 parent fef15e0 commit 45a52df

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

python/core/geometry/qgscurvepolygon.sip

+11-4
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,23 @@ class QgsCurvePolygon: public QgsSurface
5454
void setInteriorRings( const QList<QgsCurve*>& rings );
5555
/** Adds an interior ring to the geometry (takes ownership)*/
5656
virtual void addInteriorRing( QgsCurve* ring /Transfer/ );
57-
/** Removes ring. Exterior ring is 0, first interior ring 1, ...*/
58-
bool removeInteriorRing( int nr );
5957

6058
/**
61-
* Removes the interior rings from the polygon. If the minimumRingArea
59+
* Removes an interior ring from the polygon. The first interior ring has index 0.
60+
* The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed
61+
* the function will return true. It is not possible to remove the exterior ring using this method.
62+
* @see removeInteriorRings()
63+
*/
64+
bool removeInteriorRing( int ringIndex );
65+
66+
/**
67+
* Removes the interior rings from the polygon. If the minimumAllowedArea
6268
* parameter is specified then only rings smaller than this minimum
6369
* area will be removed.
6470
* @note added in QGIS 3.0
71+
* @see removeInteriorRing()
6572
*/
66-
void removeInteriorRings( double minimumRingArea = -1 );
73+
void removeInteriorRings( double minimumAllowedArea = -1 );
6774

6875
virtual void draw( QPainter& p ) const;
6976
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,

python/core/geometry/qgsgeometry.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ class QgsGeometry
346346
int addPart( const QgsGeometry& newPart ) /PyName=addPartGeometry/;
347347

348348
/**
349-
* Removes the interior rings from a (multi)polygon geometry. If the minimumRingArea
349+
* Removes the interior rings from a (multi)polygon geometry. If the minimumAllowedArea
350350
* parameter is specified then only rings smaller than this minimum
351351
* area will be removed.
352352
* @note added in QGIS 3.0
353353
*/
354-
QgsGeometry removeInteriorRings( double minimumRingArea = -1 ) const;
354+
QgsGeometry removeInteriorRings( double minimumAllowedArea = -1 ) const;
355355

356356
/** Translate this geometry by dx, dy
357357
@return 0 in case of success*/

src/core/geometry/qgscurvepolygon.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -546,17 +546,17 @@ bool QgsCurvePolygon::removeInteriorRing( int nr )
546546
return true;
547547
}
548548

549-
void QgsCurvePolygon::removeInteriorRings( double minimumRingArea )
549+
void QgsCurvePolygon::removeInteriorRings( double minimumAllowedArea )
550550
{
551551
for ( int ringIndex = mInteriorRings.size() - 1; ringIndex >= 0; --ringIndex )
552552
{
553-
if ( minimumRingArea < 0 )
553+
if ( minimumAllowedArea < 0 )
554554
delete mInteriorRings.takeAt( ringIndex );
555555
else
556556
{
557557
double area;
558558
mInteriorRings.at( ringIndex )->sumUpArea( area );
559-
if ( area < minimumRingArea )
559+
if ( area < minimumAllowedArea )
560560
delete mInteriorRings.takeAt( ringIndex );
561561
}
562562
}

src/core/geometry/qgscurvepolygon.h

+11-4
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,23 @@ class CORE_EXPORT QgsCurvePolygon: public QgsSurface
8080
void setInteriorRings( const QList<QgsCurve*>& rings );
8181
//! Adds an interior ring to the geometry (takes ownership)
8282
virtual void addInteriorRing( QgsCurve* ring );
83-
//! Removes ring. Exterior ring is 0, first interior ring 1, ...
84-
bool removeInteriorRing( int nr );
8583

8684
/**
87-
* Removes the interior rings from the polygon. If the minimumRingArea
85+
* Removes an interior ring from the polygon. The first interior ring has index 0.
86+
* The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed
87+
* the function will return true. It is not possible to remove the exterior ring using this method.
88+
* @see removeInteriorRings()
89+
*/
90+
bool removeInteriorRing( int ringIndex );
91+
92+
/**
93+
* Removes the interior rings from the polygon. If the minimumAllowedArea
8894
* parameter is specified then only rings smaller than this minimum
8995
* area will be removed.
9096
* @note added in QGIS 3.0
97+
* @see removeInteriorRing()
9198
*/
92-
void removeInteriorRings( double minimumRingArea = -1 );
99+
void removeInteriorRings( double minimumAllowedArea = -1 );
93100

94101
virtual void draw( QPainter& p ) const override;
95102
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,

src/core/geometry/qgsgeometry.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,12 @@ class CORE_EXPORT QgsGeometry
399399
int addPart( const QgsGeometry& newPart );
400400

401401
/**
402-
* Removes the interior rings from a (multi)polygon geometry. If the minimumRingArea
402+
* Removes the interior rings from a (multi)polygon geometry. If the minimumAllowedArea
403403
* parameter is specified then only rings smaller than this minimum
404404
* area will be removed.
405405
* @note added in QGIS 3.0
406406
*/
407-
QgsGeometry removeInteriorRings( double minimumRingArea = -1 ) const;
407+
QgsGeometry removeInteriorRings( double minimumAllowedArea = -1 ) const;
408408

409409
/** Translate this geometry by dx, dy
410410
@return 0 in case of success*/

0 commit comments

Comments
 (0)