Class for hierarchy tree structure. More...
#include <hpp/fcl/broadphase/hierarchy_tree.h>
Public Member Functions | |
HierarchyTree (int bu_threshold_=16, int topdown_level_=0) | |
Create hierarchy tree with suitable setting. More... | |
~HierarchyTree () | |
void | init (NodeType *leaves, int n_leaves_, int level=0) |
Initialize the tree by a set of leaves using algorithm with a given level. More... | |
size_t | insert (const BV &bv, void *data) |
Initialize the tree by a set of leaves using algorithm with a given level. More... | |
void | remove (size_t leaf) |
Remove a leaf node. More... | |
void | clear () |
Clear the tree. More... | |
bool | empty () const |
Whether the tree is empty. More... | |
void | update (size_t leaf, int lookahead_level=-1) |
update one leaf node More... | |
bool | update (size_t leaf, const BV &bv) |
update the tree when the bounding volume of a given leaf has changed More... | |
bool | update (size_t leaf, const BV &bv, const Vec3f &vel, FCL_REAL margin) |
update one leaf's bounding volume, with prediction More... | |
bool | update (size_t leaf, const BV &bv, const Vec3f &vel) |
update one leaf's bounding volume, with prediction More... | |
size_t | getMaxHeight () const |
get the max height of the tree More... | |
size_t | getMaxDepth () const |
get the max depth of the tree More... | |
void | balanceBottomup () |
balance the tree from bottom More... | |
void | balanceTopdown () |
balance the tree from top More... | |
void | balanceIncremental (int iterations) |
balance the tree in an incremental way More... | |
void | refit () |
refit the tree, i.e., when the leaf nodes' bounding volumes change, update the entire tree in a bottom-up manner More... | |
void | extractLeaves (size_t root, NodeType *&leaves) const |
extract all the leaves of the tree More... | |
size_t | size () const |
number of leaves in the tree More... | |
size_t | getRoot () const |
get the root of the tree More... | |
NodeType * | getNodes () const |
get the pointer to the nodes array More... | |
void | print (size_t root, int depth) |
print the tree in a recursive way More... | |
Public Attributes | |
int | topdown_level |
decide which topdown algorithm to use More... | |
int | bu_threshold |
decide the depth to use expensive bottom-up algorithm More... | |
Static Public Attributes | |
static const size_t | NULL_NODE = -1 |
Protected Attributes | |
size_t | root_node |
NodeType * | nodes |
size_t | n_nodes |
size_t | n_nodes_alloc |
size_t | n_leaves |
size_t | freelist |
unsigned int | opath |
int | max_lookahead_level |
Class for hierarchy tree structure.
fcl::implementation_array::HierarchyTree< BV >::HierarchyTree | ( | int | bu_threshold_ = 16 , |
int | topdown_level_ = 0 |
||
) |
Create hierarchy tree with suitable setting.
bu_threshold decides the height of tree node to start bottom-up construction / optimization; topdown_level decides different methods to construct tree in topdown manner. lower level method constructs tree with better quality but is slower.
References fcl::implementation_array::NodeBase< BV >::next.
fcl::implementation_array::HierarchyTree< BV >::~HierarchyTree | ( | ) |
void fcl::implementation_array::HierarchyTree< BV >::balanceBottomup | ( | ) |
balance the tree from bottom
References fcl::implementation_array::NodeBase< BV >::next.
void fcl::implementation_array::HierarchyTree< BV >::balanceIncremental | ( | int | iterations | ) |
balance the tree in an incremental way
void fcl::implementation_array::HierarchyTree< BV >::balanceTopdown | ( | ) |
balance the tree from top
References fcl::implementation_array::NodeBase< BV >::next.
void fcl::implementation_array::HierarchyTree< BV >::clear | ( | ) |
Clear the tree.
References fcl::implementation_array::NodeBase< BV >::next.
bool fcl::implementation_array::HierarchyTree< BV >::empty | ( | ) | const |
Whether the tree is empty.
void fcl::implementation_array::HierarchyTree< BV >::extractLeaves | ( | size_t | root, |
NodeType *& | leaves | ||
) | const |
extract all the leaves of the tree
size_t fcl::implementation_array::HierarchyTree< BV >::getMaxDepth | ( | ) | const |
get the max depth of the tree
size_t fcl::implementation_array::HierarchyTree< BV >::getMaxHeight | ( | ) | const |
get the max height of the tree
HierarchyTree< BV >::NodeType * fcl::implementation_array::HierarchyTree< BV >::getNodes | ( | ) | const |
get the pointer to the nodes array
size_t fcl::implementation_array::HierarchyTree< BV >::getRoot | ( | ) | const |
get the root of the tree
void fcl::implementation_array::HierarchyTree< BV >::init | ( | NodeType * | leaves, |
int | n_leaves_, | ||
int | level = 0 |
||
) |
Initialize the tree by a set of leaves using algorithm with a given level.
size_t fcl::implementation_array::HierarchyTree< BV >::insert | ( | const BV & | bv, |
void * | data | ||
) |
Initialize the tree by a set of leaves using algorithm with a given level.
void fcl::implementation_array::HierarchyTree< BV >::print | ( | size_t | root, |
int | depth | ||
) |
print the tree in a recursive way
References fcl::implementation_array::NodeBase< BV >::bv, fcl::implementation_array::NodeBase< BV >::children, and fcl::implementation_array::NodeBase< BV >::isLeaf().
void fcl::implementation_array::HierarchyTree< BV >::refit | ( | ) |
refit the tree, i.e., when the leaf nodes' bounding volumes change, update the entire tree in a bottom-up manner
void fcl::implementation_array::HierarchyTree< BV >::remove | ( | size_t | leaf | ) |
Remove a leaf node.
size_t fcl::implementation_array::HierarchyTree< BV >::size | ( | ) | const |
number of leaves in the tree
void fcl::implementation_array::HierarchyTree< BV >::update | ( | size_t | leaf, |
int | lookahead_level = -1 |
||
) |
update one leaf node
bool fcl::implementation_array::HierarchyTree< BV >::update | ( | size_t | leaf, |
const BV & | bv | ||
) |
update the tree when the bounding volume of a given leaf has changed
bool fcl::implementation_array::HierarchyTree< BV >::update | ( | size_t | leaf, |
const BV & | bv, | ||
const Vec3f & | vel, | ||
FCL_REAL | margin | ||
) |
update one leaf's bounding volume, with prediction
bool fcl::implementation_array::HierarchyTree< BV >::update | ( | size_t | leaf, |
const BV & | bv, | ||
const Vec3f & | vel | ||
) |
update one leaf's bounding volume, with prediction
int fcl::implementation_array::HierarchyTree< BV >::bu_threshold |
decide the depth to use expensive bottom-up algorithm
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
int fcl::implementation_array::HierarchyTree< BV >::topdown_level |
decide which topdown algorithm to use