Ocean
rendering/Cylinder.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_CYLINDER_H
9 #define META_OCEAN_RENDERING_CYLINDER_H
10 
13 #include "ocean/rendering/Shape.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Rendering
19 {
20 
21 // Forward declaration
22 class Cylinder;
23 
24 /**
25  * Definition of a smart object reference holding a cylinder.
26  * @see SmartObjectRef, Cylinder.
27  * @ingroup rendering
28  */
30 
31 /**
32  * This class is the base class for all cylinders.
33  * @ingroup rendering
34  */
35 class OCEAN_RENDERING_EXPORT Cylinder : virtual public Shape
36 {
37  public:
38 
39  /**
40  * Returns the height of this cylinder.
41  * @return Height of this cylinder
42  * @exception NotSupportedException Is thrown if this function is not supported
43  */
44  virtual Scalar height() const;
45 
46  /**
47  * Returns the radius of this cylinder.
48  * @return Radius of this cylinder
49  * @exception NotSupportedException Is thrown if this function is not supported
50  */
51  virtual Scalar radius() const;
52 
53  /**
54  * Returns whether the top face of the cylinder is visible.
55  * @exception NotSupportedException Is thrown if this function is not supported
56  * @return True, if so
57  */
58  virtual bool top() const;
59 
60  /**
61  * Returns whether the bottom face of the cylinder is visible.
62  * @exception NotSupportedException Is thrown if this function is not supported
63  * @return True, if so
64  */
65  virtual bool bottom() const;
66 
67  /**
68  * Reutrn whether the side face of the cylinder is visible.
69  * @exception NotSupportedException Is thrown if this function is not supported
70  * @return True, if so
71  */
72  virtual bool side() const;
73 
74  /**
75  * Sets the height of this cylinder.
76  * @param height The height to set
77  * @return True, if the specified height was valid and could be set
78  * @exception NotSupportedException Is thrown if this function is not supported
79  */
80  virtual bool setHeight(const Scalar height);
81 
82  /**
83  * Sets the radius of this cylinder.
84  * @param radius Radius to set
85  * @return True, if the specified radius was valid and could be set
86  * @exception NotSupportedException Is thrown if this function is not supported
87  */
88  virtual bool setRadius(const Scalar radius);
89 
90  /**
91  * Sets whether the top face of the cylinder is visible.
92  * @param visible True, if the face has to be visible
93  * @exception NotSupportedException Is thrown if this function is not supported
94  * @return True, if succeeded
95  */
96  virtual bool setTop(const bool visible);
97 
98  /**
99  * Sets whether the side face of the cylinder is visible.
100  * @param visible True, if the face has to be visible
101  * @exception NotSupportedException Is thrown if this function is not supported
102  * @return True, if succeeded
103  */
104  virtual bool setSide(const bool visible);
105 
106  /**
107  * Sets whether the bottom face of the cylinder is visible.
108  * @param visible True, if the face has to be visible
109  * @exception NotSupportedException Is thrown if this function is not supported
110  * @return True, if succeeded
111  */
112  virtual bool setBottom(const bool visible);
113 
114  /**
115  * Returns the type of this object.
116  * @see Object::type().
117  */
118  ObjectType type() const override;
119 
120  protected:
121 
122  /**
123  * Creates a new cylinder object.
124  */
126 
127  /**
128  * Destructs a cylinder object.
129  */
130  ~Cylinder() override;
131 };
132 
133 }
134 
135 }
136 
137 #endif // META_OCEAN_RENDERING_CYLINDER_H
This class is the base class for all cylinders.
Definition: rendering/Cylinder.h:36
virtual bool top() const
Returns whether the top face of the cylinder is visible.
virtual bool setTop(const bool visible)
Sets whether the top face of the cylinder is visible.
virtual Scalar radius() const
Returns the radius of this cylinder.
virtual bool side() const
Reutrn whether the side face of the cylinder is visible.
virtual bool setSide(const bool visible)
Sets whether the side face of the cylinder is visible.
virtual bool bottom() const
Returns whether the bottom face of the cylinder is visible.
Cylinder()
Creates a new cylinder object.
~Cylinder() override
Destructs a cylinder object.
virtual bool setRadius(const Scalar radius)
Sets the radius of this cylinder.
virtual bool setHeight(const Scalar height)
Sets the height of this cylinder.
virtual Scalar height() const
Returns the height of this cylinder.
ObjectType type() const override
Returns the type of this object.
virtual bool setBottom(const bool visible)
Sets whether the bottom face of the cylinder is visible.
ObjectType
Definition of different object type.
Definition: Object.h:63
This class is the base class for all geometries.
Definition: rendering/Shape.h:35
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
float Scalar
Definition of a scalar type.
Definition: Math.h:128
SmartObjectRef< Cylinder > CylinderRef
Definition of a smart object reference holding a cylinder.
Definition: rendering/Cylinder.h:22
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15