2017-04-27 07:55:22 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/geometry/qgslinestring.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsLineString: QgsCurve
|
2015-05-15 15:41:56 +02:00
|
|
|
{
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Line string geometry type, with support for z-dimension and m-values.
|
|
|
|
.. versionadded:: 2.10
|
2015-05-15 15:41:56 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslinestring.h"
|
|
|
|
%End
|
2015-05-15 15:41:56 +02:00
|
|
|
public:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsLineString();
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-06-08 21:56:21 +02:00
|
|
|
QgsLineString( const QVector<QgsPoint> &points );
|
|
|
|
%Docstring
|
|
|
|
Construct a linestring from a vector of points.
|
2017-06-23 17:52:09 +02:00
|
|
|
Z and M type will be set based on the type of the first point
|
|
|
|
in the vector.
|
2017-06-08 21:56:21 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-03-25 20:18:11 +10:00
|
|
|
QgsLineString( const QVector<double> &x, const QVector<double> &y,
|
|
|
|
const QVector<double> &z = QVector<double>(),
|
|
|
|
const QVector<double> &m = QVector<double>() );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a linestring from arrays of coordinates. If the z or m
|
|
|
|
arrays are non-empty then the resultant linestring will have
|
|
|
|
z and m types accordingly.
|
|
|
|
This constructor is more efficient then calling setPoints()
|
|
|
|
or repeatedly calling addVertex()
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsLineString( const QList<QgsPointXY> &points );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a linestring from list of points.
|
|
|
|
This constructor is more efficient then calling setPoints()
|
|
|
|
or repeatedly calling addVertex()
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool operator==( const QgsCurve &other ) const;
|
|
|
|
|
|
|
|
virtual bool operator!=( const QgsCurve &other ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2015-12-11 17:47:03 +11:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint pointN( int i ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the specified point from inside the line string.
|
|
|
|
\param i index of point, starting at 0 for the first point
|
2017-06-01 12:18:43 +02:00
|
|
|
:rtype: QgsPoint
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual double xAt( int index ) const;
|
|
|
|
|
|
|
|
virtual double yAt( int index ) const;
|
|
|
|
|
2015-11-18 16:24:27 +11:00
|
|
|
|
2015-11-18 21:48:07 +11:00
|
|
|
double zAt( int index ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the z-coordinate of the specified node in the line string.
|
|
|
|
\param index index of node, where the first node in the line is 0
|
2017-06-26 00:39:40 +02:00
|
|
|
:return: z-coordinate of node, or ``nan`` if index is out of bounds or the line
|
2017-04-27 07:55:22 +02:00
|
|
|
does not have a z dimension
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setZAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
|
|
|
double mAt( int index ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the m value of the specified node in the line string.
|
|
|
|
\param index index of node, where the first node in the line is 0
|
2017-06-26 00:39:40 +02:00
|
|
|
:return: m value of node, or ``nan`` if index is out of bounds or the line
|
2017-04-27 07:55:22 +02:00
|
|
|
does not have m values
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setMAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
|
|
|
void setXAt( int index, double x );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets 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. Corresponding
|
|
|
|
node must already exist in line string.
|
|
|
|
\param x x-coordinate of node
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: xAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
|
|
|
void setYAt( int index, double y );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets 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. Corresponding
|
|
|
|
node must already exist in line string.
|
|
|
|
\param y y-coordinate of node
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: yAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
|
|
|
void setZAt( int index, double z );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the z-coordinate of the specified node in the line string.
|
|
|
|
\param index index of node, where the first node in the line is 0. Corresponding
|
|
|
|
node must already exist in line string, and the line string must have z-dimension.
|
|
|
|
\param z z-coordinate of node
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: zAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
|
|
|
void setMAt( int index, double m );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the m value of the specified node in the line string.
|
|
|
|
\param index index of node, where the first node in the line is 0. Corresponding
|
|
|
|
node must already exist in line string, and the line string must have m values.
|
|
|
|
\param m m value of node
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: mAt()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
void setPoints( const QgsPointSequence &points );
|
|
|
|
%Docstring
|
|
|
|
Resets the line string to match the specified list of points. The line string will
|
|
|
|
inherit the dimensionality of the first point in the list.
|
|
|
|
\param points new points for line string. If empty, line string will be cleared.
|
|
|
|
%End
|
2015-11-18 16:24:27 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
void append( const QgsLineString *line );
|
|
|
|
%Docstring
|
|
|
|
Appends the contents of another line string to the end of this line string.
|
|
|
|
\param line line to append. Ownership is not transferred.
|
|
|
|
%End
|
2015-11-18 16:24:27 +11:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
void addVertex( const QgsPoint &pt );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Adds a new vertex to the end of the line string.
|
|
|
|
\param pt vertex to add
|
|
|
|
%End
|
2015-11-18 16:24:27 +11:00
|
|
|
|
|
|
|
void close();
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Closes the line string by appending the first point to the end of the line, if it is not already closed.
|
|
|
|
%End
|
|
|
|
|
2017-09-18 14:31:19 +10:00
|
|
|
virtual QgsCompoundCurve *toCurveType() const /Factory/;
|
2015-11-18 16:24:27 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the geometry converted to the more generic curve type QgsCompoundCurve
|
|
|
|
:return: the converted geometry. Caller takes ownership*
|
2017-09-18 14:31:19 +10:00
|
|
|
:rtype: QgsCompoundCurve
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2016-04-29 11:53:34 +02:00
|
|
|
|
2016-10-29 22:06:28 +10:00
|
|
|
void extend( double startDistance, double endDistance );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Extends the line geometry by extrapolating out the start or end of the line
|
|
|
|
by a specified distance. Lines are extended using the bearing of the first or last
|
|
|
|
segment in the line.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2016-10-29 22:06:28 +10:00
|
|
|
|
2015-11-18 16:24:27 +11:00
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual QString geometryType() const;
|
|
|
|
virtual int dimension() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsLineString *clone() const /Factory/;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
virtual void clear();
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool isEmpty() const;
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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 length() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint startPoint() const;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint endPoint() const;
|
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 QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%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
|
|
|
|
|
|
|
|
virtual int numPoints() const;
|
|
|
|
|
2016-10-26 17:14:51 +10:00
|
|
|
virtual int nCoordinates() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void points( QgsPointSequence &pt /Out/ ) const;
|
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void draw( QPainter &p ) const;
|
|
|
|
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
|
|
|
|
|
|
|
virtual void addToPainterPath( QPainterPath &path ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void drawAsPolygon( QPainter &p ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-04-27 07:55:22 +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 QgsLineString *reversed() const /Factory/;
|
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
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-06-01 12:18:43 +02:00
|
|
|
virtual bool pointAt( int node, QgsPoint &point, QgsVertexId::VertexType &type ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint centroid() const;
|
2015-11-26 16:56:30 +11:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual void sumUpArea( double &sum /Out/ ) const;
|
|
|
|
|
|
|
|
virtual double vertexAngle( QgsVertexId vertex ) const;
|
|
|
|
|
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 );
|
2015-11-18 16:24:27 +11:00
|
|
|
|
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();
|
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2016-08-04 09:10:08 +02:00
|
|
|
virtual bool convertTo( QgsWkbTypes::Type type );
|
2015-12-11 18:37:52 +11:00
|
|
|
|
2016-08-21 18:21:01 +02:00
|
|
|
|
2016-02-21 16:26:45 +11:00
|
|
|
protected:
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/geometry/qgslinestring.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|