template<typename _Scalar, int _Dim, typename _Object>
class Eigen::KdBVH< _Scalar, _Dim, _Object >
A simple bounding volume hierarchy based on AlignedBox.
- Parameters:
-
| _Scalar | The underlying scalar type of the bounding boxes |
| _Dim | The dimension of the space in which the hierarchy lives |
| _Object | The object type that lives in the hierarchy. It must have value semantics. Either internal::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.
Definition at line 81 of file BVH.
Classes |
| struct | VectorComparator |
Public Types |
| enum | { Dim = _Dim
} |
| typedef _Object | Object |
typedef std::vector< Object,
aligned_allocator< Object > > | ObjectList |
| typedef _Scalar | Scalar |
| typedef AlignedBox< Scalar, Dim > | Volume |
typedef std::vector< Volume,
aligned_allocator< Volume > > | VolumeList |
| typedef int | Index |
| typedef const int * | VolumeIterator |
| typedef const Object * | ObjectIterator |
Public Member Functions |
| | KdBVH () |
| template<typename Iter > |
| | KdBVH (Iter begin, Iter end) |
| | Given an iterator range over Object references, constructs the BVH.
|
| template<typename OIter , typename BIter > |
| | KdBVH (OIter begin, OIter end, BIter boxBegin, BIter boxEnd) |
| | Given an iterator range over Object references and an iterator range over their bounding boxes, constructs the BVH.
|
| template<typename Iter > |
| void | init (Iter begin, Iter end) |
| | Given an iterator range over Object references, constructs the BVH, overwriting whatever is in there currently.
|
| template<typename OIter , typename BIter > |
| void | init (OIter begin, OIter end, BIter boxBegin, BIter boxEnd) |
| | Given an iterator range over Object references and an iterator range over their bounding boxes, constructs the BVH, overwriting whatever is in there currently.
|
| Index | getRootIndex () const |
| EIGEN_STRONG_INLINE void | getChildren (Index index, VolumeIterator &outVBegin, VolumeIterator &outVEnd, ObjectIterator &outOBegin, ObjectIterator &outOEnd) const |
| | 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.
|
| const Volume & | getVolume (Index index) const |
Private Types |
typedef
internal::vector_int_pair
< Scalar, Dim > | VIPair |
typedef std::vector< VIPair,
aligned_allocator< VIPair > > | VIPairList |
| typedef Matrix< Scalar, Dim, 1 > | VectorType |
Private Member Functions |
| void | build (VIPairList &objCenters, int from, int to, const VolumeList &objBoxes, int dim) |
Private Attributes |
| std::vector< int > | children |
| VolumeList | boxes |
| ObjectList | objects |
template<typename _Scalar , int _Dim, typename _Object >
template<typename Iter >
Given an iterator range over Object references, constructs the BVH.
Requires that internal::bounding_box(Object) return a Volume.
Definition at line 97 of file BVH.
template<typename _Scalar , int _Dim, typename _Object >
template<typename OIter , typename BIter >
| Eigen::KdBVH< _Scalar, _Dim, _Object >::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.
Definition at line 100 of file BVH.
template<typename _Scalar , int _Dim, typename _Object >
template<typename Iter >
| void Eigen::KdBVH< _Scalar, _Dim, _Object >::init |
( |
Iter |
begin, |
|
|
Iter |
end |
|
) |
| [inline] |
Given an iterator range over Object references, constructs the BVH, overwriting whatever is in there currently.
Requires that internal::bounding_box(Object) return a Volume.
Definition at line 104 of file BVH.
template<typename _Scalar , int _Dim, typename _Object >
template<typename OIter , typename BIter >
| void Eigen::KdBVH< _Scalar, _Dim, _Object >::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.
Definition at line 108 of file BVH.