QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSCURVEPOLYGON_H
19 #define QGSCURVEPOLYGON_H
21 #include "qgis_core.h"
49 void clear()
override;
52 bool fromWkt(
const QString &wkt )
override;
54 int wkbSize( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() )
const override;
55 QByteArray
asWkb( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() )
const override;
68 bool removeDuplicateNodes(
double epsilon = 4 * std::numeric_limits<double>::epsilon(),
bool useZValues =
false )
override;
79 return mInteriorRings.size();
89 return mExteriorRing.get();
102 if ( i < 0 || i >= mInteriorRings.size() )
106 return mInteriorRings.at( i );
120 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
122 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
127 return sipConvertFromType(
const_cast< QgsCurve *
>( sipCpp->interiorRing( a0 ) ), sipType_QgsCurve, NULL );
151 void setInteriorRings(
const QVector<QgsCurve *> &rings
SIP_TRANSFER );
163 bool removeInteriorRing(
int ringIndex );
175 bool removeInteriorRing(
int i );
177 if ( a0 < 0 || a0 >= sipCpp->numInteriorRings() )
179 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
184 return PyBool_FromLong( sipCpp->removeInteriorRing( a0 ) );
196 void removeInteriorRings(
double minimumAllowedArea = -1 );
205 void removeInvalidRings();
218 void draw( QPainter &p )
const override;
220 void transform( const QTransform &t,
double zTranslate = 0.0,
double zScale = 1.0,
double mTranslate = 0.0,
double mScale = 1.0 ) override;
224 bool deleteVertex(
QgsVertexId position ) override;
227 int nCoordinates() const override;
228 int vertexNumberFromVertexId(
QgsVertexId id ) const override;
234 bool hasCurvedSegments() const override;
241 QgsAbstractGeometry *segmentize(
double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override
SIP_FACTORY;
248 double vertexAngle(
QgsVertexId vertex ) const override;
250 int vertexCount(
int part = 0,
int ring = 0 ) const override;
251 int ringCount(
int part = 0 ) const override
SIP_HOLDGIL;
254 double segmentLength(
QgsVertexId startVertex ) const override;
256 bool addZValue(
double zValue = 0 ) override;
257 bool addMValue(
double mValue = 0 ) override;
258 bool dropZValue() override;
259 bool dropMValue() override;
260 void swapXy() override;
292 SIP_PYOBJECT __repr__();
294 QString wkt = sipCpp->asWkt();
295 if ( wkt.length() > 1000 )
296 wkt = wkt.left( 1000 ) + QStringLiteral(
"..." );
297 QString str = QStringLiteral(
"<QgsCurvePolygon: %1>" ).arg( wkt );
298 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
317 #endif // QGSCURVEPOLYGON_H
Abstract base class for curved geometry type.
QVector< QgsRingSequence > QgsCoordinateSequence
virtual bool removeDuplicateNodes(double epsilon=4 *std::numeric_limits< double >::epsilon(), bool useZValues=false)=0
Removes duplicate nodes from the geometry, wherever removing the nodes does not result in a degenerat...
virtual bool fromWkt(const QString &wkt)=0
Sets the geometry from a WKT string.
virtual QPainterPath asQPainterPath() const =0
Returns the geometry represented as a QPainterPath.
virtual QByteArray asWkb(WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const =0
Returns a WKB representation of the geometry.
Point geometry type, with support for z-dimension and m-values.
virtual QgsAbstractGeometry * snappedToGrid(double hSpacing, double vSpacing, double dSpacing=0, double mSpacing=0) const =0
Makes a new geometry with all the points or vertices snapped to the closest point of the grid.
virtual int wkbSize(QgsAbstractGeometry::WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const =0
Returns the length of the QByteArray returned by asWkb()
const QgsCurve * exteriorRing() const SIP_HOLDGIL
Returns the curve polygon's exterior ring.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
virtual void filterVertices(const std::function< bool(const QgsPoint &) > &filter)
Filters the vertices from the geometry in place, removing any which do not return true for the filter...
Curve polygon geometry type.
virtual QString asWkt(int precision=17) const =0
Returns a WKT representation of the geometry.
Type
The WKB type describes the number of dimensions a geometry has.
virtual QString asKml(int precision=17) const =0
Returns a KML representation of the geometry.
virtual QgsAbstractGeometry * childGeometry(int index) const
Returns pointer to child geometry (for geometries with child geometries - i.e.
double closestSegment(const QgsPolylineXY &pl, const QgsPointXY &pt, int &vertexAfter, double epsilon)
A rectangle specified with double values.
#define SIP_TYPEHINT(type)
int numInteriorRings() const SIP_HOLDGIL
Returns the number of interior rings contained with the curve polygon.
double ANALYSIS_EXPORT leftOf(const QgsPoint &thepoint, const QgsPoint *p1, const QgsPoint *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'. Negative values mean left ...
virtual double area() const
Returns the planar, 2-dimensional area of the geometry.
virtual QgsPolygon * surfaceToPolygon() const =0
Gets a polygon representation of this surface.
virtual int dimension() const =0
Returns the inherent dimension of the geometry.
Custom exception class for Coordinate Reference System related exceptions.
std::unique_ptr< QgsCurve > mExteriorRing
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
AxisOrder
Axis order for GML generation.
virtual json asJsonObject(int precision=17) const
Returns a json object representation of the geometry.
CORE_EXPORT std::unique_ptr< QgsPolygon > toPolygon(const QgsMeshFace &face, const QVector< QgsMeshVertex > &vertices)
Returns face as polygon geometry, caller is responsible for delete.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
virtual void clear()=0
Clears the geometry, ie reset it to a null geometry.
const QgsCurve * interiorRing(int i) const SIP_HOLDGIL
Retrieves an interior ring from the curve polygon.
virtual bool fromWkb(QgsConstWkbPtr &wkb)=0
Sets the geometry from a WKB string.
Abstract base class for all geometries.
virtual QString geometryType() const =0
Returns a unique string representing the geometry type.
virtual QgsAbstractGeometry * createEmptyWithSameType() const =0
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
virtual QDomElement asGml3(QDomDocument &doc, int precision=17, const QString &ns="gml", AxisOrder axisOrder=QgsAbstractGeometry::AxisOrder::XY) const =0
Returns a GML3 representation of the geometry.
QgsAbstractGeometry & operator=(const QgsAbstractGeometry &geom)
virtual bool operator!=(const QgsAbstractGeometry &other) const =0
virtual void draw(QPainter &p) const =0
Draws the geometry using the specified QPainter.
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
Utility class for identifying a unique vertex within a geometry.
virtual double perimeter() const
Returns the planar, 2-dimensional perimeter of the geometry.
const QgsCurvePolygon * cast(const QgsAbstractGeometry *geom) const
Cast the geom to a QgsCurvePolygon.
virtual void transformVertices(const std::function< QgsPoint(const QgsPoint &) > &transform)
Transforms the vertices from the geometry in place, applying the transform function to every vertex.
virtual QgsAbstractGeometry * boundary() const =0
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
QVector< QgsCurve * > mInteriorRings
virtual bool operator==(const QgsAbstractGeometry &other) const =0
virtual void transform(const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) SIP_THROW(QgsCsException)=0
Transforms the geometry using a coordinate transform.
virtual QDomElement asGml2(QDomDocument &doc, int precision=17, const QString &ns="gml", AxisOrder axisOrder=QgsAbstractGeometry::AxisOrder::XY) const =0
Returns a GML2 representation of the geometry.
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.