Ocean
GLESCone.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_CONE_H
9 #define META_OCEAN_RENDERING_GLES_CONE_H
10 
14 
15 #include "ocean/rendering/Cone.h"
16 
17 namespace Ocean
18 {
19 
20 namespace Rendering
21 {
22 
23 namespace GLESceneGraph
24 {
25 
26 /**
27  * This class implements a GLESceneGraph cone object.
28  * @ingroup renderinggles
29  */
30 class OCEAN_RENDERING_GLES_EXPORT GLESCone :
31  virtual public GLESShape,
32  virtual protected GLESTriangles,
33  virtual public Cone
34 {
35  friend class GLESFactory;
36 
37  public:
38 
39  /**
40  * Returns the radius of this cone.
41  * @see Cone::radius().
42  */
43  Scalar radius() const override;
44 
45  /**
46  * Returns the height of this cone.
47  * @see Cone::height().
48  */
49  Scalar height() const override;
50 
51  /**
52  * Sets the radius of this cone.
53  * @see Cone::setRadius().
54  */
55  bool setRadius(const Scalar radius) override;
56 
57  /**
58  * Sets the height of this cone.
59  * @see Cone::setHeight().
60  */
61  bool setHeight(const Scalar height) 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 cone object.
73  */
75 
76  /**
77  * Destructs a GLESceneGraph cone object.
78  */
79  ~GLESCone() 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 cone.
96  Scalar height_ = Scalar(1);
97 
98  /// Holds the radius of this cone.
99  Scalar radius_ = Scalar(1);
100 };
101 
102 }
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_GLES_CONE_H
This class is the base class for all cones.
Definition: rendering/Cone.h:38
This class implements a GLESceneGraph cone object.
Definition: GLESCone.h:34
~GLESCone() override
Destructs a GLESceneGraph cone object.
GLESCone()
Creates a new GLESceneGraph cone object.
ObjectType type() const override
Returns the type of this object.
bool setHeight(const Scalar height) override
Sets the height of this cone.
void updateBoundingBox() override
Updates the bounding box of this primitive.
Scalar height() const override
Returns the height of this cone.
Scalar radius() const override
Returns the radius of this cone.
bool setRadius(const Scalar radius) override
Sets the radius of this cone.
void rebuildPrimitives() override
Rebuilds the primitive vertex, normals and face sets.
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 triangles object.
Definition: GLESTriangles.h:33
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