9 template <
typename MeshType,
int Dim>
11 : m_base_accessor(m, handle)
12 , m_dimension(m_base_accessor.dimension() / (sizeof(
Tuple) / sizeof(int64_t)))
14 template <
typename MeshType,
int Dim>
20 template <
typename MeshType,
int Dim>
25 static_assert(Dim == Eigen::Dynamic || Dim2 == Eigen::Dynamic || Dim == Dim2);
28 template <
typename MeshType,
int Dim>
32 auto base_map = m_base_accessor.template const_vector_attribute<D>(t);
34 const int64_t* int_data = base_map.data();
35 const Tuple* data =
reinterpret_cast<const Tuple*
>(int_data);
39 template <
typename MeshType,
int Dim>
43 auto base_map = m_base_accessor.template vector_attribute<D>(t);
44 int64_t* int_data = base_map.data();
45 Tuple* data =
reinterpret_cast<Tuple*
>(int_data);
49 template <
typename MeshType,
int Dim>
52 auto base_map = m_base_accessor.template vector_attribute<2>(t);
54 assert(m_dimension == 1);
55 return *
reinterpret_cast<Tuple*
>(base_map.data());
58 template <
typename MeshType,
int Dim>
61 assert(m_dimension == 1);
62 auto base_map = m_base_accessor.template const_vector_attribute<2>(t);
63 return *
reinterpret_cast<const Tuple*
>(base_map.data());
A CachingAccessor that uses tuples for accessing attributes instead of indices.
ConstMapResult< D > const_vector_attribute(const Tuple &t) const
const Tuple & const_scalar_attribute(const Tuple &t) const
internal::ConstMapResult< Tuple, D > ConstMapResult
MapResult< D > vector_attribute(const Tuple &t)
TupleAccessor(MeshType &m, const TypedAttributeHandle< int64_t > &handle)
Tuple & scalar_attribute(const Tuple &t)
internal::MapResult< Tuple, D > MapResult