library of assembled shared sources

http://lass.cocamware.com

lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics > Class Template Reference

an AABB bounding volume tree that looks similar to a KdTree More...

#include <aabb_tree.h>


Data Structures

struct  Input
class  Neighbour
class  Node

Public Types

enum  { dimension = TObjectTraits::dimension }
typedef AabbTree< ObjectType,
ObjectTraits, SplitHeuristics > 
TSelf
typedef ObjectType TObject
typedef ObjectTraits TObjectTraits
typedef SplitHeuristics TSplitHeuristics
typedef
TObjectTraits::TObjectIterator 
TObjectIterator
typedef
TObjectTraits::TObjectReference 
TObjectReference
typedef TObjectTraits::TAabb TAabb
typedef TObjectTraits::TRay TRay
typedef TObjectTraits::TPoint TPoint
typedef TObjectTraits::TVector TVector
typedef TObjectTraits::TValue TValue
typedef TObjectTraits::TParam TParam
typedef TObjectTraits::TReference TReference
typedef
TObjectTraits::TConstReference 
TConstReference
typedef TObjectTraits::TInfo TInfo
typedef std::vector
< TObjectIterator
TObjectIterators

Public Member Functions

 AabbTree ()
 AabbTree (TObjectIterator first, TObjectIterator last)
void reset ()
void reset (TObjectIterator first, TObjectIterator last)
const TAabb aabb () const
bool contains (const TPoint &point, const TInfo *info=0) const
template<typename OutputIterator >
OutputIterator find (const TPoint &point, OutputIterator result, const TInfo *info=0) const
TObjectIterator intersect (const TRay &ray, TReference t, TParam tMin=0, const TInfo *info=0) const
bool intersects (const TRay &ray, TParam tMin=0, TParam tMax=std::numeric_limits< TValue >::infinity(), const TInfo *info=0) const
const Neighbour nearestNeighbour (const TPoint &point, const TInfo *info=0) const
template<typename RandomIterator >
RandomIterator rangeSearch (const TPoint &center, TParam maxRadius, size_t maxCount, RandomIterator first, const TInfo *info=0) const
const bool isEmpty () const
const TObjectIterator end () const
void swap (TSelf &other)
template<typename RandomAccessIterator >
RandomAccessIterator rangeSearch (const TPoint &target, TParam maxRadius, size_t maxCount, RandomAccessIterator first, const TInfo *info) const

Private Types

typedef std::vector< InputTInputs
typedef TInputs::iterator TInputIterator
typedef std::deque< NodeTNodes

Private Member Functions

const int balance (TInputIterator first, TInputIterator last)
const int addLeafNode (const TAabb &aabb, TInputIterator first, TInputIterator last)
const int addInternalNode (const TAabb &aabb)
bool doContains (int index, const TPoint &point, const TInfo *info) const
template<typename OutputIterator >
OutputIterator doFind (int index, const TPoint &point, OutputIterator first, const TInfo *info) const
TObjectIterator doIntersect (int index, const TRay &ray, TReference t, TParam tMin, const TInfo *info) const
bool doIntersects (int iIndex, const TRay &ray, TParam tMin, TParam tMax, const TInfo *info) const
void doNearestNeighbour (int index, const TPoint &point, const TInfo *info, Neighbour &best) const
template<typename RandomIterator >
RandomIterator doRangeSearch (int index, const TPoint &point, TReference squaredRadius, size_t maxCount, RandomIterator first, RandomIterator last, const TInfo *info) const
void getChildren (int index, const TPoint &target, int indices[2], TValue squaredDistances[2]) const

Private Attributes

TObjectIterators objects_
TNodes nodes_
TObjectIterator end_


Detailed Description

template<typename ObjectType, typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
class lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >

an AABB bounding volume tree that looks similar to a KdTree

Author:
Bram de Greve [BdG]
the AabbTree does NOT own the objects. You must keep them yourself!

Definition at line 72 of file aabb_tree.h.


Member Typedef Documentation

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef AabbTree<ObjectType, ObjectTraits, SplitHeuristics> lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TSelf

Definition at line 76 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef ObjectType lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TObject

Definition at line 78 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef ObjectTraits lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TObjectTraits

Definition at line 79 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef SplitHeuristics lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TSplitHeuristics

Definition at line 80 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TObjectIterator lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TObjectIterator

Definition at line 82 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TObjectReference lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TObjectReference

Definition at line 83 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TAabb lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TAabb

Definition at line 84 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TRay lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TRay

Definition at line 85 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TPoint lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TPoint

Definition at line 86 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TVector lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TVector

Definition at line 87 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TValue lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TValue

Definition at line 88 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TParam lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TParam

Definition at line 89 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TReference lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TReference

Definition at line 90 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TConstReference lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TConstReference

Definition at line 91 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TObjectTraits::TInfo lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TInfo

Definition at line 92 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef std::vector<TObjectIterator> lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TObjectIterators

Definition at line 96 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef std::vector<Input> lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TInputs [private]

Definition at line 145 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef TInputs::iterator lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TInputIterator [private]

Definition at line 146 of file aabb_tree.h.

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
typedef std::deque<Node> lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::TNodes [private]

Definition at line 181 of file aabb_tree.h.


Member Enumeration Documentation

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
anonymous enum

Enumerator:
dimension 

Definition at line 94 of file aabb_tree.h.


Constructor & Destructor Documentation

template<typename O , typename OT , typename SH >
lass::spat::AabbTree< O, OT, SH >::AabbTree (  )  [inline]

Definition at line 59 of file aabb_tree.inl.

template<typename O , typename OT , typename SH >
lass::spat::AabbTree< O, OT, SH >::AabbTree ( TObjectIterator  first,
TObjectIterator  last 
) [inline]


Member Function Documentation

template<typename O , typename OT , typename SH >
void lass::spat::AabbTree< O, OT, SH >::reset (  )  [inline]

template<typename O , typename OT , typename SH >
void lass::spat::AabbTree< O, OT, SH >::reset ( TObjectIterator  first,
TObjectIterator  last 
) [inline]

template<typename O , typename OT , typename SH >
const AabbTree< O, OT, SH >::TAabb lass::spat::AabbTree< O, OT, SH >::aabb (  )  const [inline]

template<typename O , typename OT , typename SH >
bool lass::spat::AabbTree< O, OT, SH >::contains ( const TPoint point,
const TInfo info = 0 
) const [inline]

template<typename O , typename OT , typename SH >
template<typename OutputIterator >
OutputIterator lass::spat::AabbTree< O, OT, SH >::find ( const TPoint point,
OutputIterator  result,
const TInfo info = 0 
) const [inline]

template<typename O , typename OT , typename SH >
AabbTree< O, OT, SH >::TObjectIterator lass::spat::AabbTree< O, OT, SH >::intersect ( const TRay ray,
TReference  t,
TParam  tMin = 0,
const TInfo info = 0 
) const [inline]

template<typename O , typename OT , typename SH >
bool lass::spat::AabbTree< O, OT, SH >::intersects ( const TRay ray,
TParam  tMin = 0,
TParam  tMax = std::numeric_limits<TValue>::infinity(),
const TInfo info = 0 
) const [inline]

template<typename O , typename OT , typename SH >
const AabbTree< O, OT, SH >::Neighbour lass::spat::AabbTree< O, OT, SH >::nearestNeighbour ( const TPoint point,
const TInfo info = 0 
) const [inline]

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
template<typename RandomIterator >
RandomIterator lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::rangeSearch ( const TPoint center,
TParam  maxRadius,
size_t  maxCount,
RandomIterator  first,
const TInfo info = 0 
) const [inline]

template<typename O , typename OT , typename SH >
const bool lass::spat::AabbTree< O, OT, SH >::isEmpty (  )  const [inline]

template<typename O , typename OT , typename SH >
const AabbTree< O, OT, SH >::TObjectIterator lass::spat::AabbTree< O, OT, SH >::end (  )  const [inline]

template<typename O , typename OT , typename SH >
void lass::spat::AabbTree< O, OT, SH >::swap ( TSelf other  )  [inline]

template<typename O , typename OT , typename SH >
const int lass::spat::AabbTree< O, OT, SH >::balance ( TInputIterator  first,
TInputIterator  last 
) [inline, private]

template<typename O , typename OT , typename SH >
const int lass::spat::AabbTree< O, OT, SH >::addLeafNode ( const TAabb aabb,
TInputIterator  first,
TInputIterator  last 
) [inline, private]

template<typename O , typename OT , typename SH >
const int lass::spat::AabbTree< O, OT, SH >::addInternalNode ( const TAabb aabb  )  [inline, private]

template<typename O , typename OT , typename SH >
bool lass::spat::AabbTree< O, OT, SH >::doContains ( int  index,
const TPoint point,
const TInfo info 
) const [inline, private]

template<typename O , typename OT , typename SH >
template<typename OutputIterator >
OutputIterator lass::spat::AabbTree< O, OT, SH >::doFind ( int  index,
const TPoint point,
OutputIterator  first,
const TInfo info 
) const [inline, private]

template<typename O , typename OT , typename SH >
AabbTree< O, OT, SH >::TObjectIterator lass::spat::AabbTree< O, OT, SH >::doIntersect ( int  index,
const TRay ray,
TReference  t,
TParam  tMin,
const TInfo info 
) const [inline, private]

template<typename O , typename OT , typename SH >
bool lass::spat::AabbTree< O, OT, SH >::doIntersects ( int  iIndex,
const TRay ray,
TParam  tMin,
TParam  tMax,
const TInfo info 
) const [inline, private]

template<typename O , typename OT , typename SH >
void lass::spat::AabbTree< O, OT, SH >::doNearestNeighbour ( int  index,
const TPoint point,
const TInfo info,
Neighbour best 
) const [inline, private]

template<typename O , typename OT , typename SH >
template<typename RandomIterator >
RandomIterator lass::spat::AabbTree< O, OT, SH >::doRangeSearch ( int  index,
const TPoint point,
TReference  squaredRadius,
size_t  maxCount,
RandomIterator  first,
RandomIterator  last,
const TInfo info 
) const [inline, private]

template<typename O , typename OT , typename SH >
void lass::spat::AabbTree< O, OT, SH >::getChildren ( int  index,
const TPoint target,
int  indices[2],
TValue  squaredDistances[2] 
) const [inline, private]

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
template<typename RandomAccessIterator >
RandomAccessIterator lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::rangeSearch ( const TPoint target,
TParam  maxRadius,
size_t  maxCount,
RandomAccessIterator  first,
const TInfo info 
) const [inline]


Field Documentation

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
TObjectIterators lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::objects_ [private]

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
TNodes lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::nodes_ [private]

template<typename ObjectType , typename ObjectTraits = DefaultObjectTraits<ObjectType>, typename SplitHeuristics = DefaultSplitHeuristics<>>
TObjectIterator lass::spat::AabbTree< ObjectType, ObjectTraits, SplitHeuristics >::end_ [private]


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

Generated on Mon Nov 10 14:22:15 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo