Ocean
GLESBox.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_BOX_H
9 #define META_OCEAN_RENDERING_GLES_BOX_H
10 
14 
15 #include "ocean/rendering/Box.h"
16 
17 namespace Ocean
18 {
19 
20 namespace Rendering
21 {
22 
23 namespace GLESceneGraph
24 {
25 
26 /**
27  * This class implements a GLESceneGraph box object.
28  * @ingroup renderinggles
29  */
30 class OCEAN_RENDERING_GLES_EXPORT GLESBox :
31  virtual public GLESShape,
32  virtual protected GLESTriangles,
33  virtual public Box
34 {
35  friend class GLESFactory;
36 
37  public:
38 
39  /**
40  * Returns the dimensions of the box.
41  * @see Box::size().
42  */
43  Vector3 size() const override;
44 
45  /**
46  * Sets the dimensions of the box.
47  * @see Box::setSize().
48  */
49  bool setSize(const Vector3& size) override;
50 
51  /**
52  * Returns the type of this object.
53  * @see Object::type().
54  */
55  ObjectType type() const override;
56 
57  protected:
58 
59  /**
60  * Creates a new GLESceneGraph box object.
61  */
63 
64  /**
65  * Destructs a GLESceneGraph box object.
66  */
67  ~GLESBox() override;
68 
69  /**
70  * Rebuilds the primitive vertex, normals and face sets.
71  * @see GLESShape::rebuildPrimitives().
72  */
73  void rebuildPrimitives() override;
74 
75  /**
76  * Updates the bounding box of this primitive.
77  * @see GLESIndependentPrimitive::updateBoundingBox().
78  */
79  void updateBoundingBox() override;
80 
81  protected:
82 
83  /// The dimension of the box.
84  Vector3 size_ = Vector3(1, 1, 1);
85 };
86 
87 }
88 
89 }
90 
91 }
92 
93 #endif // META_OCEAN_RENDERING_GLES_BOX_H
This class is the base class for all boxes.
Definition: rendering/Box.h:37
This class implements a GLESceneGraph box object.
Definition: GLESBox.h:34
ObjectType type() const override
Returns the type of this object.
void rebuildPrimitives() override
Rebuilds the primitive vertex, normals and face sets.
~GLESBox() override
Destructs a GLESceneGraph box object.
void updateBoundingBox() override
Updates the bounding box of this primitive.
GLESBox()
Creates a new GLESceneGraph box object.
Vector3 size() const override
Returns the dimensions of the box.
bool setSize(const Vector3 &size) override
Sets the dimensions of the box.
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
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition: Vector3.h:22
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15