Ocean
X3DScene.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_SCENE_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_SCENE_H
10 
13 
15 
16 #include "ocean/rendering/Scene.h"
17 
18 #include <map>
19 
20 namespace Ocean
21 {
22 
23 namespace SceneDescription
24 {
25 
26 namespace SDX
27 {
28 
29 namespace X3D
30 {
31 
32 /**
33  * This class implements a scene object holding an entire x3d scene.
34  * @ingroup scenedescriptionsdxx3d
35  */
36 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT X3DScene :
37  virtual public X3DGroupingNode,
38  virtual public SDXScene
39 {
40  public:
41 
42  /**
43  * Creates a new x3d scene object.
44  * @param filename Name of the scene file, if any
45  * @param library Library providing this scene node
46  * @param engine Rendering engine corresponding with this scene and all child nodes
47  */
48  explicit X3DScene(const std::string& filename, const Library& library, const Rendering::EngineRef& engine);
49 
50  /**
51  * Returns the associated rendering object.
52  * @see SDXNode::renderingObject().
53  */
54  const Rendering::ObjectRef& renderingObject() const override;
55 
56  protected:
57 
58  /**
59  * Internal event function to inform the scene that it has been initialized and can apply all internal values to corresponding rendering objects.
60  * @see SDXScene::onInitialize().
61  */
62  void onInitialize(const Timestamp timestamp) override;
63 
64  /**
65  * Internal event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
66  * The scene node has an own onInitialize() function, use this instead
67  * @see SDXNode::onInitialize().
68  */
69  void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
70 
71  /**
72  * Specifies the node type and the fields of this node.
73  * @return Unique node specification of this node
74  */
76 
77  /**
78  * Returns the address of the most derived object.
79  * @see Node::objectAddress().
80  */
81  size_t objectAddress() const override;
82 
83  private:
84 
85  /// Additional rendering object to handle a scene and a group object in common.
87 };
88 
89 }
90 
91 }
92 
93 }
94 
95 }
96 
97 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_SCENE_H
This class is the base class for all scene description libraries.
Definition: scenedescription/Library.h:37
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements an abstract x3d grouping node.
Definition: X3DGroupingNode.h:34
This class implements a scene object holding an entire x3d scene.
Definition: X3DScene.h:39
X3DScene(const std::string &filename, const Library &library, const Rendering::EngineRef &engine)
Creates a new x3d scene object.
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
const Rendering::ObjectRef & renderingObject() const override
Returns the associated rendering object.
void onInitialize(const Rendering::SceneRef &scene, const Timestamp timestamp) override
Internal event function to inform the node that it has been initialized and can apply all internal va...
size_t objectAddress() const override
Returns the address of the most derived object.
Rendering::SceneRef renderingSceneObject_
Additional rendering object to handle a scene and a group object in common.
Definition: X3DScene.h:86
void onInitialize(const Timestamp timestamp) override
Internal event function to inform the scene that it has been initialized and can apply all internal v...
This class implements the base class for all sdx scene object providing access to all elements of a s...
Definition: SDXScene.h:39
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15