File tree 5 files changed +29
-15
lines changed
5 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,23 @@ class QgsCurvePolygon: public QgsSurface
54
54
void setInteriorRings( const QList<QgsCurve*>& rings );
55
55
/** Adds an interior ring to the geometry (takes ownership)*/
56
56
virtual void addInteriorRing( QgsCurve* ring /Transfer/ );
57
- /** Removes ring. Exterior ring is 0, first interior ring 1, ...*/
58
- bool removeInteriorRing( int nr );
59
57
60
58
/**
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
62
68
* parameter is specified then only rings smaller than this minimum
63
69
* area will be removed.
64
70
* @note added in QGIS 3.0
71
+ * @see removeInteriorRing()
65
72
*/
66
- void removeInteriorRings( double minimumRingArea = -1 );
73
+ void removeInteriorRings( double minimumAllowedArea = -1 );
67
74
68
75
virtual void draw( QPainter& p ) const;
69
76
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
Original file line number Diff line number Diff line change @@ -346,12 +346,12 @@ class QgsGeometry
346
346
int addPart( const QgsGeometry& newPart ) /PyName=addPartGeometry/;
347
347
348
348
/**
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
350
350
* parameter is specified then only rings smaller than this minimum
351
351
* area will be removed.
352
352
* @note added in QGIS 3.0
353
353
*/
354
- QgsGeometry removeInteriorRings( double minimumRingArea = -1 ) const;
354
+ QgsGeometry removeInteriorRings( double minimumAllowedArea = -1 ) const;
355
355
356
356
/** Translate this geometry by dx, dy
357
357
@return 0 in case of success*/
Original file line number Diff line number Diff line change @@ -546,17 +546,17 @@ bool QgsCurvePolygon::removeInteriorRing( int nr )
546
546
return true ;
547
547
}
548
548
549
- void QgsCurvePolygon::removeInteriorRings ( double minimumRingArea )
549
+ void QgsCurvePolygon::removeInteriorRings ( double minimumAllowedArea )
550
550
{
551
551
for ( int ringIndex = mInteriorRings .size () - 1 ; ringIndex >= 0 ; --ringIndex )
552
552
{
553
- if ( minimumRingArea < 0 )
553
+ if ( minimumAllowedArea < 0 )
554
554
delete mInteriorRings .takeAt ( ringIndex );
555
555
else
556
556
{
557
557
double area;
558
558
mInteriorRings .at ( ringIndex )->sumUpArea ( area );
559
- if ( area < minimumRingArea )
559
+ if ( area < minimumAllowedArea )
560
560
delete mInteriorRings .takeAt ( ringIndex );
561
561
}
562
562
}
Original file line number Diff line number Diff line change @@ -80,16 +80,23 @@ class CORE_EXPORT QgsCurvePolygon: public QgsSurface
80
80
void setInteriorRings ( const QList<QgsCurve*>& rings );
81
81
// ! Adds an interior ring to the geometry (takes ownership)
82
82
virtual void addInteriorRing ( QgsCurve* ring );
83
- // ! Removes ring. Exterior ring is 0, first interior ring 1, ...
84
- bool removeInteriorRing ( int nr );
85
83
86
84
/* *
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
88
94
* parameter is specified then only rings smaller than this minimum
89
95
* area will be removed.
90
96
* @note added in QGIS 3.0
97
+ * @see removeInteriorRing()
91
98
*/
92
- void removeInteriorRings ( double minimumRingArea = -1 );
99
+ void removeInteriorRings ( double minimumAllowedArea = -1 );
93
100
94
101
virtual void draw ( QPainter& p ) const override ;
95
102
void transform ( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
Original file line number Diff line number Diff line change @@ -399,12 +399,12 @@ class CORE_EXPORT QgsGeometry
399
399
int addPart ( const QgsGeometry& newPart );
400
400
401
401
/* *
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
403
403
* parameter is specified then only rings smaller than this minimum
404
404
* area will be removed.
405
405
* @note added in QGIS 3.0
406
406
*/
407
- QgsGeometry removeInteriorRings ( double minimumRingArea = -1 ) const ;
407
+ QgsGeometry removeInteriorRings ( double minimumAllowedArea = -1 ) const ;
408
408
409
409
/* * Translate this geometry by dx, dy
410
410
@return 0 in case of success*/
You can’t perform that action at this time.
0 commit comments