117 for (
int i = 0; i < nRings; ++i )
120 line->fromWkbPoints( ringType, wkbPtr );
141 int size =
sizeof( char ) +
sizeof( quint32 ) +
sizeof( quint32 );
150 size += curve->
wkbSize() - (
sizeof( char ) +
sizeof( quint32 ) );
158 unsigned char* geomPtr =
new unsigned char[binarySize];
161 wkb << static_cast<quint32>(
wkbType() );
193 if ( lineString && !lineString->
isClosed() )
227 if ( lineString && !lineString->
isClosed() )
260 for (
int i = 0; i < nInteriorRings; ++i )
278 for (
int i = 0; i < nInteriorRings; ++i )
void clear() override
Clears the geometry, ie reset it to a null geometry.
void close()
Closes the line string by appending the first point to the end of the line, if it is not already clos...
bool operator!=(const QgsPolygonV2 &other) const
virtual bool fromWkb(QgsConstWkbPtr wkb) override
Sets the geometry from a WKB string.
virtual void addInteriorRing(QgsCurveV2 *ring)
Adds an interior ring to the geometry (takes ownership)
void clear() override
Clears the geometry, ie reset it to a null geometry.
virtual bool addGeometry(QgsAbstractGeometryV2 *g) override
Adds a geometry and takes ownership.
static void pointsToWKB(QgsWkbPtr &wkb, const QgsPointSequenceV2 &points, bool is3D, bool isMeasure)
Returns a LinearRing { uint32 numPoints; Point points[numPoints]; }.
const T & at(int i) const
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.
Abstract base class for all geometries.
unsigned char * asWkb(int &binarySize) const override
Returns a WKB representation of the geometry.
virtual QgsCurveV2 * clone() const override=0
Clones the geometry by performing a deep copy.
static endian_t endian()
Returns whether this machine uses big or little endian.
Multi line string geometry collection.
virtual int wkbSize() const =0
Returns the size of the WKB representation of the geometry.
virtual void clearCache() const override
Clears any cached parameters associated with the geometry, eg bounding boxes.
QgsAbstractGeometryV2 * toCurveType() const override
Returns the geometry converted to the more generic curve type QgsCurvePolygonV2.
int count(const T &value) const
void append(const T &value)
virtual void setExteriorRing(QgsCurveV2 *ring) override
Sets the exterior ring of the polygon.
virtual bool isClosed() const
Returns true if the curve is closed.
Line string geometry type, with support for z-dimension and m-values.
QgsCurveV2 * segmentize(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
Returns a geometry without curves.
bool isMeasure() const
Returns true if the geometry contains m values.
QgsWKBTypes::Type mWkbType
virtual QgsPolygonV2 * clone() const override
Clones the geometry by performing a deep copy.
void addInteriorRing(QgsCurveV2 *ring) override
Adds an interior ring to the geometry (takes ownership)
void setZMTypeFromSubGeometry(const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values.
bool operator==(const QgsPolygonV2 &other) const
virtual bool convertTo(QgsWKBTypes::Type type)
Converts the geometry to a specified type.
QList< QgsCurveV2 * > mInteriorRings
virtual void setExteriorRing(QgsCurveV2 *ring)
Sets the exterior ring of the polygon.
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
QgsPolygonV2 * surfaceToPolygon() const override
virtual QgsLineStringV2 * curveToLine(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const =0
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
virtual QgsAbstractGeometryV2 * boundary() const override
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
static Type flatType(Type type)
Returns the flat type for a WKB type.
Curve polygon geometry type.
QgsWKBTypes::Type readHeader() const
Abstract base class for curved geometry type.
int wkbSize() const override
Returns the size of the WKB representation of the geometry.
virtual void points(QgsPointSequenceV2 &pt) const =0
Returns a list of points within the curve.
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
QgsCurveV2 * mExteriorRing