Ocean
rendering/Scene.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_RENDERING_SCENE_H
9 #define META_OCEAN_RENDERING_SCENE_H
10 
14 
15 namespace Ocean
16 {
17 
18 namespace Rendering
19 {
20 
21 // Forward declaration
22 class Scene;
23 
24 /**
25  * Definition of a smart object reference holding a scene node.
26  * @see SmartObjectRef, Scene.
27  * @ingroup rendering
28  */
30 
31 /**
32  * Definition of a vector holding scenes.
33  * @ingroup rendering
34  */
35 typedef std::vector<SceneRef> Scenes;
36 
37 /**
38  * This is the base class for all rendering scenes.
39  * A once created scene can be added to a framebuffer to render the defined scene with all child nodes.
40  * @see Framebuffer
41  * @ingroup rendering
42  */
43 class OCEAN_RENDERING_EXPORT Scene : virtual public Transform
44 {
45  public:
46 
47  /**
48  * Returns the type of this object.
49  * @see Object::type().
50  */
51  ObjectType type() const override;
52 
53  /**
54  * Returns whether this scene is lit with the view's headlight in case the view's headlight is active.
55  * @return True, if so; True, by default
56  */
57  virtual bool useHeadlight() const;
58 
59  /**
60  * Sets whether this scene is lit with the view's headlight in case the view's headlight is active.
61  * @param state True, to light this scene with the view's headlight in case the view's headlight is active; False; to not use the view's headlight in any case
62  */
63  virtual void setUseHeadlight(const bool state);
64 
65  protected:
66 
67  /**
68  * Creates a new scene object.
69  */
70  Scene();
71 
72  /**
73  * Destructs a scene object.
74  */
75  ~Scene() override;
76 
77  protected:
78 
79  /// True, to light this scene with the view's headlight in case the view's headlight is active; False; to not use the view's headlight in any case
80  bool useViewHeadlight_ = true;
81 };
82 
83 }
84 
85 }
86 
87 #endif // META_OCEAN_RENDERING_SCENE_H
ObjectType
Definition of different object type.
Definition: Object.h:63
This is the base class for all rendering scenes.
Definition: rendering/Scene.h:44
Scene()
Creates a new scene object.
~Scene() override
Destructs a scene object.
virtual bool useHeadlight() const
Returns whether this scene is lit with the view's headlight in case the view's headlight is active.
virtual void setUseHeadlight(const bool state)
Sets whether this scene is lit with the view's headlight in case the view's headlight is active.
ObjectType type() const override
Returns the type of this object.
This class is the base class for all transform nodes.
Definition: rendering/Transform.h:43
SmartObjectRef< Scene > SceneRef
Definition of a smart object reference holding a scene node.
Definition: rendering/Scene.h:22
std::vector< SceneRef > Scenes
Definition of a vector holding scenes.
Definition: rendering/Scene.h:35
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15