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