File: qgsvector3d.sip.in

package info (click to toggle)
qgis 3.34.7%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 1,087,388 kB
  • sloc: cpp: 1,440,033; python: 234,418; xml: 23,096; perl: 3,499; sh: 3,364; ansic: 2,219; sql: 2,130; yacc: 1,063; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (153 lines) | stat: -rw-r--r-- 4,141 bytes parent folder | download | duplicates (4)
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
148
149
150
151
152
153
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsvector3d.h                                               *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 ************************************************************************/




class QgsVector3D
{
%Docstring(signature="appended")
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precision
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
%End
    QgsVector3D( const QVector3D &v );
%Docstring
Constructs a vector from single-precision QVector3D
%End
    bool isNull() const /HoldGIL/;
%Docstring
Returns ``True`` if all three coordinates are zero
%End

    double x() const /HoldGIL/;
%Docstring
Returns X coordinate
%End
    double y() const /HoldGIL/;
%Docstring
Returns Y coordinate
%End
    double z() const /HoldGIL/;
%Docstring
Returns Z coordinate
%End

    void setX( double x ) /HoldGIL/;
%Docstring
Sets X coordinate

.. versionadded:: 3.34
%End

    void setY( double y ) /HoldGIL/;
%Docstring
Sets Y coordinate

.. versionadded:: 3.34
%End

    void setZ( double z ) /HoldGIL/;
%Docstring
Sets Z coordinate

.. versionadded:: 3.34
%End

    void set( double x, double y, double z ) /HoldGIL/;
%Docstring
Sets vector coordinates
%End

    bool operator==( const QgsVector3D &other ) const /HoldGIL/;
    bool operator!=( const QgsVector3D &other ) const /HoldGIL/;

    QgsVector3D operator+( const QgsVector3D &other ) const /HoldGIL/;

    QgsVector3D operator-( const QgsVector3D &other ) const /HoldGIL/;

    QgsVector3D operator *( const double factor ) const /HoldGIL/;

    QgsVector3D operator /( const double factor ) const /HoldGIL/;

    static double dotProduct( const QgsVector3D &v1, const QgsVector3D &v2 ) /HoldGIL/;
%Docstring
Returns the dot product of two vectors
%End

    static QgsVector3D crossProduct( const QgsVector3D &v1, const QgsVector3D &v2 ) /HoldGIL/;
%Docstring
Returns the cross product of two vectors
%End

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

    void normalize() /HoldGIL/;
%Docstring
Normalizes the current vector in place.
%End

    double distance( const QgsVector3D &other ) const /HoldGIL/;
%Docstring
Returns the distance with the ``other`` QgsVector3D
%End

    static QgsVector3D perpendicularPoint( const QgsVector3D &v1, const QgsVector3D &v2, const QgsVector3D &vp ) /HoldGIL/;
%Docstring
Returns the perpendicular point of vector ``vp`` from [``v1`` - ``v2``]
%End

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

    QVector3D toVector3D() const /HoldGIL/;
%Docstring
Converts the current object to QVector3D

.. warning::

   the conversion may decrease the accuracy (double to float values conversion)

.. versionadded:: 3.24
%End

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

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