Ocean
X3DTexture2DNode.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_TEXTURE_2D_NODE_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_TEXTURE_2D_NODE_H
10 
13 
14 #include "ocean/io/FileResolver.h"
15 
17 
18 #include <string>
19 #include <vector>
20 
21 namespace Ocean
22 {
23 
24 namespace SceneDescription
25 {
26 
27 namespace SDX
28 {
29 
30 namespace X3D
31 {
32 
33 /**
34  * This class implements an abstract x3d texture 2D node.
35  * @ingroup scenedescriptionsdxx3d
36  */
37 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT X3DTexture2DNode : virtual public X3DTextureNode
38 {
39  protected:
40 
41  /**
42  * Definition of a vector holding strings.
43  */
44  typedef std::vector<std::string> StringVector;
45 
46  protected:
47 
48  /**
49  * Creates a new abstract x3d texture 2D node.
50  * @param environment Node environment
51  */
52  explicit X3DTexture2DNode(const SDXEnvironment* environment);
53 
54  /**
55  * Destructs a x3d texture 2D node.
56  */
57  ~X3DTexture2DNode() override;
58 
59  /**
60  * Registers the fields of this node.
61  * @param specification Node specification receiving the field informations
62  */
63  void registerFields(NodeSpecification& specification);
64 
65  /**
66  * Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
67  * @see SDXNode::onInitialize().
68  */
69  void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
70 
71  /**
72  * Applies the current url.
73  * @param resolvedURLs Resolved URLs to be create a medium from
74  * @param mediumType Type of the framed medium to be created
75  * @param start Determines whether the framed medium will be started directly
76  */
77  void applyUrl(const StringVector& resolvedURLs, const Media::FrameMedium::Type mediumType, const bool start = true);
78 
79  /**
80  * Event function to modify properties of a new medium before it will be started and used as texture.
81  * @param medium Medium object which can be modified
82  */
83  virtual void onMediumChanged(const Media::MediumRef& medium);
84 
85  protected:
86 
87  /// RepeatS field.
89 
90  /// RepeatT field.
92 
93  /// TextureProperties field.
95 
96  /// Texture medium.
98 };
99 
100 }
101 
102 }
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_TEXTURE_2D_NODE_H
Type
Definition of different medium types.
Definition: Medium.h:57
This template class implements a object reference with an internal reference counter.
Definition: base/ObjectRef.h:58
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements an abstract x3d texture 2D node.
Definition: X3DTexture2DNode.h:38
SingleNode textureProperties_
TextureProperties field.
Definition: X3DTexture2DNode.h:94
~X3DTexture2DNode() override
Destructs a x3d texture 2D node.
virtual void onMediumChanged(const Media::MediumRef &medium)
Event function to modify properties of a new medium before it will be started and used as texture.
void registerFields(NodeSpecification &specification)
Registers the fields of this 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...
SingleBool repeatT_
RepeatT field.
Definition: X3DTexture2DNode.h:91
std::vector< std::string > StringVector
Definition of a vector holding strings.
Definition: X3DTexture2DNode.h:44
X3DTexture2DNode(const SDXEnvironment *environment)
Creates a new abstract x3d texture 2D node.
Media::FrameMediumRef textureMedium_
Texture medium.
Definition: X3DTexture2DNode.h:97
void applyUrl(const StringVector &resolvedURLs, const Media::FrameMedium::Type mediumType, const bool start=true)
Applies the current url.
SingleBool repeatS_
RepeatS field.
Definition: X3DTexture2DNode.h:88
This class implemenst an abstract x3d texture node.
Definition: X3DTextureNode.h:31
This class implements a node environment container.
Definition: SDXNode.h:62
This class implements a timestamp.
Definition: Timestamp.h:36
SmartMediumRef< FrameMedium > FrameMediumRef
Definition of a smart medium reference holding a frame medium object.
Definition: FrameMedium.h:32
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15