Template Struct NdtreeIndex

Struct Documentation

template<int dim>
struct NdtreeIndex

Public Types

using Element = IndexElement
using RelativeChild = NdtreeIndexRelativeChild
using Position = Eigen::Matrix<Element, dim, 1>
using ChildArray = std::array<NdtreeIndex, kNumChildren>

Public Functions

NdtreeIndex() = default
inline NdtreeIndex(Element height, const Position &position)
inline NdtreeIndex(Element height, Position &&position)
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
std::string toString() 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.

Position position = Position::Zero()

The node’s XYZ position in the octree’s grid at the resolution level set by 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 Element kDim = dim
static constexpr RelativeChild kNumChildren = int_math::exp2(dim)