Ocean
ShaderPart.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_SHADER_PART_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_SHADER_PART_H
10 
14 
16 
17 namespace Ocean
18 {
19 
20 namespace SceneDescription
21 {
22 
23 namespace SDX
24 {
25 
26 namespace X3D
27 {
28 
29 /**
30  * This class implements a x3d shader part node.
31  * @ingroup scenedescriptionsdxx3d
32  */
33 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT ShaderPart :
34  virtual public X3DNode,
35  virtual public X3DUrlObject
36 {
37  friend class ComposedShader;
38 
39  public:
40 
41  /**
42  * Creates a new shader part node.
43  * @param environment Node environment
44  */
45  ShaderPart(const SDXEnvironment* environment);
46 
47  protected:
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  * Returns the address of the most derived object.
63  * @see Node::objectAddress().
64  */
65  size_t objectAddress() const override;
66 
67  /**
68  * Returns the pair of filename and shader type defined by this shader part.
69  * @return The shader part's pair of filename and shader type
70  */
72 
73  protected:
74 
75  /// Type field.
77 };
78 
79 }
80 
81 }
82 
83 }
84 
85 }
86 
87 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_SHADER_PART_H
std::pair< std::string, ShaderType > FilenamePair
Definition of a pair combining a filename with a shader type with.
Definition: rendering/ShaderProgram.h:86
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements a x3d composed shader node.
Definition: ComposedShader.h:39
This class implements a x3d shader part node.
Definition: ShaderPart.h:36
ShaderPart(const SDXEnvironment *environment)
Creates a new shader part node.
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...
Rendering::ShaderProgram::FilenamePair filenamePair() const
Returns the pair of filename and shader type defined by this shader part.
size_t objectAddress() const override
Returns the address of the most derived object.
SingleString type_
Type field.
Definition: ShaderPart.h:76
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
This class implements an abstract x3d node.
Definition: X3DNode.h:48
This class implements an abstract x3d url object.
Definition: X3DUrlObject.h:35
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