49 bool fuzzyHelper(
const QgsAbstractGeometry &other,
double epsilon,
bool useDistance )
const
70 if ( !( *mExteriorRing ).fuzzyDistanceEqual( *otherPolygon->
mExteriorRing, epsilon ) )
75 if ( !( *mExteriorRing ).fuzzyEqual( *otherPolygon->
mExteriorRing, epsilon ) )
107 void removeRing(
int ringId );
114 return fuzzyHelper( other, epsilon,
false );
118 return fuzzyHelper( other, epsilon,
true );
135 void clear() override;
138 bool fromWkt( const QString &wkt ) override;
142 QString asWkt(
int precision = 17 ) const override;
145 json asJsonObject(
int precision = 17,
Qgis::GeoJsonProfile profile =
Qgis::GeoJsonProfile::Legacy ) const override
SIP_SKIP;
146 QString asKml(
int precision = 17 ) const override;
160 QgsCurvePolygon *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
162 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
172 double roundness() const;
255 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
257 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
262 return sipConvertFromType(
const_cast< QgsCurve *
>( sipCpp->interiorRing( a0 ) ), sipType_QgsCurve, NULL );
274 virtual QgsPolygon *toPolygon(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle )
const SIP_FACTORY;
284 virtual void setExteriorRing( QgsCurve *ring
SIP_TRANSFER );
287 void setInteriorRings(
const QVector<QgsCurve *> &rings
SIP_TRANSFER );
289 virtual void addInteriorRing( QgsCurve *ring
SIP_TRANSFER );
299 bool removeInteriorRing(
int ringIndex );
312 bool removeInteriorRing(
int i );
314 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
316 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
321 return PyBool_FromLong( sipCpp->removeInteriorRing( a0 ) );
333 void removeInteriorRings(
double minimumAllowedArea = -1 );
341 void removeInvalidRings();
366 void forceClockwise();
376 void forceCounterClockwise();
379 void draw( QPainter &p )
const override;
381 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
383 bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
384 bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
385 bool deleteVertex( QgsVertexId position ) override;
386 bool deleteVertices( const QSet<QgsVertexId> &positions ) override;
387 bool hasVertex( QgsVertexId position ) const override;
390 int nCoordinates() const override;
391 int vertexNumberFromVertexId( QgsVertexId
id ) const override;
393 double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt
SIP_OUT, QgsVertexId &vertexAfter
SIP_OUT,
int *leftOf
SIP_OUT =
nullptr,
double epsilon = 4 * std::numeric_limits<
double>::epsilon() ) const override;
395 bool nextVertex( QgsVertexId &
id, QgsPoint &vertex
SIP_OUT ) const override;
396 void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex
SIP_OUT, QgsVertexId &nextVertex
SIP_OUT ) const override;
397 bool hasCurvedSegments() const override;
404 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
411 double vertexAngle( QgsVertexId vertex ) const override;
413 int vertexCount(
int part = 0,
int ring = 0 ) const override;
414 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
416 QgsPoint vertexAt( QgsVertexId
id ) const override;
417 double segmentLength( QgsVertexId startVertex ) const override;
419 bool addZValue(
double zValue = 0 ) override;
420 bool addMValue(
double mValue = 0 ) override;
421 bool dropZValue() override;
422 bool dropMValue() override;
423 void swapXy() override;
425 QgsCurvePolygon *toCurveType() const override
SIP_FACTORY;
427 bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback =
nullptr ) override;
430 void filterVertices(
const std::function<
bool(
const QgsPoint & ) > &filter )
override;
431 void transformVertices(
const std::function< QgsPoint(
const QgsPoint & ) > &transform )
override;
480 SIP_PYOBJECT __repr__();
482 QString wkt = sipCpp->asWkt();
483 if ( wkt.length() > 1000 )
484 wkt = wkt.left( 1000 ) + u
"..."_s;
485 QString str = u
"<QgsCurvePolygon: %1>"_s.arg( wkt );
486 sipRes = PyUnicode_FromString( str.toUtf8().constData() );