23#ifndef VCL_MESH_COMPONENTS_BASES_POINTER_CONTAINER_COMPONENT_H
24#define VCL_MESH_COMPONENTS_BASES_POINTER_CONTAINER_COMPONENT_H
26#include "container_component.h"
28#include <vclib/mesh/iterators/components/index_from_pointer_iterator.h>
29#include <vclib/misc/iterators/const_pointer_iterator.h>
75 typename DerivedComponent,
79 typename ParentElemType,
126 using Base::container;
128 using Iterator = Base::ConstIterator;
157 void updateReferences(
const Elem*
oldBase, std::size_t offset = 0)
187 void updateReferences(
const std::vector<uint>& newIndices)
189 const Elem* base = baseOfElemContainer();
191 auto& baseContainer = Base::container();
193 for (uint j = 0; j < baseContainer.size(); ++j) {
194 if (baseContainer.at(j) !=
nullptr) {
195 size_t diff = baseContainer.at(j) - base;
197 baseContainer.at(j) =
nullptr;
200 baseContainer.at(j) = (Elem*) base + newIndices[diff];
207 const Elem* baseOfElemContainer()
const
209 return &(Base::parentElement()
211 ->template element<Elem::ELEMENT_ID>(0));
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The View class is a simple class that stores and exposes two iterators begin and end.
Definition view.h:67
The ContainerComponent class is the base class for all the components of VCLib that store a container...
Definition container_component.h:130
The PointerContainerComponent is the base class for all the components of VCLib that store a containe...
Definition pointer_container_component.h:95
auto pointers() const
Exposes the pointers in the container as a View.
Definition pointer_container_component.h:118
constexpr uint UINT_NULL
The UINT_NULL value represent a null value of uint that is the maximum value that can be represented ...
Definition base.h:48