Ocean
scenedescription/sdx/x3d/Material.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_MATERIAL_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_MATERIAL_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace SceneDescription
18 {
19 
20 namespace SDX
21 {
22 
23 namespace X3D
24 {
25 
26 /**
27  * This class implements a x3d material node.
28  * @ingroup scenedescriptionsdxx3d
29  */
30 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT Material : virtual public X3DMaterialNode
31 {
32  public:
33 
34  /**
35  * Creates a new x3d material node.
36  * @param environment Node environment
37  */
38  explicit Material(const SDXEnvironment* environment);
39 
40  protected:
41 
42  /**
43  * Specifies the node type and the fields of this node.
44  * @return Unique node specification of this node
45  */
47 
48  /**
49  * Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
50  * @see SDXNode::onInitialize().
51  */
52  void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
53 
54  /**
55  * Event function to inform the node about a changed field.
56  * @see SDXNode::onFieldChanged().
57  */
58  void onFieldChanged(const std::string& fieldName) override;
59 
60  /**
61  * Explicit changing event function for node fields.
62  * @see X3DNode::onFieldChanging().
63  */
64  bool onFieldChanging(const std::string& fieldName, const Field& field) override;
65 
66  /**
67  * Returns the address of the most derived object.
68  * @see Node::objectAddress().
69  */
70  size_t objectAddress() const override;
71 
72  protected:
73 
74  /// AmbientIntensity field.
76 
77  /// DiffuseColor field.
79 
80  /// EmissiveColor field.
82 
83  /// Shininess field.
85 
86  /// SpecularColor field.
88 
89  /// Transparency field.
91 
92  /// Reflectivity field, which is not part of the X3D specification.
94 
95  /// Refraction index field, which is not part of the X3D specification.
97 };
98 
99 }
100 
101 }
102 
103 }
104 
105 }
106 
107 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_MATERIAL_H
This class is the base class for all scene description fields.
Definition: Field.h:36
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements a x3d material node.
Definition: scenedescription/sdx/x3d/Material.h:31
SingleColor emissiveColor_
EmissiveColor field.
Definition: scenedescription/sdx/x3d/Material.h:81
SingleFloat shininess_
Shininess field.
Definition: scenedescription/sdx/x3d/Material.h:84
SingleColor diffuseColor_
DiffuseColor field.
Definition: scenedescription/sdx/x3d/Material.h:78
SingleFloat transparency_
Transparency field.
Definition: scenedescription/sdx/x3d/Material.h:90
SingleFloat ambientIntensity_
AmbientIntensity field.
Definition: scenedescription/sdx/x3d/Material.h:75
Material(const SDXEnvironment *environment)
Creates a new x3d material node.
bool onFieldChanging(const std::string &fieldName, const Field &field) override
Explicit changing event function for node fields.
SingleFloat reflectivity_
Reflectivity field, which is not part of the X3D specification.
Definition: scenedescription/sdx/x3d/Material.h:93
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...
SingleColor specularColor_
SpecularColor field.
Definition: scenedescription/sdx/x3d/Material.h:87
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.
size_t objectAddress() const override
Returns the address of the most derived object.
SingleFloat refractionIndex_
Refraction index field, which is not part of the X3D specification.
Definition: scenedescription/sdx/x3d/Material.h:96
This class implements an abstract x3d material node.
Definition: X3DMaterialNode.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