Public Member Functions

sp::scene::KDTreeNode Class Reference

kd-Tree node class for universal usage. More...

#include <spTreeNodeKD.hpp>

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

List of all members.

Public Member Functions

 KDTreeNode (TreeNode *Parent=0, const dim::aabbox3df &Box=dim::aabbox3df())
 ~KDTreeNode ()
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.
const TreeNodefindLeaf (const dim::vector3df &Point) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::vector3df &Point, f32 Radius) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line) const
void findLeafList (std::list< const TreeNode * > &TreeNodeList, const dim::line3df &Line, f32 Radius) const
const TreeNodefindLeafSub (const dim::vector3df &Point) const
void findLeafListSub (std::list< const TreeNode * > &TreeNodeList, const dim::vector3df &Point, f32 Radius) const
template<class A , class B >
void addChildren ()
 Creates the children if it currently has none.
template<class A , class B >
void addChildren (const EKDTreeAxles Axis, f32 Distance)
template<class T >
void addChildren ()
 Creates the children if it currently has none.
template<class T >
void addChildren (const EKDTreeAxles Axis, f32 Distance)
TreeNodegetChildNear () const
TreeNodegetChildFar () const
void setAxis (const EKDTreeAxles Axis)
EKDTreeAxles getAxis () const
void setDistance (f32 Distance)
f32 getDistance () const
void setBox (const dim::aabbox3df &Box)
dim::aabbox3df getBox () const

Detailed Description

kd-Tree node class for universal usage.


Constructor & Destructor Documentation

sp::scene::KDTreeNode::KDTreeNode ( TreeNode Parent = 0,
const dim::aabbox3df Box = dim::aabbox3df() 
)
sp::scene::KDTreeNode::~KDTreeNode (  ) 

Member Function Documentation

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

Creates the children if it currently has none.

Reimplemented from sp::scene::TreeNode.

template<class A , class B >
void sp::scene::KDTreeNode::addChildren (  )  [inline, virtual]

Creates the children if it currently has none.

Reimplemented from sp::scene::TreeNode.

template<class A , class B >
void sp::scene::KDTreeNode::addChildren ( const EKDTreeAxles  Axis,
f32  Distance 
) [inline]
template<class T >
void sp::scene::KDTreeNode::addChildren (  )  [inline, virtual]

Creates the children if it currently has none.

Reimplemented from sp::scene::TreeNode.

template<class T >
void sp::scene::KDTreeNode::addChildren ( const EKDTreeAxles  Axis,
f32  Distance 
) [inline]
const TreeNode * sp::scene::KDTreeNode::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 from sp::scene::TreeNode.

void sp::scene::KDTreeNode::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 from sp::scene::TreeNode.

void sp::scene::KDTreeNode::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 from sp::scene::TreeNode.

void sp::scene::KDTreeNode::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 from sp::scene::TreeNode.

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

Used internally.

See also:
findLeafList

Reimplemented from sp::scene::TreeNode.

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

Used internally.

See also:
findLeaf

Reimplemented from sp::scene::TreeNode.

EKDTreeAxles sp::scene::KDTreeNode::getAxis (  )  const [inline]
dim::aabbox3df sp::scene::KDTreeNode::getBox (  )  const [inline]
TreeNode* sp::scene::KDTreeNode::getChildFar (  )  const [inline]
TreeNode* sp::scene::KDTreeNode::getChildNear (  )  const [inline]
f32 sp::scene::KDTreeNode::getDistance (  )  const [inline]
bool sp::scene::KDTreeNode::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::KDTreeNode::removeChildren (  )  [virtual]

Deletes the children if it currently has some.

Reimplemented from sp::scene::TreeNode.

void sp::scene::KDTreeNode::setAxis ( const EKDTreeAxles  Axis  )  [inline]
void sp::scene::KDTreeNode::setBox ( const dim::aabbox3df Box  )  [inline]
void sp::scene::KDTreeNode::setDistance ( f32  Distance  )  [inline]

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