7 template <
typename T,
typename MeshType,
int Dim>
11 template <
typename T,
typename MeshType,
int Dim>
15 template <
typename T,
typename MeshType,
int Dim>
16 template <
typename OMType,
int D>
18 :
Accessor(static_cast<const MeshType&>(o.mesh()), o.handle())
20 static_assert(Dim == Eigen::Dynamic || D == Eigen::Dynamic || Dim == D);
62 template <
typename T,
typename MeshType,
int Dim>
65 assert(mesh().is_valid(t));
66 return this->mesh().id(t, BaseType::typed_handle().primitive_type());
69 template <
typename T,
typename MeshType,
int Dim>
73 return this->index(t.
tuple());
77 template <
typename T,
typename MeshType,
int Dim>
81 return this->mesh().id(t);
85 template <
typename T,
typename MeshType,
int Dim>
86 template <
int D,
typename ArgType>
90 const int64_t idx = this->index(t);
91 return CachingBaseType::template const_vector_attribute<D>(idx);
94 template <
typename T,
typename MeshType,
int Dim>
95 template <
int D,
typename ArgType>
98 const int64_t idx = this->index(t);
99 return CachingBaseType::template vector_attribute<D>(idx);
102 template <
typename T,
typename MeshType,
int Dim>
103 template <
typename ArgType>
106 const int64_t idx = this->index(t);
107 return CachingBaseType::scalar_attribute(idx);
110 template <
typename T,
typename MeshType,
int Dim>
111 template <
typename ArgType>
114 const int64_t idx = this->index(t);
115 return CachingBaseType::const_scalar_attribute(idx);
117 template <
typename T,
typename MeshType,
int Dim>
118 template <
typename ArgType>
121 const int64_t idx = this->index(t);
122 return CachingBaseType::scalar_attribute(idx);
128 template <
typename T,
typename MeshType,
int Dim>
132 assert(mesh().top_simplex_type() == BaseType::primitive_type());
141 default:
return T(0);
A CachingAccessor that uses tuples for accessing attributes instead of indices.
int64_t index(const Tuple &t) const
MapResult< D > vector_attribute(const ArgType &t)
T & topological_scalar_attribute(const ArgType &t)
T & scalar_attribute(const ArgType &t)
T const_scalar_attribute(const ArgType &t) const
T const_topological_scalar_attribute(const Tuple &t, PrimitiveType pt) const
internal::MapResult< T, D > MapResult
ConstMapResult< D > const_vector_attribute(const ArgType &t) const
An accessor for cached attribute values.
typename BaseType::template ConstMapResult< D > ConstMapResult
Handle that represents attributes for some mesh.
PrimitiveType primitive_type() const
const Tuple & tuple() const
PrimitiveType primitive_type() const