16 #ifndef QGSGEOMETRYCOLLECTION_H
17 #define QGSGEOMETRYCOLLECTION_H
22 #include "qgis_core.h"
60 return mGeometries.size();
70 sipRes = sipCpp->numGeometries();
88 return mGeometries.value( n );
107 if ( a0 < 0 || a0 >= sipCpp->numGeometries() )
109 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
114 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
124 void clear() override;
126 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
129 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
159 virtual bool removeGeometry(
int nr );
168 virtual bool removeGeometry(
int nr );
170 const int count = sipCpp->numGeometries();
171 if ( a0 < 0 || a0 >= count )
173 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
178 return PyBool_FromLong( sipCpp->removeGeometry( a0 ) );
185 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
187 void draw( QPainter &p ) const override;
188 QPainterPath asQPainterPath() const override;
191 bool fromWkt( const QString &wkt ) override;
195 QString asWkt(
int precision = 17 ) const override;
199 QString asKml(
int precision = 17 ) const override;
204 int nCoordinates() const override;
212 bool deleteVertex(
QgsVertexId position ) override;
218 bool hasCurvedSegments() const override
SIP_HOLDGIL;
225 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
227 double vertexAngle(
QgsVertexId vertex ) const override;
228 double segmentLength(
QgsVertexId startVertex ) const override;
229 int vertexCount(
int part = 0,
int ring = 0 ) const override;
230 int ringCount(
int part = 0 ) const override;
231 int partCount() const override;
233 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
235 bool addZValue(
double zValue = 0 ) override;
236 bool addMValue(
double mValue = 0 ) override;
237 bool dropZValue() override;
238 bool dropMValue() override;
239 void swapXy() override;
279 const int count = sipCpp->numGeometries();
280 if ( a0 < -count || a0 >= count )
282 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
287 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
291 return sipConvertFromType( sipCpp->geometryN( count + a0 ), sipType_QgsAbstractGeometry, NULL );
305 void __delitem__(
int index );
307 const int count = sipCpp->numGeometries();
308 if ( a0 >= 0 && a0 < count )
309 sipCpp->removeGeometry( a0 );
310 else if ( a0 < 0 && a0 >= -count )
311 sipCpp->removeGeometry( count + a0 );
314 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
326 sipRes = sipConvertFromNewType( new
QgsGeometryPartIterator( sipCpp ), sipType_QgsGeometryPartIterator, Py_None );
333 int childCount() const override;
344 virtual
bool wktOmitChildType() const;
349 bool fromCollectionWkt( const QString &wkt, const QVector<
QgsAbstractGeometry *> &subtypes, const QString &defaultChildWkbType = QString() );
352 void clearCache() const override;
357 mutable
bool mHasCachedValidity = false;
358 mutable QString mValidityFailureReason;
363 #endif // QGSGEOMETRYCOLLECTION_H