16 #ifndef QGSGEOMETRYCOLLECTION_H
17 #define QGSGEOMETRYCOLLECTION_H
22 #include "qgis_core.h"
59 return mGeometries.size();
69 sipRes = sipCpp->numGeometries();
87 return mGeometries.value( n );
105 if ( a0 < 0 || a0 >= sipCpp->numGeometries() )
107 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
112 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
122 void clear() override;
124 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
127 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
156 virtual bool removeGeometry(
int nr );
166 virtual bool removeGeometry(
int nr );
168 const int count = sipCpp->numGeometries();
169 if ( a0 < 0 || a0 >= count )
171 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
176 return PyBool_FromLong( sipCpp->removeGeometry( a0 ) );
182 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
184 void draw( QPainter &p ) const override;
185 QPainterPath asQPainterPath() const override;
188 bool fromWkt( const QString &wkt ) override;
192 QString asWkt(
int precision = 17 ) const override;
196 QString asKml(
int precision = 17 ) const override;
201 int nCoordinates() const override;
209 bool deleteVertex(
QgsVertexId position ) override;
215 bool hasCurvedSegments() const override
SIP_HOLDGIL;
222 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
224 double vertexAngle(
QgsVertexId vertex ) const override;
225 double segmentLength(
QgsVertexId startVertex ) const override;
226 int vertexCount(
int part = 0,
int ring = 0 ) const override;
227 int ringCount(
int part = 0 ) const override;
228 int partCount() const override;
230 bool isValid( QString &error
SIP_OUT,
int flags = 0 ) const override;
232 bool addZValue(
double zValue = 0 ) override;
233 bool addMValue(
double mValue = 0 ) override;
234 bool dropZValue() override;
235 bool dropMValue() override;
236 void swapXy() override;
271 const int count = sipCpp->numGeometries();
272 if ( a0 < -count || a0 >= count )
274 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
279 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
283 return sipConvertFromType( sipCpp->geometryN( count + a0 ), sipType_QgsAbstractGeometry, NULL );
295 void __delitem__(
int index );
297 const int count = sipCpp->numGeometries();
298 if ( a0 >= 0 && a0 < count )
299 sipCpp->removeGeometry( a0 );
300 else if ( a0 < 0 && a0 >= -count )
301 sipCpp->removeGeometry( count + a0 );
304 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
316 sipRes = sipConvertFromNewType( new
QgsGeometryPartIterator( sipCpp ), sipType_QgsGeometryPartIterator, Py_None );
323 int childCount() const override;
333 virtual
bool wktOmitChildType() const;
338 bool fromCollectionWkt( const QString &wkt, const QVector<
QgsAbstractGeometry *> &subtypes, const QString &defaultChildWkbType = QString() );
341 void clearCache() const override;
346 mutable
bool mHasCachedValidity = false;
347 mutable QString mValidityFailureReason;
352 #endif // QGSGEOMETRYCOLLECTION_H