|
SYS_FORCE_INLINE | BVH () noexcept |
|
template<BVH_Heuristic H, typename T , uint NAXES, typename BOX_TYPE , typename SRC_INT_TYPE = INT_TYPE> |
void | init (const BOX_TYPE *boxes, const INT_TYPE nboxes, SRC_INT_TYPE *indices=nullptr, bool reorder_indices=false, INT_TYPE max_items_per_leaf=1) noexcept |
|
template<BVH_Heuristic H, typename T , uint NAXES, typename BOX_TYPE , typename SRC_INT_TYPE = INT_TYPE> |
void | init (Box< T, NAXES > axes_minmax, const BOX_TYPE *boxes, INT_TYPE nboxes, SRC_INT_TYPE *indices=nullptr, bool reorder_indices=false, INT_TYPE max_items_per_leaf=1) noexcept |
|
SYS_FORCE_INLINE INT_TYPE | getNumNodes () const noexcept |
|
SYS_FORCE_INLINE const Node * | getNodes () const noexcept |
|
int | getMaxDepth () const noexcept |
| Returns the maximum depth of any leaf. More...
|
|
int | getPureInternalDepth () const noexcept |
| Returns the minimum depth of the first non-internal node. More...
|
|
SYS_FORCE_INLINE void | clear () noexcept |
|
template<typename LOCAL_DATA , typename FUNCTORS > |
void | traverse (FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
|
template<typename LOCAL_DATA , typename FUNCTORS > |
void | traverseParallel (INT_TYPE parallel_threshold, FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
|
template<typename LOCAL_DATA , typename FUNCTORS > |
void | traverseVector (FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
|
void | debugDump () const |
| Prints a text representation of the tree to stdout. More...
|
|
template<uint N>
class UT::BVH< N >
Definition at line 401 of file UT_BVH.h.
template<uint N>
template<typename LOCAL_DATA , typename FUNCTORS >
void UT::BVH< N >::traverse |
( |
FUNCTORS & |
functors, |
|
|
LOCAL_DATA * |
data_for_parent = nullptr |
|
) |
| const |
|
noexcept |
For each node, this effectively does: LOCAL_DATA local_data[MAX_ORDER]; bool descend = functors.pre(nodei, parent_data); if (!descend) return; for each child { if (isitem(child)) functors.item(getitemi(child), nodei, local_data[child]); else if (isnode(child)) recurse(getnodei(child), local_data); } functors.post(nodei, parent_nodei, data_for_parent, num_children, local_data);
Definition at line 428 of file UT_BVHImpl.h.
template<uint N>
template<typename LOCAL_DATA , typename FUNCTORS >
void UT::BVH< N >::traverseParallel |
( |
INT_TYPE |
parallel_threshold, |
|
|
FUNCTORS & |
functors, |
|
|
LOCAL_DATA * |
data_for_parent = nullptr |
|
) |
| const |
|
noexcept |
This acts like the traverse function, except if the number of nodes in two subtrees of a node contain at least parallel_threshold nodes, they may be executed in parallel. If parallel_threshold is 0, even item_functor may be executed on items in parallel. NOTE: Make sure that your functors don't depend on the order that they're executed in, e.g. don't add values from sibling nodes together except in post functor, else they might have nondeterministic roundoff or miss some values entirely.
Definition at line 471 of file UT_BVHImpl.h.
template<uint N>
template<typename LOCAL_DATA , typename FUNCTORS >
void UT::BVH< N >::traverseVector |
( |
FUNCTORS & |
functors, |
|
|
LOCAL_DATA * |
data_for_parent = nullptr |
|
) |
| const |
|
noexcept |
For each node, this effectively does: LOCAL_DATA local_data[MAX_ORDER]; uint descend = functors.pre(nodei, parent_data); if (!descend) return; for each child { if (!(descend & (1<<child))) continue; if (isitem(child)) functors.item(getitemi(child), nodei, local_data[child]); else if (isnode(child)) recurse(getnodei(child), local_data); } functors.post(nodei, parent_nodei, data_for_parent, num_children, local_data);
Definition at line 596 of file UT_BVHImpl.h.