2018-04-17 21:08:42 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvector3d.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-27 15:11:12 +02:00
|
|
|
|
2018-04-17 21:08:42 +02:00
|
|
|
class QgsVector3D
|
|
|
|
{
|
2021-03-22 21:13:52 +01:00
|
|
|
%Docstring(signature="appended")
|
2018-04-20 18:35:46 +02:00
|
|
|
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precision
|
2018-04-17 21:08:42 +02:00
|
|
|
instead of single precision floating point numbers.
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsvector3d.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsVector3D();
|
|
|
|
%Docstring
|
|
|
|
Constructs a null vector
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsVector3D( double x, double y, double z );
|
|
|
|
%Docstring
|
|
|
|
Constructs a vector from given coordinates
|
2018-07-27 15:11:12 +02:00
|
|
|
%End
|
|
|
|
QgsVector3D( const QVector3D &v );
|
|
|
|
%Docstring
|
|
|
|
Constructs a vector from single-precision QVector3D
|
2018-04-17 21:08:42 +02:00
|
|
|
%End
|
|
|
|
bool isNull() const;
|
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if all three coordinates are zero
|
2018-04-17 21:08:42 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
double x() const;
|
|
|
|
%Docstring
|
|
|
|
Returns X coordinate
|
|
|
|
%End
|
|
|
|
double y() const;
|
|
|
|
%Docstring
|
|
|
|
Returns Y coordinate
|
|
|
|
%End
|
|
|
|
double z() const;
|
|
|
|
%Docstring
|
|
|
|
Returns Z coordinate
|
|
|
|
%End
|
|
|
|
|
|
|
|
void set( double x, double y, double z );
|
|
|
|
%Docstring
|
|
|
|
Sets vector coordinates
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool operator==( const QgsVector3D &other ) const;
|
|
|
|
bool operator!=( const QgsVector3D &other ) const;
|
|
|
|
|
|
|
|
QgsVector3D operator+( const QgsVector3D &other ) const;
|
|
|
|
|
|
|
|
QgsVector3D operator-( const QgsVector3D &other ) const;
|
|
|
|
|
2018-04-20 18:35:46 +02:00
|
|
|
QgsVector3D operator *( const double factor ) const;
|
2018-04-17 21:08:42 +02:00
|
|
|
|
2018-04-20 18:35:46 +02:00
|
|
|
QgsVector3D operator /( const double factor ) const;
|
2018-04-17 21:08:42 +02:00
|
|
|
|
2018-04-20 18:35:46 +02:00
|
|
|
static double dotProduct( const QgsVector3D &v1, const QgsVector3D &v2 );
|
2018-04-17 21:08:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the dot product of two vectors
|
|
|
|
%End
|
|
|
|
|
2018-04-20 18:35:46 +02:00
|
|
|
static QgsVector3D crossProduct( const QgsVector3D &v1, const QgsVector3D &v2 );
|
2018-04-17 21:08:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the cross product of two vectors
|
|
|
|
%End
|
|
|
|
|
|
|
|
double length() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the length of the vector
|
|
|
|
%End
|
|
|
|
|
|
|
|
void normalize();
|
|
|
|
%Docstring
|
2018-04-20 18:35:46 +02:00
|
|
|
Normalizes the current vector in place.
|
2018-04-17 21:08:42 +02:00
|
|
|
%End
|
|
|
|
|
2019-01-15 00:24:16 +01:00
|
|
|
double distance( const QgsVector3D &other ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the distance with the ``other`` :py:class:`QgsVector3`
|
|
|
|
%End
|
|
|
|
|
|
|
|
static QgsVector3D perpendicularPoint( const QgsVector3D &v1, const QgsVector3D &v2, const QgsVector3D &vp );
|
|
|
|
%Docstring
|
|
|
|
Returns the perpendicular point of vector ``vp`` from [``v1`` - ``v2``]
|
|
|
|
%End
|
2018-04-17 21:08:42 +02:00
|
|
|
|
2019-01-15 00:24:16 +01:00
|
|
|
QString toString( int precision = 17 ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns a string representation of the 3D vector.
|
|
|
|
Members will be truncated to the specified ``precision``.
|
2022-01-05 12:13:25 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
QVector3D toVector3D() const;
|
|
|
|
%Docstring
|
|
|
|
Converts the current object to QVector3D
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
the conversion may decrease the accuracy (double to float values conversion)
|
|
|
|
|
|
|
|
.. versionadded:: 3.24
|
2019-01-15 00:24:16 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
SIP_PYOBJECT __repr__();
|
|
|
|
%MethodCode
|
|
|
|
QString str = QStringLiteral( "<QgsVector3D: %1>" ).arg( sipCpp->toString() );
|
|
|
|
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
|
|
|
%End
|
2018-04-17 21:08:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvector3d.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|