Ocean
GLESCylinder.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_CYLINDER_H
9 #define META_OCEAN_RENDERING_GLES_CYLINDER_H
10 
14 
16 
17 namespace Ocean
18 {
19 
20 namespace Rendering
21 {
22 
23 namespace GLESceneGraph
24 {
25 
26 /**
27  * This class implements a GLESceneGraph cylinder object.
28  * @ingroup renderinggles
29  */
30 class OCEAN_RENDERING_GLES_EXPORT GLESCylinder :
31  virtual public GLESShape,
32  virtual protected GLESTriangleStrips,
33  virtual public Cylinder
34 {
35  friend class GLESFactory;
36 
37  public:
38 
39  /**
40  * Returns the height of this cylinder.
41  * @see Cylinder::height().
42  */
43  Scalar height() const override;
44 
45  /**
46  * Returns the radius of this cylinder.
47  * @see Cylinder::radius().
48  */
49  Scalar radius() const override;
50 
51  /**
52  * Sets the height of this cylinder.
53  * @see Cylinder::setHeight().
54  */
55  bool setHeight(const Scalar height) override;
56 
57  /**
58  * Sets the radius of this cylinder.
59  * @see Cylinder::setRadius().
60  */
61  bool setRadius(const Scalar radius) override;
62 
63  /**
64  * Returns the type of this object.
65  * @see Object::type().
66  */
67  ObjectType type() const override;
68 
69  protected:
70 
71  /**
72  * Creates a new GLESceneGraph cylinder object.
73  */
75 
76  /**
77  * Destructs a GLESceneGraph cylinder object.
78  */
79  ~GLESCylinder() override;
80 
81  /**
82  * Rebuilds the primitive vertex, normals and face sets.
83  * @see GLESShape::rebuildPrimitives().
84  */
85  void rebuildPrimitives() override;
86 
87  /**
88  * Updates the bounding box of this primitive.
89  * @see GLESIndependentPrimitive::updateBoundingBox().
90  */
91  void updateBoundingBox() override;
92 
93  protected:
94 
95  /// Holds the height of this cylinder.
96  Scalar height_ = Scalar(1);
97 
98  /// Holds the radius of this cylinder.
99  Scalar radius_ = Scalar(1);
100 };
101 
102 }
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_GLES_CYLINDER_H
This class is the base class for all cylinders.
Definition: rendering/Cylinder.h:36
This class implements a GLESceneGraph cylinder object.
Definition: GLESCylinder.h:34
void updateBoundingBox() override
Updates the bounding box of this primitive.
bool setHeight(const Scalar height) override
Sets the height of this cylinder.
GLESCylinder()
Creates a new GLESceneGraph cylinder object.
Scalar height() const override
Returns the height of this cylinder.
~GLESCylinder() override
Destructs a GLESceneGraph cylinder object.
void rebuildPrimitives() override
Rebuilds the primitive vertex, normals and face sets.
bool setRadius(const Scalar radius) override
Sets the radius of this cylinder.
ObjectType type() const override
Returns the type of this object.
Scalar radius() const override
Returns the radius of this cylinder.
This class implements a class factory for all GLESceneGraph objects.
Definition: GLESFactory.h:30
This class is the base class for all GLESceneGraph shape objects.
Definition: GLESShape.h:34
This class implements a GLESceneGraph triangle strips object.
Definition: GLESTriangleStrips.h:32
ObjectType
Definition of different object type.
Definition: Object.h:63
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15