|
MorphologicalAttributeFilters
Public API documentation
|
Layout object that maps scalar attributes to flat-buffer offsets. More...
#include <AttributeNames.hpp>
Public Member Functions | |
| AttributeNames (std::unordered_map< Attribute, int > &&map) | |
| Constructs a layout from an already validated offset map. | |
| int | getIndex (Attribute attr) const |
Returns the per-node offset associated with attr. | |
| bool | contains (Attribute attr) const noexcept |
Returns whether this layout contains attr. | |
| int | offset (Attribute attr) const |
Returns the per-node offset associated with attr. | |
| int | linearIndex (int nodeIndex, Attribute attr) const |
Returns the linear index in the flat buffer for (node, attr). | |
Static Public Member Functions | |
| static AttributeNames | fromList (const std::vector< Attribute > &attributes) |
| Builds a dense layout from an explicit attribute list. | |
| static AttributeNames | fromGroup (AttributeGroup group) |
| Builds a layout from a public attribute group. | |
| static std::string | toString (Attribute attr) |
Returns the stable symbolic name associated with attr. | |
| static std::string | describe (Attribute attr) |
| Returns a user-facing description of an attribute. | |
| static std::optional< Attribute > | parse (const std::string &str) |
| Parses a stable symbolic attribute name. | |
Public Attributes | |
| std::unordered_map< Attribute, int > | indexMap |
| Maps each requested attribute to its per-node offset. | |
| const int | NUM_ATTRIBUTES |
| Number of scalar attributes stored for each node. | |
Layout object that maps scalar attributes to flat-buffer offsets.
AttributeNames describes the in-memory arrangement of a node-attribute buffer. The layout is node-major:
0 come first;1;NUM_ATTRIBUTES is therefore the per-node stride needed to jump from the attributes of one node to the next. The actual number of floats in a buffer is numNodes * NUM_ATTRIBUTES.
The class is deliberately lightweight because it is shared across most of the incremental attribute pipeline, dependency maps, and Python bindings.
Definition at line 146 of file AttributeNames.hpp.
|
inline |
Constructs a layout from an already validated offset map.
The constructor takes ownership of map and derives the per-node stride from its final size.
Definition at line 160 of file AttributeNames.hpp.
|
inlinenoexcept |
Returns whether this layout contains attr.
Definition at line 204 of file AttributeNames.hpp.
|
inlinestatic |
Returns a user-facing description of an attribute.
The descriptions are intentionally richer than toString(...) and are meant for documentation, notebooks, and Python introspection helpers.
Definition at line 236 of file AttributeNames.hpp.
|
inlinestatic |
Builds a layout from a public attribute group.
Definition at line 186 of file AttributeNames.hpp.
|
inlinestatic |
Builds a dense layout from an explicit attribute list.
Duplicate attributes are rejected because a repeated key would make the flat-buffer stride disagree with the lookup table.
Definition at line 169 of file AttributeNames.hpp.
|
inline |
Returns the per-node offset associated with attr.
Definition at line 197 of file AttributeNames.hpp.
Returns the linear index in the flat buffer for (node, attr).
Definition at line 218 of file AttributeNames.hpp.
|
inline |
Returns the per-node offset associated with attr.
Definition at line 211 of file AttributeNames.hpp.
|
inlinestatic |
Parses a stable symbolic attribute name.
str names a known descriptor, or std::nullopt otherwise. Definition at line 246 of file AttributeNames.hpp.
|
inlinestatic |
Returns the stable symbolic name associated with attr.
Definition at line 225 of file AttributeNames.hpp.
| std::unordered_map<Attribute, int> mmcfilters::AttributeNames::indexMap |
Maps each requested attribute to its per-node offset.
Definition at line 149 of file AttributeNames.hpp.
Number of scalar attributes stored for each node.
Definition at line 152 of file AttributeNames.hpp.