All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
KdBVH< _Scalar, _Dim, _Object > Class Template Reference

Detailed Description

template<typename _Scalar, int _Dim, typename _Object>
class Eigen::KdBVH< _Scalar, _Dim, _Object >

A simple bounding volume hierarchy based on AlignedBox.

Parameters
_ScalarThe underlying scalar type of the bounding boxes
_DimThe dimension of the space in which the hierarchy lives
_ObjectThe object type that lives in the hierarchy. It must have value semantics. Either bounding_box(_Object) must be defined and return an AlignedBox<_Scalar, _Dim> or bounding boxes must be provided to the tree initializer.

This class provides a simple (as opposed to optimized) implementation of a bounding volume hierarchy analogous to a Kd-tree. Given a sequence of objects, it computes their bounding boxes, constructs a Kd-tree of their centers and builds a BVH with the structure of that Kd-tree. When the elements of the tree are too expensive to be copied around, it is useful for _Object to be a pointer.

Public Member Functions

void getChildren (Index index, VolumeIterator &outVBegin, VolumeIterator &outVEnd, ObjectIterator &outOBegin, ObjectIterator &outOEnd) const
 
Index getRootIndex () const
 
const Volume & getVolume (Index index) const
 
template<typename Iter >
void init (Iter begin, Iter end)
 
template<typename OIter , typename BIter >
void init (OIter begin, OIter end, BIter boxBegin, BIter boxEnd)
 
template<typename Iter >
 KdBVH (Iter begin, Iter end)
 
template<typename OIter , typename BIter >
 KdBVH (OIter begin, OIter end, BIter boxBegin, BIter boxEnd)
 

Constructor & Destructor Documentation

KdBVH ( Iter  begin,
Iter  end 
)
inline

Given an iterator range over Object references, constructs the BVH. Requires that bounding_box(Object) return a Volume.

References KdBVH< _Scalar, _Dim, _Object >::init().

KdBVH ( OIter  begin,
OIter  end,
BIter  boxBegin,
BIter  boxEnd 
)
inline

Given an iterator range over Object references and an iterator range over their bounding boxes, constructs the BVH

References KdBVH< _Scalar, _Dim, _Object >::init().

Member Function Documentation

void getChildren ( Index  index,
VolumeIterator &  outVBegin,
VolumeIterator &  outVEnd,
ObjectIterator &  outOBegin,
ObjectIterator &  outOEnd 
) const
inline

Given an index of a node, on exit, outVBegin and outVEnd range over the indices of the volume children of the node and outOBegin and outOEnd range over the object children of the node

Index getRootIndex ( ) const
inline
Returns
the index of the root of the hierarchy
const Volume& getVolume ( Index  index) const
inline
Returns
the bounding box of the node at index
void init ( Iter  begin,
Iter  end 
)
inline

Given an iterator range over Object references, constructs the BVH, overwriting whatever is in there currently. Requires that bounding_box(Object) return a Volume.

References KdBVH< _Scalar, _Dim, _Object >::init().

Referenced by KdBVH< _Scalar, _Dim, _Object >::init(), and KdBVH< _Scalar, _Dim, _Object >::KdBVH().

void init ( OIter  begin,
OIter  end,
BIter  boxBegin,
BIter  boxEnd 
)
inline

Given an iterator range over Object references and an iterator range over their bounding boxes, constructs the BVH, overwriting whatever is in there currently.


The documentation for this class was generated from the following file: