Public Member Functions

sp::scene::QuadTreeNode Class Reference

Quad tree node class used for terrain patches and optimization purposes. More...

#include <spTreeNodeQuad.hpp>

Inheritance diagram for sp::scene::QuadTreeNode:
sp::scene::TreeNode sp::BaseObject

List of all members.

Public Member Functions

 QuadTreeNode (TreeNode *Parent=0)
 ~QuadTreeNode ()
bool isLeaf () const
 Returns true if this is a leaf node. In this case it has no children.
void addChildren ()
 Creates the children if it currently has none.
void removeChildren ()
 Deletes the children if it currently has some.
void findTreeNodes (std::list< const QuadTreeNode * > &TreeNodeList, const dim::point2df &Pos) const
void findTreeNodes (std::list< const QuadTreeNode * > &TreeNodeList, const dim::point2df &Pos, const dim::size2df &Radius) const
QuadTreeNodegetChild (u32 Index) const

Detailed Description

Quad tree node class used for terrain patches and optimization purposes.


Constructor & Destructor Documentation

sp::scene::QuadTreeNode::QuadTreeNode ( TreeNode Parent = 0  ) 
sp::scene::QuadTreeNode::~QuadTreeNode (  ) 

Member Function Documentation

void sp::scene::QuadTreeNode::addChildren (  )  [virtual]

Creates the children if it currently has none.

Reimplemented from sp::scene::TreeNode.

void sp::scene::QuadTreeNode::findTreeNodes ( std::list< const QuadTreeNode * > &  TreeNodeList,
const dim::point2df Pos 
) const

Searchs each quad node where the specified position is inside. Only those quad nodes are searched which have no children.

Parameters:
TreeNodeList,: Resulting list with all found QuadTreeNode objects. This must be a reference and no function's return value because it will be called recursive for each next tree node child.
void sp::scene::QuadTreeNode::findTreeNodes ( std::list< const QuadTreeNode * > &  TreeNodeList,
const dim::point2df Pos,
const dim::size2df Radius 
) const

Does the same like the first "findTreeNodes" function but considers the radius which occurs that sometimes more than one tree node can be found.

QuadTreeNode* sp::scene::QuadTreeNode::getChild ( u32  Index  )  const [inline]
Returns:
Pointer the the specified QuadTreeNode child object(index must be in a range of [0, 3]).
bool sp::scene::QuadTreeNode::isLeaf (  )  const [virtual]

Returns true if this is a leaf node. In this case it has no children.

Implements sp::scene::TreeNode.

void sp::scene::QuadTreeNode::removeChildren (  )  [virtual]

Deletes the children if it currently has some.

Reimplemented from sp::scene::TreeNode.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines