Wildmeshing Toolkit
Loading...
Searching...
No Matches
CompoundAccessor.hxx
Go to the documentation of this file.
1
2
3#pragma once
6
8
9
10template <size_t N, typename MeshType, typename... AttributeType>
12 const MeshType& m,
14 : m_base_accessors(Accessor<AttributeType, MeshType>(m, handle)...)
15{}
16template <size_t N, typename MeshType, typename... AttributeType>
18 MeshType& m,
20 : CompoundAccessor(const_cast<const MeshType&>(m), handle...)
21{}
22template <size_t N, typename MeshType, typename... AttributeType>
23template <typename FirstAccType, int FirstDim, typename... AccTypes, int... Dims>
27 //: m_base_accessors(accs...)
28 : CompoundAccessor(acc.mesh(), acc.typed_handle(), accs.typed_handle()...)
29{}
30
31template <size_t N, typename MeshType, typename... AttributeType>
32template <size_t Index>
37// template <typename MeshType, typename... AttributeType, std::bitset<sizeof...(AttributeType)>
38// ScalarAttributeMask> CompoundAccessor<MeshType>::CompoundAccessor(
39//{}
40
41// template <typename MeshType, typename... AttributeType, std::bitset<sizeof...(AttributeType)>
42// ScalarAttributeMask> template <int D> auto
43// CompoundAccessor<MeshType>::const_vector_attribute(const Compound& t) const -> ConstMapResult<D>
44//{
45// auto base_map = m_base_accessor.template const_vector_attribute<D>(t);
46//
47// const int64_t* int_data = base_map.data();
48// const Compound* data = reinterpret_cast<const Compound*>(int_data);
49// return ConstMapResult<D>(data, dimension());
50// }
51//
52// template <typename MeshType, typename... AttributeType, std::bitset<sizeof...(AttributeType)>
53// ScalarAttributeMask> template <int D> auto CompoundAccessor<MeshType>::vector_attribute(const
54// Compound& t) -> MapResult<D>
55//{
56// auto base_map = m_base_accessor.template vector_attribute<D>(t);
57// int64_t* int_data = base_map.data();
58// Compound* data = reinterpret_cast<Compound*>(int_data);
59// return MapResult<D>(data, dimension());
60// }
61//
62// template <typename MeshType, typename... AttributeType, std::bitset<sizeof...(AttributeType)>
63// ScalarAttributeMask> auto CompoundAccessor<MeshType>::scalar_attribute(const Compound& t) ->
64// Tuple&
65//{
66//
67// assert(m_dimension == 1);
68// return *reinterpret_cast<Compound*>(base_map.data());
69// }
70//
71// template <typename MeshType, typename... AttributeType, std::bitset<sizeof...(AttributeType)>
72// ScalarAttributeMask> template <typename MeshType> auto
73// CompoundAccessor<MeshType>::const_scalar_attribute(const Compound& t) const -> const Tuple&
74//{
75// assert(m_dimension == 1);
76// auto base_map = m_base_accessor.template const_vector_attribute(t);
77// return *reinterpret_cast<const Compound*>(base_map.data());
78// }
79
80
81} // namespace wmtk::attribute::internal
A CachingAccessor that uses tuples for accessing attributes instead of indices.
Definition Accessor.hpp:28
Handle that represents attributes for some mesh.
PrimitiveType primitive_type() const
returns the primitive type of the Index'th type
CompoundAccessor(MeshType &m, const TypedAttributeHandle< AttributeType > &... handle)