QGIS API Documentation  3.17.0-Master (df2c9ff931)
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;
48 
49 typedef QVector< QgsPoint > QgsPointSequence;
50 #ifndef SIP_RUN
51 typedef QVector< QgsPointSequence > QgsRingSequence;
52 typedef QVector< QgsRingSequence > QgsCoordinateSequence;
53 #else
54 typedef QVector< QVector< QgsPoint > > QgsRingSequence;
55 typedef QVector< QVector< QVector< QgsPoint > > > QgsCoordinateSequence;
56 #endif
57 
58 
74 class CORE_EXPORT QgsAbstractGeometry
75 {
76 
77 #ifdef SIP_RUN
79  if ( qgsgeometry_cast<QgsPoint *>( sipCpp ) != nullptr )
80  sipType = sipType_QgsPoint;
81  else if ( qgsgeometry_cast<QgsLineString *>( sipCpp ) != nullptr )
82  sipType = sipType_QgsLineString;
83  else if ( qgsgeometry_cast<QgsCircularString *>( sipCpp ) != nullptr )
84  sipType = sipType_QgsCircularString;
85  else if ( qgsgeometry_cast<QgsCompoundCurve *>( sipCpp ) != nullptr )
86  sipType = sipType_QgsCompoundCurve;
87  else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
88  sipType = sipType_QgsTriangle;
89  else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
90  sipType = sipType_QgsPolygon;
91  else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
92  sipType = sipType_QgsCurvePolygon;
93  else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
94  sipType = sipType_QgsMultiPoint;
95  else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
96  sipType = sipType_QgsMultiLineString;
97  else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
98  sipType = sipType_QgsMultiPolygon;
99  else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
100  sipType = sipType_QgsMultiSurface;
101  else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
102  sipType = sipType_QgsMultiCurve;
103  else if ( qgsgeometry_cast<QgsGeometryCollection *>( sipCpp ) != nullptr )
104  sipType = sipType_QgsGeometryCollection;
105  else
106  sipType = 0;
107  SIP_END
108 #endif
109 
110  Q_GADGET
111 
112  public:
113 
116  {
117 
122  MaximumAngle = 0,
123 
128  MaximumDifference
129  };
130  Q_ENUM( SegmentationToleranceType )
131 
132 
134  {
135 
139  XY = 0,
140 
144  YX
145  };
147 
148 
151  QgsAbstractGeometry() = default;
152  virtual ~QgsAbstractGeometry() = default;
154  QgsAbstractGeometry &operator=( const QgsAbstractGeometry &geom );
155 
156  virtual bool operator==( const QgsAbstractGeometry &other ) const = 0;
157  virtual bool operator!=( const QgsAbstractGeometry &other ) const = 0;
158 
162  virtual QgsAbstractGeometry *clone() const = 0 SIP_FACTORY;
163 
167  virtual void clear() = 0;
168 
172  virtual QgsRectangle boundingBox() const = 0;
173 
174  //mm-sql interface
175 
180  virtual int dimension() const = 0;
181 
187  virtual QString geometryType() const = 0;
188 
194  inline QgsWkbTypes::Type wkbType() const SIP_HOLDGIL { return mWkbType; }
195 
201  QString wktTypeStr() const;
202 
207  bool is3D() const SIP_HOLDGIL
208  {
209  return QgsWkbTypes::hasZ( mWkbType );
210  }
211 
216  bool isMeasure() const SIP_HOLDGIL
217  {
218  return QgsWkbTypes::hasM( mWkbType );
219  }
220 
227  virtual QgsAbstractGeometry *boundary() const = 0 SIP_FACTORY;
228 
229  //import
230 
236  virtual bool fromWkb( QgsConstWkbPtr &wkb ) = 0;
237 
242  virtual bool fromWkt( const QString &wkt ) = 0;
243 
244  //export
245 
250  enum WkbFlag
251  {
252  FlagExportTrianglesAsPolygons = 1 << 0,
253  };
254  Q_DECLARE_FLAGS( WkbFlags, WkbFlag )
255 
256 
263  virtual int wkbSize( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
264 
276  virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
277 
286  virtual QString asWkt( int precision = 17 ) const = 0;
287 
299  virtual QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
300 
312  virtual QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
313 
323  QString asJson( int precision = 17 );
324 
335  virtual json asJsonObject( int precision = 17 ) SIP_SKIP const;
336 
341  virtual QString asKml( int precision = 17 ) const = 0;
342 
343 
344  //render pipeline
345 
356  virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException ) = 0;
357 
364  virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0,
365  double mTranslate = 0.0, double mScale = 1.0 ) = 0;
366 
371  virtual void draw( QPainter &p ) const = 0;
372 
381  virtual QPainterPath asQPainterPath() const = 0;
382 
393  virtual int vertexNumberFromVertexId( QgsVertexId id ) const = 0;
394 
402  virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex SIP_OUT ) const = 0;
403 
408  virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex SIP_OUT, QgsVertexId &nextVertex SIP_OUT ) const = 0;
409 
414  virtual QgsCoordinateSequence coordinateSequence() const = 0;
415 
419  virtual int nCoordinates() const;
420 
424  virtual QgsPoint vertexAt( QgsVertexId id ) const = 0;
425 
438  virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt SIP_OUT,
439  QgsVertexId &vertexAfter SIP_OUT,
440  int *leftOf SIP_OUT = nullptr, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const = 0;
441 
442  //low-level editing
443 
452  virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) = 0;
453 
462  virtual bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) = 0;
463 
471  virtual bool deleteVertex( QgsVertexId position ) = 0;
472 
485  virtual double length() const;
486 
499  virtual double perimeter() const;
500 
513  virtual double area() const;
514 
523  virtual double segmentLength( QgsVertexId startVertex ) const = 0;
524 
526  virtual QgsPoint centroid() const;
527 
531  virtual bool isEmpty() const;
532 
536  virtual bool hasCurvedSegments() const;
537 
544  virtual QgsAbstractGeometry *segmentize( double tolerance = M_PI / 180., SegmentationToleranceType toleranceType = MaximumAngle ) const SIP_FACTORY;
545 
552  virtual QgsAbstractGeometry *toCurveType() const = 0 SIP_FACTORY;
553 
576  virtual QgsAbstractGeometry *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const = 0 SIP_FACTORY;
577 
598  virtual bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) = 0;
599 
607  virtual double vertexAngle( QgsVertexId vertex ) const = 0;
608 
612  virtual int vertexCount( int part = 0, int ring = 0 ) const = 0;
613 
617  virtual int ringCount( int part = 0 ) const = 0;
618 
624  virtual int partCount() const = 0;
625 
634  virtual bool addZValue( double zValue = 0 ) = 0;
635 
644  virtual bool addMValue( double mValue = 0 ) = 0;
645 
653  virtual bool dropZValue() = 0;
654 
662  virtual bool dropMValue() = 0;
663 
670  virtual void swapXy() = 0;
671 
677  virtual bool convertTo( QgsWkbTypes::Type type );
678 
690  virtual bool isValid( QString &error SIP_OUT, int flags = 0 ) const = 0;
691 
692 #ifndef SIP_RUN
693 
703  virtual void filterVertices( const std::function< bool( const QgsPoint & ) > &filter );
704 
719  virtual void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform );
720 
726  class CORE_EXPORT part_iterator
727  {
728  private:
729 
730  int mIndex = 0;
731  QgsAbstractGeometry *mGeometry = nullptr;
732 
733  public:
735  part_iterator() = default;
736 
738  part_iterator( QgsAbstractGeometry *g, int index );
739 
744  part_iterator &operator++();
745 
747  part_iterator operator++( int );
748 
751 
753  int partNumber() const;
754 
755  bool operator==( part_iterator other ) const;
756  bool operator!=( part_iterator other ) const { return !( *this == other ); }
757  };
758 
768  {
769  return part_iterator( this, 0 );
770  }
771 
780  part_iterator parts_end();
781 
789  QgsGeometryConstPartIterator parts() const;
790 
796  class CORE_EXPORT const_part_iterator
797  {
798  private:
799 
800  int mIndex = 0;
801  const QgsAbstractGeometry *mGeometry = nullptr;
802 
803  public:
805  const_part_iterator() = default;
806 
808  const_part_iterator( const QgsAbstractGeometry *g, int index );
809 
814  const_part_iterator &operator++();
815 
817  const_part_iterator operator++( int );
818 
820  const QgsAbstractGeometry *operator*() const;
821 
823  int partNumber() const;
824 
825  bool operator==( const_part_iterator other ) const;
826  bool operator!=( const_part_iterator other ) const { return !( *this == other ); }
827  };
828 
837  {
838  return const_part_iterator( this, 0 );
839  }
840 
848  const_part_iterator const_parts_end() const;
849 
850 
856  class CORE_EXPORT vertex_iterator
857  {
858  private:
859 
865  struct Level
866  {
867  const QgsAbstractGeometry *g = nullptr;
868  int index = 0;
869 
870  bool operator==( const Level &other ) const;
871  };
872 
873  std::array<Level, 3> levels;
874  int depth = -1;
875 
876  void digDown();
877 
878  public:
880  vertex_iterator() = default;
881 
883  vertex_iterator( const QgsAbstractGeometry *g, int index );
884 
889  vertex_iterator &operator++();
890 
892  vertex_iterator operator++( int );
893 
895  QgsPoint operator*() const;
896 
898  QgsVertexId vertexId() const;
899 
900  bool operator==( const vertex_iterator &other ) const;
901  bool operator!=( const vertex_iterator &other ) const { return !( *this == other ); }
902  };
903 
913  {
914  return vertex_iterator( this, 0 );
915  }
916 
926  {
927  return vertex_iterator( this, childCount() );
928  }
929 #endif
930 
964  QgsGeometryPartIterator parts();
965 
966 
990  QgsVertexIterator vertices() const;
991 
998  virtual QgsAbstractGeometry *createEmptyWithSameType() const = 0 SIP_FACTORY;
999 
1000  protected:
1001 
1007  virtual bool hasChildGeometries() const;
1008 
1014  virtual int childCount() const { return 0; }
1015 
1021  virtual QgsAbstractGeometry *childGeometry( int index ) const { Q_UNUSED( index ) return nullptr; }
1022 
1028  virtual QgsPoint childPoint( int index ) const;
1029 
1030  protected:
1032 
1036  void setZMTypeFromSubGeometry( const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType );
1037 
1042  virtual QgsRectangle calculateBoundingBox() const;
1043 
1047  virtual void clearCache() const;
1048 
1049  friend class TestQgsGeometry;
1050 };
1051 
1052 
1059 struct CORE_EXPORT QgsVertexId
1060 {
1061 
1066  {
1067  SegmentVertex = 1,
1069  };
1070 
1074  explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex ) SIP_HOLDGIL
1075 : part( _part )
1076  , ring( _ring )
1077  , vertex( _vertex )
1078  , type( _type )
1079  {}
1080 
1084  bool isValid() const SIP_HOLDGIL { return part >= 0 && ring >= 0 && vertex >= 0; }
1085 
1086  bool operator==( QgsVertexId other ) const SIP_HOLDGIL
1087  {
1088  return part == other.part && ring == other.ring && vertex == other.vertex;
1089  }
1090  bool operator!=( QgsVertexId other ) const SIP_HOLDGIL
1091  {
1092  return part != other.part || ring != other.ring || vertex != other.vertex;
1093  }
1094 
1099  {
1100  return part >= 0 && o.part == part;
1101  }
1102 
1108  {
1109  return partEqual( o ) && ( ring >= 0 && o.ring == ring );
1110  }
1111 
1117  {
1118  return ringEqual( o ) && ( vertex >= 0 && o.ring == ring );
1119  }
1120 
1124  bool isValid( const QgsAbstractGeometry *geom ) const SIP_HOLDGIL
1125  {
1126  return ( part >= 0 && part < geom->partCount() ) &&
1127  ( ring < geom->ringCount( part ) ) &&
1128  ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
1129  }
1130 
1132  int part = -1;
1133 
1135  int ring = -1;
1136 
1138  int vertex = -1;
1139 
1141  VertexType type = SegmentVertex;
1142 
1143 #ifdef SIP_RUN
1144  SIP_PYOBJECT __repr__();
1145  % MethodCode
1146  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() );
1147  sipRes = PyUnicode_FromString( str.toUtf8().data() );
1148  % End
1149 #endif
1150 
1151 };
1152 
1153 #ifndef SIP_RUN
1154 
1155 template <class T>
1156 inline T qgsgeometry_cast( const QgsAbstractGeometry *geom )
1157 {
1158  return const_cast<T>( std::remove_pointer<T>::type::cast( geom ) );
1159 }
1160 
1161 #endif
1162 
1163 // clazy:excludeall=qstring-allocations
1164 
1170 class CORE_EXPORT QgsVertexIterator
1171 {
1172  public:
1174  QgsVertexIterator() = default;
1175 
1178  : g( geometry )
1179  , i( g->vertices_begin() )
1180  , n( g->vertices_end() )
1181  {
1182  }
1183 
1185  bool hasNext() const
1186  {
1187  return g && g->vertices_end() != i;
1188  }
1189 
1191  QgsPoint next();
1192 
1193 #ifdef SIP_RUN
1194  QgsVertexIterator *__iter__();
1195  % MethodCode
1196  sipRes = sipCpp;
1197  % End
1198 
1199  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsPoint );
1200  % MethodCode
1201  if ( sipCpp->hasNext() )
1202  sipRes = sipConvertFromType( new QgsPoint( sipCpp->next() ), sipType_QgsPoint, Py_None );
1203  else
1204  PyErr_SetString( PyExc_StopIteration, "" );
1205  % End
1206 #endif
1207 
1208  private:
1209  const QgsAbstractGeometry *g = nullptr;
1211 
1212 };
1213 
1219 class CORE_EXPORT QgsGeometryPartIterator
1220 {
1221  public:
1223  QgsGeometryPartIterator() = default;
1224 
1227  : g( geometry )
1228  , i( g->parts_begin() )
1229  , n( g->parts_end() )
1230  {
1231  }
1232 
1234  bool hasNext() const SIP_HOLDGIL
1235  {
1236  return g && g->parts_end() != i;
1237  }
1238 
1240  QgsAbstractGeometry *next();
1241 
1242 #ifdef SIP_RUN
1243  QgsGeometryPartIterator *__iter__();
1244  % MethodCode
1245  sipRes = sipCpp;
1246  % End
1247 
1248  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1249  % MethodCode
1250  if ( sipCpp->hasNext() )
1251  sipRes = sipConvertFromType( sipCpp->next(), sipType_QgsAbstractGeometry, NULL );
1252  else
1253  PyErr_SetString( PyExc_StopIteration, "" );
1254  % End
1255 #endif
1256 
1257  private:
1258  QgsAbstractGeometry *g = nullptr;
1260 
1261 };
1262 
1263 
1270 {
1271  public:
1273  QgsGeometryConstPartIterator() = default;
1274 
1277  : g( geometry )
1278  , i( g->const_parts_begin() )
1279  , n( g->const_parts_end() )
1280  {
1281  }
1282 
1284  bool hasNext() const SIP_HOLDGIL
1285  {
1286  return g && g->const_parts_end() != i;
1287  }
1288 
1290  const QgsAbstractGeometry *next();
1291 
1292 #ifdef SIP_RUN
1293  QgsGeometryConstPartIterator *__iter__();
1294  % MethodCode
1295  sipRes = sipCpp;
1296  % End
1297 
1298  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1299  % MethodCode
1300  if ( sipCpp->hasNext() )
1301  sipRes = sipConvertFromType( const_cast< QgsAbstractGeometry * >( sipCpp->next() ), sipType_QgsAbstractGeometry, NULL );
1302  else
1303  PyErr_SetString( PyExc_StopIteration, "" );
1304  % End
1305 #endif
1306 
1307  private:
1308  const QgsAbstractGeometry *g = nullptr;
1310 
1311 };
1312 
1313 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAbstractGeometry::WkbFlags )
1314 
1315 #endif //QGSABSTRACTGEOMETRYV2
int precision
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Java-style iterator for traversal of parts of a geometry.
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
bool operator!=(const_part_iterator other) const
Java-style iterator for traversal of vertices of a geometry.
Multi point geometry collection.
Definition: qgsmultipoint.h:29
bool operator==(QgsVertexId other) const SIP_HOLDGIL
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QVector< QgsRingSequence > QgsCoordinateSequence
Java-style iterator for const traversal of parts of a geometry.
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:41
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
WkbFlag
WKB export flags.
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.
virtual QgsAbstractGeometry * childGeometry(int index) const
Returns pointer to child geometry (for geometries with child geometries - i.e.
The part_iterator class provides STL-style iterator for const references to geometry parts...
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
bool operator!=(const vertex_iterator &other) const
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:218
QgsVertexIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:37
bool ringEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same ring as another vertex ID (i.e.
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:69
QgsGeometryPartIterator(QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Utility class for identifying a unique vertex within a geometry.
VertexType
Type of vertex.
#define SIP_HOLDGIL
Definition: qgis_sip.h:157
#define SIP_SKIP
Definition: qgis_sip.h:126
The part_iterator class provides STL-style iterator for geometry parts.
bool vertexEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID corresponds to the same vertex as another vertex ID (i...
vertex_iterator vertices_end() const
Returns STL-style iterator pointing to the imaginary vertex after the last vertex of the geometry...
T qgsgeometry_cast(const QgsAbstractGeometry *geom)
#define SIP_END
Definition: qgis_sip.h:194
Multi curve geometry collection.
Definition: qgsmulticurve.h:29
An intermediate point on a segment defining the curvature of the segment.
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
#define SIP_FACTORY
Definition: qgis_sip.h:76
Abstract base class for all geometries.
The vertex_iterator class provides STL-style iterator for vertices.
bool partEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same part as another vertex ID.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
AxisOrder
Axis order for GML generation.
QgsGeometryConstPartIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
bool operator!=(QgsVertexId other) const SIP_HOLDGIL
double closestSegment(const QgsPolylineXY &pl, const QgsPointXY &pt, int &vertexAfter, double epsilon)
Definition: qgstracer.cpp:68
QVector< QgsPoint > QgsPointSequence
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1050
QVector< QgsPointSequence > QgsRingSequence
const_part_iterator const_parts_begin() const
Returns STL-style iterator pointing to the const first part of the geometry.
bool isMeasure() const SIP_HOLDGIL
Returns true if the geometry contains m values.
bool is3D() const SIP_HOLDGIL
Returns true if the geometry is 3D and contains a z-value.
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
Class for doing transforms between two map coordinate systems.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex) SIP_HOLDGIL
Constructor for QgsVertexId.
#define SIP_THROW(name)
Definition: qgis_sip.h:189
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
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:65
vertex_iterator vertices_begin() const
Returns STL-style iterator pointing to the first vertex of the geometry.
bool hasNext() const
Find out whether there are more vertices.
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
bool operator!=(part_iterator other) const
part_iterator parts_begin()
Returns STL-style iterator pointing to the first part of the geometry.
double ANALYSIS_EXPORT leftOf(const QgsPoint &thepoint, const QgsPoint *p1, const QgsPoint *p2)
Returns whether &#39;thepoint&#39; is left or right of the line from &#39;p1&#39; to &#39;p2&#39;. Negative values mean left ...
Definition: MathUtils.cpp:292
bool isValid(const QgsAbstractGeometry *geom) const SIP_HOLDGIL
Returns true if this vertex ID is valid for the specified geom.
bool isValid() const SIP_HOLDGIL
Returns true if the vertex id is valid.