Ocean
rendering/Box.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_BOX_H
9 #define META_OCEAN_RENDERING_BOX_H
10 
13 #include "ocean/rendering/Shape.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Rendering
19 {
20 
21 // Forward declaration
22 class Box;
23 
24 /**
25  * Definition of a smart object reference holding a box.
26  * @see SmartObjectRef, Box.
27  * @ingroup rendering
28  */
30 
31 /**
32  * This class is the base class for all boxes.<br>
33  * The box is defined about the origin with edge length (1, 1, 1).
34  * @ingroup rendering
35  */
36 class OCEAN_RENDERING_EXPORT Box : virtual public Shape
37 {
38  public:
39 
40  /**
41  * Returns the dimensions of the box.
42  * @return Dimensions of the box
43  * @exception NotSupportedException Is thrown if this function is not supported
44  */
45  virtual Vector3 size() const;
46 
47  /**
48  * Sets the dimensions of the box.
49  * @param size Dimension of the box in x-, y-, and z-direction
50  * @return True, if the specified size was valid and could be set
51  * @exception NotSupportedException Is thrown if this function is not supported
52  */
53  virtual bool setSize(const Vector3& size);
54 
55  /**
56  * Returns the type of this object.
57  * @see Object::type().
58  */
59  ObjectType type() const override;
60 
61  protected:
62 
63  /**
64  * Creates a new box object with default edge length (1, 1, 1)<br>
65  * The box will be defined about the origin.
66  */
67  Box();
68 
69  /**
70  * Destructs a box object.
71  */
72  ~Box() override;
73 };
74 
75 }
76 
77 }
78 
79 #endif // META_OCEAN_RENDERING_BOX_H
This class is the base class for all boxes.
Definition: rendering/Box.h:37
virtual bool setSize(const Vector3 &size)
Sets the dimensions of the box.
virtual Vector3 size() const
Returns the dimensions of the box.
Box()
Creates a new box object with default edge length (1, 1, 1) The box will be defined about the origin...
ObjectType type() const override
Returns the type of this object.
~Box() override
Destructs a box 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
SmartObjectRef< Box > BoxRef
Definition of a smart object reference holding a box.
Definition: rendering/Box.h:22
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15