QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
21 #include "qgis_core.h"
25 #include <QPainterPath>
48 virtual bool equals(
const QgsCurve &other )
const = 0;
59 virtual QgsPoint startPoint()
const = 0;
65 virtual QgsPoint endPoint()
const = 0;
70 virtual bool isClosed()
const;
75 virtual bool isRing()
const;
91 virtual void addToPainterPath( QPainterPath &path )
const = 0;
97 virtual void drawAsPolygon( QPainter &p )
const = 0;
107 virtual int numPoints()
const = 0;
112 Returns the number of points in the curve.
115 sipRes = sipCpp->numPoints();
119 int __bool__()
const;
128 virtual void sumUpArea(
double &sum
SIP_OUT )
const = 0;
160 int vertexCount(
int part = 0,
int ring = 0 )
const override;
161 int ringCount(
int part = 0 )
const override;
167 bool isValid( QString &error
SIP_OUT,
int flags = 0 )
const override;
174 virtual double xAt(
int index )
const = 0;
181 virtual double yAt(
int index )
const = 0;
186 virtual QPolygonF asQPolygonF()
const;
213 virtual QgsCurve *curveSubstring(
double startDistance,
double endDistance )
const = 0
SIP_FACTORY;
222 double straightDistance2d()
const;
233 double sinuosity()
const;
249 Orientation orientation()
const;
268 return static_cast<const QgsCurve *
>( geom );
288 bool snapToGridPrivate(
double hSpacing,
double vSpacing,
double dSpacing,
double mSpacing,
289 const QVector<double> &srcX,
const QVector<double> &srcY,
const QVector<double> &srcZ,
const QVector<double> &srcM,
290 QVector<double> &outX, QVector<double> &outY, QVector<double> &outZ, QVector<double> &outM )
const;
297 mutable bool mHasCachedValidity =
false;
298 mutable QString mValidityFailureReason;
Abstract base class for curved geometry type.
virtual QgsCoordinateSequence coordinateSequence() const =0
Retrieves the sequence of geometries, rings and nodes.
QVector< QgsRingSequence > QgsCoordinateSequence
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
virtual void adjacentVertices(QgsVertexId vertex, QgsVertexId &previousVertex, QgsVertexId &nextVertex) const =0
Returns the vertices adjacent to a specified vertex within a geometry.
virtual void clearCache() const
Clears any cached parameters associated with the geometry, e.g., bounding boxes.
Point geometry type, with support for z-dimension and m-values.
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.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
virtual bool isValid(QString &error, int flags=0) const =0
Checks validity of the geometry, and returns true if the geometry is valid.
virtual int partCount() const =0
Returns count of parts contained in the geometry.
Line string geometry type, with support for z-dimension and m-values.
virtual int vertexCount(int part=0, int ring=0) const =0
Returns the number of vertices of which this geometry is built.
virtual QgsPoint vertexAt(QgsVertexId id) const =0
Returns the point corresponding to a specified vertex id.
@ Clockwise
Clockwise orientation.
virtual QgsPoint childPoint(int index) const
Returns point at index (for geometries without child geometries - i.e.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
@ CounterClockwise
Counter-clockwise orientation.
virtual int vertexNumberFromVertexId(QgsVertexId id) const =0
Returns the vertex number corresponding to a vertex id.
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
static bool isSingleType(Type type)
Returns true if the WKB type is a single type.
Abstract base class for all geometries.
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
virtual QgsRectangle boundingBox() const =0
Returns the minimal bounding box for the geometry.
const QgsCurve * cast(const QgsAbstractGeometry *geom) const
Cast the geom to a QgsCurve.
QVector< QgsPoint > QgsPointSequence
virtual bool operator!=(const QgsAbstractGeometry &other) const =0
virtual QgsAbstractGeometry * toCurveType() const =0
Returns the geometry converted to the more generic curve type.
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 QgsAbstractGeometry * boundary() const =0
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
virtual bool operator==(const QgsAbstractGeometry &other) const =0
Orientation
Curve orientation.
virtual int ringCount(int part=0) const =0
Returns the number of rings of which this geometry is built.
virtual bool nextVertex(QgsVertexId &id, QgsPoint &vertex) const =0
Returns next vertex id and coordinates.