Nebula
|
#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::bbox & | GetBoundingBox () 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 Node & | GetNodeByIndex (IndexT i) const |
get pointer to node by index | |
Node & | NodeByIndex (IndexT i) |
read/write access to node | |
Node * | FindContainmentNode (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< Node > | nodeArray |
Friends | |
class | Node |
Util::QuadTree< TYPE >::QuadTree | ( | ) |
constructor
QuadTree constructor.
Util::QuadTree< TYPE >::~QuadTree | ( | ) |
destructor
QuadTree destructor.
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.
const Math::bbox & Util::QuadTree< TYPE >::GetBoundingBox | ( | ) | const |
get the top level bounding box
Returns top level bounding box of quad tree.
uchar Util::QuadTree< TYPE >::GetDepth | ( | ) | const |
get the tree depth
Returns depth of quad tree.
const QuadTree< TYPE >::Node & Util::QuadTree< TYPE >::GetNodeByIndex | ( | IndexT | i | ) | const |
get pointer to node by index
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.
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.
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.
QuadTree< TYPE >::Node & Util::QuadTree< TYPE >::NodeByIndex | ( | IndexT | i | ) |
read/write access to node
void Util::QuadTree< TYPE >::Setup | ( | const Math::bbox & | box, |
uchar | depth ) |
initialize quad tree
Initialize the quad tree.
|
friend |
|
private |
|
private |
|
private |
|
private |