2017-04-27 07:55:22 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/geometry/qgscurvepolygon.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsCurvePolygon: QgsSurface
|
2015-05-15 15:41:56 +02:00
|
|
|
{
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Curve polygon geometry type
|
|
|
|
.. versionadded:: 2.10
|
2015-05-15 15:41:56 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscurvepolygon.h"
|
|
|
|
%End
|
2015-05-15 15:41:56 +02:00
|
|
|
public:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsCurvePolygon();
|
2017-04-27 07:55:22 +02:00
|
|
|
QgsCurvePolygon( const QgsCurvePolygon &p );
|
2017-09-19 14:40:32 +10:00
|
|
|
|
|
|
|
bool operator==( const QgsCurvePolygon &other ) const;
|
|
|
|
bool operator!=( const QgsCurvePolygon &other ) const;
|
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
~QgsCurvePolygon();
|
2015-05-15 15:41:56 +02:00
|
|
|
|
|
|
|
virtual QString geometryType() const;
|
2017-09-19 14:40:32 +10:00
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual int dimension() const;
|
2017-10-27 14:29:31 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsCurvePolygon *clone() const /Factory/;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void clear();
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool fromWkb( QgsConstWkbPtr &wkb );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool fromWkt( const QString &wkt );
|
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QByteArray asWkb() const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QString asWkt( int precision = 17 ) const;
|
|
|
|
|
|
|
|
virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
|
|
|
|
|
|
|
|
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
|
|
|
|
|
|
|
|
virtual QString asJSON( int precision = 17 ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
virtual double area() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-10-17 15:40:36 +11:00
|
|
|
virtual double perimeter() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-10-29 12:08:07 +01:00
|
|
|
virtual QgsPolygon *surfaceToPolygon() const /Factory/;
|
2016-07-27 15:35:00 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsAbstractGeometry *boundary() const /Factory/;
|
2017-10-27 14:29:31 +10:00
|
|
|
|
|
|
|
virtual QgsCurvePolygon *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const /Factory/;
|
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
int numInteriorRings() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: int
|
|
|
|
%End
|
|
|
|
const QgsCurve *exteriorRing() const;
|
|
|
|
%Docstring
|
|
|
|
:rtype: QgsCurve
|
|
|
|
%End
|
|
|
|
const QgsCurve *interiorRing( int i ) const;
|
|
|
|
%Docstring
|
|
|
|
:rtype: QgsCurve
|
|
|
|
%End
|
|
|
|
|
2017-10-29 12:08:07 +01:00
|
|
|
virtual QgsPolygon *toPolygon( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a new polygon geometry corresponding to a segmentized approximation
|
|
|
|
of the curve.
|
|
|
|
\param tolerance segmentation tolerance
|
|
|
|
\param toleranceType maximum segmentation angle or maximum difference between approximation and curve*
|
2017-10-29 12:08:07 +01:00
|
|
|
:rtype: QgsPolygon
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void setExteriorRing( QgsCurve *ring /Transfer/ );
|
|
|
|
%Docstring
|
|
|
|
Sets the exterior ring of the polygon. The CurvePolygon type will be updated to match the dimensionality
|
|
|
|
of the exterior ring. For instance, setting a 2D exterior ring on a 3D CurvePolygon will drop the z dimension
|
|
|
|
from the CurvePolygon and all interior rings.
|
|
|
|
\param ring new exterior ring. Ownership is transferred to the CurvePolygon.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setInteriorRings()
|
|
|
|
.. seealso:: exteriorRing()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setInteriorRings( const QList<QgsCurve *> &rings /Transfer/ );
|
|
|
|
%Docstring
|
|
|
|
Sets all interior rings (takes ownership)
|
|
|
|
%End
|
|
|
|
virtual void addInteriorRing( QgsCurve *ring /Transfer/ );
|
|
|
|
%Docstring
|
|
|
|
Adds an interior ring to the geometry (takes ownership)
|
|
|
|
%End
|
|
|
|
|
2016-11-29 08:43:23 +10:00
|
|
|
bool removeInteriorRing( int ringIndex );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Removes an interior ring from the polygon. The first interior ring has index 0.
|
|
|
|
The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed
|
|
|
|
the function will return true. It is not possible to remove the exterior ring using this method.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: removeInteriorRings()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: bool
|
|
|
|
%End
|
2016-11-29 08:43:23 +10:00
|
|
|
|
|
|
|
void removeInteriorRings( double minimumAllowedArea = -1 );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Removes the interior rings from the polygon. If the minimumAllowedArea
|
|
|
|
parameter is specified then only rings smaller than this minimum
|
|
|
|
area will be removed.
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: removeInteriorRing()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2016-11-28 12:08:21 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void draw( QPainter &p ) const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
|
2016-06-29 09:22:23 +10:00
|
|
|
bool transformZ = false );
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void transform( const QTransform &t );
|
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual bool moveVertex( QgsVertexId position, const QgsPoint &newPos );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
virtual bool deleteVertex( QgsVertexId position );
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsCoordinateSequence coordinateSequence() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2016-10-26 17:14:51 +10:00
|
|
|
virtual int nCoordinates() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-10-22 16:41:58 +10:00
|
|
|
virtual int vertexNumberFromVertexId( QgsVertexId id ) const;
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool isEmpty() const;
|
|
|
|
|
2017-09-19 14:08:36 +10:00
|
|
|
virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt /Out/, QgsVertexId &vertexAfter /Out/, bool *leftOf /Out/ = 0, double epsilon = 4 * DBL_EPSILON ) const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex /Out/ ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-10-13 12:17:30 +10:00
|
|
|
virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex /Out/, QgsVertexId &nextVertex /Out/ ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
|
|
|
|
virtual bool hasCurvedSegments() const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual QgsAbstractGeometry *segmentize( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
|
|
|
|
|
|
|
|
%Docstring
|
|
|
|
Returns a geometry without curves. Caller takes ownership
|
|
|
|
\param tolerance segmentation tolerance
|
|
|
|
\param toleranceType maximum segmentation angle or maximum difference between approximation and curve*
|
|
|
|
:rtype: QgsAbstractGeometry
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual double vertexAngle( QgsVertexId vertex ) const;
|
|
|
|
|
|
|
|
%Docstring
|
|
|
|
Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
|
|
|
|
\param vertex the vertex id
|
|
|
|
:return: rotation in radians, clockwise from north
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-09-09 17:45:31 +02:00
|
|
|
|
2017-09-19 14:40:32 +10:00
|
|
|
virtual int vertexCount( int part = 0, int ring = 0 ) const;
|
|
|
|
|
|
|
|
virtual int ringCount( int part = 0 ) const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-09-09 17:45:31 +02:00
|
|
|
virtual int partCount() const;
|
2017-09-19 14:40:32 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint vertexAt( QgsVertexId id ) const;
|
2015-10-14 08:21:54 +11:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-10-14 08:21:54 +11:00
|
|
|
virtual bool addZValue( double zValue = 0 );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-10-14 08:21:54 +11:00
|
|
|
virtual bool addMValue( double mValue = 0 );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-12-01 16:33:44 +11:00
|
|
|
virtual bool dropZValue();
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-12-01 16:33:44 +11:00
|
|
|
virtual bool dropMValue();
|
2016-02-21 16:26:45 +11:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
|
|
|
virtual QgsCurvePolygon *toCurveType() const /Factory/;
|
|
|
|
|
2017-05-07 15:38:42 +08:00
|
|
|
protected:
|
2017-10-27 14:29:31 +10:00
|
|
|
virtual QgsCurvePolygon *createEmptyWithSameType() const /Factory/;
|
|
|
|
|
2017-05-07 15:38:42 +08:00
|
|
|
virtual int childCount() const;
|
2017-10-27 14:29:31 +10:00
|
|
|
|
2017-05-07 15:38:42 +08:00
|
|
|
virtual QgsAbstractGeometry *childGeometry( int index ) const;
|
|
|
|
|
2017-10-27 14:29:31 +10:00
|
|
|
|
2016-02-21 16:26:45 +11:00
|
|
|
protected:
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2016-02-21 16:26:45 +11:00
|
|
|
virtual QgsRectangle calculateBoundingBox() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
};
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-09-25 14:20:39 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/geometry/qgscurvepolygon.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|