Ocean
scenedescription/sdx/x3d/Background.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_BACKGROUND_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_BACKGROUND_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace SceneDescription
20 {
21 
22 namespace SDX
23 {
24 
25 namespace X3D
26 {
27 
28 /**
29  * This class implements a x3d background node.
30  * @ingroup scenedescriptionsdxx3d
31  */
32 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT Background : virtual public X3DBackgroundNode
33 {
34  public:
35 
36  /**
37  * Creates a new x3d background node.
38  * @param environment Node environment
39  */
40  explicit Background(const SDXEnvironment* environment);
41 
42  protected:
43 
44  /**
45  * Destructs a background object.
46  */
47  ~Background() override;
48 
49  /**
50  * Specifies the node type and the fields of this node.
51  * @return Unique node specification of this node
52  */
54 
55  /**
56  * Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
57  * @see SDXNode::onInitialize().
58  */
59  void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
60 
61  /**
62  * Event function to inform the node about a changed field.
63  * @see SDXNode::onFieldChanged().
64  */
65  void onFieldChanged(const std::string& fieldName) override;
66 
67  /**
68  * Returns the address of the most derived object.
69  * @see Node::objectAddress().
70  */
71  size_t objectAddress() const override;
72 
73  /**
74  * Creates a textures object by given texture urls.
75  * @param urls Texture urls to create a textures object from
76  * @return Resulting textures object
77  */
79 
80  protected:
81 
82  /// BackUrl field.
84 
85  /// BottomUrl field.
87 
88  /// FrontUrl field.
90 
91  /// LeftUrl field.
93 
94  /// RightUrl field.
96 
97  /// TopUrl field.
99 
100  /// Transparency field.
102 };
103 
104 }
105 
106 }
107 
108 }
109 
110 }
111 
112 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_BACKGROUND_H
std::vector< std::string > Values
Definition of a vector holding the single values.
Definition: Field1D.h:122
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements a x3d background node.
Definition: scenedescription/sdx/x3d/Background.h:33
MultiString leftUrl_
LeftUrl field.
Definition: scenedescription/sdx/x3d/Background.h:92
size_t objectAddress() const override
Returns the address of the most derived object.
MultiString backUrl_
BackUrl field.
Definition: scenedescription/sdx/x3d/Background.h:83
Background(const SDXEnvironment *environment)
Creates a new x3d background node.
~Background() override
Destructs a background object.
void onInitialize(const Rendering::SceneRef &scene, const Timestamp timestamp) override
Event function to inform the node that it has been initialized and can apply all internal values to c...
SingleFloat transparency_
Transparency field.
Definition: scenedescription/sdx/x3d/Background.h:101
MultiString rightUrl_
RightUrl field.
Definition: scenedescription/sdx/x3d/Background.h:95
MultiString topUrl_
TopUrl field.
Definition: scenedescription/sdx/x3d/Background.h:98
MultiString frontUrl_
FrontUrl field.
Definition: scenedescription/sdx/x3d/Background.h:89
MultiString bottomUrl_
BottomUrl field.
Definition: scenedescription/sdx/x3d/Background.h:86
void onFieldChanged(const std::string &fieldName) override
Event function to inform the node about a changed field.
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
Rendering::TexturesRef createTextures(const MultiString::Values &urls) const
Creates a textures object by given texture urls.
This class implements an abstract x3d background node.
Definition: X3DBackgroundNode.h:31
This class implements a node environment container.
Definition: SDXNode.h:62
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15