26 template <
int D = Eigen::Dynamic>
28 template <
int D = Eigen::Dynamic>
33 std::map<std::string, size_t>
child_hashes()
const override;
59 template <
int D = Eigen::Dynamic>
62 template <
int D = Eigen::Dynamic>
70 template <
int D = Eigen::Dynamic>
73 template <
int D = Eigen::Dynamic>
79 void set(std::vector<T> val);
107 void consolidate(
const std::vector<int64_t>& new2old);
114 void index_remap(
const std::vector<T>& old2new,
const std::vector<Eigen::Index>& cols);
121 template <
int D = Eigen::Dynamic>
129 template <
int D = Eigen::Dynamic>
132 const std::vector<T>& data)
const;
137 template <
int D = Eigen::Dynamic>
145 template <
int D = Eigen::Dynamic>
164 template <
int D = Eigen::Dynamic>
168 const std::vector<T>& data)
const;
174 template <
int D = Eigen::Dynamic>
178 std::vector<T>& data)
const;
183 const std::string&
name()
const;
199#if !defined(WMTK_ENABLED_DEV_MODE)
This class stores data of type T in a vector.
Attribute & operator=(Attribute &&o)
T & vector_single_value(int64_t index, int8_t vector_index)
Access to a single a single value of a scalr attribute.
void index_remap(const std::vector< T > &old2new)
Applies the scalar old2new map to the indices in the attribute This is commonly used after a consolid...
ConstMapResult< D > const_vector_attribute(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...
void set_name(const std::string &name)
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 std::string & name() const
const T & const_scalar_attribute(int64_t index) const
Access the value of a scalar attribute.
MapResult< T, D > MapResult
bool operator==(const Attribute< T > &o) const
void serialize(int dim, MeshWriter &writer) const
Attribute & operator=(const Attribute &&o)=delete
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...
void reserve(int64_t size)
T & vector_single_value(int64_t index, int8_t vector_index, std::vector< T > &data) const
Accesses the attribute using the specified scalar as the underlying data This is internally used by t...
int64_t dimension() const
The number of values for each index.
void consolidate(const std::vector< int64_t > &new2old)
Consolidate the vector, using the new2old map m provided and resizing the vector to m....
int64_t reserved_size() const
The total number of elements in a vector.
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
void set(std::vector< T > val)
Replace the internal data with val.
Attribute(const Attribute &o)=delete
MapResult< D > vector_attribute(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...
std::map< std::string, size_t > child_hashes() const override
const T & const_vector_single_value(int64_t index, int8_t vector_index, const std::vector< T > &data) const
Accesses the attribute using the specified scalar as the underlying data This is internally used by t...