Open CASCADE Technology
7.0.0
|
Stores parameters of bounding volume hierarchy (BVH). Bounding volume hierarchy (BVH) organizes geometric objects in the tree based on spatial relationships. Each node in the tree contains an axis-aligned bounding box of all the objects below it. Bounding volume hierarchies are used in many algorithms to support efficient operations on the sets of geometric objects, such as collision detection, ray-tracing, searching of nearest objects, and view frustum culling. More...
#include <BVH_Tree.hxx>
Public Types | |
typedef BVH_Box< T, N >::BVH_VecNt | BVH_VecNt |
Public Member Functions | |
BVH_Tree () | |
Creates new empty BVH tree. More... | |
void | Reserve (const Standard_Integer theNbNodes) |
Reserves internal BVH storage, so that it can contain specified number of tree nodes. More... | |
BVH_VecNt & | MinPoint (const Standard_Integer theNodeIndex) |
Returns minimum point of the given node. More... | |
BVH_VecNt & | MaxPoint (const Standard_Integer theNodeIndex) |
Returns maximum point of the given node. More... | |
const BVH_VecNt & | MinPoint (const Standard_Integer theNodeIndex) const |
Returns minimum point of the given node. More... | |
const BVH_VecNt & | MaxPoint (const Standard_Integer theNodeIndex) const |
Returns maximum point of the given node. More... | |
Standard_Integer & | LeftChild (const Standard_Integer theNodeIndex) |
Returns index of left child of the given inner node. More... | |
Standard_Integer | LeftChild (const Standard_Integer theNodeIndex) const |
Returns index of left child of the given inner node. More... | |
Standard_Integer & | RightChild (const Standard_Integer theNodeIndex) |
Returns index of right child of the given inner node. More... | |
Standard_Integer | RightChild (const Standard_Integer theNodeIndex) const |
Returns index of right child of the given inner node. More... | |
Standard_Integer & | BegPrimitive (const Standard_Integer theNodeIndex) |
Returns index of first primitive of the given leaf node. More... | |
Standard_Integer | BegPrimitive (const Standard_Integer theNodeIndex) const |
Returns index of first primitive of the given leaf node. More... | |
Standard_Integer & | EndPrimitive (const Standard_Integer theNodeIndex) |
Returns index of last primitive of the given leaf node. More... | |
Standard_Integer | EndPrimitive (const Standard_Integer theNodeIndex) const |
Returns index of last primitive of the given leaf node. More... | |
Standard_Integer | NbPrimitives (const Standard_Integer theNodeIndex) const |
Returns number of primitives for the given tree node. More... | |
Standard_Integer & | Level (const Standard_Integer theNodeIndex) |
Returns level (depth) of the given node. More... | |
Standard_Integer | Level (const Standard_Integer theNodeIndex) const |
Returns level (depth) of the given node. More... | |
Standard_Boolean | IsOuter (const Standard_Integer theNodeIndex) const |
Is node a leaf (outer)? More... | |
void | SetOuter (const Standard_Integer theNodeIndex) |
Sets node type to 'outer'. More... | |
void | SetInner (const Standard_Integer theNodeIndex) |
Sets node type to 'inner'. More... | |
Standard_Integer | Length () const |
Returns total number of BVH nodes. More... | |
Standard_Integer | Depth () const |
Returns depth of BVH tree from last build. More... | |
void | Clear () |
Removes all BVH nodes. More... | |
Standard_Integer | AddLeafNode (const BVH_VecNt &theMinPoint, const BVH_VecNt &theMaxPoint, const Standard_Integer theBegElem, const Standard_Integer theEndElem) |
Adds new leaf node to the BVH. More... | |
Standard_Integer | AddInnerNode (const BVH_VecNt &theMinPoint, const BVH_VecNt &theMaxPoint, const Standard_Integer theLftChild, const Standard_Integer theRghChild) |
Adds new inner node to the BVH. More... | |
Standard_Integer | AddLeafNode (const BVH_Box< T, N > &theAABB, const Standard_Integer theBegElem, const Standard_Integer theEndElem) |
Adds new leaf node to the BVH. More... | |
Standard_Integer | AddInnerNode (const BVH_Box< T, N > &theAABB, const Standard_Integer theLftChild, const Standard_Integer theRghChild) |
Adds new inner node to the BVH. More... | |
Standard_Integer | AddLeafNode (const Standard_Integer theBegElem, const Standard_Integer theEndElem) |
Adds new leaf node to the BVH with UNINITIALIZED bounds. More... | |
Standard_Integer | AddInnerNode (const Standard_Integer theLftChild, const Standard_Integer theRghChild) |
Adds new inner node to the BVH with UNINITIALIZED bounds. More... | |
T | EstimateSAH () const |
Returns value of SAH (surface area heuristic). Allows to compare the quality of BVH trees constructed for the same sets of geometric objects with different methods. More... | |
BVH::ArrayType< T, N >::Type & | MinPointBuffer () |
Returns array of node min points. More... | |
const BVH::ArrayType< T, N >::Type & | MinPointBuffer () const |
Returns array of node min points. More... | |
BVH::ArrayType< T, N >::Type & | MaxPointBuffer () |
Returns array of node max points. More... | |
const BVH::ArrayType< T, N >::Type & | MaxPointBuffer () const |
Returns array of node max points. More... | |
BVH_Array4i & | NodeInfoBuffer () |
Returns array of node data records. More... | |
const BVH_Array4i & | NodeInfoBuffer () const |
Returns array of node data records. More... | |
Protected Attributes | |
BVH::ArrayType< T, N >::Type | myMinPointBuffer |
Array of node minimum points. More... | |
BVH::ArrayType< T, N >::Type | myMaxPointBuffer |
Array of node maximum points. More... | |
BVH_Array4i | myNodeInfoBuffer |
Array of node data records. More... | |
Standard_Integer | myDepth |
Current depth of BVH tree. More... | |
Stores parameters of bounding volume hierarchy (BVH). Bounding volume hierarchy (BVH) organizes geometric objects in the tree based on spatial relationships. Each node in the tree contains an axis-aligned bounding box of all the objects below it. Bounding volume hierarchies are used in many algorithms to support efficient operations on the sets of geometric objects, such as collision detection, ray-tracing, searching of nearest objects, and view frustum culling.
Standard_Integer BVH_Tree< T, N >::AddInnerNode | ( | const BVH_VecNt & | theMinPoint, |
const BVH_VecNt & | theMaxPoint, | ||
const Standard_Integer | theLftChild, | ||
const Standard_Integer | theRghChild | ||
) |
Adds new inner node to the BVH.
Standard_Integer BVH_Tree< T, N >::AddInnerNode | ( | const BVH_Box< T, N > & | theAABB, |
const Standard_Integer | theLftChild, | ||
const Standard_Integer | theRghChild | ||
) |
Adds new inner node to the BVH.
Standard_Integer BVH_Tree< T, N >::AddInnerNode | ( | const Standard_Integer | theLftChild, |
const Standard_Integer | theRghChild | ||
) |
Adds new inner node to the BVH with UNINITIALIZED bounds.
Standard_Integer BVH_Tree< T, N >::AddLeafNode | ( | const BVH_VecNt & | theMinPoint, |
const BVH_VecNt & | theMaxPoint, | ||
const Standard_Integer | theBegElem, | ||
const Standard_Integer | theEndElem | ||
) |
Adds new leaf node to the BVH.
Standard_Integer BVH_Tree< T, N >::AddLeafNode | ( | const BVH_Box< T, N > & | theAABB, |
const Standard_Integer | theBegElem, | ||
const Standard_Integer | theEndElem | ||
) |
Adds new leaf node to the BVH.
Standard_Integer BVH_Tree< T, N >::AddLeafNode | ( | const Standard_Integer | theBegElem, |
const Standard_Integer | theEndElem | ||
) |
Adds new leaf node to the BVH with UNINITIALIZED bounds.
|
inline |
Returns index of first primitive of the given leaf node.
|
inline |
Returns index of first primitive of the given leaf node.
|
inline |
Returns depth of BVH tree from last build.
|
inline |
Returns index of last primitive of the given leaf node.
|
inline |
Returns index of last primitive of the given leaf node.
T BVH_Tree< T, N >::EstimateSAH | ( | ) | const |
Returns value of SAH (surface area heuristic). Allows to compare the quality of BVH trees constructed for the same sets of geometric objects with different methods.
|
inline |
Is node a leaf (outer)?
|
inline |
Returns index of left child of the given inner node.
|
inline |
Returns index of left child of the given inner node.
|
inline |
Returns total number of BVH nodes.
|
inline |
Returns level (depth) of the given node.
|
inline |
Returns level (depth) of the given node.
|
inline |
Returns maximum point of the given node.
|
inline |
Returns maximum point of the given node.
|
inline |
Returns array of node max points.
|
inline |
Returns array of node max points.
|
inline |
Returns minimum point of the given node.
|
inline |
Returns minimum point of the given node.
|
inline |
Returns array of node min points.
|
inline |
Returns array of node min points.
|
inline |
Returns number of primitives for the given tree node.
|
inline |
Returns array of node data records.
|
inline |
Returns array of node data records.
void BVH_Tree< T, N >::Reserve | ( | const Standard_Integer | theNbNodes | ) |
Reserves internal BVH storage, so that it can contain specified number of tree nodes.
|
inline |
Returns index of right child of the given inner node.
|
inline |
Returns index of right child of the given inner node.
|
inline |
Sets node type to 'inner'.
|
inline |
Sets node type to 'outer'.
|
protected |
Current depth of BVH tree.
|
protected |
Array of node maximum points.
|
protected |
Array of node minimum points.
|
protected |
Array of node data records.