QGIS/python/core/qgsvector.sip

153 lines
3.8 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsvector.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2017-02-24 12:39:34 +01:00
class QgsVector
{
%Docstring
2017-12-15 10:36:55 -04:00
A class to represent a vector.
Currently no Z axis / 2.5D support is implemented.
2017-02-24 12:39:34 +01:00
%End
%TypeHeaderCode
#include "qgsvector.h"
%End
2017-02-24 12:39:34 +01:00
public:
2017-02-24 12:39:34 +01:00
QgsVector();
%Docstring
2017-12-15 10:36:55 -04:00
Default constructor for QgsVector. Creates a vector with length of 0.0.
%End
2017-02-24 12:39:34 +01:00
QgsVector( double x, double y );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsVector taking x and y component values.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param x: x-component
:param y: y-component
%End
2017-02-24 12:39:34 +01:00
QgsVector operator-() const;
%Docstring
Swaps the sign of the x and y components of the vector.
%End
2017-02-24 12:39:34 +01:00
QgsVector operator*( double scalar ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a vector where the components have been multiplied by a scalar value.
2017-12-15 21:36:08 -04:00
:param scalar: factor to multiply by
%End
2017-02-24 12:39:34 +01:00
QgsVector operator/( double scalar ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a vector where the components have been divided by a scalar value.
2017-12-15 21:36:08 -04:00
:param scalar: factor to divide by
%End
2017-02-24 12:39:34 +01:00
double operator*( QgsVector v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the dot product of two vectors, which is the sum of the x component
of this vector multiplied by the x component of another
vector plus the y component of this vector multiplied by the y component of another vector.
%End
2017-02-24 12:39:34 +01:00
QgsVector operator+( QgsVector other ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Adds another vector to this vector.
.. versionadded:: 3.0
%End
2017-02-24 12:39:34 +01:00
QgsVector &operator+=( const QgsVector other );
%Docstring
2017-12-15 10:36:55 -04:00
Adds another vector to this vector in place.
.. versionadded:: 3.0
%End
2017-02-24 12:39:34 +01:00
QgsVector operator-( const QgsVector other ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Subtracts another vector to this vector.
.. versionadded:: 3.0
%End
2017-02-24 12:39:34 +01:00
QgsVector &operator-=( const QgsVector other );
%Docstring
2017-12-15 10:36:55 -04:00
Subtracts another vector to this vector in place.
.. versionadded:: 3.0
%End
2017-02-24 12:39:34 +01:00
double length() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the length of the vector.
%End
2017-02-24 12:39:34 +01:00
double x() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's x-component.
.. seealso:: y()
%End
2017-02-24 12:39:34 +01:00
double y() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's y-component.
.. seealso:: x()
%End
2017-02-24 12:39:34 +01:00
QgsVector perpVector() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the perpendicular vector to this vector (rotated 90 degrees counter-clockwise)
%End
2017-02-24 12:39:34 +01:00
double angle() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the angle of the vector in radians.
%End
2017-02-24 12:39:34 +01:00
double angle( QgsVector v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the angle between this vector and another vector in radians.
%End
2017-02-24 12:39:34 +01:00
QgsVector rotateBy( double rot ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Rotates the vector by a specified angle.
2017-12-15 21:36:08 -04:00
:param rot: angle in radians
%End
2017-02-24 12:39:34 +01:00
QgsVector normalized() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's normalized (or "unit") vector (ie same angle but length of 1.0).
Will throw a QgsException if called on a vector with length of 0.
%End
2017-02-24 12:39:34 +01:00
bool operator==( QgsVector other ) const;
bool operator!=( QgsVector other ) const;
%Docstring
Inequality operator
%End
2017-02-24 12:39:34 +01:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsvector.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/