2017-04-27 07:55:22 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-06-03 10:52:28 +02:00
|
|
|
* src/core/geometry/qgspoint.h *
|
2017-04-27 07:55:22 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
class QgsPoint: 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.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:37:48 +02:00
|
|
|
.. versionadded:: 3.0
|
2015-05-15 15:41:56 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-02 18:17:43 +02:00
|
|
|
#include "qgspoint.h"
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
public:
|
|
|
|
|
More intuitive QgsPoint python constructors
In python, the wkb type of a QgsPoint will by default be determined from
the provided parameters, where Z and M will be added as required if the
wkbType is Undefined.
QgsPoint(x, y, z=nan, m=nan, wkbType=QgsWkbTypes.Undefined)
Thanks to the python API support of named parameters, it's also
straightforward to specify z, m and wkbType in any desired combination.
On the other hand, on C++ side it's often preferable to use
QgsPoint(QgsWkbTypes::WkbType wkbType, double x, double y, double z, double m);
due to the lack of named parameters which make it harder to specify a
specific type and the advantage of typesafety that makes it possible to
verload the first constructor with this one.
2017-06-08 23:50:19 +02:00
|
|
|
QgsPoint( double x = 0.0, double y = 0.0, SIP_PYOBJECT z = Py_None, SIP_PYOBJECT m = Py_None, QgsWkbTypes::Type wkbType = QgsWkbTypes::Unknown ) [( double x = 0.0, double y = 0.0, double z = 0.0, double m = 0.0, QgsWkbTypes::Type wkbType = QgsWkbTypes::Unknown )];
|
2017-06-08 11:41:35 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Construct a point with the provided initial coordinate values.
|
2017-06-08 10:20:21 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
If ``wkbType`` is set to `QgsWkbTypes.Point`, `QgsWkbTypes.PointZ`, `QgsWkbTypes.PointM` or `QgsWkbTypes.PointZM`
|
|
|
|
the type will be set accordingly. If it is left to the default `QgsWkbTypes.Unknown`, the type will be set
|
|
|
|
based on the following rules:
|
|
|
|
- If only x and y are specified, the type will be a 2D point.
|
|
|
|
- If any or both of the Z and M are specified, the appropriate type will be created.
|
More intuitive QgsPoint python constructors
In python, the wkb type of a QgsPoint will by default be determined from
the provided parameters, where Z and M will be added as required if the
wkbType is Undefined.
QgsPoint(x, y, z=nan, m=nan, wkbType=QgsWkbTypes.Undefined)
Thanks to the python API support of named parameters, it's also
straightforward to specify z, m and wkbType in any desired combination.
On the other hand, on C++ side it's often preferable to use
QgsPoint(QgsWkbTypes::WkbType wkbType, double x, double y, double z, double m);
due to the lack of named parameters which make it harder to specify a
specific type and the advantage of typesafety that makes it possible to
verload the first constructor with this one.
2017-06-08 23:50:19 +02:00
|
|
|
|
2017-12-19 16:36:51 -04:00
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
pt = QgsPoint(43.4, 5.3)
|
|
|
|
pt.asWkt() # Point(43.4 5.3)
|
|
|
|
|
|
|
|
pt_z = QgsPoint(120, 343, 77)
|
|
|
|
pt.asWkt() # PointZ(120 343 77)
|
2017-12-19 21:09:15 -04:00
|
|
|
|
2017-12-19 16:36:51 -04:00
|
|
|
pt_m = QgsPoint(33, 88, m=5)
|
|
|
|
pt_m.m() # 5
|
|
|
|
pt_m.wkbType() # QgsWkbTypes.PointM
|
2017-12-19 21:09:15 -04:00
|
|
|
|
2017-12-19 16:36:51 -04:00
|
|
|
pt = QgsPoint(30, 40, wkbType=QgsWkbTypes.PointZ)
|
|
|
|
pt.z() # nan
|
|
|
|
pt.wkbType() # QgsWkbTypes.PointZ
|
2017-06-08 10:20:21 +02:00
|
|
|
%End
|
|
|
|
%MethodCode
|
|
|
|
double z;
|
|
|
|
double m;
|
|
|
|
|
|
|
|
if ( a2 == Py_None )
|
|
|
|
{
|
|
|
|
z = std::numeric_limits<double>::quiet_NaN();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
z = PyFloat_AsDouble( a2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( a3 == Py_None )
|
|
|
|
{
|
|
|
|
m = std::numeric_limits<double>::quiet_NaN();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m = PyFloat_AsDouble( a3 );
|
|
|
|
}
|
|
|
|
|
More intuitive QgsPoint python constructors
In python, the wkb type of a QgsPoint will by default be determined from
the provided parameters, where Z and M will be added as required if the
wkbType is Undefined.
QgsPoint(x, y, z=nan, m=nan, wkbType=QgsWkbTypes.Undefined)
Thanks to the python API support of named parameters, it's also
straightforward to specify z, m and wkbType in any desired combination.
On the other hand, on C++ side it's often preferable to use
QgsPoint(QgsWkbTypes::WkbType wkbType, double x, double y, double z, double m);
due to the lack of named parameters which make it harder to specify a
specific type and the advantage of typesafety that makes it possible to
verload the first constructor with this one.
2017-06-08 23:50:19 +02:00
|
|
|
sipCpp = new sipQgsPoint( a0, a1, z, m, a4 );
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
explicit QgsPoint( const QgsPointXY &p );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Construct a QgsPoint from a QgsPointXY object
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 21:48:07 +11:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
explicit QgsPoint( QPointF p );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Construct a QgsPoint from a QPointF
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2018-01-04 15:45:00 +10:00
|
|
|
virtual bool operator==( const QgsAbstractGeometry &other ) const;
|
|
|
|
|
|
|
|
virtual bool operator!=( const QgsAbstractGeometry &other ) const;
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
double x() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the point's x-coordinate.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setX`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`rx`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double y() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the point's y-coordinate.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setY`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`ry`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double z() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the point's z-coordinate.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setZ`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`rz`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
double m() const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the point's m value.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setM`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`rm`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
void setX( double x );
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the point's x-coordinate.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: x
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`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
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the point's y-coordinate.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: y
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`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
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the point's z-coordinate.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
calling this will have no effect if the point does not contain a z-dimension. Use addZValue() to
|
2018-01-12 20:51:17 -04:00
|
|
|
add a z value and force the point to have a z dimension.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: z
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`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
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the point's m-value.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
calling this will have no effect if the point does not contain a m-dimension. Use addMValue() to
|
2018-01-12 20:51:17 -04:00
|
|
|
add a m value and force the point to have an m dimension.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: m
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`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
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the point as a QPointF.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 2.14
|
|
|
|
%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
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distanceSquared`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double distance( const QgsPoint &other ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%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
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distance`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double distanceSquared( const QgsPoint &other ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distance`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%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
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distanceSquared`
|
2017-04-27 07:55:22 +02:00
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double distance3D( const QgsPoint &other ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%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
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distance`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double distanceSquared3D( const QgsPoint &other ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`distance`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double azimuth( const QgsPoint &other ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates azimuth between this point and other one (clockwise in degree, starting from north)
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-02-10 20:13:10 +01:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
double inclination( const QgsPoint &other ) const;
|
2017-05-13 09:29:50 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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).
|
|
|
|
|
2017-05-13 09:29:50 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint project( double distance, double azimuth, double inclination = 90.0 ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a new point which correspond to this point projected by a specified distance
|
|
|
|
with specified angles (azimuth and inclination).
|
|
|
|
M value is preserved.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
: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). If the point is 2D, the Z value is assumed to be 0.
|
|
|
|
|
|
|
|
: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:
|
2017-12-19 16:36:51 -04:00
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
p = QgsPoint( 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 = QgsPoint( 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)'
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-01-28 23:29:25 +01:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsVector operator-( const QgsPoint &p ) const;
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint &operator+=( QgsVector v );
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint &operator-=( QgsVector v );
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint operator+( QgsVector v ) const;
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
QgsPoint operator-( QgsVector v ) const;
|
2016-12-08 17:43:33 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual bool isEmpty() const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2016-02-21 16:26:45 +11:00
|
|
|
virtual QgsRectangle boundingBox() const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
virtual QString geometryType() const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
virtual int dimension() const;
|
2017-10-27 14:29:31 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint *clone() const /Factory/;
|
2017-10-27 14:29:31 +10:00
|
|
|
|
|
|
|
virtual QgsPoint *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const /Factory/;
|
2017-12-03 14:54:53 +10:00
|
|
|
|
|
|
|
virtual bool removeDuplicateNodes( double epsilon = 4 * DBL_EPSILON, bool useZValues = false );
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
virtual QString asWkt( int precision = 17 ) const;
|
|
|
|
|
2017-11-15 14:43:39 +10:00
|
|
|
virtual QDomElement asGml2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-11-15 14:43:39 +10:00
|
|
|
virtual QDomElement asGml3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
|
2017-04-27 07:55:22 +02:00
|
|
|
|
2017-11-15 14:43:39 +10:00
|
|
|
virtual QString asJson( int precision = 17 ) const;
|
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-11-24 15:34:35 +10:00
|
|
|
virtual void transform( const QTransform &t, double zTranslate = 0.0, double zScale = 1.0, double mTranslate = 0.0, double mScale = 1.0 );
|
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 14:53:02 +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 QgsAbstractGeometry *boundary() const /Factory/;
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual bool insertVertex( QgsVertexId position, const QgsPoint &vertex );
|
2017-09-19 14:53:02 +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-11-18 16:24:08 +11:00
|
|
|
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2017-11-29 10:04:20 +10:00
|
|
|
virtual double closestSegment( const QgsPoint &pt, QgsPoint &segmentPt /Out/, QgsVertexId &vertexAfter /Out/, int *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 nextVertex( QgsVertexId &id, QgsPoint &vertex /Out/ ) const;
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-10-13 12:17:30 +10:00
|
|
|
virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex /Out/, QgsVertexId &nextVertex /Out/ ) const;
|
2017-10-22 14:00:32 +10:00
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
virtual double vertexAngle( QgsVertexId vertex ) const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Angle undefined. Always returns 0.0
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param vertex: the vertex id
|
|
|
|
|
2017-04-27 07:55:22 +02:00
|
|
|
:return: 0.0*
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual int vertexCount( int /*part*/ = 0, int /*ring*/ = 0 ) const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2016-01-28 10:30:06 +01:00
|
|
|
virtual int ringCount( int /*part*/ = 0 ) const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
virtual int partCount() const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsPoint vertexAt( QgsVertexId /*id*/ ) const;
|
2017-09-19 14:53:02 +10:00
|
|
|
|
2017-09-19 13:53:56 +10:00
|
|
|
virtual QgsPoint *toCurveType() const /Factory/;
|
|
|
|
|
2017-11-14 08:02:42 +10:00
|
|
|
virtual double segmentLength( QgsVertexId startVertex ) const;
|
|
|
|
|
2015-11-18 16:24:08 +11:00
|
|
|
|
|
|
|
virtual bool addZValue( double zValue = 0 );
|
2017-09-19 13:53:56 +10:00
|
|
|
|
2015-11-18 16:24:08 +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();
|
2017-09-19 13:53:56 +10:00
|
|
|
|
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
|
|
|
|
2017-05-07 15:38:42 +08:00
|
|
|
|
2017-10-27 14:29:31 +10:00
|
|
|
virtual QgsPoint *createEmptyWithSameType() const /Factory/;
|
|
|
|
|
2018-02-09 15:57:19 +10:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
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 QgsPoint childPoint( int index ) const;
|
|
|
|
|
2017-10-27 14:29:31 +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 *
|
|
|
|
* *
|
2017-06-03 10:52:28 +02:00
|
|
|
* src/core/geometry/qgspoint.h *
|
2017-04-27 07:55:22 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|