Visual Computing Library
Loading...
Searching...
No Matches
vcl::comp::ReferenceContainerComponent< STORE_INDICES, DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN > Class Template Reference

The ReferenceContainerComponent is a class that inherits from the IndexContainerComponent or PointerContainerComponent classes, depending on the STORE_INDICES template parameter. More...

#include <vclib/mesh/components/bases/reference_container_component.h>

Inheritance diagram for vcl::comp::ReferenceContainerComponent< STORE_INDICES, DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >:

Protected Types

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 > >
 

Protected Member Functions

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
 

Detailed Description

template<bool STORE_INDICES, typename DerivedComponent, uint COMP_ID, typename Elem, int N, typename ParentElemType, bool VERT, bool OPT, bool TTVN>
class vcl::comp::ReferenceContainerComponent< STORE_INDICES, DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >

The ReferenceContainerComponent is a class that inherits from the IndexContainerComponent or PointerContainerComponent classes, depending on the STORE_INDICES template parameter.

Template Parameters
STORE_INDICESIf true, the component will store indices, otherwise pointers to Elem.
DerivedComponentThe type of the Derived Component. It is used to implement the CRTP pattern.
COMP_IDThe id of the component. It is a value of the enum ComponentIDEnum, or an integer value that is not already used by any other component. It is used to identify the component at compile time.
ElemThe type of the Element of which the pointers are stored. E.g. a VertexPointers component would have VertexType as Elem.
NThe size of the container: if >= 0 the size is static, if < 0 the size is dynamic.
ParentElemTypeThe Parent Element 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.
VERTBoolean that tells if the component is vertical. If the component is vertical, this parameter must be true. Note: to be vertical, this parameter must be true, and ElementType must be the type of the Element that has the component (the 'parent' Element Type).
OPTWhen a component is vertical, it could be optional, that means that could be enabled/disabled at runtime. To make the component optional, this template parameter must be true.
TTVN"Tied To Vertex Number", this boolean tells whether the component should leave liberty to control the size of the Container to the user, or it should be tied to the vertex number and changed automatically when the number of vertices changes. E.g. a AdjacentFaces component, if part of a Face element, should be tied to the vertex number of the Face, meaning that the number of face pointers should be always be the same of the number of vertices. Setting this value to true will tie the size of this container to the number of vertices.

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