Ocean
JSSquareMatrix3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_3_H
9 #define META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_3_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Interaction
18 {
19 
20 namespace JavaScript
21 {
22 
23 /**
24  * This class implements a wrapper for a JavaScript SquareMatrix3 object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSSquareMatrix3 : public JSObject<JSSquareMatrix3, SquareMatrix3>
28 {
29  friend class JSObject<JSSquareMatrix3, SquareMatrix3>;
30  friend class JSLibrary;
31 
32  public:
33 
34  /**
35  * Definition of ids for individual functions.
36  */
37  enum FunctionId : unsigned int
38  {
39  /**
40  * Adds two matrices.
41  * <pre>
42  * SquareMatrix3 = SquareMatrix3.add(SquareMatrix3)
43  * </pre>
44  */
46 
47  /**
48  * Determines the matrix's determinant.
49  * <pre>
50  * Number = SquareMatrix3.determinant()
51  * </pre>
52  */
54 
55  /**
56  * Inverts this matrix.
57  * <pre>
58  * Boolean = SquareMatrix3.invert()
59  * </pre>
60  */
62 
63  /**
64  * Returns the inverted matrix of this matrix.
65  * <pre>
66  * SquareMatrix3 = SquareMatrix3.inverted()
67  * </pre>
68  */
70 
71  /**
72  * Returns whether two matrices are equal up to some epsilon.
73  * <pre>
74  * Boolean = SquareMatrix3.isEqual(SquareMatrix3)
75  * </pre>
76  */
78 
79  /**
80  * Multiplies two matrices, mutiplies this matrix with a vector, or multiplies this matrix with a scalar.
81  * <pre>
82  * SquareMatrix3 = SquareMatrix3.multiply(SquareMatrix3)
83  * Vector3 = SquareMatrix3.multiply(Vector3)
84  * Vector2 = SquareMatrix3.multiply(Vector2)
85  * SquareMatrix3 = SquareMatrix3.multiply(Number)
86  * </pre>
87  */
89 
90  /**
91  * Returns a string with the values of this matrix.
92  * <pre>
93  * String = SquareMatrix3.string()
94  * </pre>
95  */
97 
98  /**
99  * Subtracts two matrices.
100  * <pre>
101  * SquareMatrix3 = SquareMatrix3.subtract(SquareMatrix3)
102  * </pre>
103  */
105 
106  /**
107  * Returns the trace of this matrix.
108  * <pre>
109  * Number = SquareMatrix3.trace()
110  * </pre>
111  */
113 
114  /**
115  * Transposes this matrix.
116  * <pre>
117  * SquareMatrix3.transpose()
118  * </pre>
119  */
121 
122  /**
123  * Returns the transposed matrix of this matrix.
124  * <pre>
125  * SquareMatrix3 = SquareMatrix3.transposed()
126  * </pre>
127  */
129 
130  /**
131  * Returns the x-axis of this matrix.
132  * <pre>
133  * Vector3 = SquareMatrix3.xAxis()
134  * </pre>
135  */
137 
138  /**
139  * Returns the y-axis of this matrix.
140  * <pre>
141  * Vector3 = SquareMatrix3.yAxis()
142  * </pre>
143  */
145 
146  /**
147  * Returns the z-axis of this matrix.
148  * <pre>
149  * Vector3 = SquareMatrix3.zAxis()
150  * </pre>
151  */
152  FI_Z_AXIS
153  };
154 
155  public:
156 
157  /**
158  * Returns the JavaScript name of this object.
159  * @return The object's JavaScript name
160  */
161  static inline const char* objectName();
162 
163  protected:
164 
165  /**
166  * Creates the function template and object template for this object.
167  */
168  static void createFunctionTemplate();
169 };
170 
171 inline const char* JSSquareMatrix3::objectName()
172 {
173  return "SquareMatrix3";
174 }
175 
176 }
177 
178 }
179 
180 }
181 
182 #endif // META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_3_H
This class implements the java script interaction library object.
Definition: JSLibrary.h:32
This class implements the base class for all native wrapper of JavaScript objects.
Definition: JSObject.h:31
This class implements a wrapper for a JavaScript SquareMatrix3 object.
Definition: JSSquareMatrix3.h:28
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSSquareMatrix3.h:171
static void createFunctionTemplate()
Creates the function template and object template for this object.
FunctionId
Definition of ids for individual functions.
Definition: JSSquareMatrix3.h:38
@ FI_Y_AXIS
Returns the y-axis of this matrix.
Definition: JSSquareMatrix3.h:144
@ FI_SUBTRACT
Subtracts two matrices.
Definition: JSSquareMatrix3.h:104
@ FI_X_AXIS
Returns the x-axis of this matrix.
Definition: JSSquareMatrix3.h:136
@ FI_TRANSPOSED
Returns the transposed matrix of this matrix.
Definition: JSSquareMatrix3.h:128
@ FI_DETERMINANT
Determines the matrix's determinant.
Definition: JSSquareMatrix3.h:53
@ FI_TRANSPOSE
Transposes this matrix.
Definition: JSSquareMatrix3.h:120
@ FI_IS_EQUAL
Returns whether two matrices are equal up to some epsilon.
Definition: JSSquareMatrix3.h:77
@ FI_MULTIPLY
Multiplies two matrices, mutiplies this matrix with a vector, or multiplies this matrix with a scalar...
Definition: JSSquareMatrix3.h:88
@ FI_TRACE
Returns the trace of this matrix.
Definition: JSSquareMatrix3.h:112
@ FI_ADD
Adds two matrices.
Definition: JSSquareMatrix3.h:45
@ FI_INVERT
Inverts this matrix.
Definition: JSSquareMatrix3.h:61
@ FI_STRING
Returns a string with the values of this matrix.
Definition: JSSquareMatrix3.h:96
@ FI_INVERTED
Returns the inverted matrix of this matrix.
Definition: JSSquareMatrix3.h:69
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15