Ocean
Points.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_POINTS_H
9 #define META_OCEAN_RENDERING_POINTS_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Rendering
18 {
19 
20 // Forward declaration
21 class Points;
22 
23 /**
24  * Definition of a smart object reference holding a points node.
25  * @see SmartObjectRef, Points.
26  * @ingroup rendering
27  */
29 
30 /**
31  * This class is the base for all points objects.
32  * A points object define individual points using a vertex set.<br>
33  * Different points objects can use the same vertex set to share common vertices and to reduce memory usage.
34  * @see VertexSet
35  * @ingroup rendering
36  */
37 class OCEAN_RENDERING_EXPORT Points : virtual public IndependentPrimitive
38 {
39  public:
40 
41  /**
42  * Returns the type of this object.
43  * @see Object::type().
44  */
45  ObjectType type() const override;
46 
47  /**
48  * Returns the indices of the used vertex points.
49  * @return Vertex indices
50  * @see setIndices(), VertexSet
51  * @exception NotSupportedException Is thrown if this function is not supported
52  */
53  virtual VertexIndices indices() const;
54 
55  /**
56  * Returns the number of point indices defined in this primitive.
57  * @return Number of point indices
58  * @exception NotSupportedException Is thrown if this function is not supported
59  */
60  virtual unsigned int numberIndices() const;
61 
62  /**
63  * Returns the size in pixels at which all points will be rendered.
64  * The size of a point is defined by the diameter of the point.
65  * @return The size of all points, in pixels, with range [1, infinity)
66  */
67  virtual Scalar pointSize() const;
68 
69  /**
70  * Sets the indices of the used vertex points.
71  * The indices must not extend the number of defined vertices inside the used vertex set
72  * @param indices Vertex indices to be set
73  * @see indices(), VertexSet
74  * @exception NotSupportedException Is thrown if this function is not supported
75  */
76  virtual void setIndices(const VertexIndices& indices);
77 
78  /**
79  * Sets the indices of the used vertex points.
80  * @param numberImplicitPoints The number of points on points with consecutive indices, with range [0, infinity)
81  * @exception NotSupportedException Is thrown if this function is not supported
82  */
83  virtual void setIndices(const unsigned int numberImplicitPoints);
84 
85  /**
86  * Sets the size in pixels at which all points will be rendered.
87  * @param size The size of all points, in pixels, with range [1, infinity)
88  */
89  virtual void setPointSize(const Scalar size);
90 
91  protected:
92 
93  /**
94  * Creates a new points object.
95  */
96  Points();
97 
98  /**
99  * Destructs a points object.
100  */
101  ~Points() override;
102 };
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_POINTS_H
This class is the base class for all independent primitive objects.
Definition: IndependentPrimitive.h:25
ObjectType
Definition of different object type.
Definition: Object.h:63
This class is the base for all points objects.
Definition: Points.h:38
virtual void setIndices(const unsigned int numberImplicitPoints)
Sets the indices of the used vertex points.
virtual unsigned int numberIndices() const
Returns the number of point indices defined in this primitive.
ObjectType type() const override
Returns the type of this object.
virtual Scalar pointSize() const
Returns the size in pixels at which all points will be rendered.
~Points() override
Destructs a points object.
virtual void setIndices(const VertexIndices &indices)
Sets the indices of the used vertex points.
virtual VertexIndices indices() const
Returns the indices of the used vertex points.
virtual void setPointSize(const Scalar size)
Sets the size in pixels at which all points will be rendered.
Points()
Creates a new points object.
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< VertexIndex > VertexIndices
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:101
SmartObjectRef< Points > PointsRef
Definition of a smart object reference holding a points node.
Definition: Points.h:21
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15