QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
QgsCurvePolygonV2 Class Reference

Curve polygon geometry type. More...

#include <qgscurvepolygonv2.h>

Inheritance diagram for QgsCurvePolygonV2:
Inheritance graph
[legend]

Public Member Functions

 QgsCurvePolygonV2 ()
 
 QgsCurvePolygonV2 (const QgsCurvePolygonV2 &p)
 
 ~QgsCurvePolygonV2 ()
 
void addInteriorRing (QgsCurveV2 *ring)
 Adds an interior ring to the geometry (takes ownership) More...
 
virtual double area () const override
 Returns the area of the geometry. 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...
 
QgsPointV2 centroid () const override
 
void clear () override
 Clears the geometry, ie reset it to a null geometry. More...
 
virtual QgsAbstractGeometryV2clone () 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 void coordinateSequence (QList< QList< QList< QgsPointV2 > > > &coord) const override
 Retrieves the sequence of geometries, rings and nodes. 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...
 
virtual void draw (QPainter &p) const override
 Draws the geometry using the specified QPainter. More...
 
const QgsCurveV2exteriorRing () const
 
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...
 
const QgsCurveV2interiorRing (int i) const
 
virtual double length () const override
 Returns the length (or perimeter for area geometries) of the geometry. More...
 
virtual bool moveVertex (const QgsVertexId &position, const QgsPointV2 &newPos) override
 Moves a vertex within the geometry. More...
 
bool nextVertex (QgsVertexId &id, QgsPointV2 &vertex) const override
 Returns next vertex id and coordinates. More...
 
int numInteriorRings () const
 
QgsCurvePolygonV2operator= (const QgsCurvePolygonV2 &p)
 
QgsPointV2 pointOnSurface () const override
 
bool removeInteriorRing (int nr)
 Removes ring. More...
 
QgsAbstractGeometryV2segmentize () const override
 Returns a version of the geometry without curves. More...
 
void setExteriorRing (QgsCurveV2 *ring)
 Sets exterior ring (takes ownership) More...
 
void setInteriorRings (QList< QgsCurveV2 * > rings)
 Sets all interior rings (takes ownership) More...
 
QgsPolygonV2surfaceToPolygon () const override
 
virtual QgsPolygonV2toPolygon () const
 
void transform (const QgsCoordinateTransform &ct) override
 Transforms the geometry using a coordinate transform. More...
 
void transform (const QTransform &t) override
 Transforms the geometry using a QTransform object. More...
 
int wkbSize () const override
 Returns the size of the WKB representation of the geometry. More...
 
- Public Member Functions inherited from QgsAbstractGeometryV2
 QgsAbstractGeometryV2 ()
 
 QgsAbstractGeometryV2 (const QgsAbstractGeometryV2 &geom)
 
virtual ~QgsAbstractGeometryV2 ()
 
QgsRectangle boundingBox () const
 Returns the minimal bounding box for 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 QgsAbstractGeometryV2operator= (const QgsAbstractGeometryV2 &geom)
 
QgsPointV2 vertexAt (const QgsVertexId &id) const
 Returns the point corresponding to a specified vertex id. 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...
 

Protected Attributes

QgsCurveV2mExteriorRing
 
QList< QgsCurveV2 * > mInteriorRings
 
- Protected Attributes inherited from QgsAbstractGeometryV2
QgsRectangle mBoundingBox
 
QgsWKBTypes::Type mWkbType
 

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...
 

Detailed Description

Curve polygon geometry type.

Note
added in QGIS 2.10
this API is not considered stable and may change for 2.12

Definition at line 31 of file qgscurvepolygonv2.h.

Constructor & Destructor Documentation

QgsCurvePolygonV2::QgsCurvePolygonV2 ( )

Definition at line 29 of file qgscurvepolygonv2.cpp.

QgsCurvePolygonV2::QgsCurvePolygonV2 ( const QgsCurvePolygonV2 p)

Definition at line 39 of file qgscurvepolygonv2.cpp.

QgsCurvePolygonV2::~QgsCurvePolygonV2 ( )

Definition at line 34 of file qgscurvepolygonv2.cpp.

Member Function Documentation

void QgsCurvePolygonV2::addInteriorRing ( QgsCurveV2 ring)

Adds an interior ring to the geometry (takes ownership)

Definition at line 439 of file qgscurvepolygonv2.cpp.

double QgsCurvePolygonV2::area ( ) const
overridevirtual

Returns the area of the geometry.

See Also
length

Reimplemented from QgsAbstractGeometryV2.

Definition at line 323 of file qgscurvepolygonv2.cpp.

QDomElement QgsCurvePolygonV2::asGML2 ( QDomDocument doc,
int  precision = 17,
const QString ns = "gml" 
) const
overridevirtual

Returns a GML2 representation of the geometry.

Parameters
docDOM document
precisionnumber of decimal places for coordinates
nsXML namespace
See Also
asWkb
asWkt
asGML3
asJSON

Implements QgsAbstractGeometryV2.

Definition at line 261 of file qgscurvepolygonv2.cpp.

QDomElement QgsCurvePolygonV2::asGML3 ( QDomDocument doc,
int  precision = 17,
const QString ns = "gml" 
) const
overridevirtual

Returns a GML3 representation of the geometry.

Parameters
docDOM document
precisionnumber of decimal places for coordinates
nsXML namespace
See Also
asWkb
asWkt
asGML2
asJSON

Implements QgsAbstractGeometryV2.

Definition at line 281 of file qgscurvepolygonv2.cpp.

QString QgsCurvePolygonV2::asJSON ( int  precision = 17) const
overridevirtual

Returns a GeoJSON representation of the geometry.

Parameters
precisionnumber of decimal places for coordinates
See Also
asWkb
asWkt
asGML2
asGML3

Implements QgsAbstractGeometryV2.

Definition at line 296 of file qgscurvepolygonv2.cpp.

unsigned char * QgsCurvePolygonV2::asWkb ( int &  binarySize) const
overridevirtual

Returns a WKB representation of the geometry.

Parameters
binarySizewill be set to the size of the returned WKB string
See Also
wkbSize
asWkt
asGML2
asGML3
asJSON

Implements QgsAbstractGeometryV2.

Reimplemented in QgsPolygonV2.

Definition at line 205 of file qgscurvepolygonv2.cpp.

QString QgsCurvePolygonV2::asWkt ( int  precision = 17) const
overridevirtual

Returns a WKT representation of the geometry.

Parameters
precisionnumber of decimal places for coordinates
See Also
asWkb
asGML2
asGML3
asJSON

Implements QgsAbstractGeometryV2.

Definition at line 230 of file qgscurvepolygonv2.cpp.

QgsRectangle QgsCurvePolygonV2::calculateBoundingBox ( ) const
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 182 of file qgscurvepolygonv2.cpp.

QgsPointV2 QgsCurvePolygonV2::centroid ( ) const
overridevirtual

Implements QgsSurfaceV2.

Definition at line 351 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::clear ( )
overridevirtual

Clears the geometry, ie reset it to a null geometry.

Implements QgsAbstractGeometryV2.

Definition at line 75 of file qgscurvepolygonv2.cpp.

QgsAbstractGeometryV2 * QgsCurvePolygonV2::clone ( ) const
overridevirtual

Clones the geometry by performing a deep copy.

Implements QgsAbstractGeometryV2.

Reimplemented in QgsPolygonV2.

Definition at line 70 of file qgscurvepolygonv2.cpp.

double QgsCurvePolygonV2::closestSegment ( const QgsPointV2 pt,
QgsPointV2 segmentPt,
QgsVertexId vertexAfter,
bool *  leftOf,
double  epsilon 
) const
overridevirtual

Searches for the closest segment of the geometry to a given point.

Parameters
ptSpecifies the point for search
segmentPtstorage for the closest point within the geometry
vertexAfterstorage for the id of the vertex after the closest segment
leftOfreturns if the point lies on the left of right side of the segment ( < 0 means left, > 0 means right )
epsilonepsilon for segment snapping
Returns
squared distance to closest segment

Implements QgsAbstractGeometryV2.

Definition at line 526 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::coordinateSequence ( QList< QList< QList< QgsPointV2 > > > &  coord) const
overridevirtual

Retrieves the sequence of geometries, rings and nodes.

Parameters
coorddestination for coordinate sequence.

Implements QgsAbstractGeometryV2.

Definition at line 505 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::deleteVertex ( const QgsVertexId position)
overridevirtual

Deletes a vertex within the geometry.

Parameters
positionvertex id for vertex to delete
Returns
true if delete was successful
See Also
insertVertex
moveVertex

Implements QgsAbstractGeometryV2.

Definition at line 614 of file qgscurvepolygonv2.cpp.

virtual int QgsCurvePolygonV2::dimension ( ) const
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 40 of file qgscurvepolygonv2.h.

void QgsCurvePolygonV2::draw ( QPainter p) const
overridevirtual

Draws the geometry using the specified QPainter.

Parameters
pdestination QPainter

Implements QgsAbstractGeometryV2.

Definition at line 454 of file qgscurvepolygonv2.cpp.

const QgsCurveV2 * QgsCurvePolygonV2::exteriorRing ( ) const

Definition at line 399 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::fromWkb ( const unsigned char *  wkb)
overridevirtual

Sets the geometry from a WKB string.

See Also
fromWkt

Implements QgsAbstractGeometryV2.

Reimplemented in QgsPolygonV2.

Definition at line 85 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::fromWkt ( const QString wkt)
overridevirtual

Sets the geometry from a WKT string.

See Also
fromWkb

Implements QgsAbstractGeometryV2.

Definition at line 144 of file qgscurvepolygonv2.cpp.

virtual QString QgsCurvePolygonV2::geometryType ( ) const
inlineoverridevirtual

Returns a unique string representing the geometry type.

See Also
wkbType
wktTypeStr

Implements QgsAbstractGeometryV2.

Reimplemented in QgsPolygonV2.

Definition at line 39 of file qgscurvepolygonv2.h.

bool QgsCurvePolygonV2::hasCurvedSegments ( ) const
overridevirtual

Returns true if the geometry contains curved segments.

Reimplemented from QgsAbstractGeometryV2.

Definition at line 640 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::insertVertex ( const QgsVertexId position,
const QgsPointV2 vertex 
)
overridevirtual

Inserts a vertex into the geometry.

Parameters
positionvertex id for position of inserted vertex
vertexvertex to insert
Returns
true if insert was successful
See Also
moveVertex
deleteVertex

Implements QgsAbstractGeometryV2.

Definition at line 573 of file qgscurvepolygonv2.cpp.

const QgsCurveV2 * QgsCurvePolygonV2::interiorRing ( int  i) const

Definition at line 404 of file qgscurvepolygonv2.cpp.

double QgsCurvePolygonV2::length ( ) const
overridevirtual

Returns the length (or perimeter for area geometries) of the geometry.

See Also
area

Reimplemented from QgsAbstractGeometryV2.

Definition at line 339 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::moveVertex ( const QgsVertexId position,
const QgsPointV2 newPos 
)
overridevirtual

Moves a vertex within the geometry.

Parameters
positionvertex id for vertex to move
newPosnew position of vertex
Returns
true if move was successful
See Also
insertVertex
deleteVertex

Implements QgsAbstractGeometryV2.

Definition at line 592 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::nextVertex ( QgsVertexId id,
QgsPointV2 vertex 
) const
overridevirtual

Returns next vertex id and coordinates.

Parameters
idinitial value should be the starting vertex id. The next vertex id will be stored in this variable if found.
vertexcontainer for found node
Returns
false if at end

Implements QgsAbstractGeometryV2.

Definition at line 538 of file qgscurvepolygonv2.cpp.

int QgsCurvePolygonV2::numInteriorRings ( ) const

Definition at line 394 of file qgscurvepolygonv2.cpp.

QgsCurvePolygonV2 & QgsCurvePolygonV2::operator= ( const QgsCurvePolygonV2 p)

Definition at line 52 of file qgscurvepolygonv2.cpp.

QgsPointV2 QgsCurvePolygonV2::pointOnSurface ( ) const
overridevirtual

Implements QgsSurfaceV2.

Definition at line 356 of file qgscurvepolygonv2.cpp.

bool QgsCurvePolygonV2::removeInteriorRing ( int  nr)

Removes ring.

Exterior ring is 0, first interior ring 1, ...

Definition at line 444 of file qgscurvepolygonv2.cpp.

QgsAbstractGeometryV2 * QgsCurvePolygonV2::segmentize ( ) const
overridevirtual

Returns a version of the geometry without curves.

Caller takes ownership of the returned geometry.

Reimplemented from QgsAbstractGeometryV2.

Definition at line 658 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::setExteriorRing ( QgsCurveV2 ring)

Sets exterior ring (takes ownership)

Definition at line 413 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::setInteriorRings ( QList< QgsCurveV2 * >  rings)

Sets all interior rings (takes ownership)

Definition at line 433 of file qgscurvepolygonv2.cpp.

QgsPolygonV2 * QgsCurvePolygonV2::surfaceToPolygon ( ) const
overridevirtual

Implements QgsSurfaceV2.

Reimplemented in QgsPolygonV2.

Definition at line 361 of file qgscurvepolygonv2.cpp.

QgsPolygonV2 * QgsCurvePolygonV2::toPolygon ( ) const
virtual

Definition at line 374 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::transform ( const QgsCoordinateTransform ct)
overridevirtual

Transforms the geometry using a coordinate transform.

Parameters
ctcoordinate transform

Implements QgsAbstractGeometryV2.

Definition at line 477 of file qgscurvepolygonv2.cpp.

void QgsCurvePolygonV2::transform ( const QTransform t)
overridevirtual

Transforms the geometry using a QTransform object.

Parameters
tQTransform transformation

Implements QgsAbstractGeometryV2.

Definition at line 491 of file qgscurvepolygonv2.cpp.

int QgsCurvePolygonV2::wkbSize ( ) const
overridevirtual

Returns the size of the WKB representation of the geometry.

See Also
asWkb

Implements QgsAbstractGeometryV2.

Reimplemented in QgsPolygonV2.

Definition at line 191 of file qgscurvepolygonv2.cpp.

Member Data Documentation

QgsCurveV2* QgsCurvePolygonV2::mExteriorRing
protected

Definition at line 95 of file qgscurvepolygonv2.h.

QList<QgsCurveV2*> QgsCurvePolygonV2::mInteriorRings
protected

Definition at line 96 of file qgscurvepolygonv2.h.


The documentation for this class was generated from the following files: