Skip to content
Permalink
Browse files
Rename minimum area paremeter, fix docs for QgsCurvePolygon::removeIn…
…teriorRing
  • Loading branch information
nyalldawson committed Nov 28, 2016
1 parent fef15e0 commit 45a52dfacddbaa8e89d02ff8074c041a68ec4afd
@@ -54,16 +54,23 @@ class QgsCurvePolygon: public QgsSurface
void setInteriorRings( const QList<QgsCurve*>& rings );
/** Adds an interior ring to the geometry (takes ownership)*/
virtual void addInteriorRing( QgsCurve* ring /Transfer/ );
/** Removes ring. Exterior ring is 0, first interior ring 1, ...*/
bool removeInteriorRing( int nr );

/**
* Removes the interior rings from the polygon. If the minimumRingArea
* Removes an interior ring from the polygon. The first interior ring has index 0.
* The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed
* the function will return true. It is not possible to remove the exterior ring using this method.
* @see removeInteriorRings()
*/
bool removeInteriorRing( int ringIndex );

/**
* Removes the interior rings from the polygon. If the minimumAllowedArea
* parameter is specified then only rings smaller than this minimum
* area will be removed.
* @note added in QGIS 3.0
* @see removeInteriorRing()
*/
void removeInteriorRings( double minimumRingArea = -1 );
void removeInteriorRings( double minimumAllowedArea = -1 );

virtual void draw( QPainter& p ) const;
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
@@ -346,12 +346,12 @@ class QgsGeometry
int addPart( const QgsGeometry& newPart ) /PyName=addPartGeometry/;

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

/** Translate this geometry by dx, dy
@return 0 in case of success*/
@@ -546,17 +546,17 @@ bool QgsCurvePolygon::removeInteriorRing( int nr )
return true;
}

void QgsCurvePolygon::removeInteriorRings( double minimumRingArea )
void QgsCurvePolygon::removeInteriorRings( double minimumAllowedArea )
{
for ( int ringIndex = mInteriorRings.size() - 1; ringIndex >= 0; --ringIndex )
{
if ( minimumRingArea < 0 )
if ( minimumAllowedArea < 0 )
delete mInteriorRings.takeAt( ringIndex );
else
{
double area;
mInteriorRings.at( ringIndex )->sumUpArea( area );
if ( area < minimumRingArea )
if ( area < minimumAllowedArea )
delete mInteriorRings.takeAt( ringIndex );
}
}
@@ -80,16 +80,23 @@ class CORE_EXPORT QgsCurvePolygon: public QgsSurface
void setInteriorRings( const QList<QgsCurve*>& rings );
//! Adds an interior ring to the geometry (takes ownership)
virtual void addInteriorRing( QgsCurve* ring );
//! Removes ring. Exterior ring is 0, first interior ring 1, ...
bool removeInteriorRing( int nr );

/**
* Removes the interior rings from the polygon. If the minimumRingArea
* Removes an interior ring from the polygon. The first interior ring has index 0.
* The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed
* the function will return true. It is not possible to remove the exterior ring using this method.
* @see removeInteriorRings()
*/
bool removeInteriorRing( int ringIndex );

/**
* Removes the interior rings from the polygon. If the minimumAllowedArea
* parameter is specified then only rings smaller than this minimum
* area will be removed.
* @note added in QGIS 3.0
* @see removeInteriorRing()
*/
void removeInteriorRings( double minimumRingArea = -1 );
void removeInteriorRings( double minimumAllowedArea = -1 );

virtual void draw( QPainter& p ) const override;
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
@@ -399,12 +399,12 @@ class CORE_EXPORT QgsGeometry
int addPart( const QgsGeometry& newPart );

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

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

0 comments on commit 45a52df

Please sign in to comment.