QGIS/python/core/geometry/qgscurve.sip

194 lines
5.5 KiB
Plaintext
Raw Normal View History

2017-04-27 07:55:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgscurve.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCurve: QgsAbstractGeometry
2015-05-15 15:41:56 +02:00
{
2017-04-27 07:55:22 +02:00
%Docstring
Abstract base class for curved geometry type
.. versionadded:: 2.10
%End
2015-05-15 15:41:56 +02:00
%TypeHeaderCode
2017-04-27 07:55:22 +02:00
#include "qgscurve.h"
2015-05-15 15:41:56 +02:00
%End
2017-04-27 07:55:22 +02:00
public:
2016-08-06 11:01:42 +02:00
QgsCurve();
%Docstring
Constructor for QgsCurve.
%End
2017-04-27 07:55:22 +02:00
virtual bool operator==( const QgsCurve &other ) const = 0;
virtual bool operator!=( const QgsCurve &other ) const = 0;
%Docstring
:rtype: bool
%End
2017-04-27 07:55:22 +02:00
virtual QgsCurve *clone() const = 0 /Factory/;
virtual QgsPoint startPoint() const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the starting point of the curve.
2017-04-30 16:51:18 +02:00
.. seealso:: endPoint
:rtype: QgsPoint
2017-04-27 07:55:22 +02:00
%End
2016-02-14 03:50:23 +01:00
virtual QgsPoint endPoint() const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the end point of the curve.
2017-04-30 16:51:18 +02:00
.. seealso:: startPoint
:rtype: QgsPoint
2017-04-27 07:55:22 +02:00
%End
2016-02-14 03:50:23 +01:00
2015-05-15 15:41:56 +02:00
virtual bool isClosed() const;
2017-04-27 07:55:22 +02:00
%Docstring
Returns true if the curve is closed.
:rtype: bool
%End
2016-02-14 03:50:23 +01:00
2015-05-15 15:41:56 +02:00
virtual bool isRing() const;
2017-04-27 07:55:22 +02:00
%Docstring
Returns true if the curve is a ring.
:rtype: bool
%End
2016-02-14 03:50:23 +01:00
2017-04-27 07:55:22 +02:00
virtual QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const = 0 /Factory/;
%Docstring
Returns a new line string 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*
:rtype: QgsLineString
%End
2015-05-15 15:41:56 +02:00
2017-04-27 07:55:22 +02:00
virtual void addToPainterPath( QPainterPath &path ) const = 0;
%Docstring
Adds a curve to a painter path.
%End
2016-02-14 03:50:23 +01:00
2017-04-27 07:55:22 +02:00
virtual void drawAsPolygon( QPainter &p ) const = 0;
%Docstring
Draws the curve as a polygon on the specified QPainter.
\param p destination QPainter
%End
2016-02-14 03:50:23 +01:00
2017-04-27 07:55:22 +02:00
virtual void points( QgsPointSequence &pt /Out/ ) const = 0;
%Docstring
Returns a list of points within the curve.
%End
2016-02-14 03:50:23 +01:00
2015-05-15 15:41:56 +02:00
virtual int numPoints() const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the number of points in the curve.
:rtype: int
%End
2015-05-15 15:41:56 +02:00
2017-04-27 07:55:22 +02:00
virtual void sumUpArea( double &sum /Out/ ) const = 0;
%Docstring
Sums up the area of the curve by iterating over the vertices (shoelace formula).
%End
2015-05-15 15:41:56 +02:00
2017-04-27 07:55:22 +02:00
virtual QgsCoordinateSequence coordinateSequence() const;
virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex /Out/ ) const;
2017-04-27 07:55:22 +02:00
virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex /Out/, QgsVertexId &nextVertex /Out/ );
virtual bool pointAt( int node, QgsPoint &point /Out/, QgsVertexId::VertexType &type /Out/ ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the point and vertex id of a point within the curve.
\param node node number, where the first node is 0
\param point will be set to point at corresponding node in the curve
\param type will be set to the vertex type of the node
:return: true if node exists within the curve
:rtype: bool
%End
2016-02-14 03:50:23 +01:00
2017-04-27 07:55:22 +02:00
virtual QgsCurve *reversed() const = 0 /Factory/;
%Docstring
Returns a reversed copy of the curve, where the direction of the curve has been flipped.
.. versionadded:: 2.14
:rtype: QgsCurve
%End
2015-05-29 17:59:52 +02:00
2017-04-27 07:55:22 +02:00
virtual QgsAbstractGeometry *boundary() const /Factory/;
2017-04-27 07:55:22 +02:00
virtual QgsCurve *segmentize( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
2017-04-27 07:55:22 +02:00
%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: QgsCurve
%End
virtual int vertexCount( int part = 0, int ring = 0 ) const;
virtual int ringCount( int part = 0 ) const;
virtual int partCount() const;
virtual QgsPoint vertexAt( QgsVertexId id ) const;
virtual QgsCurve *toCurveType() const /Factory/;
virtual QgsRectangle boundingBox() const;
virtual double xAt( int index ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the x-coordinate of the specified node in the line string.
\param index index of node, where the first node in the line is 0
:return: x-coordinate of node, or 0.0 if index is out of bounds
2017-04-30 16:51:18 +02:00
.. seealso:: setXAt()
2017-04-27 07:55:22 +02:00
:rtype: float
%End
virtual double yAt( int index ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
Returns the y-coordinate of the specified node in the line string.
\param index index of node, where the first node in the line is 0
:return: y-coordinate of node, or 0.0 if index is out of bounds
2017-04-30 16:51:18 +02:00
.. seealso:: setYAt()
2017-04-27 07:55:22 +02:00
:rtype: float
%End
QPolygonF asQPolygonF() const;
2017-04-27 07:55:22 +02:00
%Docstring
Returns a QPolygonF representing the points.
:rtype: QPolygonF
%End
protected:
virtual void clearCache() const;
virtual int childCount() const;
virtual QgsPoint childPoint( int index ) const;
2015-05-15 15:41:56 +02:00
};
2017-04-27 07:55:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgscurve.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/