Ocean
X3DEnvironmentalSensorNode.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_SCENEDESCRIPTION_SDX_X3D_X3D_ENVIRONMENTAL_SENSOR_NODE_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_ENVIRONMENTAL_SENSOR_NODE_H
10 
13 
15 
16 #include "ocean/rendering/Node.h"
17 
18 namespace Ocean
19 {
20 
21 namespace SceneDescription
22 {
23 
24 namespace SDX
25 {
26 
27 namespace X3D
28 {
29 
30 /**
31  * This class implements an abstract x3d envrionmental sensor node.
32  * @ingroup scenedescriptionsdxx3d
33  */
34 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT X3DEnvironmentalSensorNode :
35  virtual public X3DSensorNode,
36  virtual public SDXUpdateNode
37 {
38  protected:
39 
40  /**
41  * Creates an abstract x3d environmental sensor node.
42  * @param environment Node environment
43  */
44  explicit X3DEnvironmentalSensorNode(const SDXEnvironment* environment);
45 
46  /**
47  * Registers the fields of this node.
48  * @param specification Node specification receiving the field informations
49  */
50  void registerFields(NodeSpecification& specification);
51 
52  /**
53  * Update event function.
54  * @see SDXUpdateNode::onUpdate().
55  */
56  void onUpdate(const Rendering::ViewRef& view, const Timestamp timestamp) override;
57 
58  /**
59  * Event function for the new position and orientaiton inside the defined bounding box.
60  * This function should be used by derivated classes.
61  * @param translation Local translation inside the sensor bounding box
62  * @param orientation Local orientation inside the sensor bounding box
63  * @param timestamp Event timestamp
64  */
65  virtual void onInsideBoundingBox(const Vector3& translation, const Quaternion& orientation, const Timestamp timestamp) = 0;
66 
67  /**
68  * Returns the coordinate systems of the sensor node in world.
69  * @return All possible sensor node coordinate systems, which is world_T_sensors
70  */
72 
73  protected:
74 
75  /// Center field.
77 
78  /// Size field.
80 
81  /// EnterTime field.
83 
84  /// ExitTime field.
86 
87  /// IsActive field.
89 
90  /// State determining the enter state.
92 };
93 
94 }
95 
96 }
97 
98 }
99 
100 }
101 
102 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_ENVIRONMENTAL_SENSOR_NODE_H
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements an abstract x3d envrionmental sensor node.
Definition: X3DEnvironmentalSensorNode.h:37
SingleVector3 size_
Size field.
Definition: X3DEnvironmentalSensorNode.h:79
SingleVector3 center_
Center field.
Definition: X3DEnvironmentalSensorNode.h:76
SingleTime exitTime_
ExitTime field.
Definition: X3DEnvironmentalSensorNode.h:85
SingleTime enterTime_
EnterTime field.
Definition: X3DEnvironmentalSensorNode.h:82
X3DEnvironmentalSensorNode(const SDXEnvironment *environment)
Creates an abstract x3d environmental sensor node.
bool sensorEntered_
State determining the enter state.
Definition: X3DEnvironmentalSensorNode.h:91
void registerFields(NodeSpecification &specification)
Registers the fields of this node.
SingleBool isActive_
IsActive field.
Definition: X3DEnvironmentalSensorNode.h:88
virtual void onInsideBoundingBox(const Vector3 &translation, const Quaternion &orientation, const Timestamp timestamp)=0
Event function for the new position and orientaiton inside the defined bounding box.
void onUpdate(const Rendering::ViewRef &view, const Timestamp timestamp) override
Update event function.
HomogenousMatrices4 sensorTransformations() const
Returns the coordinate systems of the sensor node in world.
This class implements an abstract x3d sensor node.
Definition: X3DSensorNode.h:31
This class implements a node environment container.
Definition: SDXNode.h:62
This class implements the base class for all nodes needing update calls regularly.
Definition: SDXUpdateNode.h:25
This class implements a timestamp.
Definition: Timestamp.h:36
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15