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 ) )
106 return fuzzyHelper( other, epsilon,
false );
110 return fuzzyHelper( other, epsilon,
true );
127 void clear() override;
130 bool fromWkt( const QString &wkt ) override;
134 QString asWkt(
int precision = 17 ) const override;
137 json asJsonObject(
int precision = 17 ) const override
SIP_SKIP;
138 QString asKml(
int precision = 17 ) const override;
152 QgsCurvePolygon *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
154 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
164 double roundness() const;
246 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
248 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
253 return sipConvertFromType(
const_cast< QgsCurve *
>( sipCpp->interiorRing( a0 ) ), sipType_QgsCurve, NULL );
264 virtual QgsPolygon *toPolygon(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle )
const SIP_FACTORY;
274 virtual void setExteriorRing( QgsCurve *ring
SIP_TRANSFER );
277 void setInteriorRings(
const QVector<QgsCurve *> &rings
SIP_TRANSFER );
279 virtual void addInteriorRing( QgsCurve *ring
SIP_TRANSFER );
289 bool removeInteriorRing(
int ringIndex );
301 bool removeInteriorRing(
int i );
303 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
305 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
310 return PyBool_FromLong( sipCpp->removeInteriorRing( a0 ) );
321 void removeInteriorRings(
double minimumAllowedArea = -1 );
329 void removeInvalidRings();
354 void forceClockwise();
364 void forceCounterClockwise();
367 void draw( QPainter &p )
const override;
369 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
371 bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
372 bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
373 bool deleteVertex( QgsVertexId position ) override;
376 int nCoordinates() const override;
377 int vertexNumberFromVertexId( QgsVertexId
id ) const override;
379 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;
381 bool nextVertex( QgsVertexId &
id, QgsPoint &vertex
SIP_OUT ) const override;
382 void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex
SIP_OUT, QgsVertexId &nextVertex
SIP_OUT ) const override;
383 bool hasCurvedSegments() const override;
390 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
397 double vertexAngle( QgsVertexId vertex ) const override;
399 int vertexCount(
int part = 0,
int ring = 0 ) const override;
400 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
402 QgsPoint vertexAt( QgsVertexId
id ) const override;
403 double segmentLength( QgsVertexId startVertex ) const override;
405 bool addZValue(
double zValue = 0 ) override;
406 bool addMValue(
double mValue = 0 ) override;
407 bool dropZValue() override;
408 bool dropMValue() override;
409 void swapXy() override;
411 QgsCurvePolygon *toCurveType() const override
SIP_FACTORY;
413 bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback =
nullptr ) override;
416 void filterVertices(
const std::function<
bool(
const QgsPoint & ) > &filter )
override;
417 void transformVertices(
const std::function< QgsPoint(
const QgsPoint & ) > &transform )
override;
465 SIP_PYOBJECT __repr__();
467 QString wkt = sipCpp->asWkt();
468 if ( wkt.length() > 1000 )
469 wkt = wkt.left( 1000 ) + u
"..."_s;
470 QString str = u
"<QgsCurvePolygon: %1>"_s.arg( wkt );
471 sipRes = PyUnicode_FromString( str.toUtf8().constData() );