QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 <functional>
20 #include <QString>
21 
22 #include "qgis_core.h"
23 #include "qgscoordinatetransform.h"
24 #include "qgswkbtypes.h"
25 #include "qgswkbptr.h"
26 
27 #ifndef SIP_RUN
28 #include "json_fwd.hpp"
29 using namespace nlohmann;
30 #endif
31 
32 class QgsMapToPixel;
33 class QgsCurve;
34 class QgsMultiCurve;
35 class QgsMultiPoint;
36 
37 struct QgsVertexId;
38 class QgsVertexIterator;
39 class QPainter;
40 class QDomDocument;
41 class QDomElement;
45 
46 typedef QVector< QgsPoint > QgsPointSequence;
47 #ifndef SIP_RUN
48 typedef QVector< QgsPointSequence > QgsRingSequence;
49 typedef QVector< QgsRingSequence > QgsCoordinateSequence;
50 #else
51 typedef QVector< QVector< QgsPoint > > QgsRingSequence;
52 typedef QVector< QVector< QVector< QgsPoint > > > QgsCoordinateSequence;
53 #endif
54 
55 
71 class CORE_EXPORT QgsAbstractGeometry
72 {
73 
74 #ifdef SIP_RUN
76  if ( qgsgeometry_cast<QgsPoint *>( sipCpp ) != nullptr )
77  sipType = sipType_QgsPoint;
78  else if ( qgsgeometry_cast<QgsLineString *>( sipCpp ) != nullptr )
79  sipType = sipType_QgsLineString;
80  else if ( qgsgeometry_cast<QgsCircularString *>( sipCpp ) != nullptr )
81  sipType = sipType_QgsCircularString;
82  else if ( qgsgeometry_cast<QgsCompoundCurve *>( sipCpp ) != nullptr )
83  sipType = sipType_QgsCompoundCurve;
84  else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
85  sipType = sipType_QgsTriangle;
86  else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
87  sipType = sipType_QgsPolygon;
88  else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
89  sipType = sipType_QgsCurvePolygon;
90  else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
91  sipType = sipType_QgsMultiPoint;
92  else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
93  sipType = sipType_QgsMultiLineString;
94  else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
95  sipType = sipType_QgsMultiPolygon;
96  else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
97  sipType = sipType_QgsMultiSurface;
98  else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
99  sipType = sipType_QgsMultiCurve;
100  else if ( qgsgeometry_cast<QgsGeometryCollection *>( sipCpp ) != nullptr )
101  sipType = sipType_QgsGeometryCollection;
102  else
103  sipType = 0;
104  SIP_END
105 #endif
106 
107  Q_GADGET
108 
109  public:
110 
113  {
114 
118  MaximumAngle = 0,
119 
123  MaximumDifference
124  };
125  Q_ENUM( SegmentationToleranceType )
126 
127 
129  {
130 
134  XY = 0,
135 
139  YX
140  };
142 
143 
146  QgsAbstractGeometry() = default;
147  virtual ~QgsAbstractGeometry() = default;
149  QgsAbstractGeometry &operator=( const QgsAbstractGeometry &geom );
150 
151  virtual bool operator==( const QgsAbstractGeometry &other ) const = 0;
152  virtual bool operator!=( const QgsAbstractGeometry &other ) const = 0;
153 
157  virtual QgsAbstractGeometry *clone() const = 0 SIP_FACTORY;
158 
162  virtual void clear() = 0;
163 
167  virtual QgsRectangle boundingBox() const = 0;
168 
169  //mm-sql interface
170 
175  virtual int dimension() const = 0;
176 
182  virtual QString geometryType() const = 0;
183 
189  inline QgsWkbTypes::Type wkbType() const { return mWkbType; }
190 
196  QString wktTypeStr() const;
197 
202  bool is3D() const
203  {
204  return QgsWkbTypes::hasZ( mWkbType );
205  }
206 
211  bool isMeasure() const
212  {
213  return QgsWkbTypes::hasM( mWkbType );
214  }
215 
222  virtual QgsAbstractGeometry *boundary() const = 0 SIP_FACTORY;
223 
224  //import
225 
231  virtual bool fromWkb( QgsConstWkbPtr &wkb ) = 0;
232 
237  virtual bool fromWkt( const QString &wkt ) = 0;
238 
239  //export
240 
245  enum WkbFlag
246  {
247  FlagExportTrianglesAsPolygons = 1 << 0,
248  };
249  Q_DECLARE_FLAGS( WkbFlags, WkbFlag )
250 
251 
262  virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
263 
272  virtual QString asWkt( int precision = 17 ) const = 0;
273 
285  virtual QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
286 
298  virtual QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
299 
309  QString asJson( int precision = 17 );
310 
321  virtual json asJsonObject( int precision = 17 ) SIP_SKIP const;
322 
327  virtual QString asKml( int precision = 17 ) const = 0;
328 
329 
330  //render pipeline
331 
342  virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException ) = 0;
343 
350  virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0,
351  double mTranslate = 0.0, double mScale = 1.0 ) = 0;
352 
357  virtual void draw( QPainter &p ) const = 0;
358 
369  virtual int vertexNumberFromVertexId( QgsVertexId id ) const = 0;
370 
378  virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex SIP_OUT ) const = 0;
379 
384  virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex SIP_OUT, QgsVertexId &nextVertex SIP_OUT ) const = 0;
385 
390  virtual QgsCoordinateSequence coordinateSequence() const = 0;
391 
395  virtual int nCoordinates() const;
396 
400  virtual QgsPoint vertexAt( QgsVertexId id ) const = 0;
401 
414  virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt SIP_OUT,
415  QgsVertexId &vertexAfter SIP_OUT,
416  int *leftOf SIP_OUT = nullptr, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const = 0;
417 
418  //low-level editing
419 
428  virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) = 0;
429 
438  virtual bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) = 0;
439 
447  virtual bool deleteVertex( QgsVertexId position ) = 0;
448 
461  virtual double length() const;
462 
475  virtual double perimeter() const;
476 
489  virtual double area() const;
490 
499  virtual double segmentLength( QgsVertexId startVertex ) const = 0;
500 
502  virtual QgsPoint centroid() const;
503 
507  virtual bool isEmpty() const;
508 
512  virtual bool hasCurvedSegments() const;
513 
520  virtual QgsAbstractGeometry *segmentize( double tolerance = M_PI / 180., SegmentationToleranceType toleranceType = MaximumAngle ) const SIP_FACTORY;
521 
528  virtual QgsAbstractGeometry *toCurveType() const = 0 SIP_FACTORY;
529 
552  virtual QgsAbstractGeometry *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const = 0 SIP_FACTORY;
553 
574  virtual bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) = 0;
575 
583  virtual double vertexAngle( QgsVertexId vertex ) const = 0;
584 
588  virtual int vertexCount( int part = 0, int ring = 0 ) const = 0;
589 
593  virtual int ringCount( int part = 0 ) const = 0;
594 
600  virtual int partCount() const = 0;
601 
610  virtual bool addZValue( double zValue = 0 ) = 0;
611 
620  virtual bool addMValue( double mValue = 0 ) = 0;
621 
629  virtual bool dropZValue() = 0;
630 
638  virtual bool dropMValue() = 0;
639 
646  virtual void swapXy() = 0;
647 
653  virtual bool convertTo( QgsWkbTypes::Type type );
654 
666  virtual bool isValid( QString &error SIP_OUT, int flags = 0 ) const = 0;
667 
668 #ifndef SIP_RUN
669 
679  virtual void filterVertices( const std::function< bool( const QgsPoint & ) > &filter );
680 
695  virtual void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform );
696 
702  class CORE_EXPORT part_iterator
703  {
704  private:
705 
706  int mIndex = 0;
707  QgsAbstractGeometry *mGeometry = nullptr;
708 
709  public:
711  part_iterator() = default;
712 
714  part_iterator( QgsAbstractGeometry *g, int index );
715 
720  part_iterator &operator++();
721 
723  part_iterator operator++( int );
724 
727 
729  int partNumber() const;
730 
731  bool operator==( part_iterator other ) const;
732  bool operator!=( part_iterator other ) const { return !( *this == other ); }
733  };
734 
744  {
745  return part_iterator( this, 0 );
746  }
747 
756  part_iterator parts_end();
757 
765  QgsGeometryConstPartIterator parts() const;
766 
772  class CORE_EXPORT const_part_iterator
773  {
774  private:
775 
776  int mIndex = 0;
777  const QgsAbstractGeometry *mGeometry = nullptr;
778 
779  public:
781  const_part_iterator() = default;
782 
784  const_part_iterator( const QgsAbstractGeometry *g, int index );
785 
790  const_part_iterator &operator++();
791 
793  const_part_iterator operator++( int );
794 
796  const QgsAbstractGeometry *operator*() const;
797 
799  int partNumber() const;
800 
801  bool operator==( const_part_iterator other ) const;
802  bool operator!=( const_part_iterator other ) const { return !( *this == other ); }
803  };
804 
813  {
814  return const_part_iterator( this, 0 );
815  }
816 
824  const_part_iterator const_parts_end() const;
825 
826 
832  class CORE_EXPORT vertex_iterator
833  {
834  private:
835 
841  struct Level
842  {
843  const QgsAbstractGeometry *g = nullptr;
844  int index = 0;
845  };
846 
847  Level levels[3];
848  int depth = -1;
849 
850  void digDown();
851 
852  public:
854  vertex_iterator() = default;
855 
857  vertex_iterator( const QgsAbstractGeometry *g, int index );
858 
863  vertex_iterator &operator++();
864 
866  vertex_iterator operator++( int );
867 
869  QgsPoint operator*() const;
870 
872  QgsVertexId vertexId() const;
873 
874  bool operator==( const vertex_iterator &other ) const;
875  bool operator!=( const vertex_iterator &other ) const { return !( *this == other ); }
876  };
877 
887  {
888  return vertex_iterator( this, 0 );
889  }
890 
900  {
901  return vertex_iterator( this, childCount() );
902  }
903 #endif
904 
938  QgsGeometryPartIterator parts();
939 
940 
964  QgsVertexIterator vertices() const;
965 
972  virtual QgsAbstractGeometry *createEmptyWithSameType() const = 0 SIP_FACTORY;
973 
974  protected:
975 
981  virtual bool hasChildGeometries() const;
982 
988  virtual int childCount() const { return 0; }
989 
995  virtual QgsAbstractGeometry *childGeometry( int index ) const { Q_UNUSED( index ) return nullptr; }
996 
1002  virtual QgsPoint childPoint( int index ) const;
1003 
1004  protected:
1006 
1010  void setZMTypeFromSubGeometry( const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType );
1011 
1016  virtual QgsRectangle calculateBoundingBox() const;
1017 
1021  virtual void clearCache() const;
1022 
1023  friend class TestQgsGeometry;
1024 };
1025 
1026 
1033 struct CORE_EXPORT QgsVertexId
1034 {
1036  {
1037  SegmentVertex = 1, //start / endpoint of a segment
1038  CurveVertex
1039  };
1040 
1041  explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex )
1042  : part( _part )
1043  , ring( _ring )
1044  , vertex( _vertex )
1045  , type( _type )
1046  {}
1047 
1051  bool isValid() const { return part >= 0 && ring >= 0 && vertex >= 0; }
1052 
1053  bool operator==( QgsVertexId other ) const
1054  {
1055  return part == other.part && ring == other.ring && vertex == other.vertex;
1056  }
1057  bool operator!=( QgsVertexId other ) const
1058  {
1059  return part != other.part || ring != other.ring || vertex != other.vertex;
1060  }
1061  bool partEqual( QgsVertexId o ) const
1062  {
1063  return part >= 0 && o.part == part;
1064  }
1065  bool ringEqual( QgsVertexId o ) const
1066  {
1067  return partEqual( o ) && ( ring >= 0 && o.ring == ring );
1068  }
1069  bool vertexEqual( QgsVertexId o ) const
1070  {
1071  return ringEqual( o ) && ( vertex >= 0 && o.ring == ring );
1072  }
1073  bool isValid( const QgsAbstractGeometry *geom ) const
1074  {
1075  return ( part >= 0 && part < geom->partCount() ) &&
1076  ( ring < geom->ringCount( part ) ) &&
1077  ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
1078  }
1079 
1080  int part;
1081  int ring;
1082  int vertex;
1084 
1085 #ifdef SIP_RUN
1086  SIP_PYOBJECT __repr__();
1087  % MethodCode
1088  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() );
1089  sipRes = PyUnicode_FromString( str.toUtf8().data() );
1090  % End
1091 #endif
1092 
1093 };
1094 
1095 #ifndef SIP_RUN
1096 
1097 template <class T>
1098 inline T qgsgeometry_cast( const QgsAbstractGeometry *geom )
1099 {
1100  return const_cast<T>( reinterpret_cast<T>( 0 )->cast( geom ) );
1101 }
1102 
1103 #endif
1104 
1105 // clazy:excludeall=qstring-allocations
1106 
1112 class CORE_EXPORT QgsVertexIterator
1113 {
1114  public:
1116  QgsVertexIterator() = default;
1117 
1120  : g( geometry )
1121  , i( g->vertices_begin() )
1122  , n( g->vertices_end() )
1123  {
1124  }
1125 
1127  bool hasNext() const
1128  {
1129  return g && g->vertices_end() != i;
1130  }
1131 
1133  QgsPoint next();
1134 
1135 #ifdef SIP_RUN
1136  QgsVertexIterator *__iter__();
1137  % MethodCode
1138  sipRes = sipCpp;
1139  % End
1140 
1141  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsPoint );
1142  % MethodCode
1143  if ( sipCpp->hasNext() )
1144  sipRes = sipConvertFromType( new QgsPoint( sipCpp->next() ), sipType_QgsPoint, Py_None );
1145  else
1146  PyErr_SetString( PyExc_StopIteration, "" );
1147  % End
1148 #endif
1149 
1150  private:
1151  const QgsAbstractGeometry *g = nullptr;
1153 
1154 };
1155 
1161 class CORE_EXPORT QgsGeometryPartIterator
1162 {
1163  public:
1165  QgsGeometryPartIterator() = default;
1166 
1169  : g( geometry )
1170  , i( g->parts_begin() )
1171  , n( g->parts_end() )
1172  {
1173  }
1174 
1176  bool hasNext() const
1177  {
1178  return g && g->parts_end() != i;
1179  }
1180 
1182  QgsAbstractGeometry *next();
1183 
1184 #ifdef SIP_RUN
1185  QgsGeometryPartIterator *__iter__();
1186  % MethodCode
1187  sipRes = sipCpp;
1188  % End
1189 
1190  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1191  % MethodCode
1192  if ( sipCpp->hasNext() )
1193  sipRes = sipConvertFromType( sipCpp->next(), sipType_QgsAbstractGeometry, NULL );
1194  else
1195  PyErr_SetString( PyExc_StopIteration, "" );
1196  % End
1197 #endif
1198 
1199  private:
1200  QgsAbstractGeometry *g = nullptr;
1202 
1203 };
1204 
1205 
1212 {
1213  public:
1215  QgsGeometryConstPartIterator() = default;
1216 
1219  : g( geometry )
1220  , i( g->const_parts_begin() )
1221  , n( g->const_parts_end() )
1222  {
1223  }
1224 
1226  bool hasNext() const
1227  {
1228  return g && g->const_parts_end() != i;
1229  }
1230 
1232  const QgsAbstractGeometry *next();
1233 
1234 #ifdef SIP_RUN
1235  QgsGeometryConstPartIterator *__iter__();
1236  % MethodCode
1237  sipRes = sipCpp;
1238  % End
1239 
1240  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1241  % MethodCode
1242  if ( sipCpp->hasNext() )
1243  sipRes = sipConvertFromType( const_cast< QgsAbstractGeometry * >( sipCpp->next() ), sipType_QgsAbstractGeometry, NULL );
1244  else
1245  PyErr_SetString( PyExc_StopIteration, "" );
1246  % End
1247 #endif
1248 
1249  private:
1250  const QgsAbstractGeometry *g = nullptr;
1252 
1253 };
1254 
1255 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAbstractGeometry::WkbFlags )
1256 
1257 #endif //QGSABSTRACTGEOMETRYV2
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
QgsAbstractGeometry::vertices_end
vertex_iterator vertices_end() const
Returns STL-style iterator pointing to the imaginary vertex after the last vertex of the geometry.
Definition: qgsabstractgeometry.h:899
QgsVertexId::part
int part
Definition: qgsabstractgeometry.h:1080
QgsGeometryPartIterator::hasNext
bool hasNext() const
Find out whether there are more parts.
Definition: qgsabstractgeometry.h:1176
QgsCoordinateSequence
QVector< QgsRingSequence > QgsCoordinateSequence
Definition: qgsabstractgeometry.h:49
QgsVertexId::operator!=
bool operator!=(QgsVertexId other) const
Definition: qgsabstractgeometry.h:1057
QgsVertexId::isValid
bool isValid(const QgsAbstractGeometry *geom) const
Definition: qgsabstractgeometry.h:1073
QgsVertexId::vertex
int vertex
Definition: qgsabstractgeometry.h:1082
QgsVertexId::isValid
bool isValid() const
Returns true if the vertex id is valid.
Definition: qgsabstractgeometry.h:1051
QgsAbstractGeometry::wkbType
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
Definition: qgsabstractgeometry.h:189
QgsAbstractGeometry::part_iterator::operator!=
bool operator!=(part_iterator other) const
Definition: qgsabstractgeometry.h:732
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:399
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
qgswkbptr.h
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
QgsGeometryConstPartIterator
Java-style iterator for const traversal of parts of a geometry.
Definition: qgsabstractgeometry.h:1211
QgsWkbTypes::Type
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
QgsAbstractGeometry::vertex_iterator::operator!=
bool operator!=(const vertex_iterator &other) const
Definition: qgsabstractgeometry.h:875
QgsWkbTypes::hasZ
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1042
QgsAbstractGeometry::SegmentationToleranceType
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
Definition: qgsabstractgeometry.h:112
QgsAbstractGeometry::childGeometry
virtual QgsAbstractGeometry * childGeometry(int index) const
Returns pointer to child geometry (for geometries with child geometries - i.e.
Definition: qgsabstractgeometry.h:995
QgsAbstractGeometry::const_part_iterator::operator!=
bool operator!=(const_part_iterator other) const
Definition: qgsabstractgeometry.h:802
closestSegment
double closestSegment(const QgsPolylineXY &pl, const QgsPointXY &pt, int &vertexAfter, double epsilon)
Definition: qgstracer.cpp:68
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:404
QgsRectangle
Definition: qgsrectangle.h:41
SIP_TYPEHINT
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:213
QgsVertexIterator::QgsVertexIterator
QgsVertexIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1119
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsVertexId::partEqual
bool partEqual(QgsVertexId o) const
Definition: qgsabstractgeometry.h:1061
QgsVertexId::operator==
bool operator==(QgsVertexId other) const
Definition: qgsabstractgeometry.h:1053
QgsAbstractGeometry::part_iterator
Definition: qgsabstractgeometry.h:702
MathUtils::leftOf
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
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsGeometryPartIterator::QgsGeometryPartIterator
QgsGeometryPartIterator(QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1168
precision
int precision
Definition: qgswfsgetfeature.cpp:103
QgsCsException
Definition: qgsexception.h:65
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
SIP_THROW
#define SIP_THROW(name)
Definition: qgis_sip.h:184
QgsVertexId::ringEqual
bool ringEqual(QgsVertexId o) const
Definition: qgsabstractgeometry.h:1065
QgsWkbTypes::Unknown
@ Unknown
Definition: qgswkbtypes.h:70
QgsAbstractGeometry::AxisOrder
AxisOrder
Axis order for GML generation.
Definition: qgsabstractgeometry.h:128
QgsMultiCurve
Multi curve geometry collection.
Definition: qgsmulticurve.h:29
QgsAbstractGeometry::const_part_iterator
Definition: qgsabstractgeometry.h:772
QgsConstWkbPtr
Definition: qgswkbptr.h:127
QgsAbstractGeometry::vertices_begin
vertex_iterator vertices_begin() const
Returns STL-style iterator pointing to the first vertex of the geometry.
Definition: qgsabstractgeometry.h:886
QgsGeometryConstPartIterator::hasNext
bool hasNext() const
Find out whether there are more parts.
Definition: qgsabstractgeometry.h:1226
operator*
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
qgscoordinatetransform.h
qgsgeometry_cast
T qgsgeometry_cast(const QgsAbstractGeometry *geom)
Definition: qgsabstractgeometry.h:1098
QgsAbstractGeometry::is3D
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
Definition: qgsabstractgeometry.h:202
QgsRingSequence
QVector< QgsPointSequence > QgsRingSequence
Definition: qgsabstractgeometry.h:48
QgsMultiPoint
Multi point geometry collection.
Definition: qgsmultipoint.h:29
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:71
QgsVertexId::type
VertexType type
Definition: qgsabstractgeometry.h:1083
QgsWkbTypes::hasM
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:1092
QgsAbstractGeometry::vertex_iterator
Definition: qgsabstractgeometry.h:832
QgsPointSequence
QVector< QgsPoint > QgsPointSequence
Definition: qgsabstractgeometry.h:44
QgsMapToPixel
Definition: qgsmaptopixel.h:37
QgsGeometryPartIterator
Java-style iterator for traversal of parts of a geometry.
Definition: qgsabstractgeometry.h:1161
QgsAbstractGeometry::WkbFlag
WkbFlag
WKB export flags.
Definition: qgsabstractgeometry.h:245
QgsAbstractGeometry::childCount
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
Definition: qgsabstractgeometry.h:988
QgsVertexId
Utility class for identifying a unique vertex within a geometry.
Definition: qgsabstractgeometry.h:1033
QgsGeometryConstPartIterator::QgsGeometryConstPartIterator
QgsGeometryConstPartIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1218
QgsVertexId::ring
int ring
Definition: qgsabstractgeometry.h:1081
QgsAbstractGeometry::isMeasure
bool isMeasure() const
Returns true if the geometry contains m values.
Definition: qgsabstractgeometry.h:211
QgsVertexId::vertexEqual
bool vertexEqual(QgsVertexId o) const
Definition: qgsabstractgeometry.h:1069
QgsVertexId::VertexType
VertexType
Definition: qgsabstractgeometry.h:1035
QgsVertexIterator
Java-style iterator for traversal of vertices of a geometry.
Definition: qgsabstractgeometry.h:1112
QgsVertexIterator::hasNext
bool hasNext() const
Find out whether there are more vertices.
Definition: qgsabstractgeometry.h:1127
QgsWkbTypes
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:40
QgsAbstractGeometry::parts_begin
part_iterator parts_begin()
Returns STL-style iterator pointing to the first part of the geometry.
Definition: qgsabstractgeometry.h:743
QgsAbstractGeometry::const_parts_begin
const_part_iterator const_parts_begin() const
Returns STL-style iterator pointing to the const first part of the geometry.
Definition: qgsabstractgeometry.h:812
QgsVertexId::CurveVertex
@ CurveVertex
Definition: qgsabstractgeometry.h:1038
QgsCoordinateTransform
Definition: qgscoordinatetransform.h:52
QgsVertexId::QgsVertexId
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex)
Definition: qgsabstractgeometry.h:1041
qgswkbtypes.h
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsAbstractGeometry::ringCount
virtual int ringCount(int part=0) const =0
Returns the number of rings of which this geometry is built.