Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
KdBVH< _Scalar, _Dim, _Object > Class Template Reference

A simple bounding volume hierarchy based on AlignedBox. More...

#include <KdBVH.h>

List of all members.

Classes

struct  VectorComparator

Public Types

enum  { Dim = _Dim }
typedef int Index
typedef _Object Object
typedef const ObjectObjectIterator
typedef std::vector< Object,
aligned_allocator< Object > > 
ObjectList
typedef _Scalar Scalar
typedef AlignedBox< Scalar, DimVolume
typedef const int * VolumeIterator
typedef std::vector< Volume,
aligned_allocator< Volume > > 
VolumeList

Public Member Functions

EIGEN_STRONG_INLINE void getChildren (Index index, VolumeIterator &outVBegin, VolumeIterator &outVEnd, ObjectIterator &outOBegin, ObjectIterator &outOEnd) const
Index getRootIndex () const
const VolumegetVolume (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)

Private Types

typedef Matrix< Scalar, Dim, 1 > VectorType
typedef
internal::vector_int_pair
< Scalar, Dim
VIPair
typedef std::vector< VIPair,
aligned_allocator< VIPair > > 
VIPairList

Private Member Functions

void build (VIPairList &objCenters, int from, int to, const VolumeList &objBoxes, int dim)

Private Attributes

VolumeList boxes
std::vector< int > children
ObjectList objects

Detailed Description

template<typename _Scalar, int _Dim, typename _Object>
class 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 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 80 of file KdBVH.h.


Member Typedef Documentation

template<typename _Scalar, int _Dim, typename _Object>
typedef int KdBVH< _Scalar, _Dim, _Object >::Index

Definition at line 89 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef _Object KdBVH< _Scalar, _Dim, _Object >::Object

Definition at line 84 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef const Object* KdBVH< _Scalar, _Dim, _Object >::ObjectIterator

Definition at line 91 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef std::vector<Object, aligned_allocator<Object> > KdBVH< _Scalar, _Dim, _Object >::ObjectList

Definition at line 85 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef _Scalar KdBVH< _Scalar, _Dim, _Object >::Scalar

Definition at line 86 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef Matrix<Scalar, Dim, 1> KdBVH< _Scalar, _Dim, _Object >::VectorType [private]

Definition at line 185 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef internal::vector_int_pair<Scalar, Dim> KdBVH< _Scalar, _Dim, _Object >::VIPair [private]

Definition at line 183 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef std::vector<VIPair, aligned_allocator<VIPair> > KdBVH< _Scalar, _Dim, _Object >::VIPairList [private]

Definition at line 184 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef AlignedBox<Scalar, Dim> KdBVH< _Scalar, _Dim, _Object >::Volume

Definition at line 87 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef const int* KdBVH< _Scalar, _Dim, _Object >::VolumeIterator

Definition at line 90 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
typedef std::vector<Volume, aligned_allocator<Volume> > KdBVH< _Scalar, _Dim, _Object >::VolumeList

Definition at line 88 of file KdBVH.h.


Member Enumeration Documentation

template<typename _Scalar, int _Dim, typename _Object>
anonymous enum
Enumerator:
Dim 

Definition at line 83 of file KdBVH.h.


Constructor & Destructor Documentation

template<typename _Scalar, int _Dim, typename _Object>
KdBVH< _Scalar, _Dim, _Object >::KdBVH ( ) [inline]

Definition at line 93 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
template<typename Iter >
KdBVH< _Scalar, _Dim, _Object >::KdBVH ( Iter  begin,
Iter  end 
) [inline]

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

Definition at line 96 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
template<typename OIter , typename BIter >
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 99 of file KdBVH.h.


Member Function Documentation

template<typename _Scalar, int _Dim, typename _Object>
void KdBVH< _Scalar, _Dim, _Object >::build ( VIPairList objCenters,
int  from,
int  to,
const VolumeList objBoxes,
int  dim 
) [inline, private]

Definition at line 196 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
EIGEN_STRONG_INLINE void KdBVH< _Scalar, _Dim, _Object >::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

Definition at line 145 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
Index KdBVH< _Scalar, _Dim, _Object >::getRootIndex ( ) const [inline]
Returns:
the index of the root of the hierarchy

Definition at line 141 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
const Volume& KdBVH< _Scalar, _Dim, _Object >::getVolume ( Index  index) const [inline]
Returns:
the bounding box of the node at index

Definition at line 177 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
template<typename Iter >
void 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 103 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
template<typename OIter , typename BIter >
void 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 107 of file KdBVH.h.


Member Data Documentation

template<typename _Scalar, int _Dim, typename _Object>
VolumeList KdBVH< _Scalar, _Dim, _Object >::boxes [private]

Definition at line 229 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
std::vector<int> KdBVH< _Scalar, _Dim, _Object >::children [private]

Definition at line 228 of file KdBVH.h.

template<typename _Scalar, int _Dim, typename _Object>
ObjectList KdBVH< _Scalar, _Dim, _Object >::objects [private]

Definition at line 230 of file KdBVH.h.


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


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:34:21