56 bool fuzzyHelper(
const QgsAbstractGeometry &other,
double epsilon,
bool useDistance )
const
69 for (
int i = 0; i <
mPatches.count(); ++i )
95 return fuzzyHelper( other, epsilon,
false );
99 return fuzzyHelper( other, epsilon,
true );
117 void clear() override;
120 bool fromWkt( const QString &wkt ) override;
122 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
126 QString asWkt(
int precision = 17 ) const override;
129 json asJsonObject(
int precision = 17 ) const override
SIP_SKIP;
130 QString asKml(
int precision = 17 ) const override;
138 QgsPolyhedralSurface *snappedToGrid(
double hSpacing,
double vSpacing,
double dSpacing = 0,
double mSpacing = 0,
bool removeRedundantPoints = false ) const override
SIP_FACTORY;
140 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<
double>::epsilon(),
bool useZValues = false ) override;
164 if ( i < 0 || i >=
mPatches.size() )
178 if ( i < 0 || i >=
mPatches.size() )
196 if ( a0 < 0 || a0 >= sipCpp->numPatches() )
198 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
203 return sipConvertFromType(
const_cast< QgsPolygon *
>( sipCpp->patchN( a0 ) ), sipType_QgsPolygon, NULL );
212 virtual void setPatches(
const QVector<QgsPolygon *> &patches
SIP_TRANSFER );
217 virtual void addPatch( QgsPolygon *patch
SIP_TRANSFER );
227 bool removePatch(
int patchIndex );
238 bool removePatch(
int ringIndex );
240 if ( a0 < 0 || a0 >= sipCpp->numPatches() )
242 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
247 return PyBool_FromLong( sipCpp->removePatch( a0 ) );
254 void draw( QPainter &p )
const override;
256 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
258 bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) override;
259 bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) override;
260 bool deleteVertex( QgsVertexId position ) override;
263 int nCoordinates() const override;
264 int vertexNumberFromVertexId( QgsVertexId
id ) const override;
266 double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt
SIP_OUT, QgsVertexId &vertexAfter
SIP_OUT,
int *leftOf
SIP_OUT =
nullptr,
double epsilon = 4 * std::numeric_limits<
double>::epsilon() ) const override;
268 bool nextVertex( QgsVertexId &
id, QgsPoint &vertex
SIP_OUT ) const override;
269 void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex
SIP_OUT, QgsVertexId &nextVertex
SIP_OUT ) const override;
270 bool hasCurvedSegments() const final;
277 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
284 double vertexAngle( QgsVertexId vertex ) const override;
286 int vertexCount(
int part = 0,
int ring = 0 ) const override;
287 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
289 QgsPoint vertexAt( QgsVertexId
id ) const override;
290 double segmentLength( QgsVertexId startVertex ) const override;
292 bool addZValue(
double zValue = 0 ) override;
293 bool addMValue(
double mValue = 0 ) override;
294 bool dropZValue() override;
295 bool dropMValue() override;
296 void swapXy() override;
298 QgsMultiSurface *toCurveType() const override
SIP_FACTORY;
300 bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback =
nullptr ) override;
306 QgsMultiPolygon *toMultiPolygon() const
SIP_FACTORY;
309 void filterVertices(
const std::function<
bool(
const QgsPoint & ) > &filter )
override;
310 void transformVertices(
const std::function< QgsPoint(
const QgsPoint & ) > &transform )
override;
359 SIP_PYOBJECT __repr__();
361 QString wkt = sipCpp->asWkt();
362 if ( wkt.length() > 1000 )
363 wkt = wkt.left( 1000 ) + u
"..."_s;
364 QString str = u
"<QgsPolyhedralSurface: %1>"_s.arg( wkt );
365 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
373 sipRes = sipCpp->numPatches();
386 const int count = sipCpp->numPatches();
387 if ( a0 < -count || a0 >= count )
389 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
394 return sipConvertFromType( sipCpp->patchN( a0 ), sipType_QgsPolygon, NULL );
398 return sipConvertFromType( sipCpp->patchN( count + a0 ), sipType_QgsPolygon, NULL );
407 QgsAbstractGeometry *
childGeometry(
int index )
const override;