Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
#include <ActorKdTree.hpp>

Public Member Functions | |
| ActorKdTree () | |
| virtual const char * | className () |
| Returns the name of the class. | |
| virtual int | childrenCount () const |
| Returns the number of child nodes of an ActorTreeAbstract node. | |
| virtual ActorTreeAbstract * | child (int i) |
| Returns the i-th child node of an ActorTreeAbstract node. | |
| virtual const ActorTreeAbstract * | child (int i) const |
| Returns the i-th child node of an ActorTreeAbstract node. | |
| void | compileKdTree (ActorCollection &actors, int max_depth=100, float minimum_volume=0) |
| Builds a ActorKdTree with the given list of Actor[s]. | |
| void | compileKdTree (int max_depth=100, float minimum_volume=0) |
| Builds a ActorKdTree with the Actor[s] contained in the tree. | |
| const Plane & | plane () const |
| Returns the splitting plane used to divide its two child nodes. | |
| ActorKdTree * | childN () |
| Returns the child node that lies in the negative space defined by the splitting plane. | |
| const ActorKdTree * | childN () const |
| Returns the child node that lies in the negative space defined by the splitting plane. | |
| ActorKdTree * | childP () |
| Returns the child node that lies in the positive space defined by the splitting plane. | |
| const ActorKdTree * | childP () const |
| Returns the child node that lies in the positive space defined by the splitting plane. | |
| ActorKdTree * | insertActor (Actor *actor) |
| Inserts an Actor in the ActorKdTree node hierarchy. | |
| ref< ActorKdTree > | kdtreeFromNonLeafyActors (int max_depth=100, float minimum_volume=0) |
| Removes the Actor[s] in the internal nodes of the ActorKdTree and uses them to create a new ActorKdTree. | |
| void | harvestNonLeafActors (ActorCollection &actors) |
| Removes the Actor[s] in the internal nodes of the ActorKdTree and appends them in the given ActorCollection. | |
Protected Attributes | |
| Plane | mPlane |
| ref< ActorKdTree > | mChildN |
| ref< ActorKdTree > | mChildP |
| vl::ActorKdTree::ActorKdTree | ( | ) | [inline] |
| virtual const char* vl::ActorKdTree::className | ( | ) | [inline, virtual] |
| int ActorKdTree::childrenCount | ( | ) | const [virtual] |
| ActorTreeAbstract * ActorKdTree::child | ( | int | i | ) | [virtual] |
| const ActorTreeAbstract * ActorKdTree::child | ( | int | i | ) | const [virtual] |
| void vl::ActorKdTree::compileKdTree | ( | ActorCollection & | actors, | |
| int | max_depth = 100, |
|||
| float | minimum_volume = 0 | |||
| ) |
Builds a ActorKdTree with the given list of Actor[s].
The ActorKdTree generation routine will try to minimize the ActorKdTree depth. Note that this function is relatively quick, but is not for free. Consider that using a Core 2 Duo .0GHz you can process around 22.000 objects/sec.
| void ActorKdTree::compileKdTree | ( | int | max_depth = 100, |
|
| float | minimum_volume = 0 | |||
| ) |
Builds a ActorKdTree with the Actor[s] contained in the tree.
| const Plane& vl::ActorKdTree::plane | ( | ) | const [inline] |
Returns the splitting plane used to divide its two child nodes.
| ActorKdTree* vl::ActorKdTree::childN | ( | ) | [inline] |
Returns the child node that lies in the negative space defined by the splitting plane.
| const ActorKdTree* vl::ActorKdTree::childN | ( | ) | const [inline] |
Returns the child node that lies in the negative space defined by the splitting plane.
| ActorKdTree* vl::ActorKdTree::childP | ( | ) | [inline] |
Returns the child node that lies in the positive space defined by the splitting plane.
| const ActorKdTree* vl::ActorKdTree::childP | ( | ) | const [inline] |
Returns the child node that lies in the positive space defined by the splitting plane.
| ActorKdTree * ActorKdTree::insertActor | ( | Actor * | actor | ) |
Inserts an Actor in the ActorKdTree node hierarchy.
Note that the Actor is likely to be inserted in a node whose bounding volume does not surround the Actor's bounding volume. For this reason after you inserted one or more Actor[s] in the ActorKdTree you should call computeAABB() on the root node of the ActorKdTree. Inserting and removing Actor[s] is an expensive operation and produces a ActorKdTree that is less balanced than the one you would get by recompiling the whole ActorKdTree from scratch.
| ref< ActorKdTree > ActorKdTree::kdtreeFromNonLeafyActors | ( | int | max_depth = 100, |
|
| float | minimum_volume = 0 | |||
| ) |
Removes the Actor[s] in the internal nodes of the ActorKdTree and uses them to create a new ActorKdTree.
| void vl::ActorKdTree::harvestNonLeafActors | ( | ActorCollection & | actors | ) |
Removes the Actor[s] in the internal nodes of the ActorKdTree and appends them in the given ActorCollection.
Plane vl::ActorKdTree::mPlane [protected] |
ref<ActorKdTree> vl::ActorKdTree::mChildN [protected] |
ref<ActorKdTree> vl::ActorKdTree::mChildP [protected] |