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

The PointerContainerComponent is the base class for all the components of VCLib that store a container of pointers to an Element. More...

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

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

Public Member Functions

template<typename T >
requires std::is_same_v<T, Elem>
auto pointers () const
 Exposes the pointers in the container as a View.
 

Protected Types

using Iterator = Base::ConstIterator
 
using ConstIterator = ConstPointerIterator< typename Base::ConstIterator >
 
using ConstIndexIterator = IndexFromPointerIterator< ConstIterator >
 
- Protected Types inherited from vcl::comp::ContainerComponent< DerivedComponent, COMP_ID, Elem *, N, void, ParentElemType, VERT, OPT, TTVN, Elem >
using Iterator = Vector< Elem *, N >::Iterator
 
using ConstIterator = Vector< Elem *, N >::ConstIterator
 

Protected Member Functions

void updateReferences (const Elem *oldBase, std::size_t offset=0)
 
void updateReferences (const std::vector< uint > &newIndices)
 
- Protected Member Functions inherited from vcl::comp::ContainerComponent< DerivedComponent, COMP_ID, Elem *, N, void, ParentElemType, VERT, OPT, TTVN, Elem >
void init ()
 
Vector< Elem *, N > & container ()
 
const Vector< Elem *, N > & container () const
 
AdDtadditionalData ()
 
const AdDtadditionalData () const
 

Private Types

using Base = ContainerComponent< DerivedComponent, COMP_ID, Elem *, N, void, ParentElemType, VERT, OPT, TTVN, Elem >
 

Private Member Functions

const ElembaseOfElemContainer () const
 

Additional Inherited Members

- Static Public Attributes inherited from vcl::comp::ContainerComponent< DerivedComponent, COMP_ID, Elem *, N, void, ParentElemType, VERT, OPT, TTVN, Elem >
static const bool TIED_TO_VERTEX_NUMBER
 Boolean that tells if this component stores a container having its size tied to the number of the vertices of the Element.
 
static const int SIZE
 

Detailed Description

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

The PointerContainerComponent is the base class for all the components of VCLib that store a container of pointers to an Element.

A component that inherits from this class will have all the features of the Component and ContainerComponent classes, and will have access to the implementations of updateElementPointers member functions, that should be used by the Derived Component.

For further details , please refer to the page implement_component page.

Template Parameters
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.

Member Function Documentation

◆ pointers()

template<typename DerivedComponent , uint COMP_ID, typename Elem , int N, typename ParentElemType , bool VERT, bool OPT, bool TTVN>
template<typename T >
requires std::is_same_v<T, Elem>
auto vcl::comp::PointerContainerComponent< DerivedComponent, COMP_ID, Elem, N, ParentElemType, VERT, OPT, TTVN >::pointers ( ) const
inline

Exposes the pointers in the container as a View.

This function is templated in order to force the user to specify the type of the pointers that are stored in the container. This is necessary when a component that stores pointers to different types of elements is used.


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