QGIS API Documentation
2.12.0-Lyon
|
Circular string geometry type. More...
#include <qgscircularstringv2.h>
Public Member Functions | |
QgsCircularStringV2 () | |
~QgsCircularStringV2 () | |
virtual bool | addMValue (double mValue=0) override |
Adds a measure to the geometry, initialized to a preset value. More... | |
void | addToPainterPath (QPainterPath &path) const override |
Adds a curve to a painter path. More... | |
virtual bool | addZValue (double zValue=0) override |
Adds a z-dimension to the geometry, initialized to a preset value. More... | |
QDomElement | asGML2 (QDomDocument &doc, int precision=17, const QString &ns="gml") const override |
Returns a GML2 representation of the geometry. More... | |
QDomElement | asGML3 (QDomDocument &doc, int precision=17, const QString &ns="gml") const override |
Returns a GML3 representation of the geometry. More... | |
QString | asJSON (int precision=17) const override |
Returns a GeoJSON representation of the geometry. More... | |
unsigned char * | asWkb (int &binarySize) const override |
Returns a WKB representation of the geometry. More... | |
QString | asWkt (int precision=17) const override |
Returns a WKT representation of the geometry. More... | |
virtual QgsRectangle | calculateBoundingBox () const override |
Calculates the minimal bounding box for the geometry. More... | |
virtual void | clear () override |
Clears the geometry, ie reset it to a null geometry. More... | |
virtual QgsCircularStringV2 * | clone () const override |
Clones the geometry by performing a deep copy. More... | |
double | closestSegment (const QgsPointV2 &pt, QgsPointV2 &segmentPt, QgsVertexId &vertexAfter, bool *leftOf, double epsilon) const override |
Searches for the closest segment of the geometry to a given point. More... | |
virtual QgsLineStringV2 * | curveToLine () const override |
Returns a new line string geometry corresponding to a segmentized approximation of the curve. More... | |
virtual bool | deleteVertex (const QgsVertexId &position) override |
Deletes a vertex within the geometry. More... | |
virtual int | dimension () const override |
Returns the inherent dimension of the geometry. More... | |
void | draw (QPainter &p) const override |
Draws the geometry using the specified QPainter. More... | |
void | drawAsPolygon (QPainter &p) const override |
Draws the curve as a polygon on the specified QPainter. More... | |
virtual QgsPointV2 | endPoint () const override |
Returns the end point of the curve. More... | |
virtual bool | fromWkb (const unsigned char *wkb) override |
Sets the geometry from a WKB string. More... | |
virtual bool | fromWkt (const QString &wkt) override |
Sets the geometry from a WKT string. More... | |
virtual QString | geometryType () const override |
Returns a unique string representing the geometry type. More... | |
bool | hasCurvedSegments () const override |
Returns true if the geometry contains curved segments. More... | |
virtual bool | insertVertex (const QgsVertexId &position, const QgsPointV2 &vertex) override |
Inserts a vertex into the geometry. More... | |
virtual double | length () const override |
Returns the length of the geometry. More... | |
virtual bool | moveVertex (const QgsVertexId &position, const QgsPointV2 &newPos) override |
Moves a vertex within the geometry. More... | |
int | numPoints () const override |
Returns the number of points in the curve. More... | |
bool | pointAt (int i, QgsPointV2 &vertex, QgsVertexId::VertexType &type) const override |
Returns the point and vertex id of a point within the curve. More... | |
QgsPointV2 | pointN (int i) const |
Returns the point at index i within the circular string. More... | |
void | points (QList< QgsPointV2 > &pts) const override |
Returns a list of points within the curve. More... | |
void | setPoints (const QList< QgsPointV2 > &points) |
Sets the circular string's points. More... | |
virtual QgsPointV2 | startPoint () const override |
Returns the starting point of the curve. More... | |
void | sumUpArea (double &sum) const override |
Calculates the area of the curve. More... | |
void | transform (const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform) override |
Transforms the geometry using a coordinate transform. More... | |
void | transform (const QTransform &t) override |
Transforms the geometry using a QTransform object. More... | |
double | vertexAngle (const QgsVertexId &vertex) const override |
Returns approximate rotation angle for a vertex. More... | |
int | wkbSize () const override |
Returns the size of the WKB representation of the geometry. More... | |
Public Member Functions inherited from QgsCurveV2 | |
QgsCurveV2 () | |
virtual | ~QgsCurveV2 () |
virtual void | coordinateSequence (QList< QList< QList< QgsPointV2 > > > &coord) const override |
Retrieves the sequence of geometries, rings and nodes. More... | |
virtual bool | isClosed () const |
Returns true if the curve is closed. More... | |
virtual bool | isRing () const |
Returns true if the curve is a ring. More... | |
virtual bool | nextVertex (QgsVertexId &id, QgsPointV2 &vertex) const override |
Returns next vertex id and coordinates. More... | |
virtual int | partCount () const override |
virtual int | ringCount (int=0) const override |
QgsAbstractGeometryV2 * | segmentize () const override |
Returns a version of the geometry without curves. More... | |
virtual QgsPointV2 | vertexAt (const QgsVertexId &id) const override |
Returns the point corresponding to a specified vertex id. More... | |
virtual int | vertexCount (int=0, int=0) const override |
Public Member Functions inherited from QgsAbstractGeometryV2 | |
QgsAbstractGeometryV2 () | |
QgsAbstractGeometryV2 (const QgsAbstractGeometryV2 &geom) | |
virtual | ~QgsAbstractGeometryV2 () |
virtual double | area () const |
Returns the area of the geometry. More... | |
QgsRectangle | boundingBox () const |
Returns the minimal bounding box for the geometry. More... | |
virtual QgsPointV2 | centroid () const |
Returns the centroid of the geometry. More... | |
bool | is3D () const |
Returns true if the geometry is 3D and contains a z-value. More... | |
bool | isEmpty () const |
Returns true if the geometry is empty. More... | |
bool | isMeasure () const |
Returns true if the geometry contains m values. More... | |
int | nCoordinates () const |
Returns the number of nodes contained in the geometry. More... | |
virtual QgsAbstractGeometryV2 & | operator= (const QgsAbstractGeometryV2 &geom) |
virtual double | perimeter () const |
Returns the perimeter of the geometry. More... | |
QgsWKBTypes::Type | wkbType () const |
Returns the WKB type of the geometry. More... | |
QString | wktTypeStr () const |
Returns the WKT type string of the geometry. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsAbstractGeometryV2 | |
void | setZMTypeFromSubGeometry (const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType) |
Updates the geometry type based on whether sub geometries contain z or m values. More... | |
Static Protected Member Functions inherited from QgsAbstractGeometryV2 | |
static bool | readWkbHeader (QgsConstWkbPtr &wkbPtr, QgsWKBTypes::Type &wkbType, bool &endianSwap, QgsWKBTypes::Type expectedType) |
Reads a WKB header and tests its validity. More... | |
Protected Attributes inherited from QgsAbstractGeometryV2 | |
QgsRectangle | mBoundingBox |
QgsWKBTypes::Type | mWkbType |
Circular string geometry type.
Definition at line 30 of file qgscircularstringv2.h.
QgsCircularStringV2::QgsCircularStringV2 | ( | ) |
Definition at line 29 of file qgscircularstringv2.cpp.
QgsCircularStringV2::~QgsCircularStringV2 | ( | ) |
Definition at line 34 of file qgscircularstringv2.cpp.
|
overridevirtual |
Adds a measure to the geometry, initialized to a preset value.
mValue | initial m-value for all nodes |
Implements QgsAbstractGeometryV2.
Definition at line 1029 of file qgscircularstringv2.cpp.
|
overridevirtual |
Adds a curve to a painter path.
Implements QgsCurveV2.
Definition at line 628 of file qgscircularstringv2.cpp.
|
overridevirtual |
Adds a z-dimension to the geometry, initialized to a preset value.
zValue | initial z-value for all nodes |
Implements QgsAbstractGeometryV2.
Definition at line 1012 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a GML2 representation of the geometry.
doc | DOM document |
precision | number of decimal places for coordinates |
ns | XML namespace |
Implements QgsAbstractGeometryV2.
Definition at line 279 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a GML3 representation of the geometry.
doc | DOM document |
precision | number of decimal places for coordinates |
ns | XML namespace |
Implements QgsAbstractGeometryV2.
Definition at line 288 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a GeoJSON representation of the geometry.
precision | number of decimal places for coordinates |
Implements QgsAbstractGeometryV2.
Definition at line 302 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a WKB representation of the geometry.
binarySize | will be set to the size of the returned WKB string |
Implements QgsAbstractGeometryV2.
Definition at line 257 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a WKT representation of the geometry.
precision | number of decimal places for coordinates |
Implements QgsAbstractGeometryV2.
Definition at line 270 of file qgscircularstringv2.cpp.
|
overridevirtual |
Calculates the minimal bounding box for the geometry.
Derived classes should override this method to return the correct bounding box.
Reimplemented from QgsAbstractGeometryV2.
Definition at line 53 of file qgscircularstringv2.cpp.
|
overridevirtual |
Clears the geometry, ie reset it to a null geometry.
Implements QgsAbstractGeometryV2.
Definition at line 44 of file qgscircularstringv2.cpp.
|
overridevirtual |
Clones the geometry by performing a deep copy.
Implements QgsAbstractGeometryV2.
Definition at line 39 of file qgscircularstringv2.cpp.
|
overridevirtual |
Searches for the closest segment of the geometry to a given point.
pt | Specifies the point for search |
segmentPt | storage for the closest point within the geometry |
vertexAfter | storage for the id of the vertex after the closest segment |
leftOf | returns if the point lies on the left of right side of the segment ( < 0 means left, > 0 means right ) |
epsilon | epsilon for segment snapping |
Implements QgsAbstractGeometryV2.
Definition at line 771 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a new line string geometry corresponding to a segmentized approximation of the curve.
Implements QgsCurveV2.
Definition at line 341 of file qgscircularstringv2.cpp.
|
overridevirtual |
Deletes a vertex within the geometry.
position | vertex id for vertex to delete |
Implements QgsAbstractGeometryV2.
Definition at line 729 of file qgscircularstringv2.cpp.
|
inlineoverridevirtual |
Returns the inherent dimension of the geometry.
For example, this is 0 for a point geometry, 1 for a linestring and 2 for a polygon.
Implements QgsAbstractGeometryV2.
Definition at line 37 of file qgscircularstringv2.h.
|
overridevirtual |
Draws the geometry using the specified QPainter.
p | destination QPainter |
Implements QgsAbstractGeometryV2.
Definition at line 582 of file qgscircularstringv2.cpp.
|
overridevirtual |
Draws the curve as a polygon on the specified QPainter.
p | destination QPainter |
Implements QgsCurveV2.
Definition at line 672 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the end point of the curve.
Implements QgsCurveV2.
Definition at line 332 of file qgscircularstringv2.cpp.
|
overridevirtual |
Sets the geometry from a WKB string.
Implements QgsAbstractGeometryV2.
Definition at line 195 of file qgscircularstringv2.cpp.
|
overridevirtual |
Sets the geometry from a WKT string.
Implements QgsAbstractGeometryV2.
Definition at line 236 of file qgscircularstringv2.cpp.
|
inlineoverridevirtual |
Returns a unique string representing the geometry type.
Implements QgsAbstractGeometryV2.
Definition at line 36 of file qgscircularstringv2.h.
|
inlineoverridevirtual |
Returns true if the geometry contains curved segments.
Reimplemented from QgsAbstractGeometryV2.
Definition at line 121 of file qgscircularstringv2.h.
|
overridevirtual |
Inserts a vertex into the geometry.
position | vertex id for position of inserted vertex |
vertex | vertex to insert |
Implements QgsAbstractGeometryV2.
Definition at line 677 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the length of the geometry.
Reimplemented from QgsAbstractGeometryV2.
Definition at line 312 of file qgscircularstringv2.cpp.
|
overridevirtual |
Moves a vertex within the geometry.
position | vertex id for vertex to move |
newPos | new position of vertex |
Implements QgsAbstractGeometryV2.
Definition at line 708 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the number of points in the curve.
Implements QgsCurveV2.
Definition at line 356 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the point and vertex id of a point within the curve.
Implements QgsCurveV2.
Definition at line 807 of file qgscircularstringv2.cpp.
QgsPointV2 QgsCircularStringV2::pointN | ( | int | i | ) | const |
Returns the point at index i within the circular string.
Definition at line 361 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns a list of points within the curve.
Implements QgsCurveV2.
Definition at line 398 of file qgscircularstringv2.cpp.
void QgsCircularStringV2::setPoints | ( | const QList< QgsPointV2 > & | points | ) |
Sets the circular string's points.
Definition at line 408 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the starting point of the curve.
Implements QgsCurveV2.
Definition at line 323 of file qgscircularstringv2.cpp.
|
overridevirtual |
Calculates the area of the curve.
Derived classes should override this to return the correct area of the curve.
Implements QgsCurveV2.
Definition at line 818 of file qgscircularstringv2.cpp.
|
overridevirtual |
Transforms the geometry using a coordinate transform.
ct | coordinate transform |
d | transformation direction |
Implements QgsAbstractGeometryV2.
Definition at line 589 of file qgscircularstringv2.cpp.
|
overridevirtual |
Transforms the geometry using a QTransform object.
t | QTransform transformation |
Implements QgsAbstractGeometryV2.
Definition at line 610 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns approximate rotation angle for a vertex.
Usually average angle between adjacent segments.
vertex | the vertex id |
Implements QgsAbstractGeometryV2.
Definition at line 957 of file qgscircularstringv2.cpp.
|
overridevirtual |
Returns the size of the WKB representation of the geometry.
Implements QgsAbstractGeometryV2.
Definition at line 250 of file qgscircularstringv2.cpp.