Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SVector3.h
1
2
3
5
6#pragma once
7
8#include "RshPluginScript/RshPluginScriptDefines.h"
9#include "RshPluginScript/SClass/SObject.h"
10
11#ifndef FCT_DOC
12namespace rsh::ScriptBinding
13{
14#endif // !FCT_DOC
15
25class SVector : public SObject
26{
27 //======================================================================================================================
28 // INTERNAL FUNCTION
29 //======================================================================================================================
30
31 //======================================================================================================================
32 // DOCUMENTED FUNCTION
33 //======================================================================================================================
34
35public slots: // these functions (slots) will be available in QtScript
38 // TESTED
39 Number GetX() ;
42 // TESTED
43 SetX(Number X);
44
47 // TESTED
48 Number GetY() ;
51 // TESTED
52 SetY(Number Y);
53
56 // TESTED
57 Number GetZ() ;
60 // TESTED
61 SetZ(Number Z);
62
65 // TESTED
66 Number GetLength() ;
67
74 // TESTED
76
81 // TESTED
83
90 // TESTED
92
96 // TESTED
97 Boolean IsNull() ;
98
101 // TESTED
103
107 // TESTED
108 Boolean Equals( SVector VectToCompare) ;
109
114 // TESTED
115 SVector Div(Number Div) ;
116
123 // TESTED
124 SVector Mult(Number Multiplicateur) ;
125
132 // TESTED
133 SVector Add( SVector Vecteur) ;
134
141 // TESTED
142 SVector Sub( SVector Vecteur) ;
143
148 // TESTED
150
153 String toString() ;
154
157 String ValuesToString() ;
158};
159
160// @brief
161// this class allow to wrap static function to SVector easily
162// this allow to wrap constructor more easily the constructor will be declared with the function New(...)
163class SVector
164#ifndef FCT_DOC
165 : public SObjectStatic
166#endif // FCT_DOC
167{
168 //======================================================================================================================
169 // INTERNAL FUNCTION
170 //======================================================================================================================
171 //======================================================================================================================
172 // DOCUMENTED FUNCTION
173 //======================================================================================================================
174
175public slots:
178 // TESTED
179 static SVector New();
180
183 // TESTED
184 static SVector New( SVector Other);
185
188 // TESTED
189 static SVector New(
190 Number X,
192 Number Y,
194 Number Z
196 );
197
201 // TESTED
202 static SVector New(SPoint StartPt, SPoint EndPt);
203
206 // TESTED
207 static SVector New(SPoint EndPt);
208
212 // TESTED
213 static Number Dot(
214 SVector V1,
216 SVector V2
218 );
219
224 // TESTED
226 SVector V1, SVector V2);
227
232 // TESTED
233 static Number Angle( SVector V1, SVector V2);
234
237 static String toString();
238};
239Q_DECLARE_METATYPE(SVector::_SVectorDummy);
240Q_DECLARE_METATYPE(SVector);
241
242#ifndef FCT_DOC
243} // namespace rsh::ScriptBinding
244#endif // !FCT_DOC
Matrix with 3 lines and 4 columns to make any transformation. This class should be used in order to a...
Definition: SMatrix.h:21
This class is an abstract class, you can use these function in its derived classes.
Definition: SObject.h:35
3D point manipulation class. The SPoint creation can be done by calling the static functions:
Definition: SPoint.h:23
The mathematical object vector.
Definition: SVector3.h:26
static SVector New()
Default constructor to initialize all values with zero.
static SVector New(Number X, Number Y, Number Z)
Constructs a new SVector by defining its data.
String toString()
Get the type of the variable.
Boolean IsNull()
SVector GetNormalized()
Normalize a copy of the current vector.
Boolean Equals(SVector VectToCompare)
Normalize()
Modifies the 3D vector to have its norm equal to 1.
Number GetZ()
static String toString()
Get the type of the variable.
SetX(Number X)
Sets the X coordinate.
SVector Add(SVector Vecteur)
Calculates the sum of the current vector and another vector.
SVector Sub(SVector Vecteur)
Calculates the subtraction of the current vector by another vector.
SVector Mult(Number Multiplicateur)
To multiply the current vector with a scalar value.
static SVector New(SPoint EndPt)
Constructor from one point. The result is the vector between the origin (0,0,0) and the point EndPt.
static SVector New(SPoint StartPt, SPoint EndPt)
Constructor which initializes the vector between a starting point and an ending point....
SVector Div(Number Div)
To divide a vector by a value.
static Number Angle(SVector V1, SVector V2)
Compute the angle in degrees between two 3D vectors.
Opposite()
Calculates a vector's opposite.
Number GetY()
Number GetLength()
static SVector New(SVector Other)
Constructs an SVector by copying the SVector Other.
SVector SetNormed()
Modifies the 3D vector to have its norm equal to 1.
SetY(Number Y)
Sets the Y coordinate.
ApplyTransformation(SMatrix iMatrix)
To apply a geometric transformation to the current object by making a product with the given matrix.
static SVector Cross(SVector V1, SVector V2)
Make the 3D vectorial product of two 3D vectors (cross product).
String ValuesToString()
Get a string representation of the vector.
Number GetX()
static Number Dot(SVector V1, SVector V2)
Make the scalar product of two 3D vectors (dot product).
SetZ(Number Z)
Sets the Z coordinate.