QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 <QString>
22 
23 #include "qgis_core.h"
24 #include "qgscoordinatetransform.h"
25 #include "qgswkbtypes.h"
26 #include "qgswkbptr.h"
27 
28 #ifndef SIP_RUN
29 #include "json_fwd.hpp"
30 using namespace nlohmann;
31 #endif
32 
33 class QgsMapToPixel;
34 class QgsCurve;
35 class QgsMultiCurve;
36 class QgsMultiPoint;
37 
38 struct QgsVertexId;
39 class QgsVertexIterator;
40 class QPainter;
41 class QDomDocument;
42 class QDomElement;
45 class QgsConstWkbPtr;
46 class QPainterPath;
47 
48 typedef QVector< QgsPoint > QgsPointSequence;
49 #ifndef SIP_RUN
50 typedef QVector< QgsPointSequence > QgsRingSequence;
51 typedef QVector< QgsRingSequence > QgsCoordinateSequence;
52 #else
53 typedef QVector< QVector< QgsPoint > > QgsRingSequence;
54 typedef QVector< QVector< QVector< QgsPoint > > > QgsCoordinateSequence;
55 #endif
56 
57 
73 class CORE_EXPORT QgsAbstractGeometry
74 {
75 
76 #ifdef SIP_RUN
78  if ( qgsgeometry_cast<QgsPoint *>( sipCpp ) != nullptr )
79  sipType = sipType_QgsPoint;
80  else if ( qgsgeometry_cast<QgsLineString *>( sipCpp ) != nullptr )
81  sipType = sipType_QgsLineString;
82  else if ( qgsgeometry_cast<QgsCircularString *>( sipCpp ) != nullptr )
83  sipType = sipType_QgsCircularString;
84  else if ( qgsgeometry_cast<QgsCompoundCurve *>( sipCpp ) != nullptr )
85  sipType = sipType_QgsCompoundCurve;
86  else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
87  sipType = sipType_QgsTriangle;
88  else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
89  sipType = sipType_QgsPolygon;
90  else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
91  sipType = sipType_QgsCurvePolygon;
92  else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
93  sipType = sipType_QgsMultiPoint;
94  else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
95  sipType = sipType_QgsMultiLineString;
96  else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
97  sipType = sipType_QgsMultiPolygon;
98  else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
99  sipType = sipType_QgsMultiSurface;
100  else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
101  sipType = sipType_QgsMultiCurve;
102  else if ( qgsgeometry_cast<QgsGeometryCollection *>( sipCpp ) != nullptr )
103  sipType = sipType_QgsGeometryCollection;
104  else
105  sipType = 0;
106  SIP_END
107 #endif
108 
109  Q_GADGET
110 
111  public:
112 
115  {
116 
121  MaximumAngle = 0,
122 
127  MaximumDifference
128  };
129  Q_ENUM( SegmentationToleranceType )
130 
131 
133  {
134 
138  XY = 0,
139 
143  YX
144  };
146 
147 
150  QgsAbstractGeometry() = default;
151  virtual ~QgsAbstractGeometry() = default;
153  QgsAbstractGeometry &operator=( const QgsAbstractGeometry &geom );
154 
155  virtual bool operator==( const QgsAbstractGeometry &other ) const = 0;
156  virtual bool operator!=( const QgsAbstractGeometry &other ) const = 0;
157 
161  virtual QgsAbstractGeometry *clone() const = 0 SIP_FACTORY;
162 
166  virtual void clear() = 0;
167 
171  virtual QgsRectangle boundingBox() const = 0;
172 
173  //mm-sql interface
174 
179  virtual int dimension() const = 0;
180 
186  virtual QString geometryType() const = 0;
187 
193  inline QgsWkbTypes::Type wkbType() const SIP_HOLDGIL { return mWkbType; }
194 
200  QString wktTypeStr() const;
201 
206  bool is3D() const SIP_HOLDGIL
207  {
208  return QgsWkbTypes::hasZ( mWkbType );
209  }
210 
215  bool isMeasure() const SIP_HOLDGIL
216  {
217  return QgsWkbTypes::hasM( mWkbType );
218  }
219 
227 
228  //import
229 
235  virtual bool fromWkb( QgsConstWkbPtr &wkb ) = 0;
236 
241  virtual bool fromWkt( const QString &wkt ) = 0;
242 
243  //export
244 
249  enum WkbFlag
250  {
251  FlagExportTrianglesAsPolygons = 1 << 0,
252  };
253  Q_DECLARE_FLAGS( WkbFlags, WkbFlag )
254 
255 
262  virtual int wkbSize( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
263 
275  virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
276 
285  virtual QString asWkt( int precision = 17 ) const = 0;
286 
298  virtual QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
299 
311  virtual QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml", AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY ) const = 0;
312 
322  QString asJson( int precision = 17 );
323 
334  virtual json asJsonObject( int precision = 17 ) SIP_SKIP const;
335 
340  virtual QString asKml( int precision = 17 ) const = 0;
341 
342 
343  //render pipeline
344 
355  virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform, bool transformZ = false ) SIP_THROW( QgsCsException ) = 0;
356 
363  virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0,
364  double mTranslate = 0.0, double mScale = 1.0 ) = 0;
365 
370  virtual void draw( QPainter &p ) const = 0;
371 
380  virtual QPainterPath asQPainterPath() const = 0;
381 
392  virtual int vertexNumberFromVertexId( QgsVertexId id ) const = 0;
393 
401  virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex SIP_OUT ) const = 0;
402 
407  virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex SIP_OUT, QgsVertexId &nextVertex SIP_OUT ) const = 0;
408 
413  virtual QgsCoordinateSequence coordinateSequence() const = 0;
414 
418  virtual int nCoordinates() const;
419 
423  virtual QgsPoint vertexAt( QgsVertexId id ) const = 0;
424 
437  virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt SIP_OUT,
438  QgsVertexId &vertexAfter SIP_OUT,
439  int *leftOf SIP_OUT = nullptr, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const = 0;
440 
441  //low-level editing
442 
451  virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex ) = 0;
452 
461  virtual bool moveVertex( QgsVertexId position, const QgsPoint &newPos ) = 0;
462 
470  virtual bool deleteVertex( QgsVertexId position ) = 0;
471 
484  virtual double length() const;
485 
498  virtual double perimeter() const;
499 
512  virtual double area() const;
513 
522  virtual double segmentLength( QgsVertexId startVertex ) const = 0;
523 
525  virtual QgsPoint centroid() const;
526 
530  virtual bool isEmpty() const;
531 
535  virtual bool hasCurvedSegments() const;
536 
543  virtual QgsAbstractGeometry *segmentize( double tolerance = M_PI / 180., SegmentationToleranceType toleranceType = MaximumAngle ) const SIP_FACTORY;
544 
551  virtual QgsAbstractGeometry *toCurveType() const = 0 SIP_FACTORY;
552 
575  virtual QgsAbstractGeometry *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const = 0 SIP_FACTORY;
576 
597  virtual bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) = 0;
598 
606  virtual double vertexAngle( QgsVertexId vertex ) const = 0;
607 
611  virtual int vertexCount( int part = 0, int ring = 0 ) const = 0;
612 
616  virtual int ringCount( int part = 0 ) const = 0;
617 
623  virtual int partCount() const = 0;
624 
633  virtual bool addZValue( double zValue = 0 ) = 0;
634 
643  virtual bool addMValue( double mValue = 0 ) = 0;
644 
652  virtual bool dropZValue() = 0;
653 
661  virtual bool dropMValue() = 0;
662 
669  virtual void swapXy() = 0;
670 
676  virtual bool convertTo( QgsWkbTypes::Type type );
677 
689  virtual bool isValid( QString &error SIP_OUT, int flags = 0 ) const = 0;
690 
691 #ifndef SIP_RUN
692 
702  virtual void filterVertices( const std::function< bool( const QgsPoint & ) > &filter );
703 
718  virtual void transformVertices( const std::function< QgsPoint( const QgsPoint & ) > &transform );
719 
725  class CORE_EXPORT part_iterator
726  {
727  private:
728 
729  int mIndex = 0;
730  QgsAbstractGeometry *mGeometry = nullptr;
731 
732  public:
734  part_iterator() = default;
735 
737  part_iterator( QgsAbstractGeometry *g, int index );
738 
743  part_iterator &operator++();
744 
746  part_iterator operator++( int );
747 
750 
752  int partNumber() const;
753 
754  bool operator==( part_iterator other ) const;
755  bool operator!=( part_iterator other ) const { return !( *this == other ); }
756  };
757 
767  {
768  return part_iterator( this, 0 );
769  }
770 
779  part_iterator parts_end();
780 
788  QgsGeometryConstPartIterator parts() const;
789 
795  class CORE_EXPORT const_part_iterator
796  {
797  private:
798 
799  int mIndex = 0;
800  const QgsAbstractGeometry *mGeometry = nullptr;
801 
802  public:
804  const_part_iterator() = default;
805 
807  const_part_iterator( const QgsAbstractGeometry *g, int index );
808 
813  const_part_iterator &operator++();
814 
816  const_part_iterator operator++( int );
817 
819  const QgsAbstractGeometry *operator*() const;
820 
822  int partNumber() const;
823 
824  bool operator==( const_part_iterator other ) const;
825  bool operator!=( const_part_iterator other ) const { return !( *this == other ); }
826  };
827 
836  {
837  return const_part_iterator( this, 0 );
838  }
839 
847  const_part_iterator const_parts_end() const;
848 
849 
855  class CORE_EXPORT vertex_iterator
856  {
857  private:
858 
864  struct Level
865  {
866  const QgsAbstractGeometry *g = nullptr;
867  int index = 0;
868 
869  bool operator==( const Level &other ) const;
870  };
871 
872  std::array<Level, 3> levels;
873  int depth = -1;
874 
875  void digDown();
876 
877  public:
879  vertex_iterator() = default;
880 
882  vertex_iterator( const QgsAbstractGeometry *g, int index );
883 
888  vertex_iterator &operator++();
889 
891  vertex_iterator operator++( int );
892 
894  QgsPoint operator*() const;
895 
897  QgsVertexId vertexId() const;
898 
899  bool operator==( const vertex_iterator &other ) const;
900  bool operator!=( const vertex_iterator &other ) const { return !( *this == other ); }
901  };
902 
912  {
913  return vertex_iterator( this, 0 );
914  }
915 
925  {
926  return vertex_iterator( this, childCount() );
927  }
928 #endif
929 
963  QgsGeometryPartIterator parts();
964 
965 
989  QgsVertexIterator vertices() const;
990 
998 
999  protected:
1000 
1006  virtual bool hasChildGeometries() const;
1007 
1013  virtual int childCount() const { return 0; }
1014 
1020  virtual QgsAbstractGeometry *childGeometry( int index ) const { Q_UNUSED( index ) return nullptr; }
1021 
1027  virtual QgsPoint childPoint( int index ) const;
1028 
1029  protected:
1031 
1035  void setZMTypeFromSubGeometry( const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType );
1036 
1041  virtual QgsRectangle calculateBoundingBox() const;
1042 
1046  virtual void clearCache() const;
1047 
1048  friend class TestQgsGeometry;
1049 };
1050 
1051 
1058 struct CORE_EXPORT QgsVertexId
1059 {
1060 
1065  {
1066  SegmentVertex = 1,
1068  };
1069 
1073  explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex ) SIP_HOLDGIL
1074 : part( _part )
1075  , ring( _ring )
1076  , vertex( _vertex )
1077  , type( _type )
1078  {}
1079 
1083  bool isValid() const SIP_HOLDGIL { return part >= 0 && ring >= 0 && vertex >= 0; }
1084 
1085  bool operator==( QgsVertexId other ) const SIP_HOLDGIL
1086  {
1087  return part == other.part && ring == other.ring && vertex == other.vertex;
1088  }
1089  bool operator!=( QgsVertexId other ) const SIP_HOLDGIL
1090  {
1091  return part != other.part || ring != other.ring || vertex != other.vertex;
1092  }
1093 
1098  {
1099  return part >= 0 && o.part == part;
1100  }
1101 
1107  {
1108  return partEqual( o ) && ( ring >= 0 && o.ring == ring );
1109  }
1110 
1116  {
1117  return ringEqual( o ) && ( vertex >= 0 && o.ring == ring );
1118  }
1119 
1123  bool isValid( const QgsAbstractGeometry *geom ) const SIP_HOLDGIL
1124  {
1125  return ( part >= 0 && part < geom->partCount() ) &&
1126  ( ring < geom->ringCount( part ) ) &&
1127  ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
1128  }
1129 
1131  int part = -1;
1132 
1134  int ring = -1;
1135 
1137  int vertex = -1;
1138 
1140  VertexType type = SegmentVertex;
1141 
1142 #ifdef SIP_RUN
1143  SIP_PYOBJECT __repr__();
1144  % MethodCode
1145  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() );
1146  sipRes = PyUnicode_FromString( str.toUtf8().data() );
1147  % End
1148 #endif
1149 
1150 };
1151 
1152 #ifndef SIP_RUN
1153 
1154 template <class T>
1155 inline T qgsgeometry_cast( const QgsAbstractGeometry *geom )
1156 {
1157  return const_cast<T>( reinterpret_cast<T>( 0 )->cast( geom ) );
1158 }
1159 
1160 #endif
1161 
1162 // clazy:excludeall=qstring-allocations
1163 
1169 class CORE_EXPORT QgsVertexIterator
1170 {
1171  public:
1173  QgsVertexIterator() = default;
1174 
1177  : g( geometry )
1178  , i( g->vertices_begin() )
1179  , n( g->vertices_end() )
1180  {
1181  }
1182 
1184  bool hasNext() const
1185  {
1186  return g && g->vertices_end() != i;
1187  }
1188 
1190  QgsPoint next();
1191 
1192 #ifdef SIP_RUN
1193  QgsVertexIterator *__iter__();
1194  % MethodCode
1195  sipRes = sipCpp;
1196  % End
1197 
1198  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsPoint );
1199  % MethodCode
1200  if ( sipCpp->hasNext() )
1201  sipRes = sipConvertFromType( new QgsPoint( sipCpp->next() ), sipType_QgsPoint, Py_None );
1202  else
1203  PyErr_SetString( PyExc_StopIteration, "" );
1204  % End
1205 #endif
1206 
1207  private:
1208  const QgsAbstractGeometry *g = nullptr;
1210 
1211 };
1212 
1218 class CORE_EXPORT QgsGeometryPartIterator
1219 {
1220  public:
1223 
1226  : g( geometry )
1227  , i( g->parts_begin() )
1228  , n( g->parts_end() )
1229  {
1230  }
1231 
1233  bool hasNext() const SIP_HOLDGIL
1234  {
1235  return g && g->parts_end() != i;
1236  }
1237 
1239  QgsAbstractGeometry *next();
1240 
1241 #ifdef SIP_RUN
1242  QgsGeometryPartIterator *__iter__();
1243  % MethodCode
1244  sipRes = sipCpp;
1245  % End
1246 
1247  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1248  % MethodCode
1249  if ( sipCpp->hasNext() )
1250  sipRes = sipConvertFromType( sipCpp->next(), sipType_QgsAbstractGeometry, NULL );
1251  else
1252  PyErr_SetString( PyExc_StopIteration, "" );
1253  % End
1254 #endif
1255 
1256  private:
1257  QgsAbstractGeometry *g = nullptr;
1259 
1260 };
1261 
1262 
1269 {
1270  public:
1273 
1276  : g( geometry )
1277  , i( g->const_parts_begin() )
1278  , n( g->const_parts_end() )
1279  {
1280  }
1281 
1283  bool hasNext() const SIP_HOLDGIL
1284  {
1285  return g && g->const_parts_end() != i;
1286  }
1287 
1289  const QgsAbstractGeometry *next();
1290 
1291 #ifdef SIP_RUN
1292  QgsGeometryConstPartIterator *__iter__();
1293  % MethodCode
1294  sipRes = sipCpp;
1295  % End
1296 
1297  SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsAbstractGeometry );
1298  % MethodCode
1299  if ( sipCpp->hasNext() )
1300  sipRes = sipConvertFromType( const_cast< QgsAbstractGeometry * >( sipCpp->next() ), sipType_QgsAbstractGeometry, NULL );
1301  else
1302  PyErr_SetString( PyExc_StopIteration, "" );
1303  % End
1304 #endif
1305 
1306  private:
1307  const QgsAbstractGeometry *g = nullptr;
1309 
1310 };
1311 
1312 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAbstractGeometry::WkbFlags )
1313 
1314 #endif //QGSABSTRACTGEOMETRYV2
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
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:924
QgsCoordinateSequence
QVector< QgsRingSequence > QgsCoordinateSequence
Definition: qgsabstractgeometry.h:51
QgsAbstractGeometry::fromWkt
virtual bool fromWkt(const QString &wkt)=0
Sets the geometry from a WKT string.
QgsAbstractGeometry::part_iterator::operator!=
bool operator!=(part_iterator other) const
Definition: qgsabstractgeometry.h:755
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:400
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
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:1269
QgsGeometryPartIterator::hasNext
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
Definition: qgsabstractgeometry.h:1233
QgsWkbTypes::Type
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
QgsAbstractGeometry::vertex_iterator::operator!=
bool operator!=(const vertex_iterator &other) const
Definition: qgsabstractgeometry.h:900
QgsVertexIterator::QgsVertexIterator
QgsVertexIterator()=default
Constructor for QgsVertexIterator.
QgsAbstractGeometry::SegmentationToleranceType
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
Definition: qgsabstractgeometry.h:115
QgsAbstractGeometry::childGeometry
virtual QgsAbstractGeometry * childGeometry(int index) const
Returns pointer to child geometry (for geometries with child geometries - i.e.
Definition: qgsabstractgeometry.h:1020
QgsAbstractGeometry::const_part_iterator::operator!=
bool operator!=(const_part_iterator other) const
Definition: qgsabstractgeometry.h:825
closestSegment
double closestSegment(const QgsPolylineXY &pl, const QgsPointXY &pt, int &vertexAfter, double epsilon)
Definition: qgstracer.cpp:68
QgsVertexId::partEqual
bool partEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same part as another vertex ID.
Definition: qgsabstractgeometry.h:1097
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
SIP_TYPEHINT
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:218
QgsVertexIterator::QgsVertexIterator
QgsVertexIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1176
QgsGeometryPartIterator::QgsGeometryPartIterator
QgsGeometryPartIterator()=default
Constructor for QgsGeometryPartIterator.
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsAbstractGeometry::isMeasure
bool isMeasure() const SIP_HOLDGIL
Returns true if the geometry contains m values.
Definition: qgsabstractgeometry.h:215
QgsAbstractGeometry::part_iterator
The part_iterator class provides STL-style iterator for geometry parts.
Definition: qgsabstractgeometry.h:726
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:177
QgsGeometryPartIterator::QgsGeometryPartIterator
QgsGeometryPartIterator(QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1225
QgsVertexId::QgsVertexId
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex) SIP_HOLDGIL
Constructor for QgsVertexId.
Definition: qgsabstractgeometry.h:1073
precision
int precision
Definition: qgswfsgetfeature.cpp:49
QgsCsException
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsGeometryConstPartIterator::QgsGeometryConstPartIterator
QgsGeometryConstPartIterator()=default
Constructor for QgsGeometryConstPartIterator.
SIP_HOLDGIL
#define SIP_HOLDGIL
Definition: qgis_sip.h:157
SIP_THROW
#define SIP_THROW(name)
Definition: qgis_sip.h:189
QgsWkbTypes::Unknown
@ Unknown
Definition: qgswkbtypes.h:71
QgsAbstractGeometry::AxisOrder
AxisOrder
Axis order for GML generation.
Definition: qgsabstractgeometry.h:133
QgsMultiCurve
Multi curve geometry collection.
Definition: qgsmulticurve.h:30
QgsAbstractGeometry::const_part_iterator
The part_iterator class provides STL-style iterator for const references to geometry parts.
Definition: qgsabstractgeometry.h:796
QgsConstWkbPtr
Definition: qgswkbptr.h:128
QgsAbstractGeometry::vertices_begin
vertex_iterator vertices_begin() const
Returns STL-style iterator pointing to the first vertex of the geometry.
Definition: qgsabstractgeometry.h:911
QgsAbstractGeometry::const_part_iterator::const_part_iterator
const_part_iterator()=default
Create invalid iterator.
Q_DECLARE_OPERATORS_FOR_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.
QgsWkbTypes::hasM
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:1093
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:1155
QgsAbstractGeometry::part_iterator::part_iterator
part_iterator()=default
Create invalid iterator.
QgsRingSequence
QVector< QgsPointSequence > QgsRingSequence
Definition: qgsabstractgeometry.h:50
QgsAbstractGeometry::fromWkb
virtual bool fromWkb(QgsConstWkbPtr &wkb)=0
Sets the geometry from a WKB string.
QgsMultiPoint
Multi point geometry collection.
Definition: qgsmultipoint.h:30
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:74
QgsAbstractGeometry::is3D
bool is3D() const SIP_HOLDGIL
Returns true if the geometry is 3D and contains a z-value.
Definition: qgsabstractgeometry.h:206
QgsVertexId::vertexEqual
bool vertexEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID corresponds to the same vertex as another vertex ID (i....
Definition: qgsabstractgeometry.h:1115
QgsVertexId::isValid
bool isValid() const SIP_HOLDGIL
Returns true if the vertex id is valid.
Definition: qgsabstractgeometry.h:1083
QgsAbstractGeometry::createEmptyWithSameType
virtual QgsAbstractGeometry * createEmptyWithSameType() const =0
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
QgsAbstractGeometry::vertex_iterator
The vertex_iterator class provides STL-style iterator for vertices.
Definition: qgsabstractgeometry.h:856
QgsPointSequence
QVector< QgsPoint > QgsPointSequence
Definition: qgsabstractgeometry.h:46
QgsMapToPixel
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:38
QgsGeometryPartIterator
Java-style iterator for traversal of parts of a geometry.
Definition: qgsabstractgeometry.h:1219
QgsGeometryConstPartIterator::hasNext
bool hasNext() const SIP_HOLDGIL
Find out whether there are more parts.
Definition: qgsabstractgeometry.h:1283
QgsAbstractGeometry::WkbFlag
WkbFlag
WKB export flags.
Definition: qgsabstractgeometry.h:250
QgsAbstractGeometry::childCount
virtual int childCount() const
Returns number of child geometries (for geometries with child geometries) or child points (for geomet...
Definition: qgsabstractgeometry.h:1013
QgsVertexId
Utility class for identifying a unique vertex within a geometry.
Definition: qgsabstractgeometry.h:1059
QgsGeometryConstPartIterator::QgsGeometryConstPartIterator
QgsGeometryConstPartIterator(const QgsAbstractGeometry *geometry)
Constructs iterator for the given geometry.
Definition: qgsabstractgeometry.h:1275
QgsVertexId::ringEqual
bool ringEqual(QgsVertexId o) const SIP_HOLDGIL
Returns true if this vertex ID belongs to the same ring as another vertex ID (i.e.
Definition: qgsabstractgeometry.h:1106
QgsAbstractGeometry::boundary
virtual QgsAbstractGeometry * boundary() const =0
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
QgsVertexId::VertexType
VertexType
Type of vertex.
Definition: qgsabstractgeometry.h:1065
QgsVertexIterator
Java-style iterator for traversal of vertices of a geometry.
Definition: qgsabstractgeometry.h:1170
QgsWkbTypes::hasZ
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1043
QgsVertexIterator::hasNext
bool hasNext() const
Find out whether there are more vertices.
Definition: qgsabstractgeometry.h:1184
QgsWkbTypes
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:42
QgsVertexId::operator!=
bool operator!=(QgsVertexId other) const SIP_HOLDGIL
Definition: qgsabstractgeometry.h:1089
QgsAbstractGeometry::parts_begin
part_iterator parts_begin()
Returns STL-style iterator pointing to the first part of the geometry.
Definition: qgsabstractgeometry.h:766
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:835
QgsAbstractGeometry::vertex_iterator::vertex_iterator
vertex_iterator()=default
Create invalid iterator.
QgsVertexId::CurveVertex
@ CurveVertex
An intermediate point on a segment defining the curvature of the segment.
Definition: qgsabstractgeometry.h:1067
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:53
qgswkbtypes.h
QgsVertexId::isValid
bool isValid(const QgsAbstractGeometry *geom) const SIP_HOLDGIL
Returns true if this vertex ID is valid for the specified geom.
Definition: qgsabstractgeometry.h:1123
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
QgsVertexId::operator==
bool operator==(QgsVertexId other) const SIP_HOLDGIL
Definition: qgsabstractgeometry.h:1085