Ocean
Loading...
Searching...
No Matches
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
17
18#include <map>
19
20namespace Ocean
21{
22
23namespace SceneDescription
24{
25
26namespace SDX
27{
28
29namespace X3D
30{
31
32/**
33 * This class implements a scene object holding an entire x3d scene.
34 * @ingroup scenedescriptionsdxx3d
35 */
36class 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
X3DGroupingNode(const SDXEnvironment *environment)
Creates an abstract x3d grouping node.
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.
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.
const Rendering::ObjectRef & renderingObject() const override
Returns the associated rendering 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...
const Rendering::EngineRef & engine() const
Returns the rendering engine used by this node.
Definition SDXNode.h:296
const std::string & library() const
Returns the name of the scene description library defining this node.
Definition SDXNode.h:302
SDXScene(const std::string &filename, const Library &library, const Rendering::EngineRef &engine)
Creates a new scene object.
const std::string & filename() const
Returns the name of the file defining this node.
Definition SDXScene.h:119
This class implements a timestamp.
Definition Timestamp.h:64
Ocean::ObjectRef< Engine > EngineRef
Definition of an engine reference object.
Definition Engine.h:30
SmartObjectRef< Scene > SceneRef
Definition of a smart object reference holding a scene node.
Definition rendering/Scene.h:29
Ocean::ObjectRef< Object > ObjectRef
Definition of a rendering object reference with an internal reference counter.
Definition Object.h:34
Namespace of the S(scene)D(escription)X X3D SceneDescription library.
Definition Appearance.h:26
Definition Appearance.h:23
Namespace of the SceneDescription library.
Definition DynamicNode.h:21
The namespace covering the entire Ocean framework.
Definition Accessor.h:15