Wildmeshing Toolkit
CompoundAccessor.hxx
Go to the documentation of this file.
1 
2 
3 #pragma once
5 #include "CompoundAccessor.hpp"
6 
8 
9 
10 template <size_t N, typename MeshType, typename... AttributeType>
12  const MeshType& m,
13  const TypedAttributeHandle<AttributeType>&... handle)
14  : m_base_accessors(Accessor<AttributeType, MeshType>(m, handle)...)
15 {}
16 template <size_t N, typename MeshType, typename... AttributeType>
18  MeshType& m,
19  const TypedAttributeHandle<AttributeType>&... handle)
20  : CompoundAccessor(const_cast<const MeshType&>(m), handle...)
21 {}
22 template <size_t N, typename MeshType, typename... AttributeType>
23 template <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 
31 template <size_t N, typename MeshType, typename... AttributeType>
32 template <size_t Index>
34 {
35  return get<Index>().primitive_type();
36 }
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:25
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)