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

The AdjacentVertices class is a container of Vertex indices or pointers. It is a component that makes sense to use mostly on Vertex Elements. For Faces and Edges, see the VertexPointers component (which is similar, but has different member function names). More...

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

Inheritance diagram for vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >:

Public Types

using AdjacentVertexType = Vertex
 Expose the type of the Adjacent Vertex.
 
using AdjacentVertexIterator = Base::Iterator
 
using ConstAdjacentVertexIterator = Base::ConstIterator
 
using ConstAdjacentVertexIndexIterator = Base::ConstIndexIterator
 

Public Member Functions

 AdjacentVertices ()=default
 Empty constructor.
 
uint adjVerticesNumber () const
 Returns the number of adjacent vertices of the element.
 
VertexadjVertex (uint i)
 Returns the pointer to the i-th adjacent vertex of an element.
 
const VertexadjVertex (uint i) const
 Returns a const pointer to the i-th adjacent vertex of the element.
 
uint adjVertexIndex (uint i) const
 Returns the index in the vertex container of the i-th adjacent vertex of the element.
 
VertexadjVertexMod (int i)
 Returns the pointer to the i-th adjacent vertex of the element, but using as index the module between i and the number of adjacent vertices. You can use this function if you need to get the "next adjacent vertex after position k", without check if it is less than the number of adj vertices. Works also for negative numbers:
 
const VertexadjVertexMod (int i) const
 Same of adjVertexMod, but returns a const Pointer to the adjacent vertex.
 
uint adjVertexIndexMod (int i) const
 Returns the index in the vertex container of the i-th adjacent vertex of the element, but using as index the module between i and the number of adjacent vertices. You can use this function if you need to get the "index of the adjacent vertex next to position k", without check if it is less than the number of adjacent vertices. Works also for negative numbers:
 
void setAdjVertex (uint i, Vertex *v)
 Sets the i-th adjacent vertex of the element.
 
void setAdjVertex (uint i, uint vi)
 Sets the i-th adjacent vertex of the element.
 
void setAdjVertex (ConstAdjacentVertexIterator it, Vertex *v)
 Sets the adjacent vertex pointed by the iterator.
 
void setAdjVertex (ConstAdjacentVertexIterator it, uint vi)
 Sets the adjacent vertex pointed by the iterator.
 
void setAdjVertex (ConstAdjacentVertexIndexIterator it, Vertex *v)
 Sets the adjacent vertex pointed by the iterator.
 
void setAdjVertex (ConstAdjacentVertexIndexIterator it, uint vi)
 Sets the adjacent vertex pointed by the iterator.
 
void setAdjVertexMod (int i, Vertex *v)
 Sets the i-th adjacent vertex of the element, but using as index the module between i and the number of adjacent vertices. You can use this function if you need to set the "next adjacent vertex after position k", without check if it is less than the number of adjacent vertices. Works also for negative numbers:
 
void setAdjVertexMod (int i, uint vi)
 Sets the i-th adjacent vertex of the element, but using as index the module between i and the number of adjacent vertices. You can use this function if you need to set the "next adjacent vertex after position k", without check if it is less than the number of adjacent vertices. Works also for negative numbers:
 
template<Range Rng>
requires InputRange<Rng, Vertex*>
void setAdjVertices (Rng &&r)
 Sets all the adjacent vertices of this element.
 
template<Range Rng>
requires InputRange<Rng, uint>
void setAdjVertices (Rng &&r)
 Sets all the adjacent vertices of this element.
 
bool containsAdjVertex (const Vertex *v) const
 Returns true if the container of adjacent vertices contains the given vertex, false otherwise.
 
bool containsAdjVertex (uint vi) const
 Returns true if the container of adjacent vertices contains the given vertex, false otherwise.
 
uint indexOfAdjVertex (const Vertex *v) const
 Returns the index of the given adjacent vertex in the container of the element. If the given adjacent vertex is not in the container, returns UINT_NULL.
 
uint indexOfAdjVertex (uint vi) const
 Returns the index of the adjacent vertex with the given index in the container of the element. If the given adjacent vertex is not in the container, returns UINT_NULL.
 
void resizeAdjVertices (uint n)
 Resize the container of the adjacent vertices to the given size.
 
void pushAdjVertex (Vertex *v)
 Pushes in the back of the container the given adjacent vertex.
 
void pushAdjVertex (uint vi)
 Pushes in the back of the container the given adjacent vertex..
 
void insertAdjVertex (uint i, Vertex *v)
 Inserts the given adjacent vertex in the container at the given position.
 
void insertAdjVertex (uint i, uint vi)
 Inserts the given adjacent vertex in the container at the given position.
 
void eraseAdjVertex (uint i)
 Removes the adjacent vertex at the given position from the container.
 
void clearAdjVertices ()
 Clears the container of adjacent vertices, making it empty.
 
AdjacentVertexIterator adjVertexBegin ()
 Returns an iterator to the first adjacent vertex in the container of this component.
 
AdjacentVertexIterator adjVertexEnd ()
 Returns an iterator to the end of the container of this component.
 
ConstAdjacentVertexIterator adjVertexBegin () const
 Returns a const iterator to the first adjacent vertex in the container of this component.
 
ConstAdjacentVertexIterator adjVertexEnd () const
 Returns a const iterator to the end of the container of this component.
 
ConstAdjacentVertexIndexIterator adjVertexIndexBegin () const
 Returns an iterator to the first adjacent vertex index in the container of this component.
 
ConstAdjacentVertexIndexIterator adjVertexIndexEnd () const
 Returns an iterator to the end of the container of this component.
 
View< AdjacentVertexIterator > adjVertices ()
 Returns a lightweight view object that stores the begin and end iterators of the container of adjacent 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< ConstAdjacentVertexIterator > adjVertices () const
 Returns a lightweight const view object that stores the begin and end iterators of the container of adjacent 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< ConstAdjacentVertexIndexIterator > adjVertexIndices () const
 Returns a lightweight view object that stores the begin and end iterators of the container of adjacent 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:
 
void __adjacentVertices () const
 

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, AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >, CompId::ADJACENT_VERTICES, Vertex, -1, ParentElemType, VERT, OPT, 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, typename ParentElemType = void, bool VERT = false, bool OPT = false>
class vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >

The AdjacentVertices class is a container of Vertex indices or pointers. It is a component that makes sense to use mostly on Vertex Elements. For Faces and Edges, see the VertexPointers component (which is similar, but has different member function names).

It is a random access container having dynamic size.

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 Vertex Element v that has the AdjacentVertices component, you'll be able to access to this component member functions from v:

v.adjVerticesNumber();
auto* v = v.adjVertex(0);
uint vi = v.adjVertexIndex(0);
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Note
With respect to the other components that store adjacencies, this component does not have two template arguments:
  • N, because the container of adjacent vertices is always dynamic (there are no contexts in which it would make sense to have a fixed size container of adjacent vertices);
  • TTVN, because this argument is used on components that could be part of face elements, and this component does not apply to faces.
Template Parameters
STORE_INDICESIf true, the component will store indices, otherwise pointers to Face.
VertexThe type of the adjacent Vertex element.
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.
OPTIf true, the component will be optional. This argument is considered only if the component is stored vertically.

Constructor & Destructor Documentation

◆ AdjacentVertices()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::AdjacentVertices ( )
default

Empty constructor.

Initializes an empty container of Adjacent Vertices.

Member Function Documentation

◆ adjVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
Vertex * vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertex ( uint  i)
inline

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

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

◆ adjVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
const Vertex * vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertex ( uint  i) const
inline

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

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

◆ adjVertexBegin() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
AdjacentVertexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexBegin ( )
inline

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

Returns
an iterator pointing to the begin of this container.

◆ adjVertexBegin() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
ConstAdjacentVertexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexBegin ( ) const
inline

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

Returns
an iterator pointing to the begin of this container.

◆ adjVertexEnd() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
AdjacentVertexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexEnd ( )
inline

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

Returns
an iterator pointing to the end of this container.

◆ adjVertexEnd() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
ConstAdjacentVertexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexEnd ( ) 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.

◆ adjVertexIndex()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
uint vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexIndex ( uint  i) const
inline

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

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

◆ adjVertexIndexBegin()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
ConstAdjacentVertexIndexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexIndexBegin ( ) const
inline

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

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

◆ adjVertexIndexEnd()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
ConstAdjacentVertexIndexIterator vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexIndexEnd ( ) const
inline

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

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

◆ adjVertexIndexMod()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
uint vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexIndexMod ( int  i) const
inline

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

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

◆ adjVertexIndices()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
View< ConstAdjacentVertexIndexIterator > vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexIndices ( ) const
inline

Returns a lightweight view object that stores the begin and end iterators of the container of adjacent 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:

// Do something with adj vertex index...
}
View< ConstAdjacentVertexIndexIterator > adjVertexIndices() const
Returns a lightweight view object that stores the begin and end iterators of the container of adjacen...
Definition adjacent_vertices.h:586
Returns
a lightweight view object that can be used in range-based for loops to iterate over adjacent vertex indices.

◆ adjVertexMod() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
Vertex * vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexMod ( int  i)
inline

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

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

◆ adjVertexMod() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
const Vertex * vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertexMod ( int  i) const
inline

Same of adjVertexMod, but returns a const Pointer to the adjacent vertex.

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

◆ adjVertices() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
View< AdjacentVertexIterator > vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertices ( )
inline

Returns a lightweight view object that stores the begin and end iterators of the container of adjacent 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* adjEdge : el.adjVertices()) {
// Do something with adjVertex
}
View< AdjacentVertexIterator > adjVertices()
Returns a lightweight view object that stores the begin and end iterators of the container of adjacen...
Definition adjacent_vertices.h:547
Returns
a lightweight view object that can be used in range-based for loops to iterate over adjacent edges.

◆ adjVertices() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
View< ConstAdjacentVertexIterator > vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVertices ( ) const
inline

Returns a lightweight const view object that stores the begin and end iterators of the container of adjacent 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* adjEdge : el.adjVertices()) {
// Do something read-only with adjVertex
}
Returns
a lightweight view object that can be used in range-based for loops to iterate over adjacent edges.

◆ adjVerticesNumber()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
uint vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::adjVerticesNumber ( ) const
inline

Returns the number of adjacent vertices of the element.

Returns
The number of adjacent vertices of the element.

◆ clearAdjVertices()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::clearAdjVertices ( )
inline

Clears the container of adjacent vertices, making it empty.

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

◆ containsAdjVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
bool vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::containsAdjVertex ( const Vertex v) const
inline

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

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

◆ containsAdjVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
bool vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::containsAdjVertex ( uint  vi) const
inline

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

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

◆ eraseAdjVertex()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::eraseAdjVertex ( uint  i)
inline

Removes the adjacent vertex at the given position from the container.

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

◆ indexOfAdjVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
uint vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::indexOfAdjVertex ( const Vertex v) const
inline

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

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

◆ indexOfAdjVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
uint vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::indexOfAdjVertex ( uint  vi) const
inline

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

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

◆ insertAdjVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::insertAdjVertex ( uint  i,
uint  vi 
)
inline

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

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

◆ insertAdjVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::insertAdjVertex ( uint  i,
Vertex v 
)
inline

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

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

◆ pushAdjVertex() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::pushAdjVertex ( uint  vi)
inline

Pushes in the back of the container the given adjacent vertex..

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

◆ pushAdjVertex() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::pushAdjVertex ( Vertex v)
inline

Pushes in the back of the container the given adjacent vertex.

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

◆ resizeAdjVertices()

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::resizeAdjVertices ( uint  n)
inline

Resize the container of the adjacent vertices to the given size.

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

◆ setAdjVertex() [1/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( ConstAdjacentVertexIndexIterator  it,
uint  vi 
)
inline

Sets the adjacent vertex pointed by the iterator.

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

◆ setAdjVertex() [2/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( ConstAdjacentVertexIndexIterator  it,
Vertex v 
)
inline

Sets the adjacent vertex pointed by the iterator.

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

◆ setAdjVertex() [3/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( ConstAdjacentVertexIterator  it,
uint  vi 
)
inline

Sets the adjacent vertex pointed by the iterator.

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

◆ setAdjVertex() [4/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( ConstAdjacentVertexIterator  it,
Vertex v 
)
inline

Sets the adjacent vertex pointed by the iterator.

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

◆ setAdjVertex() [5/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( uint  i,
uint  vi 
)
inline

Sets the i-th adjacent vertex of the element.

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

◆ setAdjVertex() [6/6]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertex ( uint  i,
Vertex v 
)
inline

Sets the i-th adjacent vertex of the element.

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

◆ setAdjVertexMod() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertexMod ( int  i,
uint  vi 
)
inline

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

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

◆ setAdjVertexMod() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertexMod ( int  i,
Vertex v 
)
inline

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

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

◆ setAdjVertices() [1/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
template<Range Rng>
requires InputRange<Rng, Vertex*>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertices ( Rng &&  r)
inline

Sets all the adjacent vertices of this 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 adjacent vertices to set. The value type of the range must be convertible to a pointer to an AdjacentVertex.
Parameters
[in]rrange of adjacent vertices to set.

◆ setAdjVertices() [2/2]

template<bool STORE_INDICES, typename Vertex , typename ParentElemType = void, bool VERT = false, bool OPT = false>
template<Range Rng>
requires InputRange<Rng, uint>
void vcl::comp::AdjacentVertices< STORE_INDICES, Vertex, ParentElemType, VERT, OPT >::setAdjVertices ( Rng &&  r)
inline

Sets all the adjacent vertices of this 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 adjacent vertex indices to set. The value type of the range must be convertible to unsigned integer.
Parameters
[in]rrange of indices of adjacent vertices to set.

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