3#if defined(WMTK_ENABLED_DEV_MODE)
4#define WMTK_ATTRIBUTE_INLINE
6#define WMTK_ATTRIBUTE_INLINE inline
16 const std::vector<T>& data)
const
18 assert(index < reserved_size(data));
19 assert(m_dimension == 1);
26 assert(index < reserved_size(data));
27 assert(m_dimension == 1);
40 assert(m_dimension > 0);
41 assert(D == Eigen::Dynamic || D == m_dimension);
42 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
45 assert(R.size() == m_dimension);
55 assert(m_dimension > 0);
56 assert(D == Eigen::Dynamic || D == m_dimension);
57 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
59 assert(R.size() == m_dimension);
72 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
73 assert(D == Eigen::Dynamic || D == m_dimension);
74 assert(index < reserved_size(data));
75 assert(data.size() % m_dimension == 0);
76 const int64_t start = index * dim;
77 return const_vector_attribute_without_stride<D>(start, data);
84 assert(index < reserved_size(data));
85 assert(data.size() % m_dimension == 0);
86 assert(D == Eigen::Dynamic || D == m_dimension);
87 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
88 const int64_t start = index * dim;
89 return vector_attribute_without_stride<D>(start, data);
101 const std::vector<T>& data)
const
103 assert(D == Eigen::Dynamic || D == m_dimension);
104 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
105 const int64_t idx = index * dim + vector_index;
106 assert(index < reserved_size(data));
114 assert(D == Eigen::Dynamic || D == m_dimension);
115 int64_t dim = D == Eigen::Dynamic ? m_dimension : D;
116 const int64_t idx = index * dim + vector_index;
117 assert(index < reserved_size(data));
128 return const_scalar_attribute(index, m_data);
133 return scalar_attribute(index, m_data);
145 return const_vector_attribute<D>(index, m_data);
153 return vector_attribute<D>(index, m_data);
164 int8_t vector_index)
const
166 return const_vector_single_value<D>(index, vector_index, m_data);
173 return vector_single_value<D>(index, vector_index, m_data);
189 return m_default_value;
194#undef WMTK_ATTRIBUTE_INLINE
#define WMTK_ATTRIBUTE_INLINE
T & vector_single_value(int64_t index, int8_t vector_index)
Access to a single a single value of a scalr attribute.
ConstMapResult< D > const_vector_attribute(int64_t index) const
Access the value of an attribute at a particular index. If the dimension of the attribute is known at...
const T & const_scalar_attribute(int64_t index) const
Access the value of a scalar attribute.
MapResult< T, D > MapResult
ConstMapResult< D > const_vector_attribute_without_stride(int64_t index, const std::vector< T > &data) const
Accesses the attribute using the specified vector as the underlying data This is internally used by t...
ConstMapResult< T, D > ConstMapResult
MapResult< D > vector_attribute_without_stride(int64_t index, std::vector< T > &data) const
Accesses the attribute using the specified vector as the underlying data This is internally used by t...
int64_t dimension() const
The number of values for each index.
const T & const_vector_single_value(int64_t index, int8_t vector_index) const
Access a single entry in a vector attribute. TODO: this might not actually be more performant than.
T & scalar_attribute(int64_t index)
Access the value of a scalar attribute. Assignment to the returned value will change the value.
MapResult< D > vector_attribute(int64_t index)
Access the value of an attribute at a particular index. If the dimension of the attribute is known at...
const T & default_value() const
returns the default value of this attribute