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;
187 QgsGeometryCollection *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
188 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
191 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
230 virtual bool removeGeometry(
int nr );
239 virtual bool removeGeometry(
int nr );
241 const int count = sipCpp->numGeometries();
242 if ( a0 < 0 || a0 >= count )
244 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
249 return PyBool_FromLong( sipCpp->removeGeometry( a0 ) );
260 QVector< QgsAbstractGeometry * > takeGeometries()
SIP_TRANSFER;
264 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
266 void draw( QPainter &p ) const override;
267 QPainterPath asQPainterPath() const override;
270 bool fromWkt( const QString &wkt ) override;
274 QString asWkt(
int precision = 17 ) const override;
278 QString asKml(
int precision = 17 ) const override;
280 QgsBox3D boundingBox3D() const override;
283 int nCoordinates() const override;
291 bool deleteVertex(
QgsVertexId position ) override;
297 bool hasCurvedSegments() const override
SIP_HOLDGIL;
304 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
306 double vertexAngle(
QgsVertexId vertex ) const override;
307 double segmentLength(
QgsVertexId startVertex ) const override;
308 int vertexCount(
int part = 0,
int ring = 0 ) const override;
309 int ringCount(
int part = 0 ) const override;
310 int partCount() const override;
312 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
314 bool addZValue(
double zValue = 0 ) override;
315 bool addMValue(
double mValue = 0 ) override;
316 bool dropZValue() override;
317 bool dropMValue() override;
318 void swapXy() override;
358 const int count = sipCpp->numGeometries();
359 if ( a0 < -count || a0 >= count )
361 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
366 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
370 return sipConvertFromType( sipCpp->geometryN( count + a0 ), sipType_QgsAbstractGeometry, NULL );
384 void __delitem__(
int index );
386 const int count = sipCpp->numGeometries();
387 if ( a0 >= 0 && a0 < count )
388 sipCpp->removeGeometry( a0 );
389 else if ( a0 < 0 && a0 >= -count )
390 sipCpp->removeGeometry( count + a0 );
393 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
405 sipRes = sipConvertFromNewType( new
QgsGeometryPartIterator( sipCpp ), sipType_QgsGeometryPartIterator, Py_None );
427 int childCount() const override;
437 virtual
bool wktOmitChildType() const;
442 bool fromCollectionWkt( const QString &wkt, const QVector<
QgsAbstractGeometry *> &subtypes, const QString &defaultChildWkbType = QString() );
444 QgsBox3D calculateBoundingBox3D() const override;
445 void clearCache() const override;
450 mutable
bool mHasCachedValidity = false;
451 mutable QString mValidityFailureReason;