Wildmeshing Toolkit
|
Contains all attributes of type T for a single mesh. More...
#include <MeshAttributes.hpp>
Public Member Functions | |
MeshAttributes ()=default | |
MeshAttributes (const MeshAttributes &o)=delete | |
MeshAttributes (MeshAttributes &&o)=default | |
MeshAttributes & | operator= (const MeshAttributes &o)=delete |
MeshAttributes & | operator= (MeshAttributes &&o)=default |
void | serialize (const int dim, MeshWriter &writer) const |
std::map< std::string, const wmtk::utils::Hashable * > | child_hashables () const override |
std::map< std::string, std::size_t > | child_hashes () const override |
AttributeHandle | register_attribute (const std::string &name, int64_t dimension, bool replace=false, T default_value=T(0)) |
int64_t | reserved_size () const |
void | reserve (const int64_t size) |
void | reserve_more (int64_t size) |
void | guarantee_at_least (int64_t size) |
void | remove_attributes (const std::vector< AttributeHandle > &attributes, bool invalidate_handles=true) |
Remove all passed in attributes. More... | |
void | remove_attribute (const AttributeHandle &attribute) |
Remove a single attribute. More... | |
bool | operator== (const MeshAttributes< T > &other) const |
void | push_scope () |
void | pop_scope (bool apply_updates=true) |
void | rollback_current_scope () |
void | change_to_parent_scope () const |
void | change_to_child_scope () const |
int64_t | dimension (const AttributeHandle &handle) const |
const T & | default_value (const AttributeHandle &handle) const |
std::string | get_name (const AttributeHandle &handle) const |
void | set_name (const AttributeHandle &handle, const std::string &name) |
bool | has_attribute (const std::string &name) const |
size_t | attribute_count () const |
std::vector< AttributeHandle > | active_attributes () const |
void | assert_capacity_valid (int64_t cap) const |
Attribute< T > & | attribute (const AttributeHandle &handle) |
const Attribute< T > & | attribute (const AttributeHandle &handle) const |
AttributeHandle | attribute_handle (const std::string &name) const |
bool | is_active (const AttributeHandle &handle) const |
void | set (const AttributeHandle &handle, std::vector< T > val) |
Public Member Functions inherited from wmtk::utils::MerkleTreeInteriorNode | |
std::map< std::string, std::size_t > | child_hashes () const override |
Public Member Functions inherited from wmtk::utils::Hashable | |
Hashable () | |
Hashable (const Hashable &) | |
Hashable (Hashable &&) | |
Hashable & | operator= (const Hashable &) |
Hashable & | operator= (Hashable &&) |
virtual | ~Hashable () |
virtual std::size_t | hash () const |
Protected Member Functions | |
void | clear_dead_attributes () |
Clears and compactifies the attribute list. This invalidates all existing handles. More... | |
size_t | attribute_size (const AttributeHandle &handle) const |
Private Types | |
typedef Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 > > | MapResult |
typedef Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 > > | ConstMapResult |
Private Attributes | |
std::map< std::string, AttributeHandle > | m_handles |
int64_t | m_reserved_size = -1 |
std::vector< std::unique_ptr< Attribute< T > > > | m_attributes |
Friends | |
template<typename U , int D> | |
class | AccessorBase |
Contains all attributes of type T for a single mesh.
It also stores a map so that attributes can be accessed through a name.
Definition at line 29 of file MeshAttributes.hpp.
|
private |
Definition at line 35 of file MeshAttributes.hpp.
|
private |
Definition at line 34 of file MeshAttributes.hpp.
|
default |
|
delete |
|
default |
auto wmtk::attribute::MeshAttributes< T >::active_attributes |
Definition at line 209 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::assert_capacity_valid | ( | int64_t | cap | ) | const |
Definition at line 137 of file MeshAttributes.cpp.
|
inline |
Definition at line 136 of file MeshAttributes.hpp.
References wmtk::attribute::AttributeHandle::index.
|
inline |
Definition at line 142 of file MeshAttributes.hpp.
References wmtk::attribute::AttributeHandle::index.
size_t wmtk::attribute::MeshAttributes< T >::attribute_count |
Definition at line 204 of file MeshAttributes.cpp.
AttributeHandle wmtk::attribute::MeshAttributes< T >::attribute_handle | ( | const std::string & | name | ) | const |
Definition at line 146 of file MeshAttributes.cpp.
|
protected |
Definition at line 190 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index.
void wmtk::attribute::MeshAttributes< T >::change_to_child_scope |
Definition at line 96 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::change_to_parent_scope |
Definition at line 84 of file MeshAttributes.cpp.
|
overridevirtual |
Implements wmtk::utils::MerkleTreeInteriorNode.
Definition at line 45 of file MeshAttributes.cpp.
|
overridevirtual |
Reimplemented from wmtk::utils::Hashable.
Definition at line 33 of file MeshAttributes.cpp.
References wmtk::utils::MerkleTreeInteriorNode::child_hashes().
|
protected |
Clears and compactifies the attribute list. This invalidates all existing handles.
Definition at line 293 of file MeshAttributes.cpp.
|
inline |
Definition at line 153 of file MeshAttributes.hpp.
|
inline |
Definition at line 148 of file MeshAttributes.hpp.
std::string wmtk::attribute::MeshAttributes< T >::get_name | ( | const AttributeHandle & | handle | ) | const |
Definition at line 317 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::guarantee_at_least | ( | int64_t | size | ) |
Definition at line 247 of file MeshAttributes.cpp.
bool wmtk::attribute::MeshAttributes< T >::has_attribute | ( | const std::string & | name | ) | const |
Definition at line 151 of file MeshAttributes.cpp.
bool wmtk::attribute::MeshAttributes< T >::is_active | ( | const AttributeHandle & | handle | ) | const |
Definition at line 222 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index.
|
delete |
|
default |
bool wmtk::attribute::MeshAttributes< T >::operator== | ( | const MeshAttributes< T > & | other | ) | const |
Definition at line 158 of file MeshAttributes.cpp.
References wmtk::attribute::MeshAttributes< T >::m_attributes, and wmtk::attribute::MeshAttributes< T >::m_handles.
void wmtk::attribute::MeshAttributes< T >::pop_scope | ( | bool | apply_updates = true | ) |
Definition at line 66 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::push_scope |
Definition at line 57 of file MeshAttributes.cpp.
AttributeHandle wmtk::attribute::MeshAttributes< T >::register_attribute | ( | const std::string & | name, |
int64_t | dimension, | ||
bool | replace = false , |
||
T | default_value = T(0) |
||
) |
Definition at line 106 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index, wmtk::log_and_throw_error(), and wmtk::simplex::utils::make_unique().
void wmtk::attribute::MeshAttributes< T >::remove_attribute | ( | const AttributeHandle & | attribute | ) |
Remove a single attribute.
attribute | the attribute being deleted |
Definition at line 287 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index.
void wmtk::attribute::MeshAttributes< T >::remove_attributes | ( | const std::vector< AttributeHandle > & | attributes, |
bool | invalidate_handles = true |
||
) |
Remove all passed in attributes.
attributes | Vector of attributes that should be removed. |
invalidate_handles | invalidates all handles. If true this garbage collects old handles |
Definition at line 256 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::reserve | ( | const int64_t | size | ) |
Definition at line 230 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::reserve_more | ( | int64_t | size | ) |
Definition at line 241 of file MeshAttributes.cpp.
int64_t wmtk::attribute::MeshAttributes< T >::reserved_size |
Definition at line 198 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::rollback_current_scope |
Definition at line 75 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::serialize | ( | const int | dim, |
MeshWriter & | writer | ||
) | const |
Definition at line 20 of file MeshAttributes.cpp.
void wmtk::attribute::MeshAttributes< T >::set | ( | const AttributeHandle & | handle, |
std::vector< T > | val | ||
) |
Definition at line 180 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index.
void wmtk::attribute::MeshAttributes< T >::set_name | ( | const AttributeHandle & | handle, |
const std::string & | name | ||
) |
Definition at line 329 of file MeshAttributes.cpp.
References wmtk::attribute::AttributeHandle::index.
Definition at line 32 of file MeshAttributes.hpp.
|
private |
Definition at line 133 of file MeshAttributes.hpp.
Referenced by wmtk::attribute::MeshAttributes< T >::operator==().
|
private |
Definition at line 128 of file MeshAttributes.hpp.
Referenced by wmtk::attribute::MeshAttributes< T >::operator==().
|
private |
Definition at line 131 of file MeshAttributes.hpp.