|
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) |
|
| KdBVH () |
|
template<typename Iter > |
| KdBVH (Iter begin, Iter end) |
|
template<typename OIter , typename BIter > |
| KdBVH (OIter begin, OIter end, BIter boxBegin, BIter boxEnd) |
|
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 |
<em>Object | The 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.
Definition at line 70 of file KdBVH.h.
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 89 of file KdBVH.h.
89 {
init(begin,
end, boxBegin, boxEnd); }
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 bounding_box(Object) return a Volume.
Definition at line 93 of file KdBVH.h.
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 97 of file KdBVH.h.
104 int n =
static_cast<int>(
objects.size());
113 internal::get_boxes_helper<ObjectList, VolumeList, BIter>()(
objects, boxBegin, boxEnd, objBoxes);
115 objCenters.reserve(n);
116 boxes.reserve(n - 1);
119 for(
int i = 0;
i <
n; ++
i)
120 objCenters.push_back(
VIPair(objBoxes[i].center(), i));
122 build(objCenters, 0, n, objBoxes, 0);
126 for(
int i = 0;
i <
n; ++
i)
127 objects[i] = tmp[objCenters[i].second];
std::vector< VIPair, aligned_allocator< VIPair > > VIPairList
std::vector< Object, aligned_allocator< Object > > ObjectList
internal::vector_int_pair< Scalar, Dim > VIPair
std::vector< Volume, aligned_allocator< Volume > > VolumeList