23#ifndef VCL_MESH_COMPONENTS_BASES_CONTAINER_COMPONENT_H
24#define VCL_MESH_COMPONENTS_BASES_CONTAINER_COMPONENT_H
28#include <vclib/space/core/vector.h>
50using ContCompBase = std::conditional_t<
51 std::is_same_v<AD, void>,
52 Component<DC, CT, Vector<T, N>, El, v, o, PT...>,
53 Component<DC, CT, std::tuple<Vector<T, N>, AD>, El, v, o, PT...>>;
108 typename DerivedComponent,
112 typename AdditionalData,
113 typename ParentElemType,
117 typename... PointedTypes>
119 public detail::ContCompBase<
131 static constexpr bool HAS_ADDITIONAL_DATA =
132 !std::is_same_v<AdditionalData, void>;
134 using Base = detail::ContCompBase<
159 static const int SIZE = N;
177 if constexpr (!Base::IS_VERTICAL) {
178 if constexpr (N >= 0) {
179 Base::data().fill(T());
192 if constexpr (N >= 0) {
195 container().fill(T());
204 Vector<T, N>& container()
206 if constexpr (HAS_ADDITIONAL_DATA) {
207 return std::get<0>(Base::data());
214 const Vector<T, N>& container()
const
216 if constexpr (HAS_ADDITIONAL_DATA) {
217 return std::get<0>(Base::data());
224 template<
typename AdDt = AdditionalData>
225 AdDt& additionalData()
requires (HAS_ADDITIONAL_DATA)
227 return std::get<1>(Base::data());
230 template<
typename AdDt = AdditionalData>
231 const AdDt& additionalData() const requires (HAS_ADDITIONAL_DATA)
233 return std::get<1>(Base::data());
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Container::iterator Iterator
An iterator to the elements of the Vector.
Definition vector.h:102
Container::const_iterator ConstIterator
A const iterator to the elements of the Vector.
Definition vector.h:105
The ContainerComponent class is the base class for all the components of VCLib that store a container...
Definition container_component.h:130
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 ver...
Definition container_component.h:157