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>
58template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
59template <
int D,
typename ArgType>
63 const int64_t idx = this->index(t);
64 return m_attribute.template const_vector_attribute<std::max(D, Dim)>(idx);
67template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
68template <
int D,
typename ArgType>
72 const int64_t idx = this->index(t);
73 return m_attribute.template vector_attribute<std::max(D, Dim)>(idx);
76template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
77template <
typename ArgType>
80 const int64_t idx = this->index(t);
81 return m_attribute.scalar_attribute(idx);
84template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
85template <
typename ArgType>
89 const int64_t idx = this->index(t);
90 return m_attribute.const_scalar_attribute(idx);
102template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
107 assert(mesh().top_simplex_type() == m_handle.primitive_type());
123template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
128template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
134template <
typename T,
typename MeshType,
typename AttributeType_,
int Dim>
137 return attribute().transaction_depth();
140template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
143 return attribute().reserved_size();
146template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
149 return attribute().dimension();
152template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
155 return attribute().default_value();
158template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
163template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
168template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
174template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
180template <
typename T,
typename MeshType,
typename AttributeType,
int Dim>
183 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.
int64_t transaction_depth() const
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)
Access function for a vector attribute.
int64_t index(const Tuple &t) const
Retrieve the global ID of the given simplex.
const Scalar & const_scalar_attribute(const ArgType &t) const
Constant access function for a scalar attribute.
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
Constant access function for a vector attribute.
Scalar & scalar_attribute(const ArgType &t)
Access function for a scalar attribute.
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