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  * @exception NotSupportedException Is thrown if this function is not supported
67  * @see setPointSize().
68  */
69  virtual Scalar pointSize() const;
70 
71  /**
72  * Sets the indices of the used vertex points.
73  * The indices must not extend the number of defined vertices inside the used vertex set
74  * @param indices Vertex indices to be set
75  * @see indices(), VertexSet
76  * @exception NotSupportedException Is thrown if this function is not supported
77  */
78  virtual void setIndices(const VertexIndices& indices);
79 
80  /**
81  * Sets the indices of the used vertex points.
82  * @param numberImplicitPoints The number of points on points with consecutive indices, with range [0, infinity)
83  * @exception NotSupportedException Is thrown if this function is not supported
84  */
85  virtual void setIndices(const unsigned int numberImplicitPoints);
86 
87  /**
88  * Sets the size in pixels at which all points will be rendered.
89  * @param size The size of all points, in pixels, with range [1, infinity)
90  * @exception NotSupportedException Is thrown if this function is not supported
91  * @see pointSize().
92  */
93  virtual void setPointSize(const Scalar size);
94 
95  protected:
96 
97  /**
98  * Creates a new points object.
99  */
101 
102  /**
103  * Destructs a points object.
104  */
105  ~Points() override;
106 };
107 
108 }
109 
110 }
111 
112 #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