67 void QgsAbstractGeometryV2::clip(
const QgsRectangle& rect )
84 bool hasZ = subgeom->
is3D();
137 if (
id.part >= coordinates.
size() )
142 if (
id.ring >= part.size() )
147 if (
id.vertex >= ring.size() )
151 return ring.at(
id.vertex );
161 for ( ; partIt != coordinates.
constEnd(); ++partIt )
165 for ( ; ringIt != part.
constEnd(); ++ringIt )
167 nCoords += ringIt->
size();
186 if ( !static_cast<const unsigned char*>( wkbPtr ) )
static void endian_swap(T &value)
Swap the endianness of the specified value.
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
A rectangle specified with double values.
virtual QgsAbstractGeometryV2 & operator=(const QgsAbstractGeometryV2 &geom)
const T & at(int i) const
bool isNull() const
test if the rectangle is null (all coordinates zero or after call to setMinimal()).
Abstract base class for all geometries.
QgsPointV2 vertexAt(const QgsVertexId &id) const
Returns the point corresponding to a specified vertex id.
static endian_t endian()
Returns whether this machine uses big or little endian.
QString wktTypeStr() const
Returns the WKT type string of the geometry.
int nCoordinates() const
Returns the number of nodes contained in the geometry.
static bool readWkbHeader(QgsConstWkbPtr &wkbPtr, QgsWKBTypes::Type &wkbType, bool &endianSwap, QgsWKBTypes::Type expectedType)
Reads a WKB header and tests its validity.
virtual void clear()=0
Clears the geometry, ie reset it to a null geometry.
static Type flatType(Type type)
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
Utility class for identifying a unique vertex within a geometry.
bool isMeasure() const
Returns true if the geometry contains m values.
virtual QgsRectangle calculateBoundingBox() const
Calculates the minimal bounding box for the geometry.
bool isEmpty() const
Returns true if the geometry is empty.
QgsWKBTypes::Type mWkbType
void setZMTypeFromSubGeometry(const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values.
virtual bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const =0
Returns next vertex id and coordinates.
virtual QString geometryType() const =0
Returns a unique string representing the geometry type.
Class to store information about wkb types.
virtual void coordinateSequence(QList< QList< QList< QgsPointV2 > > > &coord) const =0
Retrieves the sequence of geometries, rings and nodes.
QgsRectangle mBoundingBox
const_iterator constEnd() const
const_iterator constBegin() const
QgsRectangle boundingBox() const
Returns the minimal bounding box for the geometry.
virtual ~QgsAbstractGeometryV2()