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 deleteVertices( const QSet<QgsVertexId> &positions ) override;
386 bool hasVertex( QgsVertexId position ) const override;
389 int nCoordinates() const override;
390 int vertexNumberFromVertexId( QgsVertexId
id ) const override;
392 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;
394 bool nextVertex( QgsVertexId &
id, QgsPoint &vertex
SIP_OUT ) const override;
395 void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex
SIP_OUT, QgsVertexId &nextVertex
SIP_OUT ) const override;
396 bool hasCurvedSegments() const override;
403 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
410 double vertexAngle( QgsVertexId vertex ) const override;
412 int vertexCount(
int part = 0,
int ring = 0 ) const override;
413 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
415 QgsPoint vertexAt( QgsVertexId
id ) const override;
416 double segmentLength( QgsVertexId startVertex ) const override;
418 bool addZValue(
double zValue = 0 ) override;
419 bool addMValue(
double mValue = 0 ) override;
420 bool dropZValue() override;
421 bool dropMValue() override;
422 void swapXy() override;
424 QgsCurvePolygon *toCurveType() const override
SIP_FACTORY;
426 bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback =
nullptr ) override;
429 void filterVertices(
const std::function<
bool(
const QgsPoint & ) > &filter )
override;
430 void transformVertices(
const std::function< QgsPoint(
const QgsPoint & ) > &transform )
override;
479 SIP_PYOBJECT __repr__();
481 QString wkt = sipCpp->asWkt();
482 if ( wkt.length() > 1000 )
483 wkt = wkt.left( 1000 ) + u
"..."_s;
484 QString str = u
"<QgsCurvePolygon: %1>"_s.arg( wkt );
485 sipRes = PyUnicode_FromString( str.toUtf8().constData() );