25#include <QPainterPath>
102 virtual
void addToPainterPath( QPainterPath &path ) const = 0;
103 QPainterPath asQPainterPath() const override;
109 virtual
void drawAsPolygon( QPainter &p ) const = 0;
119 virtual
int numPoints() const = 0;
124 Returns the number of points in the curve.
127 sipRes = sipCpp->numPoints();
131 int __bool__()
const;
175 QString asKml(
int precision = 17 ) const override;
184 int vertexCount(
int part = 0,
int ring = 0 ) const override;
185 int ringCount(
int part = 0 ) const override;
186 int partCount() const override;
191 QgsBox3D boundingBox3D() const override;
192 bool isValid( QString &error
SIP_OUT,
Qgis::GeometryValidityFlags flags =
Qgis::GeometryValidityFlags() ) const override;
199 virtual
double xAt(
int index ) const = 0;
206 virtual
double yAt(
int index ) const = 0;
214 virtual
double zAt(
int index ) const = 0;
222 virtual
double mAt(
int index ) const = 0;
227 virtual QPolygonF asQPolygonF() const;
263 double straightDistance2d() const;
274 double sinuosity() const;
283 Qgis::AngularDirection orientation() const;
296 virtual
void scroll(
int firstVertexIndex ) = 0;
314 return static_cast<const QgsCurve *
>( geom );
329 virtual std::tuple< std::unique_ptr< QgsCurve >, std::unique_ptr< QgsCurve > >
splitCurveAtVertex(
int index )
const = 0;
346 bool snapToGridPrivate(
double hSpacing,
double vSpacing,
double dSpacing,
double mSpacing,
347 const QVector<double> &srcX,
const QVector<double> &srcY,
const QVector<double> &srcZ,
const QVector<double> &srcM,
348 QVector<double> &outX, QVector<double> &outY, QVector<double> &outZ, QVector<double> &outM,
349 bool removeRedundantPoints )
const;
357 mutable bool mHasCachedSummedUpArea =
false;
358 mutable double mSummedUpArea = 0;
362 mutable bool mHasCachedValidity =
false;
363 mutable QString mValidityFailureReason;
365 friend class TestQgsGeometry;
The Qgis class provides global constants for use throughout the application.
VertexType
Types of vertex.
WkbType
The WKB type describes the number of dimensions a geometry has.
Abstract base class for all geometries.
virtual QgsPoint childPoint(int index) const
Returns point at index (for geometries without child geometries - i.e.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
virtual int vertexNumberFromVertexId(QgsVertexId id) const =0
Returns the vertex number corresponding to a vertex id.
virtual QgsAbstractGeometry * boundary() const =0
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
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.
Qgis::WkbType wkbType() const
Returns the WKB type of the geometry.
virtual bool operator!=(const QgsAbstractGeometry &other) const =0
virtual QgsCoordinateSequence coordinateSequence() const =0
Retrieves the sequence of geometries, rings and nodes.
virtual bool operator==(const QgsAbstractGeometry &other) const =0
virtual bool nextVertex(QgsVertexId &id, QgsPoint &vertex) const =0
Returns next vertex id and coordinates.
A 3-dimensional box composed of x, y, z coordinates.
Abstract base class for curved geometry type.
virtual bool equals(const QgsCurve &other) const =0
Checks whether this curve exactly equals another curve.
virtual bool pointAt(int node, QgsPoint &point, Qgis::VertexType &type) const =0
Returns the point and vertex id of a point within the curve.
static const QgsCurve * cast(const QgsAbstractGeometry *geom)
Cast the geom to a QgsCurve.
virtual int indexOf(const QgsPoint &point) const =0
Returns the index of the first vertex matching the given point, or -1 if a matching vertex is not fou...
virtual void sumUpArea(double &sum) const =0
Sums up the area of the curve by iterating over the vertices (shoelace formula).
QgsBox3D mBoundingBox
Cached bounding box.
QgsCurve * clone() const override=0
Clones the geometry by performing a deep copy.
virtual QgsPoint startPoint() const =0
Returns the starting point of the curve.
virtual std::tuple< std::unique_ptr< QgsCurve >, std::unique_ptr< QgsCurve > > splitCurveAtVertex(int index) const =0
Splits the curve at the specified vertex index, returning two curves which represent the portion of t...
virtual QgsCurve * reversed() const =0
Returns a reversed copy of the curve, where the direction of the curve has been flipped.
virtual QgsPoint endPoint() const =0
Returns the end point of the curve.
QgsCurve()=default
Constructor for QgsCurve.
Line string geometry type, with support for z-dimension and m-values.
Point geometry type, with support for z-dimension and m-values.
static Qgis::GeometryType geometryType(Qgis::WkbType type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
static bool isSingleType(Qgis::WkbType type)
Returns true if the WKB type is a single type.
QVector< QgsRingSequence > QgsCoordinateSequence
QVector< QgsPoint > QgsPointSequence
Utility class for identifying a unique vertex within a geometry.