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  * Sets the indices of the used vertex lines.
65  * The indices must not extend the number of defined vertices inside the used vertex set
66  * @param indices Vertex indices to be set
67  * @see indices(), VertexSet
68  * @exception NotSupportedException Is thrown if this function is not supported
69  */
70  virtual void setIndices(const VertexIndices& indices);
71 
72  /**
73  * Sets the indices of the used vertex lines.
74  * @param numberImplicitLines The number of lines on points with consecutive indices, with range [0, infinity)
75  * @exception NotSupportedException Is thrown if this function is not supported
76  */
77  virtual void setIndices(const unsigned int numberImplicitLines);
78 
79  protected:
80 
81  /**
82  * Creates a new lines object.
83  */
84  Lines();
85 
86  /**
87  * Destructs a lines object.
88  */
89  ~Lines() override;
90 };
91 
92 }
93 
94 }
95 
96 #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 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 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
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