class TSpatialTree::NodeIterator

Iterator that iterates over tree nodes.

By default only the first inserted node will be iterated over and it is up the the user to add new ones using PushChild(). The iterator takes care of updating the node bounds accordingly.

Public

Constructors

NodeIterator

NodeIterator(const TSpatialTree &tree)

Initializes the iterator, starting with the root tree node.

NodeIterator

NodeIterator(const Node *node, const NodeBounds &bounds)

Initializes the iterator using a specific node and its bounds.

Methods

GetCurrent

const NodeTraversalContext &GetCurrent() const

Returns information about the current node.

MoveNext() must be called at least once and it must return true prior to attempting to access this data.

MoveNext

bool MoveNext()

Moves to the next entry in the iterator.

Iterator starts at a position before the first element, therefore this method must be called at least once before attempting to access the current node. If the method returns false it means the iterator end has been reached and attempting to access data will result in an error.

PushChild

void PushChild(const TSpatialTreeChildNodeId<Dimension> &child)

Inserts a child of the current node to be iterated over.

Private

Fields

mCurrentNodeContext

NodeTraversalContext mCurrentNodeContext

mNodeStack

TInlineArray<NodeTraversalContext, Options::MaximumDepth * kChildNodeCount> mNodeStack