59 void QgsAbstractGeometryV2::clip(
const QgsRectangle& rect )
90 bool hasZ = subgeom->
is3D();
184 for ( ; j < n; i = j++ )
192 double d = vi.
x() * vj.
y() - vj.
x() * vi.
y();
194 Cx += ( vi.
x() + vj.
x() ) * d;
195 Cy += ( vi.
y() + vj.
y() ) * d;
201 for (
int i = 0; i < n - 1; ++i )
207 return QgsPointV2( Cx / ( n - 1 ), Cy / ( n - 1 ) );
211 return QgsPointV2( v0.
x() + Cx / ( 3. * A ), v0.
y() + Cy / ( 3. * A ) );
256 Q_UNUSED( tolerance );
257 Q_UNUSED( toleranceType );
QString wktTypeStr() const
Returns the WKT type string of the geometry.
double & rx()
Returns a reference to the x-coordinate of this point.
A rectangle specified with double values.
bool isEmpty() const
Returns true if the geometry is empty.
virtual bool dropMValue()=0
Drops any measure values which exist in the geometry.
virtual QgsCoordinateSequenceV2 coordinateSequence() const =0
Retrieves the sequence of geometries, rings and nodes.
virtual QgsAbstractGeometryV2 & operator=(const QgsAbstractGeometryV2 &geom)
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
Abstract base class for all geometries.
virtual bool dropZValue()=0
Drops any z-dimensions which exist in the geometry.
double y() const
Returns the point's y-coordinate.
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
virtual bool addMValue(double mValue=0)=0
Adds a measure to the geometry, initialized to a preset value.
virtual void clear()=0
Clears the geometry, ie reset it to a null geometry.
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
static Type addM(Type type)
Adds the m dimension to a WKB type and returns the new type.
Utility class for identifying a unique vertex within a geometry.
bool isMeasure() const
Returns true if the geometry contains m values.
Point geometry type, with support for z-dimension and m-values.
virtual QgsAbstractGeometryV2 * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
QgsWKBTypes::Type mWkbType
double x() const
Returns the point's x-coordinate.
void setZMTypeFromSubGeometry(const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values.
virtual bool addZValue(double zValue=0)=0
Adds a z-dimension to the geometry, initialized to a preset value.
virtual bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const =0
Returns next vertex id and coordinates.
virtual int nCoordinates() const
Returns the number of nodes contained in the geometry.
virtual QString geometryType() const =0
Returns a unique string representing the geometry type.
virtual bool convertTo(QgsWKBTypes::Type type)
Converts the geometry to a specified type.
virtual int vertexCount(int part=0, int ring=0) const =0
Handles storage of information regarding WKB types and their properties.
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
static Type flatType(Type type)
Returns the flat type for a WKB type.
virtual QgsPointV2 centroid() const
Returns the centroid of the geometry.
double & ry()
Returns a reference to the y-coordinate of this point.
virtual ~QgsAbstractGeometryV2()
virtual QgsAbstractGeometryV2 * clone() const =0
Clones the geometry by performing a deep copy.
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.
virtual QgsPointV2 vertexAt(QgsVertexId id) const =0
Returns the point corresponding to a specified vertex id.
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.