Ocean
GLESTriangleFans.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_GLES_TRIANGLE_FANS_H
9 #define META_OCEAN_RENDERING_GLES_TRIANGLE_FANS_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GLESceneGraph
23 {
24 
25 /**
26  * This class implements a GLESceneGraph triangle fans object.
27  * @ingroup renderinggles
28  */
29 class OCEAN_RENDERING_GLES_EXPORT GLESTriangleFans :
30  virtual public GLESStripPrimitive,
31  virtual public TriangleFans
32 {
33  friend class GLESFactory;
34 
35  protected:
36 
37  /**
38  * Definition of a pair holding a vertex buffer object and the number of indices.
39  */
40  typedef std::pair<GLuint, unsigned int> VertexBufferPair;
41 
42  /**
43  * Definition of a vector holding vertex buffer objects.
44  */
45  typedef std::vector<VertexBufferPair> VertexBufferPairs;
46 
47  public:
48 
49  /**
50  * Returns the strips of this primitive object.
51  * @see StripPrimitive::strips().
52  */
53  VertexIndexGroups strips() const override;
54 
55  /**
56  * Returns the number of triangle strips defined in this primitive.
57  * @see StripPrimitive::numberStrips().
58  */
59  unsigned int numberStrips() const override;
60 
61  /**
62  * Sets the strips of this primitive object.
63  * @see StripPtrimitive::setStrips().
64  */
65  void setStrips(const VertexIndexGroups& strips) override;
66 
67  /**
68  * Renders the triangles defined by the associated vertex set and the defined triangle faces.
69  * @see Renderable::render().
70  */
71  void render(const GLESFramebuffer& framebuffer, const SquareMatrix4& projectionMatrix, const HomogenousMatrix4& camera_T_object, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, GLESAttributeSet& attributeSet, const Lights& lights) override;
72 
73  /**
74  * Renders the triangles defined by the associated vertex set and the defined triangle faces.
75  * @see Renderable::render().
76  */
77  void render(const SquareMatrix4& projectionMatrix, const HomogenousMatrix4& camera_T_object, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, GLESShaderProgram& shaderProgram) override;
78 
79  protected:
80 
81  /**
82  * Creates a new GLESceneGraph triangle fans object.
83  */
85 
86  /**
87  * Destructs a GLESceneGraph triangle fans object.
88  */
89  ~GLESTriangleFans() override;
90 
91  /**
92  * Releases the internal vertex buffer object containing the triangle strips indices.
93  */
94  void release();
95 
96  /**
97  * Updates the bounding box of this primitive.
98  * @see GLESPrimitive::updateBoundingBox().
99  */
100  void updateBoundingBox() override;
101 
102  protected:
103 
104  /// Vertex buffer pairs holding the indices of the fans.
106 
107  /// The strips of the fans.
109 };
110 
111 }
112 
113 }
114 
115 }
116 
117 #endif // META_OCEAN_RENDERING_GLES_TRIANGLE_FANS_H
This class implements a GLESceneGraph attribute set object.
Definition: GLESAttributeSet.h:40
This class implements a class factory for all GLESceneGraph objects.
Definition: GLESFactory.h:30
This class implements a base for all GLESceneGraph framebuffers.
Definition: rendering/glescenegraph/GLESFramebuffer.h:34
This class implements a container for an OpenGL ES shader program.
Definition: GLESShaderProgram.h:53
This class is the base class for all GLESceneGraph stripped primitives.
Definition: GLESStripPrimitive.h:32
This class implements a GLESceneGraph triangle fans object.
Definition: GLESTriangleFans.h:32
void render(const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESShaderProgram &shaderProgram) override
Renders the triangles defined by the associated vertex set and the defined triangle faces.
unsigned int numberStrips() const override
Returns the number of triangle strips defined in this primitive.
std::vector< VertexBufferPair > VertexBufferPairs
Definition of a vector holding vertex buffer objects.
Definition: GLESTriangleFans.h:45
GLESTriangleFans()
Creates a new GLESceneGraph triangle fans object.
VertexIndexGroups strips() const override
Returns the strips of this primitive object.
VertexIndexGroups strips_
The strips of the fans.
Definition: GLESTriangleFans.h:108
void setStrips(const VertexIndexGroups &strips) override
Sets the strips of this primitive object.
VertexBufferPairs vertexBufferPairs_
Vertex buffer pairs holding the indices of the fans.
Definition: GLESTriangleFans.h:105
void release()
Releases the internal vertex buffer object containing the triangle strips indices.
std::pair< GLuint, unsigned int > VertexBufferPair
Definition of a pair holding a vertex buffer object and the number of indices.
Definition: GLESTriangleFans.h:40
void render(const GLESFramebuffer &framebuffer, const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESAttributeSet &attributeSet, const Lights &lights) override
Renders the triangles defined by the associated vertex set and the defined triangle faces.
void updateBoundingBox() override
Updates the bounding box of this primitive.
~GLESTriangleFans() override
Destructs a GLESceneGraph triangle fans object.
This class is the base class for all triangle fan objects.
Definition: TriangleFans.h:35
std::vector< VertexIndices > VertexIndexGroups
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:125
std::vector< LightPair > Lights
Definition of a set holding light sources.
Definition: GLESLightSource.h:44
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15