110 for (
int i = 0; i < nRings; ++i )
113 line->fromWkbPoints( ringType, wkbPtr );
134 int size =
sizeof( char ) +
sizeof( quint32 ) +
sizeof( quint32 );
143 size += curve->
wkbSize() - (
sizeof( char ) +
sizeof( quint32 ) );
151 unsigned char* geomPtr =
new unsigned char[binarySize];
154 wkb << static_cast<quint32>(
wkbType() );
186 if ( lineString && !lineString->
isClosed() )
220 if ( lineString && !lineString->
isClosed() )
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
void close()
Closes the line string by appending the first point to the end of the line, if it is not already clos...
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.
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
unsigned char * asWkb(int &binarySize) const override
Returns a WKB representation of the geometry.
QgsCurveV2 * segmentize() const override
Returns a geometry without curves.
static endian_t endian()
Returns whether this machine uses big or little endian.
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.
bool operator==(const QgsPolygonV2 &other) const
QgsWKBTypes::Type readHeader() const
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
int count(const T &value) const
void append(const T &value)
virtual void setExteriorRing(QgsCurveV2 *ring) override
Sets the exterior ring of the polygon.
bool isMeasure() const
Returns true if the geometry contains m values.
Line string geometry type, with support for z-dimension and 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)
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.
bool operator!=(const QgsPolygonV2 &other) const
void setZMTypeFromSubGeometry(const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values.
virtual bool convertTo(QgsWKBTypes::Type type)
Converts the geometry to a specified type.
QList< QgsCurveV2 * > mInteriorRings
virtual QgsLineStringV2 * curveToLine() const =0
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
virtual bool isClosed() const
Returns true if the curve is closed.
QgsPolygonV2 * surfaceToPolygon() const override
static Type flatType(Type type)
Returns the flat type for a WKB type.
Curve polygon geometry type.
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.
QgsCurveV2 * mExteriorRing