Ocean
JSEuler.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_EULER_H
9 #define META_OCEAN_INTERACTION_JS_EULER_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 Euler object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSEuler : public JSObject<JSEuler, Euler>
28 {
29  friend class JSObject<JSEuler, Euler>;
30  friend class JSLibrary;
31 
32  public:
33 
34  /**
35  * Definition of ids for individual accessors.
36  */
37  enum AccessorId : unsigned int
38  {
39  /// The accessor for the yaw property, a number value.
41  /// The accessor for the roll property, a number value.
43  /// The accessor for the pitch property, a number value.
44  AI_ROLL
45  };
46 
47  /**
48  * Definition of ids for individual functions.
49  */
50  enum FunctionId : unsigned int
51  {
52  /**
53  * Returns whether two euler objects are equal up to some epsilon.
54  * <pre>
55  * Boolean = Euler.isEqual(Euler)
56  * </pre>
57  */
59 
60  /**
61  * Returns a string with the values of this euler object.
62  * <pre>
63  * String = Euler.string()
64  * </pre>
65  */
66  FI_STRING
67  };
68 
69  public:
70 
71  /**
72  * Returns the JavaScript name of this object.
73  * @return The object's JavaScript name
74  */
75  static inline const char* objectName();
76 
77  protected:
78 
79  /**
80  * Creates the function template and object template for this object.
81  */
82  static void createFunctionTemplate();
83 };
84 
85 inline const char* JSEuler::objectName()
86 {
87  return "Euler";
88 }
89 
90 }
91 
92 }
93 
94 }
95 
96 #endif // META_OCEAN_INTERACTION_JS_EULER_H
This class implements an euler rotation with angles: yaw, pitch and roll.
Definition: Euler.h:80
This class implements a wrapper for a JavaScript Euler object.
Definition: JSEuler.h:28
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSEuler.h:85
AccessorId
Definition of ids for individual accessors.
Definition: JSEuler.h:38
@ AI_PITCH
The accessor for the roll property, a number value.
Definition: JSEuler.h:42
@ AI_YAW
The accessor for the yaw property, a number value.
Definition: JSEuler.h:40
FunctionId
Definition of ids for individual functions.
Definition: JSEuler.h:51
@ FI_IS_EQUAL
Returns whether two euler objects are equal up to some epsilon.
Definition: JSEuler.h:58
static void createFunctionTemplate()
Creates the function template and object template for this object.
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
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15