Wildmeshing Toolkit
Loading...
Searching...
No Matches
CompoundAccessor.hxx
Go to the documentation of this file.
1
2
3
#pragma once
4
#include <
wmtk/utils/Rational.hpp
>
5
#include "
CompoundAccessor.hpp
"
6
7
namespace
wmtk::attribute::internal
{
8
9
10
template
<
size_t
N,
typename
MeshType,
typename
...
AttributeType
>
11
CompoundAccessor<N, MeshType, AttributeType...>::CompoundAccessor
(
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
>
17
CompoundAccessor<N, MeshType, AttributeType...>::CompoundAccessor
(
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>
24
CompoundAccessor<N, MeshType, AttributeType...>::CompoundAccessor
(
25
const
Accessor<FirstAccType, MeshType, FirstDim>
& acc,
26
const
Accessor<AccTypes, MeshType, Dims>
&... accs)
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>
33
PrimitiveType
CompoundAccessor<N, MeshType, AttributeType...>::primitive_type
()
const
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
CompoundAccessor.hpp
Rational.hpp
wmtk::attribute::Accessor
A CachingAccessor that uses tuples for accessing attributes instead of indices.
Definition
Accessor.hpp:28
wmtk::attribute::TypedAttributeHandle
Handle that represents attributes for some mesh.
Definition
TypedAttributeHandle.hpp:28
wmtk::attribute::internal::CompoundAccessor
Definition
CompoundAccessor.hpp:11
wmtk::attribute::internal::CompoundAccessor::primitive_type
PrimitiveType primitive_type() const
returns the primitive type of the Index'th type
Definition
CompoundAccessor.hxx:33
wmtk::attribute::internal::CompoundAccessor::CompoundAccessor
CompoundAccessor(MeshType &m, const TypedAttributeHandle< AttributeType > &... handle)
Definition
CompoundAccessor.hxx:17
wmtk::attribute::internal
Definition
Attribute.hpp:19
wmtk::attribute::AttributeType
AttributeType
Definition
AttributeType.hpp:5
wmtk::PrimitiveType
PrimitiveType
Definition
PrimitiveType.hpp:9
src
wmtk
attribute
internal
CompoundAccessor.hxx
Generated by
1.9.8