Nebula
Loading...
Searching...
No Matches
Util::QuadTree< TYPE > Class Template Reference

#include <quadtree.h>

Classes

class  Node
 node in quad tree More...
 

Public Member Functions

 QuadTree ()
 constructor
 
 ~QuadTree ()
 destructor
 
void Setup (const Math::bbox &box, uchar depth)
 initialize quad tree
 
const Math::bboxGetBoundingBox () const
 get the top level bounding box
 
uchar GetDepth () const
 get the tree depth
 
SizeT GetNumNodes (uchar level) const
 compute number of nodes in a level, including its children
 
IndexT GetNodeIndex (uchar level, ushort col, ushort row) const
 compute linear chunk index from level, col and row
 
SizeT GetNumNodesInTree () const
 get overall number of nodes in the tree
 
const NodeGetNodeByIndex (IndexT i) const
 get pointer to node by index
 
NodeNodeByIndex (IndexT i)
 read/write access to node
 
NodeFindContainmentNode (const Math::bbox &box)
 recursively find the smallest child node which contains the bounding box
 

Private Attributes

uchar treeDepth
 
Math::bbox boundingBox
 
Math::vector baseNodeSize
 
Util::FixedArray< NodenodeArray
 

Friends

class Node
 

Constructor & Destructor Documentation

◆ QuadTree()

template<class TYPE >
Util::QuadTree< TYPE >::QuadTree ( )

constructor

QuadTree constructor.

◆ ~QuadTree()

template<class TYPE >
Util::QuadTree< TYPE >::~QuadTree ( )

destructor

QuadTree destructor.

Member Function Documentation

◆ FindContainmentNode()

template<class TYPE >
QuadTree< TYPE >::Node * Util::QuadTree< TYPE >::FindContainmentNode ( const Math::bbox & box)

recursively find the smallest child node which contains the bounding box

Find the biggest quad tree which completely contains the provided bounding box.

◆ GetBoundingBox()

template<class TYPE >
const Math::bbox & Util::QuadTree< TYPE >::GetBoundingBox ( ) const

get the top level bounding box

Returns top level bounding box of quad tree.

◆ GetDepth()

template<class TYPE >
uchar Util::QuadTree< TYPE >::GetDepth ( ) const

get the tree depth

Returns depth of quad tree.

◆ GetNodeByIndex()

template<class TYPE >
const QuadTree< TYPE >::Node & Util::QuadTree< TYPE >::GetNodeByIndex ( IndexT i) const

get pointer to node by index

◆ GetNodeIndex()

template<class TYPE >
IndexT Util::QuadTree< TYPE >::GetNodeIndex ( uchar level,
ushort col,
ushort row ) const

compute linear chunk index from level, col and row

Computes a linear chunk index for a chunk address consisting of level, col and row.

◆ GetNumNodes()

template<class TYPE >
SizeT Util::QuadTree< TYPE >::GetNumNodes ( uchar level) const

compute number of nodes in a level, including its children

Computes number of nodes in a level, including its child nodes.

◆ GetNumNodesInTree()

template<class TYPE >
SizeT Util::QuadTree< TYPE >::GetNumNodesInTree ( ) const

get overall number of nodes in the tree

Returns the overall number of nodes in the tree for linear access.

◆ NodeByIndex()

template<class TYPE >
QuadTree< TYPE >::Node & Util::QuadTree< TYPE >::NodeByIndex ( IndexT i)

read/write access to node

◆ Setup()

template<class TYPE >
void Util::QuadTree< TYPE >::Setup ( const Math::bbox & box,
uchar depth )

initialize quad tree

Initialize the quad tree.

Friends And Related Symbol Documentation

◆ Node

template<class TYPE >
friend class Node
friend

Member Data Documentation

◆ baseNodeSize

template<class TYPE >
Math::vector Util::QuadTree< TYPE >::baseNodeSize
private

◆ boundingBox

template<class TYPE >
Math::bbox Util::QuadTree< TYPE >::boundingBox
private

◆ nodeArray

template<class TYPE >
Util::FixedArray<Node> Util::QuadTree< TYPE >::nodeArray
private

◆ treeDepth

template<class TYPE >
uchar Util::QuadTree< TYPE >::treeDepth
private

The documentation for this class was generated from the following file: