Template Struct NdtreeIndex
Defined in File ndtree_index.h
Struct Documentation
-
template<int dim>
struct NdtreeIndex Public Types
-
using Element = IndexElement
-
using RelativeChild = NdtreeIndexRelativeChild
-
using ChildArray = std::array<NdtreeIndex, kNumChildren>
Public Functions
-
inline bool operator==(const NdtreeIndex &other) const
-
inline bool operator!=(const NdtreeIndex &other) const
-
NdtreeIndex computeParentIndex() const
Compute the index of the node’s direct parent.
-
NdtreeIndex computeParentIndex(Element parent_height) const
Compute the index of the node’s parent (or ancestor) at parent_height
-
NdtreeIndex computeChildIndex(RelativeChild relative_child_index) const
Compute the index of the node’s n-th child.
-
ChildArray computeChildIndices() const
-
RelativeChild computeRelativeChildIndex() const
Public Members
-
Element height = 0
The node’s resolution level in the octree.
Note
A height of 0 corresponds to the map’s maximum resolution. In a fully allocated tree, all leaf nodes are at height 0. Increasing the height by 1 doubles the node size along each dimension. The root node corresponds to the map’s lowest resolution, and the root node’s height matches the configured tree height.
Public Static Functions
-
static RelativeChild computeRelativeChildIndex(MortonIndex morton, Element parent_height)
-
static IndexElement computeLastCommonAncestorHeight(MortonIndex first_morton, Element first_height, MortonIndex second_morton, Element second_height)
-
static LinearIndex computeLevelTraversalDistance(MortonIndex morton, Element parent_height, Element child_height)
-
static LinearIndex computeTreeTraversalDistance(MortonIndex morton, Element parent_height, Element child_height)
Public Static Attributes
-
static constexpr RelativeChild kNumChildren = int_math::exp2(dim)
-
using Element = IndexElement