2017-04-27 07:55:22 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/geometry/qgspointv2.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsPointV2: QgsAbstractGeometry
|
2015-05-15 15:41:56 +02:00
|
|
|
{
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Point 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 "qgspointv2.h"
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
public:
|
|
|
|
|
|
|
|
QgsPointV2( double x = 0.0, double y = 0.0 );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a 2 dimensional point with an initial x and y coordinate.
|
|
|
|
\param x x-coordinate of point
|
|
|
|
\param y y-coordinate of point
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
explicit QgsPointV2( const QgsPoint &p );
|
|
|
|
%Docstring
|
|
|
|
Construct a QgsPointV2 from a QgsPoint object
|
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
explicit QgsPointV2( QPointF p );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a QgsPointV2 from a QPointF
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2016-08-04 09:10:08 +02:00
|
|
|
QgsPointV2( QgsWkbTypes::Type type, double x = 0.0, double y = 0.0, double z = 0.0, double m = 0.0 );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a point with a specified type (e.g., PointZ, PointM) and initial x, y, z, and m values.
|
|
|
|
\param type point type
|
|
|
|
\param x x-coordinate of point
|
|
|
|
\param y y-coordinate of point
|
|
|
|
\param z z-coordinate of point, for PointZ or PointZM types
|
|
|
|
\param m m-value of point, for PointM or PointZM types
|
|
|
|
%End
|
2016-01-28 10:30:06 +01:00
|
|
|
%MethodCode
|
2017-04-27 07:55:22 +02:00
|
|
|
if ( QgsWkbTypes::flatType( a0 ) != QgsWkbTypes::Point )
|
|
|
|
{
|
|
|
|
PyErr_SetString( PyExc_ValueError,
|
|
|
|
QString( "%1 is not a valid WKB type for point geometries" ).arg( QgsWkbTypes::displayString( a0 ) ).toUtf8().constData() );
|
|
|
|
sipIsErr = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sipCpp = new sipQgsPointV2( a0, a1, a2, a3, a4 );
|
|
|
|
}
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool operator==( const QgsPointV2 &pt ) const;
|
|
|
|
bool operator!=( const QgsPointV2 &pt ) const;
|
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
double x() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the point's x-coordinate.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setX()
|
|
|
|
.. seealso:: rx()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double y() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the point's y-coordinate.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setY()
|
|
|
|
.. seealso:: ry()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double z() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the point's z-coordinate.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setZ()
|
|
|
|
.. seealso:: rz()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double m() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the point's m value.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setM()
|
|
|
|
.. seealso:: rm()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
void setX( double x );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the point's x-coordinate.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: x()
|
|
|
|
.. seealso:: rx()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
void setY( double y );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the point's y-coordinate.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: y()
|
|
|
|
.. seealso:: ry()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
void setZ( double z );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the point's z-coordinate.
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
calling this will have no effect if the point does not contain a z-dimension. Use addZValue() to
|
|
|
|
add a z value and force the point to have a z dimension.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: z()
|
|
|
|
.. seealso:: rz()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
void setM( double m );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the point's m-value.
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
calling this will have no effect if the point does not contain a m-dimension. Use addMValue() to
|
|
|
|
add a m value and force the point to have an m dimension.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: m()
|
|
|
|
.. seealso:: rm()
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2015-12-15 22:36:49 +11:00
|
|
|
QPointF toQPointF() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the point as a QPointF.
|
|
|
|
.. versionadded:: 2.14
|
|
|
|
:rtype: QPointF
|
|
|
|
%End
|
2015-12-15 22:36:49 +11:00
|
|
|
|
2016-11-05 20:11:15 +10:00
|
|
|
double distance( double x, double y ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the distance between this point and a specified x, y coordinate. In certain
|
|
|
|
cases it may be more appropriate to call the faster distanceSquared() method, e.g.,
|
|
|
|
when comparing distances.
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distanceSquared()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
double distance( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the 2D distance between this point and another point. In certain
|
|
|
|
cases it may be more appropriate to call the faster distanceSquared() method, e.g.,
|
|
|
|
when comparing distances.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2016-11-05 20:11:15 +10:00
|
|
|
|
|
|
|
double distanceSquared( double x, double y ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the squared distance between this point a specified x, y coordinate. Calling
|
|
|
|
this is faster than calling distance(), and may be useful in use cases such as comparing
|
|
|
|
distances where the extra expense of calling distance() is not required.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distance()
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
double distanceSquared( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the squared distance between this point another point. Calling
|
|
|
|
this is faster than calling distance(), and may be useful in use cases such as comparing
|
|
|
|
distances where the extra expense of calling distance() is not required.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distance()
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2016-11-05 20:11:15 +10:00
|
|
|
|
2017-02-10 20:13:10 +01:00
|
|
|
double distance3D( double x, double y, double z ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the 3D distance between this point and a specified x, y, z coordinate. In certain
|
|
|
|
cases it may be more appropriate to call the faster distanceSquared() method, e.g.,
|
|
|
|
when comparing distances.
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distanceSquared()
|
2017-04-27 07:55:22 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
double distance3D( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the 3D distance between this point and another point. In certain
|
|
|
|
cases it may be more appropriate to call the faster distanceSquared() method, e.g.,
|
|
|
|
when comparing distances.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2017-02-10 20:13:10 +01:00
|
|
|
|
|
|
|
double distanceSquared3D( double x, double y, double z ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the 3D squared distance between this point a specified x, y, z coordinate. Calling
|
|
|
|
this is faster than calling distance(), and may be useful in use cases such as comparing
|
|
|
|
distances where the extra expense of calling distance() is not required.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distance()
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
double distanceSquared3D( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the 3D squared distance between this point another point. Calling
|
|
|
|
this is faster than calling distance(), and may be useful in use cases such as comparing
|
|
|
|
distances where the extra expense of calling distance() is not required.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: distance()
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
double azimuth( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Calculates azimuth between this point and other one (clockwise in degree, starting from north)
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2017-02-10 20:13:10 +01:00
|
|
|
|
2017-05-13 09:29:50 +02:00
|
|
|
double inclination( const QgsPointV2 &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Calculates inclination between this point and other one (starting from zenith = 0 to nadir = 180. Horizon = 90)
|
|
|
|
Returns 90.0 if the distance between this point and other one is equal to 0 (same point).
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
2017-01-28 23:29:25 +01:00
|
|
|
QgsPointV2 project( double distance, double azimuth, double inclination = 90.0 ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a new point which correspond to this point projected by a specified distance
|
|
|
|
with specified angles (azimuth and inclination).
|
|
|
|
M value is preserved.
|
|
|
|
\param distance distance to project
|
|
|
|
\param azimuth angle to project in X Y, clockwise in degrees starting from north
|
|
|
|
\param inclination angle to project in Z (3D)
|
|
|
|
:return: The point projected. If a 2D point is projected a 3D point will be returned except if
|
|
|
|
inclination is 90. A 3D point is always returned if a 3D point is projected.
|
|
|
|
Example:
|
|
|
|
\code{.py}
|
|
|
|
p = QgsPointV2( 1, 2 ) # 2D point
|
|
|
|
pr = p.project ( 1, 0 )
|
|
|
|
# pr is a 2D point: 'Point (1 3)'
|
|
|
|
pr = p.project ( 1, 0, 90 )
|
|
|
|
# pr is a 2D point: 'Point (1 3)'
|
|
|
|
pr = p.project (1, 0, 0 )
|
|
|
|
# pr is a 3D point: 'PointZ (1 2 1)'
|
|
|
|
p = QgsPointV2( QgsWkbTypes.PointZ, 1, 2, 2 ) # 3D point
|
|
|
|
pr = p.project ( 1, 0 )
|
|
|
|
# pr is a 3D point: 'PointZ (1 3 2)'
|
|
|
|
pr = p.project ( 1, 0, 90 )
|
|
|
|
# pr is a 3D point: 'PointZ (1 3 2)'
|
|
|
|
pr = p.project (1, 0, 0 )
|
|
|
|
# pr is a 3D point: 'PointZ (1 2 3)'
|
|
|
|
\endcode
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsPointV2
|
|
|
|
%End
|
2017-01-28 23:29:25 +01:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
QgsVector operator-( const QgsPointV2 &p ) const;
|
|
|
|
%Docstring
|
|
|
|
Calculates the vector obtained by subtracting a point from this point.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsVector
|
|
|
|
%End
|
2016-12-08 17:43:33 +10:00
|
|
|
|
|
|
|
QgsPointV2 &operator+=( QgsVector v );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Adds a vector to this point in place.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsPointV2
|
|
|
|
%End
|
2016-12-08 17:43:33 +10:00
|
|
|
|
|
|
|
QgsPointV2 &operator-=( QgsVector v );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Subtracts a vector from this point in place.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsPointV2
|
|
|
|
%End
|
2016-12-08 17:43:33 +10:00
|
|
|
|
|
|
|
QgsPointV2 operator+( QgsVector v ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Adds a vector to this point.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsPointV2
|
|
|
|
%End
|
2016-12-08 17:43:33 +10:00
|
|
|
|
|
|
|
QgsPointV2 operator-( QgsVector v ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
|
|
|
Subtracts a vector from this point.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsPointV2
|
|
|
|
%End
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool isEmpty() const;
|
2016-02-21 16:26:45 +11:00
|
|
|
virtual QgsRectangle boundingBox() const;
|
2015-11-18 16:24:08 +11:00
|
|
|
virtual QString geometryType() const;
|
|
|
|
virtual int dimension() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsPointV2 *clone() const /Factory/;
|
|
|
|
virtual void clear();
|
|
|
|
|
|
|
|
virtual bool fromWkb( QgsConstWkbPtr &wkb );
|
|
|
|
virtual bool fromWkt( const QString &wkt );
|
|
|
|
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;
|
|
|
|
|
|
|
|
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 QgsCoordinateSequence coordinateSequence() const;
|
2016-10-26 17:14:51 +10:00
|
|
|
virtual int nCoordinates() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsAbstractGeometry *boundary() const /Factory/;
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool insertVertex( QgsVertexId position, const QgsPointV2 &vertex );
|
|
|
|
virtual bool moveVertex( QgsVertexId position, const QgsPointV2 &newPos );
|
2016-02-02 19:46:18 +11:00
|
|
|
virtual bool deleteVertex( QgsVertexId position );
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual double closestSegment( const QgsPointV2 &pt, QgsPointV2 &segmentPt /Out/,
|
|
|
|
QgsVertexId &vertexAfter /Out/, bool *leftOf /Out/,
|
|
|
|
double epsilon ) const;
|
|
|
|
virtual bool nextVertex( QgsVertexId &id, QgsPointV2 &vertex /Out/ ) const;
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual double vertexAngle( QgsVertexId vertex ) const;
|
|
|
|
%Docstring
|
|
|
|
Angle undefined. Always returns 0.0
|
|
|
|
\param vertex the vertex id
|
|
|
|
:return: 0.0*
|
|
|
|
:rtype: float
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual int vertexCount( int /*part*/ = 0, int /*ring*/ = 0 ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
virtual int ringCount( int /*part*/ = 0 ) const;
|
2015-11-18 16:24:08 +11:00
|
|
|
virtual int partCount() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual QgsPointV2 vertexAt( QgsVertexId /*id*/ ) const;
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
virtual bool addZValue( double zValue = 0 );
|
|
|
|
virtual bool addMValue( double mValue = 0 );
|
2015-12-01 16:33:44 +11:00
|
|
|
virtual bool dropZValue();
|
|
|
|
virtual bool dropMValue();
|
2016-08-04 09:10:08 +02:00
|
|
|
virtual bool convertTo( QgsWkbTypes::Type type );
|
2015-12-01 16:33:44 +11:00
|
|
|
|
2017-04-27 07:55:22 +02: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/qgspointv2.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|