14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/utils/BitField.h>
16#include <lagrange/utils/span.h>
53template <
typename ExpectedValueType,
typename Scalar,
typename Index>
59 size_t expected_channels,
80template <
typename ExpectedValueType,
typename Scalar,
typename Index>
83 std::string_view name,
86 size_t expected_channels);
107template <
typename ExpectedValueType,
typename Scalar,
typename Index>
113 size_t expected_channels);
131template <
typename ExpectedValueType,
typename Scalar,
typename Index>
134 std::string_view name,
137 size_t expected_channels);
157template <
typename ExpectedValueType,
typename Scalar,
typename Index>
160 std::string_view name,
163 size_t expected_channels,
Bit field utility class.
Definition BitField.h:33
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
AttributeUsage
Usage tag indicating how the attribute should behave under mesh transformations.
Definition AttributeFwd.h:54
AttributeElement
Type of element to which the attribute is attached.
Definition AttributeFwd.h:26
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition attribute_string_utils.h:21
CheckAttributeResult check_attribute(const SurfaceMesh< Scalar, Index > &mesh, AttributeId id, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels, ShouldBeWritable expected_writable=ShouldBeWritable::No)
Check that an attribute matches the expected value type, element type, usage and number of channels.
Definition find_attribute_utils.cpp:38
AttributeId find_attribute(const SurfaceMesh< Scalar, Index > &mesh, std::string_view name, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels)
Find an attribute with a given name, ensuring the usage and element type match an expected target.
Definition find_attribute_utils.cpp:152
ShouldBeWritable
Whether the attribute should be writable.
Definition find_attribute_utils.h:27
AttributeId find_matching_attribute(const SurfaceMesh< Scalar, Index > &mesh, std::string_view name, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels)
Find an attribute with a given name, ensuring the usage and element type match an expected target.
Definition find_attribute_utils.cpp:89
ResetToDefault
Whether to reset the attribute values to default when an existing attribute is found.
Definition find_attribute_utils.h:24
AttributeId find_or_create_attribute(SurfaceMesh< Scalar, Index > &mesh, std::string_view name, AttributeElement expected_element, AttributeUsage expected_usage, size_t expected_channels, ResetToDefault reset_tag)
Either retrieve or create an attribute with a prescribed name, element type and usage.
Definition find_attribute_utils.cpp:177
Result of a check_attribute call.
Definition find_attribute_utils.h:31
std::string msg
Error message if the check failed.
Definition find_attribute_utils.h:33
bool success
Whether the check passed.
Definition find_attribute_utils.h:32