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