Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

sp::scene::TreeNode Class Reference

This is the tree node base class. More...

#include <spTreeNode.hpp>

Inheritance diagram for sp::scene::TreeNode:
sp::BaseObject sp::scene::BSPTreeNode sp::scene::KDTreeNode sp::scene::OBBTreeNode sp::scene::OcTreeNode sp::scene::QuadTreeNode

List of all members.

Public Member Functions

virtual ~TreeNode ()
virtual const TreeNodegetRoot () const
 Returns a constant pointer to the tree root node.
virtual TreeNodegetRoot ()
 Returns a pointer to the tree root node.
virtual u32 getLevel () const
 Returns the tree level. The root node has level 0, its children 1 and so on.
virtual bool isLeaf () const =0
 Returns true if this is a leaf node. In this case it has no children.
virtual void addChildren ()
 Creates the children if it currently has none.
virtual void removeChildren ()
 Deletes the children if it currently has some.
virtual const TreeNodefindLeaf (const dim::vector3df &Point) const
virtual void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::vector3df &Point, f32 Radius) const
virtual void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line) const
virtual void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line, f32 Radius) const
virtual const TreeNodefindLeafSub (const dim::vector3df &Point) const
virtual void findLeafListSub (std::list< const TreeNode * > &TreeNodeList, const dim::vector3df &Point, f32 Radius) const
ETreeNodeTypes getType () const
 Returns the type of tree node (QuadTree, OcTree, BSP-Tree, kd-Tree).
TreeNodegetParent () const
 Returns the parent node.
bool isRoot () const
 Returns true if this node is a root node (when it has no parent).
void setDestructorCallback (const TreeNodeDestructorCallback &Callback)

Protected Member Functions

 TreeNode (TreeNode *Parent, const ETreeNodeTypes Type)
template<class T >
TreeNodecreateChild (const dim::aabbox3df &Box)

Protected Attributes

ETreeNodeTypes Type_
TreeNodeParent_
TreeNodeDestructorCallback DestructorCallback_

Static Protected Attributes

static const f32 EXT_BOUNDBOX_SIZE = 0.01f

Detailed Description

This is the tree node base class.


Constructor & Destructor Documentation

sp::scene::TreeNode::~TreeNode (  )  [virtual]
sp::scene::TreeNode::TreeNode ( TreeNode Parent,
const ETreeNodeTypes  Type 
) [protected]

Member Function Documentation

void sp::scene::TreeNode::addChildren (  )  [virtual]
template<class T >
TreeNode* sp::scene::TreeNode::createChild ( const dim::aabbox3df Box  )  [inline, protected]
const TreeNode * sp::scene::TreeNode::findLeaf ( const dim::vector3df Point  )  const [virtual]

Searches for a leaf TreeNode object that contains the specified point.

Parameters:
Point,: Specifies the point where the node is you are searching for.
Returns:
Pointer to the TreeNode object which has been found. If no tree node has been found the return value is null.

Reimplemented in sp::scene::KDTreeNode, and sp::scene::OBBTreeNode.

void sp::scene::TreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::vector3df Point,
f32  Radius 
) const [virtual]

Searches all leaf TreeNode objects that contains the specified ellipsoid.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Point,: Specifies the ellipsoid's point.
Radius,: Specifies the ellipsoid's volumetric radius.

Reimplemented in sp::scene::KDTreeNode, and sp::scene::OBBTreeNode.

void sp::scene::TreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::line3df Line 
) const [virtual]

Searches all leaf TreeNode objects which the specified line intersects.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Line,: Specifies the line which is to be used for intersection tests. When you want to transform the whole tree transform the line inverse instead.

Reimplemented in sp::scene::KDTreeNode, and sp::scene::OBBTreeNode.

void sp::scene::TreeNode::findLeafList ( std::list< const TreeNode * > &  TreeNodeList,
const dim::line3df Line,
f32  Radius 
) const [virtual]

Searches all leaf TreeNode objects which the specified volumetric line intersects.

Parameters:
TreeNodeList,: Specifies the list where the result will be stored.
Line,: Specifies the line which is to be used for intersection tests.
Radius,: Specifise the line's radius (or rather size).

Reimplemented in sp::scene::KDTreeNode, and sp::scene::OBBTreeNode.

void sp::scene::TreeNode::findLeafListSub ( std::list< const TreeNode * > &  TreeNodeList,
const dim::vector3df Point,
f32  Radius 
) const [virtual]

Used internally.

See also:
findLeafList

Reimplemented in sp::scene::KDTreeNode.

const TreeNode * sp::scene::TreeNode::findLeafSub ( const dim::vector3df Point  )  const [virtual]

Used internally.

See also:
findLeaf

Reimplemented in sp::scene::KDTreeNode.

u32 sp::scene::TreeNode::getLevel (  )  const [virtual]

Returns the tree level. The root node has level 0, its children 1 and so on.

TreeNode* sp::scene::TreeNode::getParent (  )  const [inline]

Returns the parent node.

const TreeNode * sp::scene::TreeNode::getRoot (  )  const [virtual]

Returns a constant pointer to the tree root node.

TreeNode * sp::scene::TreeNode::getRoot (  )  [virtual]

Returns a pointer to the tree root node.

ETreeNodeTypes sp::scene::TreeNode::getType (  )  const [inline]

Returns the type of tree node (QuadTree, OcTree, BSP-Tree, kd-Tree).

virtual bool sp::scene::TreeNode::isLeaf (  )  const [pure virtual]

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

Implemented in sp::scene::BSPTreeNode, sp::scene::KDTreeNode, sp::scene::OBBTreeNode, sp::scene::OcTreeNode, and sp::scene::QuadTreeNode.

bool sp::scene::TreeNode::isRoot (  )  const [inline]

Returns true if this node is a root node (when it has no parent).

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

Deletes the children if it currently has some.

Reimplemented in sp::scene::BSPTreeNode, sp::scene::KDTreeNode, sp::scene::OcTreeNode, and sp::scene::QuadTreeNode.

void sp::scene::TreeNode::setDestructorCallback ( const TreeNodeDestructorCallback Callback  )  [inline]

Member Data Documentation

const f32 sp::scene::TreeNode::EXT_BOUNDBOX_SIZE = 0.01f [static, protected]

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