Visual Computing Library
Loading...
Searching...
No Matches
vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT > Class Template Reference

The VertexReferences class represents a component that stores a container of indices or pointers to vertices that will be part of an Element (e.g. Face, Edge, Tetrahedron, etc.). More...

#include <vclib/mesh/components/vertex_references.h>

Inheritance diagram for vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >:

Public Types

using VertexType = Vertex
 Expose the type of the Vertex.
 
using VertexIterator = Base::Iterator
 
using ConstVertexIterator = Base::ConstIterator
 
using ConstVertexIndexIterator = Base::ConstIndexIterator
 

Public Member Functions

 VertexReferences ()=default
 Empty constructor.
 
uint vertexNumber () const
 Returns the number of vertices of the element.
 
Vertexvertex (uint i)
 Returns the pointer to the i-th vertex of the element.
 
const Vertexvertex (uint i) const
 Returns a const pointer to the i-th vertex of the element.
 
uint vertexIndex (uint i) const
 Returns the index in the vertex container of the i-th vertex of the element.
 
VertexvertexMod (int i)
 Returns a reference of the pointer to the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to get the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:
 
const VertexvertexMod (int i) const
 Same of vertexMod, but returns a const pointer to the vertex.
 
uint vertexIndexMod (int i) const
 Returns the index in the vertex container of the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to get the "index of the vertex next to position k", without check if it is less than the number of vertices. Works also for negative numbers:
 
void setVertex (uint i, Vertex *v)
 Sets the i-th vertex of the element.
 
void setVertex (uint i, uint vi)
 Sets the i-th vertex of the element.
 
void setVertex (ConstVertexIterator it, Vertex *v)
 Sets the vertex pointed by the iterator.
 
void setVertex (ConstVertexIterator it, uint vi)
 Sets the vertex pointed by the iterator.
 
void setVertex (ConstVertexIndexIterator it, Vertex *v)
 Sets the vertex pointed by the iterator.
 
void setVertex (ConstVertexIndexIterator it, uint vi)
 Sets the vertex pointed by the iterator.
 
void setVertexMod (int i, Vertex *v)
 Sets the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to set the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:
 
void setVertexMod (int i, uint vi)
 Sets the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to set the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:
 
template<Range Rng>
requires InputRange<Rng, Vertex*>
void setVertices (Rng &&r)
 Sets all the vertex pointers of the element.
 
template<Range Rng>
requires InputRange<Rng, uint>
void setVertices (Rng &&r)
 Sets all the vertex pointers of the element.
 
bool containsVertex (const Vertex *v) const
 Returns true if the container of vertices contains the given vertex, false otherwise.
 
bool containsVertex (uint vi) const
 Returns true if the container of vertices contains the vertex with the given index, false otherwise.
 
uint indexOfVertex (const Vertex *v) const
 Returns the index of the given vertex in the container of the element. If the given vertex is not in the container, returns UINT_NULL.
 
uint indexOfVertex (uint vi) const
 Returns the index of the vertex with the given index in the container of the element. If the vertex with the given index is not in the container, returns UINT_NULL.
 
uint indexOfEdge (const Vertex *v1, const Vertex *v2) const
 Returns the index of the given edge composed of the two vertices v1 and v2 in the container of the element.
 
uint indexOfEdge (uint vi1, uint vi2) const
 Returns the index of the edge composed of the two vertices with the given indices in the container of the element.
 
void resizeVertices (uint n)
 Resize the container of the vertices to the given size.
 
void pushVertex (Vertex *v)
 Pushes in the back of the container the given vertex.
 
void pushVertex (uint vi)
 Pushes in the back of the container the given vertex.
 
void insertVertex (uint i, Vertex *v)
 Inserts the given vertex in the container at the given position.
 
void insertVertex (uint i, uint vi)
 Inserts the vertex with the given index in the container at the given position.
 
void eraseVertex (uint i)
 Removes the vertex at the given position from the container.
 
void clearVertices ()
 Clears the container of vertices, making it empty.
 
VertexIterator vertexBegin ()
 Returns an iterator to the first vertex in the container of this component.
 
VertexIterator vertexEnd ()
 Returns an iterator to the end of the container of this component.
 
ConstVertexIterator vertexBegin () const
 Returns a const iterator to the first vertex in the container of this component.
 
ConstVertexIterator vertexEnd () const
 Returns a const iterator to the end of the container of this component.
 
ConstVertexIndexIterator vertexIndexBegin () const
 Returns an iterator to the first vertex index in the container of this component.
 
ConstVertexIndexIterator vertexIndexEnd () const
 Returns an iterator to the end of the container of this component.
 
View< VertexIterator > vertices ()
 Returns a lightweight view object that stores the begin and end iterators of the container of vertices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:
 
View< ConstVertexIterator > vertices () const
 Returns a lightweight const view object that stores the begin and end iterators of the container of vertices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:
 
View< ConstVertexIndexIterator > vertexIndices () const
 Returns a lightweight view object that stores the begin and end iterators of the container of vertex indices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:
 

Static Public Attributes

static const bool INDEXED = STORE_INDICES
 
static const int VERTEX_NUMBER = Base::SIZE
 

Protected Member Functions

template<typename Element >
void importFrom (const Element &e, bool importRefs=true)
 
void serialize (std::ostream &os) const
 
void deserialize (std::istream &is)
 
- Protected Member Functions inherited from vcl::comp::ReferenceContainerComponent< STORE_INDICES, DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >
uint size () const
 
Elemelement (uint i)
 
const Elemelement (uint i) const
 
uint elementIndex (uint i) const
 
ElemelementMod (int i)
 
const ElemelementMod (int i) const
 
uint elementIndexMod (int i) const
 
void setElement (uint i, Elem *e)
 
void setElement (uint i, uint ei)
 
void setElement (Base::ConstIterator it, Elem *v)
 
void setElement (Base::ConstIterator it, uint vi)
 
void setElement (Base::ConstIndexIterator it, Elem *v)
 
void setElement (Base::ConstIndexIterator it, uint vi)
 
void setElementMod (int i, Elem *e)
 
void setElementMod (int i, uint ei)
 
template<Range Rng>
requires InputRange<Rng, Elem*>
void setElements (Rng &&r)
 
template<Range Rng>
requires InputRange<Rng, uint>
void setElements (Rng &&r)
 
bool containsElement (const Elem *e) const
 
bool containsElement (uint ei) const
 
uint indexOfElement (const Elem *e) const
 
uint indexOfElement (uint ei) const
 
Base::Iterator elementBegin ()
 
Base::Iterator elementEnd ()
 
Base::ConstIterator elementBegin () const
 
Base::ConstIterator elementEnd () const
 
Base::ConstIndexIterator elementIndexBegin () const
 
Base::ConstIndexIterator elementIndexEnd () const
 
View< typename Base::Iterator > elements ()
 
View< typename Base::ConstIterator > elements () const
 
View< typename Base::ConstIndexIterator > elementIndices () const
 
void resize (uint n)
 
void pushBack (Elem *e=nullptr)
 
void pushBack (uint ei)
 
void insert (uint i, Elem *e=nullptr)
 
void insert (uint i, uint ei)
 
void erase (uint i)
 
void clear ()
 
uint indexFromPointer (const Elem *v) const
 
ElemelemFromParent (uint vi)
 
const ElemelemFromParent (uint vi) const
 

Private Types

using Base = ReferenceContainerComponent< STORE_INDICES, VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >, CompId::VERTEX_REFERENCES, Vertex, N, ParentElemType, VERT, false, false >
 

Private Member Functions

template<typename Element >
void importIndicesFrom (const Element &e)
 

Additional Inherited Members

- Protected Types inherited from vcl::comp::ReferenceContainerComponent< STORE_INDICES, DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >
using Base = std::conditional_t< STORE_INDICES, IndexContainerComponent< DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >, PointerContainerComponent< DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN > >
 

Detailed Description

template<bool STORE_INDICES, typename Vertex, int N, typename ParentElemType = void, bool VERT = false>
class vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >

The VertexReferences class represents a component that stores a container of indices or pointers to vertices that will be part of an Element (e.g. Face, Edge, Tetrahedron, etc.).

The container of Vertex references is a random access container that could have static or dynamic size, depending on the value of the template argument N (a negative number means dynamic).

For example, if a Face element should represent only triangles, N could be

  1. In this case, the container will have static size and it can't be resized in any way. If N is -1, the container will have dynamic size and it will be possible to resize it (e.g. if the Face element should represent a polygon).

The member functions of this class will be available in the instance of any Element that will contain this component.

For example, if you have a Face Element f that has the VertexReferences component, you'll be able to access to this component member functions from f:

uint n = f.vertexNumber();
auto* v = f.vertex(0);
uint vi = f.vertexIndex(0);
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Note
This component is usually the main component of an Element, and therefore it cannot be optional.
Several components are Tied To Vertex Number: in other words, they are composed by a container that has the same size of the VertexReferences and, when the VertexReferences container is resized, also the container of these components is resized automatically.
Template Parameters
STORE_INDICESIf true, the component will store indices, otherwise pointers to Vertex.
VertexThe type of the vertices.
NThe size of the container, that will represent the number of storable vertices. If negative, the container is dynamic.
ParentElemTypeThis type is used to get access to the Element that has the component (and, in case, to the Mesh that has the Element). If the component doesn't need to access the Element, this type can be void. Note: if the component is vertical (or optional), this type cannot be void.
VERTIf true, the component will be stored vertically. This argument is considered only if the ElementType is not void.

Constructor & Destructor Documentation

◆ VertexReferences()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::VertexReferences ( )
default

Empty constructor.

If the VertexReferences container size is static, initializes all the pointers/indices to nullptr/UINT_NULL, otherwise the container will be empty.

Member Function Documentation

◆ clearVertices()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::clearVertices ( )
inline

Clears the container of vertices, making it empty.

Note
This function is available only if the container of the Vertices has dynamic size.

◆ containsVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
bool vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::containsVertex ( const Vertex v) const
inline

Returns true if the container of vertices contains the given vertex, false otherwise.

Parameters
[in]vthe pointer to the vertex to search.
Returns
true if the container of vertices contains the given vertex, false otherwise.

◆ containsVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
bool vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::containsVertex ( uint  vi) const
inline

Returns true if the container of vertices contains the vertex with the given index, false otherwise.

Parameters
[in]vithe index of the vertex to search.
Returns
true if the container of vertices contains the vertex with the given index, false otherwise.

◆ eraseVertex()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::eraseVertex ( uint  i)
inline

Removes the vertex at the given position from the container.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]iThe position of the vertex to remove from this container.

◆ indexOfEdge() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::indexOfEdge ( const Vertex v1,
const Vertex v2 
) const
inline

Returns the index of the given edge composed of the two vertices v1 and v2 in the container of the element.

The order of the two vertices is not important. The index of the edge corresponds to the index of the first vertex found in the container. If the edge formed by the two vertices is not in the container, returns UINT_NULL.

Parameters
[in]v1the pointer to the first vertex that compose the edge to search.
[in]v2the pointer to the second vertex that compose the edge to search.
Returns
the index of the edge composed of v1 and v2, or UINT_NULL if it is not found.

◆ indexOfEdge() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::indexOfEdge ( uint  vi1,
uint  vi2 
) const
inline

Returns the index of the edge composed of the two vertices with the given indices in the container of the element.

The order of the two vertices is not important. The index of the edge corresponds to the index of the first vertex found in the container. If the edge formed by the two vertices is not in the container, returns UINT_NULL.

Parameters
[in]vi1the index of the first vertex that compose the edge to search.
[in]vi2the index of the second vertex that compose the edge to search.
Returns
the index of the edge composed of the vertices with the given indices, or UINT_NULL if it is not found.

◆ indexOfVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::indexOfVertex ( const Vertex v) const
inline

Returns the index of the given vertex in the container of the element. If the given vertex is not in the container, returns UINT_NULL.

Parameters
[in]vthe pointer to the vertex to search.
Returns
the index of the given vertex, or UINT_NULL if it is not found.

◆ indexOfVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::indexOfVertex ( uint  vi) const
inline

Returns the index of the vertex with the given index in the container of the element. If the vertex with the given index is not in the container, returns UINT_NULL.

Parameters
[in]vithe index of the vertex to search.
Returns
the index of the vertex with the given index, or UINT_NULL if it is not found.

◆ insertVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::insertVertex ( uint  i,
uint  vi 
)
inline

Inserts the vertex with the given index in the container at the given position.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]iThe position in this container where to insert the vertex.
[in]viThe index of the vertex to insert in the container.

◆ insertVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::insertVertex ( uint  i,
Vertex v 
)
inline

Inserts the given vertex in the container at the given position.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]iThe position in this container where to insert the vertex.
[in]vThe pointer to the vertex to insert in the container.

◆ pushVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::pushVertex ( uint  vi)
inline

Pushes in the back of the container the given vertex.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]viThe index to the vertex to push in the back of the container.

◆ pushVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::pushVertex ( Vertex v)
inline

Pushes in the back of the container the given vertex.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]vThe pointer to the vertex to push in the back of the container.

◆ resizeVertices()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::resizeVertices ( uint  n)
inline

Resize the container of the vertices to the given size.

Note
This function is available only if the container of the Vertices has dynamic size.
Parameters
[in]nThe new size of the vertices container.

◆ setVertex() [1/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( ConstVertexIndexIterator  it,
uint  vi 
)
inline

Sets the vertex pointed by the iterator.

Parameters
[in]itthe iterator in this container on which set the vertex; the value must be between begin() and end().
[in]viThe index in the vertex container of the vertex to set.

◆ setVertex() [2/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( ConstVertexIndexIterator  it,
Vertex v 
)
inline

Sets the vertex pointed by the iterator.

Parameters
[in]ititerator in this container on which set the vertex; the value must be between begin() and end().
[in]vThe pointer to the vertex to set to the element.

◆ setVertex() [3/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( ConstVertexIterator  it,
uint  vi 
)
inline

Sets the vertex pointed by the iterator.

Parameters
[in]itthe iterator in this container on which set the vertex; the value must be between begin() and end().
[in]viThe index in the vertex container of the vertex to set.

◆ setVertex() [4/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( ConstVertexIterator  it,
Vertex v 
)
inline

Sets the vertex pointed by the iterator.

Parameters
[in]itthe iterator in this container on which set the vertex; the value must be between begin() and end().
[in]vThe pointer to the vertex to set to the element.

◆ setVertex() [5/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( uint  i,
uint  vi 
)
inline

Sets the i-th vertex of the element.

Parameters
[in]ithe position in this container on which set the vertex; the value must be between 0 and the number of vertices.
[in]viThe index in the vertex container of the vertex to set.

◆ setVertex() [6/6]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertex ( uint  i,
Vertex v 
)
inline

Sets the i-th vertex of the element.

Parameters
[in]ithe position in this container on which set the vertex; the value must be between 0 and the number of vertices.
[in]vThe pointer to the vertex to set to the element.

◆ setVertexMod() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertexMod ( int  i,
uint  vi 
)
inline

Sets the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to set the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:

k = pos; // some position of a vertex
e.setVertexMod(k+1, aVertInd); // set the vertex next to k, that may also
// be at pos 0
e.setVertexMod(-1, aVertInd); // set the vertex in position
// vertexNumber()-1
Parameters
[in]ithe position in this container w.r.t. the position 0 on which set the vertex; value is modularized on vertexNumber().
[in]viThe index in the vertex container of the vertex to set.

◆ setVertexMod() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertexMod ( int  i,
Vertex v 
)
inline

Sets the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to set the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:

k = pos; // some position of a vertex
e.setVertexMod(k+1, aVertex); // set the vertex next to k, that may also
// be at pos 0
e.setVertexMod(-1, aVertex); // set the vertex in position
// vertexNumber()-1
Parameters
[in]ithe position in this container w.r.t. the position 0 on which set the vertex; value is modularized on vertexNumber().
[in]vThe pointer to the vertex to set to the element.

◆ setVertices() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
template<Range Rng>
requires InputRange<Rng, Vertex*>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertices ( Rng &&  r)
inline

Sets all the vertex pointers of the element.

If the size of the container is static, the size of the input range must be the same one of the container.

Template Parameters
RngThe type of the range of vertex pointers to set. The value type of the range must be convertible to a pointer to a Vertex.
Parameters
[in]rrange of vertex pointers to set.

◆ setVertices() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
template<Range Rng>
requires InputRange<Rng, uint>
void vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::setVertices ( Rng &&  r)
inline

Sets all the vertex pointers of the element.

If the size of the container is static, the size of the input range must be the same one of the container.

Template Parameters
RngThe type of the range of vertex indices to set. The value type of the range must be convertible to unsigned integer.
Parameters
[in]rrange of vertex indices to set.

◆ vertex() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
Vertex * vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertex ( uint  i)
inline

Returns the pointer to the i-th vertex of the element.

Parameters
[in]ithe position of the required vertex in this container.
Returns
The pointer i-th vertex of the element.

◆ vertex() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
const Vertex * vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertex ( uint  i) const
inline

Returns a const pointer to the i-th vertex of the element.

Parameters
[in]ithe position of the required vertex in this container; the value must be between 0 and the number of vertices.
Returns
The pointer to the i-th vertex of the element.

◆ vertexBegin() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
VertexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexBegin ( )
inline

Returns an iterator to the first vertex in the container of this component.

Returns
an iterator pointing to the begin of this container.

◆ vertexBegin() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
ConstVertexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexBegin ( ) const
inline

Returns a const iterator to the first vertex in the container of this component.

Returns
an iterator pointing to the begin of this container.

◆ vertexEnd() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
VertexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexEnd ( )
inline

Returns an iterator to the end of the container of this component.

Returns
an iterator pointing to the end of this container.

◆ vertexEnd() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
ConstVertexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexEnd ( ) const
inline

Returns a const iterator to the end of the container of this component.

Returns
an iterator pointing to the end of this container.

◆ vertexIndex()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexIndex ( uint  i) const
inline

Returns the index in the vertex container of the i-th vertex of the element.

Parameters
[in]ithe position of the required vertex in this container.
Returns
The index of the i-th vertex of the element.

◆ vertexIndexBegin()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
ConstVertexIndexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexIndexBegin ( ) const
inline

Returns an iterator to the first vertex index in the container of this component.

Returns
an iterator pointing to the begin of the vertex indices.

◆ vertexIndexEnd()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
ConstVertexIndexIterator vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexIndexEnd ( ) const
inline

Returns an iterator to the end of the container of this component.

Returns
an iterator pointing to the end of the vertex indices.

◆ vertexIndexMod()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexIndexMod ( int  i) const
inline

Returns the index in the vertex container of the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to get the "index of the vertex next to position k", without check if it is less than the number of vertices. Works also for negative numbers:

k = pos; // some position of a vertex
auto idx = e.vertexIndexMod(k+1); // the index of the vertex next to k,
// that may also be at pos 0
auto lastIdx = e.vertexIndexMod(-1); // the index of the vertex in
// position vertexNumber()-1
Parameters
[in]ithe position of the required vertex in this container, w.r.t. the position 0; value is modularized on vertexNumber().
Returns
The index of the required vertex of the element.

◆ vertexIndices()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
View< ConstVertexIndexIterator > vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexIndices ( ) const
inline

Returns a lightweight view object that stores the begin and end iterators of the container of vertex indices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:

for (uint vid : el.vertexIndices()) {
// Do something with vertex index...
}
View< ConstVertexIndexIterator > vertexIndices() const
Returns a lightweight view object that stores the begin and end iterators of the container of vertex ...
Definition vertex_references.h:652
Returns
a lightweight view object that can be used in range-based for loops to iterate over vertex indices.

◆ vertexMod() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
Vertex * vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexMod ( int  i)
inline

Returns a reference of the pointer to the i-th vertex of the element, but using as index the module between i and the number of vertices. You can use this function if you need to get the "next vertex after position k", without check if it is less than the number of vertices. Works also for negative numbers:

k = pos; // some position of a vertex
auto* next = e.vertexMod(k+1); // the vertex next to k, that may also
// be at pos 0
auto* last = e.vertexMod(-1); // the vertex in position vertexNumber()-1
Parameters
[in]ithe position of the required vertex in this container, w.r.t. the position 0; value is modularized on vertexNumber().
Returns
The pointer to the required vertex of the element.

◆ vertexMod() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
const Vertex * vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexMod ( int  i) const
inline

Same of vertexMod, but returns a const pointer to the vertex.

Parameters
[in]ithe position of the required vertex in this container, w.r.t. the position 0; value is modularized on vertexNumber().
Returns
The pointer to the required vertex of the element.

◆ vertexNumber()

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
uint vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertexNumber ( ) const
inline

Returns the number of vertices of the element.

Returns
The number of vertices of the element.

◆ vertices() [1/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
View< VertexIterator > vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertices ( )
inline

Returns a lightweight view object that stores the begin and end iterators of the container of vertices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:

for (auto* vertex : el.vertices()) {
// Do something with vertex...
}
View< VertexIterator > vertices()
Returns a lightweight view object that stores the begin and end iterators of the container of vertice...
Definition vertex_references.h:616
Vertex * vertex(uint i)
Returns the pointer to the i-th vertex of the element.
Definition vertex_references.h:151
Returns
a lightweight view object that can be used in range-based for loops to iterate over vertices.

◆ vertices() [2/2]

template<bool STORE_INDICES, typename Vertex , int N, typename ParentElemType = void, bool VERT = false>
View< ConstVertexIterator > vcl::comp::VertexReferences< STORE_INDICES, Vertex, N, ParentElemType, VERT >::vertices ( ) const
inline

Returns a lightweight const view object that stores the begin and end iterators of the container of vertices of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops:

for (const auto* vertex : el.vertices()) {
// Do something read-only with vertex...
}
Returns
a lightweight view object that can be used in range-based for loops to iterate over vertices.

The documentation for this class was generated from the following file: