14#include <lagrange/Attribute.h>
15#include <lagrange/AttributeTypes.h>
16#include <lagrange/AttributeValueType.h>
17#include <lagrange/IndexedAttribute.h>
18#include <lagrange/SurfaceMesh.h>
38template <
typename Func,
typename Scalar,
typename Index>
41 const auto& attr = mesh.get_attribute_base(
id);
42 auto type = attr.get_value_type();
45#define LA_X_visit(_, ValueType) \
46 case make_attribute_value_type<ValueType>(): { \
48 func(static_cast<const IndexedAttribute<ValueType, Index>&>(attr)); \
50 func(static_cast<const Attribute<ValueType>&>(attr)); \
75template <
typename Func,
typename Scalar,
typename Index>
78 const auto& attr = mesh.get_attribute_base(
id);
79 auto type = attr.get_value_type();
82#define LA_X_visit(_, ValueType) \
83 case make_attribute_value_type<ValueType>(): { \
85 func(mesh.template ref_indexed_attribute<ValueType>(id)); \
87 func(mesh.template ref_attribute<ValueType>(id)); \
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73
#define LA_ATTRIBUTE_X(mode, data)
X Macro arguments for the Attribute<> class.
Definition: AttributeTypes.h:48
@ Indexed
Indexed mesh attributes.
Definition: AttributeFwd.h:45
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition: attribute_string_utils.h:21
void visit_attribute_write(SurfaceMesh< Scalar, Index > &mesh, AttributeId id, Func &&func)
Apply a function to a writeable mesh attribute.
Definition: visit_attribute.h:76
void visit_attribute_read(const SurfaceMesh< Scalar, Index > &mesh, AttributeId id, Func &&func)
Apply a function to a read-only mesh attribute.
Definition: visit_attribute.h:39