8template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
14 , m_attribute(mesh().m_attribute_manager.get(m_handle).attribute(m_handle.m_base_handle))
16template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
20 :
Accessor(const_cast<MeshType&>(m), handle)
22template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
23template <
typename OMType,
typename OAT,
int D>
25 :
Accessor(static_cast<const MeshType&>(o.mesh()), o.handle())
27 static_assert(Dim == Eigen::Dynamic || D == Eigen::Dynamic || Dim == D);
31template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
34 assert(mesh().is_valid(t));
35 return this->mesh().id(t, typed_handle().primitive_type());
38template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
42 return this->index(t.
tuple());
45template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
49 return this->mesh().id(t);
52template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
53template <
int D,
typename ArgType>
57 const int64_t idx = this->index(t);
58 return m_attribute.template const_vector_attribute<std::max(D, Dim)>(idx);
61template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
62template <
int D,
typename ArgType>
66 const int64_t idx = this->index(t);
67 return m_attribute.template vector_attribute<std::max(D, Dim)>(idx);
70template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
71template <
typename ArgType>
74 const int64_t idx = this->index(t);
75 return m_attribute.scalar_attribute(idx);
78template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
79template <
typename ArgType>
83 const int64_t idx = this->index(t);
84 return m_attribute.const_scalar_attribute(idx);
96template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
101 assert(mesh().top_simplex_type() == m_handle.primitive_type());
117template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
122template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
128template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
131 return attribute().reserved_size();
134template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
137 return attribute().dimension();
140template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
143 return attribute().default_value();
146template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
151template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
156template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
162template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
168template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
171 return handle().primitive_type();
The Tuple is the basic navigation tool in our mesh data structure.
int64_t global_cid() const
An Accessor that uses tuples for accessing attributes instead of indices.
AttributeType_ AttributeType
typename AttributeType::template MapResult< D > MapResult
typename AttributeType::template ConstMapResult< D > ConstMapResult
const TypedAttributeHandle< T > & typed_handle() const
MapResult< std::max(D, Dim)> vector_attribute(const ArgType &t)
int64_t index(const Tuple &t) const
const Scalar & const_scalar_attribute(const ArgType &t) const
MeshAttributeHandle handle() const
const T & const_topological_scalar_attribute(const Tuple &t, PrimitiveType pt) const
auto default_value() const -> const Scalar &
auto reserved_size() const -> int64_t
AttributeType & attribute()
ConstMapResult< std::max(D, Dim)> const_vector_attribute(const ArgType &t) const
Scalar & scalar_attribute(const ArgType &t)
auto dimension() const -> int64_t
PrimitiveType primitive_type() const
Accessor(MeshType &m, const TypedAttributeHandle< T > &handle)
Handle that represents attributes for some mesh.
PrimitiveType primitive_type() const
const Tuple & tuple() const
PrimitiveType primitive_type() const