62 bool fuzzyHelper(
const QgsAbstractGeometry &other,
double epsilon,
bool useDistance )
const
64 const QgsGeometryCollection *otherCollection = qgsgeometry_cast< const QgsGeometryCollection * >( &other );
65 if ( !otherCollection )
68 if ( mWkbType != otherCollection->
mWkbType )
71 if ( mGeometries.count() != otherCollection->
mGeometries.count() )
74 for (
int i = 0; i < mGeometries.count(); ++i )
88 if ( !( *g1 ).fuzzyDistanceEqual( *g2, epsilon ) )
95 if ( !( *g1 ).fuzzyEqual( *g2, epsilon ) )
108 return fuzzyHelper( other, epsilon,
false );
112 return fuzzyHelper( other, epsilon,
true );
122 return mGeometries.size();
132 sipRes = sipCpp->numGeometries();
136 int __bool__()
const;
150 return mGeometries.value( n );
169 if ( a0 < 0 || a0 >= sipCpp->numGeometries() )
171 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
176 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
186 void clear() override;
188 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
191 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
221 virtual bool removeGeometry(
int nr );
230 virtual bool removeGeometry(
int nr );
232 const int count = sipCpp->numGeometries();
233 if ( a0 < 0 || a0 >= count )
235 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
240 return PyBool_FromLong( sipCpp->removeGeometry( a0 ) );
247 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
249 void draw( QPainter &p ) const override;
250 QPainterPath asQPainterPath() const override;
253 bool fromWkt( const QString &wkt ) override;
257 QString asWkt(
int precision = 17 ) const override;
261 QString asKml(
int precision = 17 ) const override;
263 QgsBox3D boundingBox3D() const override;
266 int nCoordinates() const override;
274 bool deleteVertex(
QgsVertexId position ) override;
280 bool hasCurvedSegments() const override
SIP_HOLDGIL;
287 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
289 double vertexAngle(
QgsVertexId vertex ) const override;
290 double segmentLength(
QgsVertexId startVertex ) const override;
291 int vertexCount(
int part = 0,
int ring = 0 ) const override;
292 int ringCount(
int part = 0 ) const override;
293 int partCount() const override;
295 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
297 bool addZValue(
double zValue = 0 ) override;
298 bool addMValue(
double mValue = 0 ) override;
299 bool dropZValue() override;
300 bool dropMValue() override;
301 void swapXy() override;
340 const int count = sipCpp->numGeometries();
341 if ( a0 < -count || a0 >= count )
343 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
348 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
352 return sipConvertFromType( sipCpp->geometryN( count + a0 ), sipType_QgsAbstractGeometry, NULL );
366 void __delitem__(
int index );
368 const int count = sipCpp->numGeometries();
369 if ( a0 >= 0 && a0 < count )
370 sipCpp->removeGeometry( a0 );
371 else if ( a0 < 0 && a0 >= -count )
372 sipCpp->removeGeometry( count + a0 );
375 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
387 sipRes = sipConvertFromNewType( new
QgsGeometryPartIterator( sipCpp ), sipType_QgsGeometryPartIterator, Py_None );
409 int childCount() const override;
419 virtual
bool wktOmitChildType() const;
424 bool fromCollectionWkt( const QString &wkt, const QVector<
QgsAbstractGeometry *> &subtypes, const QString &defaultChildWkbType = QString() );
426 QgsBox3D calculateBoundingBox3D() const override;
427 void clearCache() const override;
432 mutable
bool mHasCachedValidity = false;
433 mutable QString mValidityFailureReason;