Ocean
GIVertexSet.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_GI_VERTEX_SET_H
9 #define META_OCEAN_RENDERING_GI_VERTEX_SET_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GlobalIllumination
23 {
24 
25 #define maximalTextureLayers 8
26 
27 /**
28  * This class implements a vertex set.
29  * @ingroup renderinggi
30  */
31 class OCEAN_RENDERING_GI_EXPORT GIVertexSet :
32  virtual public GIObject,
33  virtual public VertexSet
34 {
35  friend class GIFactory;
36 
37  public:
38 
39  /**
40  * Returns the normals of this set.
41  * @see VertexSet::normals().
42  */
43  Normals normals() const override;
44 
45  /**
46  * Returns the texture coordinates of this set.
47  * @see VertexSet::textureCoordinates().
48  */
49  TextureCoordinates textureCoordinates(const unsigned int layerIndex) const override;
50 
51  /**
52  * Returns the vertices of this set.
53  * @see VertexSet::vertices().
54  */
55  Vertices vertices() const override;
56 
57  /**
58  * Returns the colors of this set.
59  * @see VertexSet::colors().
60  */
61  RGBAColors colors() const override;
62 
63  /**
64  * Returns the number of normals of this set.
65  * @see VertexSet::numberNormals().
66  */
67  unsigned int numberNormals() const override;
68 
69  /**
70  * Returns the number of texture coordinats of this set.
71  * @see VertexSet::numberTextureCoordinates().
72  */
73  unsigned int numberTextureCoordinates(const unsigned int layerIndex) const override;
74 
75  /**
76  * Returns the number of vertices of this set.
77  * @see VertexSet::numberVertices().
78  */
79  unsigned int numberVertices() const override;
80 
81  /**
82  * Returns the number of colors of this set.
83  * @see VertexSet::numberColors().
84  */
85  unsigned int numberColors() const override;
86 
87  /**
88  * Sets the normals for this set.
89  * @see VertexSet::setNormals().
90  */
91  void setNormals(const Normals& normals) override;
92 
93  /**
94  * Sets the texels for this set.
95  * @see VertexSet::setTextureCoordinates().
96  */
97  void setTextureCoordinates(const TextureCoordinates& textureCoordinates, const unsigned int layerIndex) override;
98 
99  /**
100  * Sets the vertices for this set.
101  * @see VertexSet::setVertices().
102  */
103  void setVertices(const Vertices& vertices) override;
104 
105  /**
106  * Sets the colors for this set.
107  * @see VertexSet::setColors().
108  */
109  void setColors(const RGBAColors& colors) override;
110 
111  /**
112  * Sets several attributes concurrently.
113  * @see VertexSet::set().
114  */
115  void set(const Vertices& vertices, const Normals& normals, const TextureCoordinates& textureCoordinates, const RGBAColors& colors) override;
116 
117  protected:
118 
119  /**
120  * Creates a new vertex set object.
121  */
123 
124  /**
125  * Destructs a vertex set object.
126  */
127  ~GIVertexSet() override;
128 
129  protected:
130 
131  /// Vertex set normals.
133 
134  /// Vertex set texture coordinates.
135  TextureCoordinates vertexSetTextureCoordinates[maximalTextureLayers];
136 
137  /// Vertex set vertices.
139 
140  /// Vertex set colors.
142 };
143 
144 }
145 
146 }
147 
148 }
149 
150 #endif // META_OCEAN_RENDERING_GI_VERTEX_SET_H
This class implements a class factory for all Global Illumination objects.
Definition: GIFactory.h:30
This class is the base class for all Global Illumination objects.
Definition: GIObject.h:29
This class implements a vertex set.
Definition: GIVertexSet.h:34
unsigned int numberNormals() const override
Returns the number of normals of this set.
void setTextureCoordinates(const TextureCoordinates &textureCoordinates, const unsigned int layerIndex) override
Sets the texels for this set.
TextureCoordinates textureCoordinates(const unsigned int layerIndex) const override
Returns the texture coordinates of this set.
Vertices vertices() const override
Returns the vertices of this set.
void setNormals(const Normals &normals) override
Sets the normals for this set.
Normals normals() const override
Returns the normals of this set.
unsigned int numberVertices() const override
Returns the number of vertices of this set.
Normals vertexSetNormals
Vertex set normals.
Definition: GIVertexSet.h:132
~GIVertexSet() override
Destructs a vertex set object.
GIVertexSet()
Creates a new vertex set object.
void set(const Vertices &vertices, const Normals &normals, const TextureCoordinates &textureCoordinates, const RGBAColors &colors) override
Sets several attributes concurrently.
RGBAColors colors() const override
Returns the colors of this set.
unsigned int numberTextureCoordinates(const unsigned int layerIndex) const override
Returns the number of texture coordinats of this set.
void setVertices(const Vertices &vertices) override
Sets the vertices for this set.
RGBAColors vertexSetColors
Vertex set colors.
Definition: GIVertexSet.h:141
Vertices vertexSetVertices
Vertex set vertices.
Definition: GIVertexSet.h:138
void setColors(const RGBAColors &colors) override
Sets the colors for this set.
unsigned int numberColors() const override
Returns the number of colors of this set.
This class is the base class for all rendering vertex sets.
Definition: VertexSet.h:47
std::vector< RGBAColor > RGBAColors
Definition of a vector holding rgba color objects.
Definition: RGBAColor.h:21
std::vector< Vertex > Vertices
Definition of a vector holding vertices.
Definition: rendering/Rendering.h:119
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition: rendering/Rendering.h:113
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition: rendering/Rendering.h:107
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15