File: qgsvector.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (147 lines) | stat: -rw-r--r-- 3,914 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsvector.h                                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/



class QgsVector
{
%Docstring(signature="appended")
A class to represent a vector. Currently no Z axis / 2.5D support is
implemented.
%End

%TypeHeaderCode
#include "qgsvector.h"
%End
  public:

    QgsVector();
%Docstring
Default constructor for QgsVector. Creates a vector with length of 0.0.
%End

    QgsVector( double x, double y );
%Docstring
Constructor for QgsVector taking x and y component values.

:param x: x-component
:param y: y-component
%End

    QgsVector operator-() const /HoldGIL/;

    QgsVector operator*( double scalar ) const /HoldGIL/;

    QgsVector operator/( double scalar ) const /HoldGIL/;

    double operator*( QgsVector v ) const /HoldGIL/;

    QgsVector operator+( QgsVector other ) const /HoldGIL/;

    QgsVector &operator+=( QgsVector other ) /HoldGIL/;

    QgsVector operator-( QgsVector other ) const /HoldGIL/;

    QgsVector &operator-=( QgsVector other ) /HoldGIL/;

    double length() const /HoldGIL/;
%Docstring
Returns the length of the vector.

.. seealso:: :py:func:`lengthSquared`
%End

    double lengthSquared() const /HoldGIL/;
%Docstring
Returns the length of the vector.

.. seealso:: :py:func:`length`

.. versionadded:: 3.2
%End

    double x() const /HoldGIL/;
%Docstring
Returns the vector's x-component.

.. seealso:: y
%End

    double y() const /HoldGIL/;
%Docstring
Returns the vector's y-component.

.. seealso:: x
%End

    QgsVector perpVector() const /HoldGIL/;
%Docstring
Returns the perpendicular vector to this vector (rotated 90 degrees
counter-clockwise)
%End

    double angle() const /HoldGIL/;
%Docstring
Returns the angle of the vector in radians.
%End

    double angle( QgsVector v ) const /HoldGIL/;
%Docstring
Returns the angle between this vector and another vector in radians.
%End

    double crossProduct( QgsVector v ) const /HoldGIL/;
%Docstring
Returns the 2D cross product of this vector and another vector ``v``.
(This is sometimes referred to as a "perpendicular dot product", and
equals x1 * y1 - y1 * x2).

.. versionadded:: 3.2
%End

    QgsVector rotateBy( double rot ) const /HoldGIL/;
%Docstring
Rotates the vector by a specified angle.

:param rot: angle in radians
%End

    QgsVector normalized() const throw( QgsException );
%Docstring
Returns the vector's normalized (or "unit") vector (ie same angle but
length of 1.0).

:raises QgsException: if called on a vector with length of 0.
%End

    bool operator==( QgsVector other ) const /HoldGIL/;

    bool operator!=( QgsVector other ) const;

    QString toString( int precision = 17 ) const /HoldGIL/;
%Docstring
Returns a string representation of the vector. Members will be truncated
to the specified ``precision``.
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsVector: %1>" ).arg( sipCpp->toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsvector.h                                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/