Bidirectional mapper between UUIDs and array positions. More...
#include <IndexTypes.h>
Public Member Functions | |
| void | build (const std::vector< uint > &primitive_uuids) |
| Build mapping from ordered UUID list. | |
| ArrayPosition | toPosition (PrimitiveUUID uuid) const |
| Convert UUID to array position. | |
| PrimitiveUUID | toUUID (ArrayPosition pos) const |
| Convert array position to UUID. | |
| bool | isValidUUID (PrimitiveUUID uuid) const |
| Check if UUID exists in the mapping. | |
| size_t | getPrimitiveCount () const |
| Get total number of primitives in the mapping. | |
| bool | empty () const |
| Check if mapper is empty (no primitives) | |
Bidirectional mapper between UUIDs and array positions.
Provides O(1) conversion in both directions:
uuid_to_position_[UUID]position_to_uuid_[position]The mapper is built once during geometry initialization and used throughout the radiation model for all index conversions.
Thread-safe for read operations after build() completes.
Definition at line 133 of file IndexTypes.h.
|
inline |
Build mapping from ordered UUID list.
| primitive_uuids | Vector of UUIDs in array position order (i.e., primitive_uuids[i] is the UUID at position i) |
This method:
Complexity: O(n) where n = number of primitives
Definition at line 156 of file IndexTypes.h.
|
inline |
Check if mapper is empty (no primitives)
Definition at line 252 of file IndexTypes.h.
|
inline |
Get total number of primitives in the mapping.
Definition at line 245 of file IndexTypes.h.
|
inline |
Check if UUID exists in the mapping.
| uuid | Primitive UUID to check |
Definition at line 236 of file IndexTypes.h.
|
inline |
Convert UUID to array position.
| uuid | Primitive UUID |
Complexity: O(1)
Definition at line 190 of file IndexTypes.h.
|
inline |
Convert array position to UUID.
| pos | Array position |
| std::out_of_range | if position is out of bounds |
Complexity: O(1)
Definition at line 217 of file IndexTypes.h.