Ocean
Loading...
Searching...
No Matches
GLESLineStrips.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_LINE_STRIPS_H
9#define META_OCEAN_RENDERING_GLES_LINE_STRIPS_H
10
13
15
16namespace Ocean
17{
18
19namespace Rendering
20{
21
22namespace GLESceneGraph
23{
24
25/**
26 * This class implements a GLESceneGraph line strips object.
27 * @ingroup renderinggles
28 */
29class OCEAN_RENDERING_GLES_EXPORT GLESLineStrips :
30 virtual public GLESStripPrimitive,
31 virtual public LineStrips
32{
33 friend class GLESFactory;
34
35 public:
36
37 /**
38 * Returns the strips of this primitive object.
39 * @see StripPrimitive::strips().
40 */
41 VertexIndexGroups strips() const override;
42
43 /**
44 * Returns the number of line strips defined in this primitive.
45 * @see StripPrimitive::numberStrips().
46 */
47 unsigned int numberStrips() const override;
48
49 /**
50 * Returns the width (thickness ) in pixels at which all lines will be rendered
51 * @see LineStrips::lineWidth().
52 */
53 Scalar lineWidth() const override;
54
55 /**
56 * Sets the strips of this primitive object.
57 * @see StripPtrimitive::setStrips().
58 */
59 void setStrips(const VertexIndexGroups& strips) override;
60
61 /**
62 * Sets the width (thickness) in pixels at which all lines will be rendered.
63 * @see LineStrips::setLineWidth().
64 */
65 void setLineWidth(const Scalar width) override;
66
67 /**
68 * Renders the line strips defined by the associated vertex set and the defined line 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 line strips defined by the associated vertex set and the defined line 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 /**
80 * Draws all line strips with the currently bound shader program.
81 */
83
84 protected:
85
86 /**
87 * Creates a new GLESceneGraph line strips object.
88 */
90
91 /**
92 * Destructs a GLESceneGraph line strips object.
93 */
94 ~GLESLineStrips() override;
95
96 /**
97 * Releases the internal vertex buffer object containing the line strips indices.
98 */
99 void release();
100
101 /**
102 * Updates the bounding box of this primitive.
103 * @see GLESPrimitive::updateBoundingBox().
104 */
105 void updateBoundingBox() override;
106
107 protected:
108
109 /// Vertex buffer object for line indices.
110 GLuint vboIndices_ = 0u;
111
112 /// The line strips.
114
115 /// The width (thickness) of the line in pixels, with range [1, infinity)
117};
118
119}
120
121}
122
123}
124
125#endif // META_OCEAN_RENDERING_GLES_LINE_STRIPS_H
This class implements a GLESceneGraph attribute set object.
Definition GLESAttributeSet.h:40
This class implements a base for all GLESceneGraph framebuffers.
Definition rendering/glescenegraph/GLESFramebuffer.h:34
friend class GLESFactory
Definition GLESLineStrips.h:33
VertexIndexGroups strips() const override
Returns the strips of this primitive object.
void setLineWidth(const Scalar width) override
Sets the width (thickness) in pixels at which all lines will be rendered.
void updateBoundingBox() override
Updates the bounding box of this primitive.
void setStrips(const VertexIndexGroups &strips) override
Sets the strips of this primitive object.
void release()
Releases the internal vertex buffer object containing the line strips indices.
~GLESLineStrips() override
Destructs a GLESceneGraph line strips object.
GLuint vboIndices_
Vertex buffer object for line indices.
Definition GLESLineStrips.h:110
Scalar lineWidth_
The width (thickness) of the line in pixels, with range [1, infinity).
Definition GLESLineStrips.h:116
GLESLineStrips()
Creates a new GLESceneGraph line strips object.
void render(const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESShaderProgram &shaderProgram) override
Renders the line strips defined by the associated vertex set and the defined line faces.
VertexIndexGroups strips_
The line strips.
Definition GLESLineStrips.h:113
unsigned int numberStrips() const override
Returns the number of line strips defined in this primitive.
void drawLineStrips()
Draws all line strips with the currently bound shader program.
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 line strips defined by the associated vertex set and the defined line faces.
Scalar lineWidth() const override
Returns the width (thickness ) in pixels at which all lines will be rendered.
This class implements a container for an OpenGL ES shader program.
Definition GLESShaderProgram.h:53
GLESStripPrimitive()
Creates a new GLESceneGraph stripped primitive object.
LineStrips()
Creates a new line strips object.
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
SquareMatrixT3< Scalar > SquareMatrix3
Definition of the SquareMatrix3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix3.h:43
SquareMatrixT4< Scalar > SquareMatrix4
Definition of the SquareMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix4.h:39
float Scalar
Definition of a scalar type.
Definition Math.h:129
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
Namespace of the Rendering GLESceneGraph library.
Definition rendering/glescenegraph/android/Android.h:20
Namespace of the Rendering library.
Definition AbsoluteTransform.h:18
The namespace covering the entire Ocean framework.
Definition Accessor.h:15