QGIS/python/core/qgsvector.sip.in

112 lines
2.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;
QgsVector operator*( double scalar ) const;
QgsVector operator/( double scalar ) const;
double operator*( QgsVector v ) const;
QgsVector operator+( QgsVector other ) const;
QgsVector &operator+=( const QgsVector other );
2017-02-24 12:39:34 +01:00
QgsVector operator-( const QgsVector other ) const;
2017-02-24 12:39:34 +01:00
QgsVector &operator-=( const QgsVector other );
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;
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 *
************************************************************************/