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 ) )
105 return fuzzyHelper( other, epsilon,
false );
109 return fuzzyHelper( other, epsilon,
true );
126 void clear() override;
129 bool fromWkt( const QString &wkt ) override;
133 QString asWkt(
int precision = 17 ) const override;
136 json asJsonObject(
int precision = 17 ) const override
SIP_SKIP;
137 QString asKml(
int precision = 17 ) const override;
151 QgsCurvePolygon *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
153 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
163 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 );
265 virtual QgsPolygon *toPolygon(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle )
const SIP_FACTORY;
275 virtual void setExteriorRing( QgsCurve *ring
SIP_TRANSFER );
278 void setInteriorRings(
const QVector<QgsCurve *> &rings
SIP_TRANSFER );
280 virtual void addInteriorRing( QgsCurve *ring
SIP_TRANSFER );
290 bool removeInteriorRing(
int ringIndex );
303 bool removeInteriorRing(
int i );
305 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
307 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
312 return PyBool_FromLong( sipCpp->removeInteriorRing( a0 ) );
324 void removeInteriorRings(
double minimumAllowedArea = -1 );
332 void removeInvalidRings();
357 void forceClockwise();
367 void forceCounterClockwise();
370 void draw( QPainter &p )
const override;
372 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
374 bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
375 bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
376 bool deleteVertex( QgsVertexId position ) override;
379 int nCoordinates() const override;
380 int vertexNumberFromVertexId( QgsVertexId
id ) const override;
382 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;
384 bool nextVertex( QgsVertexId &
id, QgsPoint &vertex
SIP_OUT ) const override;
385 void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex
SIP_OUT, QgsVertexId &nextVertex
SIP_OUT ) const override;
386 bool hasCurvedSegments() const override;
393 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
400 double vertexAngle( QgsVertexId vertex ) const override;
402 int vertexCount(
int part = 0,
int ring = 0 ) const override;
403 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
405 QgsPoint vertexAt( QgsVertexId
id ) const override;
406 double segmentLength( QgsVertexId startVertex ) const override;
408 bool addZValue(
double zValue = 0 ) override;
409 bool addMValue(
double mValue = 0 ) override;
410 bool dropZValue() override;
411 bool dropMValue() override;
412 void swapXy() override;
414 QgsCurvePolygon *toCurveType() const override
SIP_FACTORY;
416 bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback =
nullptr ) override;
419 void filterVertices(
const std::function<
bool(
const QgsPoint & ) > &filter )
override;
420 void transformVertices(
const std::function< QgsPoint(
const QgsPoint & ) > &transform )
override;
469 SIP_PYOBJECT __repr__();
471 QString wkt = sipCpp->asWkt();
472 if ( wkt.length() > 1000 )
473 wkt = wkt.left( 1000 ) + u
"..."_s;
474 QString str = u
"<QgsCurvePolygon: %1>"_s.arg( wkt );
475 sipRes = PyUnicode_FromString( str.toUtf8().constData() );