Ocean
JSPlane3.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_PLANE_3_H
9 #define META_OCEAN_INTERACTION_JS_PLANE_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 Plane object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSPlane3 : public JSObject<JSPlane3, Plane3>
28 {
29  friend class JSObject<JSPlane3, Plane3>;
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 normal property, a Vector3 object.
41  /// The accessor for the distance property, a Number value.
42  AI_DISTANCE
43  };
44 
45  /**
46  * Definition of ids for individual functions.
47  */
48  enum FunctionId : unsigned int
49  {
50  /**
51  * Returns the intersection between this plane and another plane or a line.
52  * <pre>
53  * Line3 = Plane3.intersection(Plane3)
54  * Vector3 = Plane3.intersection(Line3)
55  * </pre>
56  */
58 
59  /**
60  * Returns whether two line objects are equal up to some epsilon.
61  * <pre>
62  * Boolean = Line3.isEqual(Line3)
63  * </pre>
64  */
66 
67  /**
68  * Returns whether two plane objects, or this plane and another line are parallel.
69  * <pre>
70  * Boolean = Plane3.isParallel(Plane3)
71  * Boolean = Plane3.isParallel(Line3)
72  * </pre>
73  */
75 
76  /**
77  * Returns a string with the values of this line object.
78  * <pre>
79  * String = Line3.string()
80  * </pre>
81  */
82  FI_STRING
83  };
84 
85  public:
86 
87  /**
88  * Returns the JavaScript name of this object.
89  * @return The object's JavaScript name
90  */
91  static inline const char* objectName();
92 
93  protected:
94 
95  /**
96  * Creates the function template and object template for this object.
97  */
98  static void createFunctionTemplate();
99 };
100 
101 inline const char* JSPlane3::objectName()
102 {
103  return "Plane3";
104 }
105 
106 }
107 
108 }
109 
110 }
111 
112 #endif // META_OCEAN_INTERACTION_JS_PLANE_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 Plane object.
Definition: JSPlane3.h:28
FunctionId
Definition of ids for individual functions.
Definition: JSPlane3.h:49
@ FI_IS_PARALLEL
Returns whether two plane objects, or this plane and another line are parallel.
Definition: JSPlane3.h:74
@ FI_INTERSECTION
Returns the intersection between this plane and another plane or a line.
Definition: JSPlane3.h:57
@ FI_IS_EQUAL
Returns whether two line objects are equal up to some epsilon.
Definition: JSPlane3.h:65
AccessorId
Definition of ids for individual accessors.
Definition: JSPlane3.h:38
@ AI_NORMAL
The accessor for the normal property, a Vector3 object.
Definition: JSPlane3.h:40
static void createFunctionTemplate()
Creates the function template and object template for this object.
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSPlane3.h:101
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15