16 #ifndef QGSGEOMETRYCOLLECTION_H
17 #define QGSGEOMETRYCOLLECTION_H
22 #include "qgis_core.h"
53 return mGeometries.size();
63 sipRes = sipCpp->numGeometries();
81 return mGeometries.value( n );
99 if ( a0 < 0 || a0 >= sipCpp->numGeometries() )
101 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
106 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
116 void clear()
override;
118 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
121 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
131 void reserve(
int size );
150 virtual bool removeGeometry(
int nr );
160 virtual bool removeGeometry(
int nr );
162 const int count = sipCpp->numGeometries();
163 if ( a0 < 0 || a0 >= count )
165 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
170 return PyBool_FromLong( sipCpp->removeGeometry( a0 ) );
176 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
178 void draw( QPainter &p ) const override;
181 bool fromWkt( const QString &wkt ) override;
183 QString asWkt(
int precision = 17 ) const override;
187 QString asKml(
int precision = 17 ) const override;
192 int nCoordinates() const override;
200 bool deleteVertex(
QgsVertexId position ) override;
202 double length() const override;
203 double area() const override;
204 double perimeter() const override;
206 bool hasCurvedSegments() const override;
212 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
214 double vertexAngle(
QgsVertexId vertex ) const override;
215 double segmentLength(
QgsVertexId startVertex ) const override;
216 int vertexCount(
int part = 0,
int ring = 0 ) const override;
217 int ringCount(
int part = 0 ) const override;
218 int partCount() const override;
220 bool isValid( QString &error
SIP_OUT,
int flags = 0 ) const override;
222 bool addZValue(
double zValue = 0 ) override;
223 bool addMValue(
double mValue = 0 ) override;
224 bool dropZValue() override;
225 bool dropMValue() override;
226 void swapXy() override;
261 const int count = sipCpp->numGeometries();
262 if ( a0 < -count || a0 >= count )
264 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
269 return sipConvertFromType( sipCpp->geometryN( a0 ), sipType_QgsAbstractGeometry, NULL );
273 return sipConvertFromType( sipCpp->geometryN( count + a0 ), sipType_QgsAbstractGeometry, NULL );
285 void __delitem__(
int index );
287 const int count = sipCpp->numGeometries();
288 if ( a0 >= 0 && a0 < count )
289 sipCpp->removeGeometry( a0 );
290 else if ( a0 < 0 && a0 >= -count )
291 sipCpp->removeGeometry( count + a0 );
294 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
306 sipRes = sipConvertFromNewType( new
QgsGeometryPartIterator( sipCpp ), sipType_QgsGeometryPartIterator, Py_None );
313 int childCount() const override;
323 virtual
bool wktOmitChildType() const;
328 bool fromCollectionWkt( const QString &wkt, const QVector<
QgsAbstractGeometry *> &subtypes, const QString &defaultChildWkbType = QString() );
331 void clearCache() const override;
336 mutable
bool mHasCachedValidity = false;
337 mutable QString mValidityFailureReason;
342 #endif // QGSGEOMETRYCOLLECTION_H