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

#include <quadtree.h>

Detailed Description

template<class TYPE>
class Util::QuadTree< TYPE >::Node

node in quad tree

Public Member Functions

 Node ()
 constructor
 
 ~Node ()
 destructor
 
void Setup (QuadTree< TYPE > *tree, uchar _level, ushort _col, ushort _row)
 recursively initialize the node
 
char Level () const
 get the node's level
 
ushort Column () const
 get the node's column
 
ushort Row () const
 get the node's row
 
const Math::bboxGetBoundingBox () const
 compute the node's bounding box
 
NodeFindContainmentNode (const Math::bbox &box)
 recursively find the smallest child node which contains the bounding box
 
void SetElement (const TYPE &elm)
 set data element associated with node
 
const TYPE & GetElement () const
 get data element
 
NodeGetChildAt (IndexT i)
 get child at index
 

Private Attributes

Nodechildren [4]
 
char level
 
ushort col
 
ushort row
 
Math::bbox box
 
TYPE element
 

Friends

class QuadTree
 

Constructor & Destructor Documentation

◆ Node()

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

constructor

◆ ~Node()

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

destructor

Member Function Documentation

◆ Column()

template<class TYPE >
ushort Util::QuadTree< TYPE >::Node::Column ( ) const

get the node's column

◆ FindContainmentNode()

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

recursively find the smallest child node which contains the bounding box

This finds the smallest child node which completely contains the given bounding box.

Calls itself recursively.

◆ GetBoundingBox()

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

compute the node's bounding box

◆ GetChildAt()

template<class TYPE >
QuadTree< TYPE >::Node * Util::QuadTree< TYPE >::Node::GetChildAt ( IndexT i)

get child at index

◆ GetElement()

template<class TYPE >
const TYPE & Util::QuadTree< TYPE >::Node::GetElement ( ) const

get data element

◆ Level()

template<class TYPE >
char Util::QuadTree< TYPE >::Node::Level ( ) const

get the node's level

◆ Row()

template<class TYPE >
ushort Util::QuadTree< TYPE >::Node::Row ( ) const

get the node's row

◆ SetElement()

template<class TYPE >
void Util::QuadTree< TYPE >::Node::SetElement ( const TYPE & elm)

set data element associated with node

◆ Setup()

template<class TYPE >
void Util::QuadTree< TYPE >::Node::Setup ( QuadTree< TYPE > * tree,
uchar _level,
ushort _col,
ushort _row )

recursively initialize the node

Recursively initialize a quad tree node.

Friends And Related Symbol Documentation

◆ QuadTree

template<class TYPE >
friend class QuadTree
friend

Member Data Documentation

◆ box

template<class TYPE >
Math::bbox Util::QuadTree< TYPE >::Node::box
private

◆ children

template<class TYPE >
Node* Util::QuadTree< TYPE >::Node::children[4]
private

◆ col

template<class TYPE >
ushort Util::QuadTree< TYPE >::Node::col
private

◆ element

template<class TYPE >
TYPE Util::QuadTree< TYPE >::Node::element
private

◆ level

template<class TYPE >
char Util::QuadTree< TYPE >::Node::level
private

◆ row

template<class TYPE >
ushort Util::QuadTree< TYPE >::Node::row
private

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