QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgsabstractgeometry.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsabstractgeometry.h
3  -------------------------------------------------------------------
4 Date : 04 Sept 2014
5 Copyright : (C) 2014 by Marco Hugentobler
6 email : marco.hugentobler at sourcepole dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSABSTRACTGEOMETRYV2
17 #define QGSABSTRACTGEOMETRYV2
18 
19 #include <array>
20 #include <functional>
21 #include <type_traits>
22 #include <QString>
23 
24 #include "qgis_core.h"
25 #include "qgscoordinatetransform.h"
26 #include "qgswkbtypes.h"
27 #include "qgswkbptr.h"
28 
29 #ifndef SIP_RUN
30 #include "json_fwd.hpp"
31 using namespace nlohmann;
32 #endif
33 
34 class QgsMapToPixel;
35 class QgsCurve;
36 class QgsMultiCurve;
37 class QgsMultiPoint;
38 
39 struct QgsVertexId;
40 class QgsVertexIterator;
41 class QPainter;
42 class QDomDocument;
43 class QDomElement;
46 class QgsConstWkbPtr;
47 class QPainterPath;
49 class QgsFeedback;
50 
51 typedef QVector< QgsPoint > QgsPointSequence;
52 #ifndef SIP_RUN
53 typedef QVector< QgsPointSequence > QgsRingSequence;
54 typedef QVector< QgsRingSequence > QgsCoordinateSequence;
55 #else
56 typedef QVector< QVector< QgsPoint > > QgsRingSequence;
57 typedef QVector< QVector< QVector< QgsPoint > > > QgsCoordinateSequence;
58 #endif
59 
60 
76 class CORE_EXPORT QgsAbstractGeometry
77 {
78 
79 #ifdef SIP_RUN
81  if ( qgsgeometry_cast<QgsPoint *>( sipCpp ) != nullptr )
82  sipType = sipType_QgsPoint;
83  else if ( qgsgeometry_cast<QgsLineString *>( sipCpp ) != nullptr )
84  sipType = sipType_QgsLineString;
85  else if ( qgsgeometry_cast<QgsCircularString *>( sipCpp ) != nullptr )
86  sipType = sipType_QgsCircularString;
87  else if ( qgsgeometry_cast<QgsCompoundCurve *>( sipCpp ) != nullptr )
88  sipType = sipType_QgsCompoundCurve;
89  else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
90  sipType = sipType_QgsTriangle;
91  else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
92  sipType = sipType_QgsPolygon;
93  else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
94  sipType = sipType_QgsCurvePolygon;
95  else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
96  sipType = sipType_QgsMultiPoint;
97  else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
98  sipType = sipType_QgsMultiLineString;
99  else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
100  sipType = sipType_QgsMultiPolygon;
101  else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
102  sipType = sipType_QgsMultiSurface;
103  else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
104  sipType = sipType_QgsMultiCurve;
105  else if ( qgsgeometry_cast<QgsGeometryCollection *>( sipCpp ) != nullptr )
106  sipType = sipType_QgsGeometryCollection;
107  else
108  sipType = 0;
109  SIP_END
110 #endif
111 
112  Q_GADGET
113 
114  public:
115 
118  {
119 
124  MaximumAngle = 0,
125 
130  MaximumDifference
131  };
132  Q_ENUM( SegmentationToleranceType )
133 
134 
136  {
137 
141  XY = 0,
142 
146  YX
147  };
149 
150 
153  QgsAbstractGeometry() = default;
154  virtual ~QgsAbstractGeometry() = default;
156  QgsAbstractGeometry &operator=( const QgsAbstractGeometry &geom );
157 
158  virtual bool operator==( const QgsAbstractGeometry &other ) const = 0;
159  virtual bool operator!=( const QgsAbstractGeometry &other ) const = 0;
160 
164  virtual QgsAbstractGeometry *clone() const = 0 SIP_FACTORY;
165 
169  virtual void clear() = 0;
170 
174  virtual QgsRectangle boundingBox() const = 0;
175 
176  //mm-sql interface
177 
182  virtual int dimension() const = 0;
183 
189  virtual QString geometryType() const = 0;
190 
196  inline QgsWkbTypes::Type wkbType() const SIP_HOLDGIL { return mWkbType; }
197 
203  QString wktTypeStr() const;
204 
209  bool is3D() const SIP_HOLDGIL
210  {
211  return QgsWkbTypes::hasZ( mWkbType );
212  }
213 
218  bool isMeasure() const SIP_HOLDGIL
219  {
220  return QgsWkbTypes::hasM( mWkbType );
221  }
222 
230 
231  //import
232 
238  virtual bool fromWkb( QgsConstWkbPtr &wkb ) = 0;
239 
244  virtual bool fromWkt( const QString &wkt ) = 0;
245 
246  //export
247 
252  enum WkbFlag
253  {
254  FlagExportTrianglesAsPolygons = 1 << 0,
255  };
256  Q_DECLARE_FLAGS( WkbFlags, WkbFlag )
257 
258 
265  virtual int wkbSize( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
266 
278  virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
279 
288  virtual QString asWkt( int precision = 17 ) const = 0;
289 
301  virtual QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
302 
314  virtual QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
315 
325  QString asJson( int precision = 17 );
326 
337  virtual json asJsonObject( int precision = 17 ) SIP_SKIP const;
338 
343  virtual QString asKml( int precision = 17 ) const = 0;
344 
345 
346  //render pipeline
347 
358  virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException ) = 0;
359 
366  virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0,
367  double mTranslate = 0.0, double mScale = 1.0 ) = 0;
368 
373  virtual void draw( QPainter &p ) const = 0;
374 
383  virtual QPainterPath asQPainterPath() const = 0;
384 
395  virtual int vertexNumberFromVertexId( QgsVertexId id ) const = 0;
396 
404  virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex SIP_OUT ) const = 0;
405 
410  virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex SIP_OUT, QgsVertexId &nextVertex SIP_OUT ) const = 0;
411 
416  virtual QgsCoordinateSequence coordinateSequence() const = 0;
417 
421  virtual int nCoordinates() const;
422 
426  virtual QgsPoint vertexAt( QgsVertexId id ) const = 0;
427 
440  virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt SIP_OUT,
441  QgsVertexId &vertexAfter SIP_OUT,
442  int *leftOf SIP_OUT = nullptr, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const = 0;
443 
444  //low-level editing
445 
454  virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) = 0;
455 
464  virtual bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) = 0;
465 
473  virtual bool deleteVertex( QgsVertexId position ) = 0;
474 
487  virtual double length() const;
488 
501  virtual double perimeter() const;
502 
515  virtual double area() const;
516 
525  virtual double segmentLength( QgsVertexId startVertex ) const = 0;
526 
528  virtual QgsPoint centroid() const;
529 
533  virtual bool isEmpty() const;
534 
538  virtual bool hasCurvedSegments() const;
539 
546  virtual QgsAbstractGeometry *segmentize( double tolerance = M_PI / 180., SegmentationToleranceType toleranceType = MaximumAngle ) const SIP_FACTORY;
547 
554  virtual QgsAbstractGeometry *toCurveType() const = 0 SIP_FACTORY;
555 
578  virtual QgsAbstractGeometry *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const = 0 SIP_FACTORY;
579 
600  virtual bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) = 0;
601 
609  virtual double vertexAngle( QgsVertexId vertex ) const = 0;
610 
614  virtual int vertexCount( int part = 0, int ring = 0 ) const = 0;
615 
619  virtual int ringCount( int part = 0 ) const = 0;
620 
626  virtual int partCount() const = 0;
627 
636  virtual bool addZValue( double zValue = 0 ) = 0;
637 
646  virtual bool addMValue( double mValue = 0 ) = 0;
647 
655  virtual bool dropZValue() = 0;
656 
664  virtual bool dropMValue() = 0;
665 
672  virtual void swapXy() = 0;
673 
679  virtual bool convertTo( QgsWkbTypes::Type type );
680 
692  virtual bool isValid( QString &error SIP_OUT, int flags = 0 ) const = 0;
693 
707  virtual bool transform( QgsAbstractGeometryTransformer *transformer, QgsFeedback *feedback = nullptr ) = 0;
708 
709 #ifndef SIP_RUN
710 
720  virtual void filterVertices( const std::function< bool( const QgsPoint & ) > &filter );
721 
736  virtual void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform );
737 
743  class CORE_EXPORT part_iterator
744  {
745  private:
746 
747  int mIndex = 0;
748  QgsAbstractGeometry *mGeometry = nullptr;
749 
750  public:
752  part_iterator() = default;
753 
755  part_iterator( QgsAbstractGeometry *g, int index );
756 
761  part_iterator &operator++();
762 
764  part_iterator operator++( int );
765 
768 
770  int partNumber() const;
771 
772  bool operator==( part_iterator other ) const;
773  bool operator!=( part_iterator other ) const { return !( *this == other ); }
774  };
775 
785  {
786  return part_iterator( this, 0 );
787  }
788 
797  part_iterator parts_end();
798 
806  QgsGeometryConstPartIterator parts() const;
807 
813  class CORE_EXPORT const_part_iterator
814  {
815  private:
816 
817  int mIndex = 0;
818  const QgsAbstractGeometry *mGeometry = nullptr;
819 
820  public:
822  const_part_iterator() = default;
823 
825  const_part_iterator( const QgsAbstractGeometry *g, int index );
826 
831  const_part_iterator &operator++();
832 
834  const_part_iterator operator++( int );
835 
837  const QgsAbstractGeometry *operator*() const;
838 
840  int partNumber() const;
841 
842  bool operator==( const_part_iterator other ) const;
843  bool operator!=( const_part_iterator other ) const { return !( *this == other ); }
844  };
845 
854  {
855  return const_part_iterator( this, 0 );
856  }
857 
865  const_part_iterator const_parts_end() const;
866 
867 
873  class CORE_EXPORT vertex_iterator
874  {
875  private:
876 
882  struct Level
883  {
884  const QgsAbstractGeometry *g = nullptr;
885  int index = 0;
886 
887  bool operator==( const Level &other ) const;
888  };
889 
890  std::array<Level, 3> levels;
891  int depth = -1;
892 
893  void digDown();
894 
895  public:
897  vertex_iterator() = default;
898 
900  vertex_iterator( const QgsAbstractGeometry *g, int index );
901 
906  vertex_iterator &operator++();
907 
909  vertex_iterator operator++( int );
910 
912  QgsPoint operator*() const;
913 
915  QgsVertexId vertexId() const;
916 
917  bool operator==( const vertex_iterator &other ) const;
918  bool operator!=( const vertex_iterator &other ) const { return !( *this == other ); }
919  };
920 
930  {
931  return vertex_iterator( this, 0 );
932  }
933 
943  {
944  return vertex_iterator( this, childCount() );
945  }
946 #endif
947 
981  QgsGeometryPartIterator parts();
982 
983 
1007  QgsVertexIterator vertices() const;
1008 
1016 
1017  protected:
1018 
1024  virtual bool hasChildGeometries() const;
1025 
1031  virtual int childCount() const { return 0; }
1032 
1038  virtual QgsAbstractGeometry *childGeometry( int index ) const { Q_UNUSED( index ) return nullptr; }
1039 
1045  virtual QgsPoint childPoint( int index ) const;
1046 
1047  protected:
1049 
1053  void setZMTypeFromSubGeometry( const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType );
1054 
1059  virtual QgsRectangle calculateBoundingBox() const;
1060 
1064  virtual void clearCache() const;
1065 
1066  friend class TestQgsGeometry;
1067 };
1068 
1069 
1076 struct CORE_EXPORT QgsVertexId
1077 {
1078 
1083  {
1084  SegmentVertex = 1,
1086  };
1087 
1091  explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex ) SIP_HOLDGIL
1092 : part( _part )
1093  , ring( _ring )
1094  , vertex( _vertex )
1095  , type( _type )
1096  {}
1097 
1101  bool isValid() const SIP_HOLDGIL { return part >= 0 && ring >= 0 && vertex >= 0; }
1102 
1103  bool operator==( QgsVertexId other ) const SIP_HOLDGIL
1104  {
1105  return part == other.part && ring == other.ring && vertex == other.vertex;
1106  }
1107  bool operator!=( QgsVertexId other ) const SIP_HOLDGIL
1108  {
1109  return part != other.part || ring != other.ring || vertex != other.vertex;
1110  }
1111 
1116  {
1117  return part >= 0 && o.part == part;
1118  }
1119 
1125  {
1126  return partEqual( o ) && ( ring >= 0 && o.ring == ring );
1127  }
1128 
1134  {
1135  return ringEqual( o ) && ( vertex >= 0 && o.ring == ring );
1136  }
1137 
1141  bool isValid( const QgsAbstractGeometry *geom ) const SIP_HOLDGIL
1142  {
1143  return ( part >= 0 && part < geom->partCount() ) &&
1144  ( ring < geom->ringCount( part ) ) &&
1145  ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
1146  }
1147 
1149  int part = -1;
1150 
1152  int ring = -1;
1153 
1155  int vertex = -1;
1156 
1158  VertexType type = SegmentVertex;
1159 
1160 #ifdef SIP_RUN
1161  SIP_PYOBJECT __repr__();
1162  % MethodCode
1163  QString str = QStringLiteral( "<QgsVertexId: %1,%2,%3%4>" ).arg( sipCpp->part ).arg( sipCpp->ring ).arg( sipCpp->vertex ).arg( sipCpp->type == QgsVertexId::CurveVertex ? QStringLiteral( " CurveVertex" ) : QString() );
1164  sipRes = PyUnicode_FromString( str.toUtf8().data() );
1165  % End
1166 #endif
1167 
1168 };
1169 
1170 #ifndef SIP_RUN
1171 
1172 template <class T>
1173 inline T qgsgeometry_cast( const QgsAbstractGeometry *geom )
1174 {
1175  return const_cast<T>( std::remove_pointer<T>::type::cast( geom ) );
1176 }
1177 
1178 #endif
1179 
1180 // clazy:excludeall=qstring-allocations
1181 
1187 class CORE_EXPORT QgsVertexIterator
1188 {
1189  public:
1191  QgsVertexIterator() = default;
1192 
1195  : g( geometry )
1196  , i( g->vertices_begin() )
1197  , n( g->vertices_end() )
1198  {
1199  }
1200 
1202  bool hasNext() const
1203  {
1204  return g && g->vertices_end() != i;
1205  }
1206 
1208  QgsPoint next();
1209 
1210 #ifdef SIP_RUN
1211  QgsVertexIterator *__iter__();
1212  % MethodCode
1213  sipRes = sipCpp;
1214  % End
1215 
1216  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsPoint );
1217  % MethodCode
1218  if ( sipCpp->hasNext() )
1219  sipRes = sipConvertFromType( new QgsPoint( sipCpp->next() ), sipType_QgsPoint, Py_None );
1220  else
1221  PyErr_SetString( PyExc_StopIteration, "" );
1222  % End
1223 #endif
1224 
1225  private:
1226  const QgsAbstractGeometry *g = nullptr;
1228 
1229 };
1230 
1236 class CORE_EXPORT QgsGeometryPartIterator
1237 {
1238  public:
1241 
1244  : g( geometry )
1245  , i( g->parts_begin() )
1246  , n( g->parts_end() )
1247  {
1248  }
1249 
1251  bool hasNext() const SIP_HOLDGIL
1252  {
1253  return g && g->parts_end() != i;
1254  }
1255 
1257  QgsAbstractGeometry *next();
1258 
1259 #ifdef SIP_RUN
1260  QgsGeometryPartIterator *__iter__();
1261  % MethodCode
1262  sipRes = sipCpp;
1263  % End
1264 
1265  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1266  % MethodCode
1267  if ( sipCpp->hasNext() )
1268  sipRes = sipConvertFromType( sipCpp->next(), sipType_QgsAbstractGeometry, NULL );
1269  else
1270  PyErr_SetString( PyExc_StopIteration, "" );
1271  % End
1272 #endif
1273 
1274  private:
1275  QgsAbstractGeometry *g = nullptr;
1277 
1278 };
1279 
1280 
1287 {
1288  public:
1291 
1294  : g( geometry )
1295  , i( g->const_parts_begin() )
1296  , n( g->const_parts_end() )
1297  {
1298  }
1299 
1301  bool hasNext() const SIP_HOLDGIL
1302  {
1303  return g && g->const_parts_end() != i;
1304  }
1305 
1307  const QgsAbstractGeometry *next();
1308 
1309 #ifdef SIP_RUN
1310  QgsGeometryConstPartIterator *__iter__();
1311  % MethodCode
1312  sipRes = sipCpp;
1313  % End
1314 
1315  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1316  % MethodCode
1317  if ( sipCpp->hasNext() )
1318  sipRes = sipConvertFromType( const_cast< QgsAbstractGeometry * >( sipCpp->next() ), sipType_QgsAbstractGeometry, NULL );
1319  else
1320  PyErr_SetString( PyExc_StopIteration, "" );
1321  % End
1322 #endif
1323 
1324  private:
1325  const QgsAbstractGeometry *g = nullptr;
1327 
1328 };
1329 
1330 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAbstractGeometry::WkbFlags )
1331 
1332 #endif //QGSABSTRACTGEOMETRYV2
An abstract base class for classes which transform geometries by transforming input points to output ...
The part_iterator class provides STL-style iterator for const references to geometry parts.
bool operator!=(const_part_iterator other) const
const_part_iterator()=default
Create invalid iterator.
The part_iterator class provides STL-style iterator for geometry parts.
part_iterator()=default
Create invalid iterator.
bool operator!=(part_iterator other) const
The vertex_iterator class provides STL-style iterator for vertices.
vertex_iterator()=default
Create invalid iterator.
bool operator!=(const vertex_iterator &other) const
Abstract base class for all geometries.
virtual bool fromWkb(QgsConstWkbPtr &wkb)=0
Sets the geometry from a WKB string.
virtual QgsAbstractGeometry * boundary() const =0
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
vertex_iterator vertices_end() const
Returns STL-style iterator pointing to the imaginary vertex after the last vertex of the geometry.
bool is3D() const SIP_HOLDGIL
Returns true if the geometry is 3D and contains a z-value.
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
AxisOrder
Axis order for GML generation.
virtual QgsAbstractGeometry * createEmptyWithSameType() const =0
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
virtual bool fromWkt(const QString &wkt)=0
Sets the geometry from a WKT string.
vertex_iterator vertices_begin() const
Returns STL-style iterator pointing to the first vertex of the geometry.
virtual QgsAbstractGeometry * childGeometry(int index) const
Returns pointer to child geometry (for geometries with child geometries - i.e.
WkbFlag
WKB export flags.
const_part_iterator const_parts_begin() const
Returns STL-style iterator pointing to the const first part of the geometry.
part_iterator parts_begin()
Returns STL-style iterator pointing to the first part of the geometry.
bool isMeasure() const SIP_HOLDGIL
Returns true if the geometry contains m values.
A const WKB pointer.
Definition: qgswkbptr.h:130
Class for doing transforms between two map coordinate systems.
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
Java-style iterator for const traversal of parts of a geometry.
QgsGeometryConstPartIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
QgsGeometryConstPartIterator()=default
Constructor for QgsGeometryConstPartIterator.
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
Java-style iterator for traversal of parts of a geometry.
QgsGeometryPartIterator()=default
Constructor for QgsGeometryPartIterator.
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
QgsGeometryPartIterator(QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:39
Multi curve geometry collection.
Definition: qgsmulticurve.h:30
Multi point geometry collection.
Definition: qgsmultipoint.h:30
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Java-style iterator for traversal of vertices of a geometry.
bool hasNext() const
Find out whether there are more vertices.
QgsVertexIterator()=default
Constructor for QgsVertexIterator.
QgsVertexIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:42
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:1100
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1050
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 ...
Definition: MathUtils.cpp:292
#define SIP_THROW(name)
Definition: qgis_sip.h:189
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:218
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_HOLDGIL
Definition: qgis_sip.h:157
#define SIP_FACTORY
Definition: qgis_sip.h:76
#define SIP_END
Definition: qgis_sip.h:194
T qgsgeometry_cast(const QgsAbstractGeometry *geom)
QVector< QgsRingSequence > QgsCoordinateSequence
QVector< QgsPointSequence > QgsRingSequence
QVector< QgsPoint > QgsPointSequence
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QgsMargins operator*(const QgsMargins &margins, double factor)
Returns a QgsMargins object that is formed by multiplying each component of the given margins by fact...
Definition: qgsmargins.h:242
double closestSegment(const QgsPolylineXY &pl, const QgsPointXY &pt, int &vertexAfter, double epsilon)
Definition: qgstracer.cpp:68
int precision
Utility class for identifying a unique vertex within a geometry.
bool operator!=(QgsVertexId other) const SIP_HOLDGIL
bool ringEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same ring as another vertex ID (i.e.
bool partEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same part as another vertex ID.
bool isValid() const SIP_HOLDGIL
Returns true if the vertex id is valid.
bool vertexEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID corresponds to the same vertex as another vertex ID (i....
bool isValid(const QgsAbstractGeometry *geom) const SIP_HOLDGIL
Returns true if this vertex ID is valid for the specified geom.
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex) SIP_HOLDGIL
Constructor for QgsVertexId.
bool operator==(QgsVertexId other) const SIP_HOLDGIL
VertexType
Type of vertex.
@ CurveVertex
An intermediate point on a segment defining the curvature of the segment.