rcrt::BIH< T > Class Template Reference

#include <BIH.hpp>

Inheritance diagram for rcrt::BIH< T >:

Inheritance graph
[legend]
Collaboration diagram for rcrt::BIH< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 B ()
 B (std::vector< T * > *trList)
void setTraceables (std::vector< T * > *trList)
virtual ~BIH ()
virtual Intersection intersect (Ray &r) const
virtual const AABBgetBoundingBox () const
virtual const Point3DgetCentroid () const
std::vector< T * > * getTraceables () const
AABB clipBox (AABB &cbox) const

Static Public Member Functions

static AABB calcBoundingBox (std::vector< T * > *trList)

Private Attributes

AABB boundingBox
BIHNode< T > * rootNode


Detailed Description

template<class T>
class rcrt::BIH< T >

The Bounding Interval Hierarchy. An acceleration structure that is built very fast and is still quite efficient. This the interface of the tree, most of the actual implementation is in the BIHNode class. * Inserted objects will need to provide at least the intersect(), getBoundingBox() and getCentroid() methods from Traceable.

See also:
Instant Ray Tracing: The Bounding Interval Hierarchy (PDF)

Definition at line 24 of file BIH.hpp.


Constructor & Destructor Documentation

template<class T>
virtual rcrt::BIH< T >::~BIH (  )  [inline, virtual]

Definition at line 71 of file BIH.hpp.


Member Function Documentation

template<class T>
rcrt::BIH< T >::B (  )  [inline]

Constructs an empty BIH.

template<class T>
rcrt::BIH< T >::B ( std::vector< T * > *  trList  )  [inline]

Constructs a BIH with the given vector of objects.

Parameters:
trList A vector of objects of the type chosen. Neither the vector nor the objects will get deleted by this BIH. Note that this vector may be resorted.

template<class T>
void rcrt::BIH< T >::setTraceables ( std::vector< T * > *  trList  )  [inline]

A method to initialize or reconstruct the BIH with new objects. Any previously constructed hierarchy will be deleted.

Parameters:
trList A vector of objects. Note that this vector may be resorted.

Definition at line 57 of file BIH.hpp.

template<class T>
virtual Intersection rcrt::BIH< T >::intersect ( Ray r  )  const [inline, virtual]

Parameters:
r A ray.
Returns:
The closest intersection with the objects in this BIH.

Implements rcrt::Traceable.

Definition at line 81 of file BIH.hpp.

template<class T>
virtual const AABB& rcrt::BIH< T >::getBoundingBox (  )  const [inline, virtual]

Returns:
An axis-aligned Bounding Box that contains all the objects in this BIH.

Implements rcrt::Traceable.

Definition at line 92 of file BIH.hpp.

Referenced by rcrt::BIH< rcrt::Traceable >::clipBox().

template<class T>
virtual const Point3D& rcrt::BIH< T >::getCentroid (  )  const [inline, virtual]

Returns:
The central point of the AABB of this BIH.

Implements rcrt::Traceable.

Definition at line 100 of file BIH.hpp.

template<class T>
std::vector<T*>* rcrt::BIH< T >::getTraceables (  )  const [inline]

Returns:
The vector of objects contained by this tree.

Definition at line 108 of file BIH.hpp.

template<class T>
static AABB rcrt::BIH< T >::calcBoundingBox ( std::vector< T * > *  trList  )  [inline, static]

Parameters:
trList A vector of objects.
Returns:
The AABB of all objects in the given list.

Definition at line 120 of file BIH.hpp.

Referenced by rcrt::BIH< rcrt::Traceable >::setTraceables().

template<class T>
AABB rcrt::BIH< T >::clipBox ( AABB cbox  )  const [inline]

Definition at line 129 of file BIH.hpp.


Member Data Documentation

template<class T>
AABB rcrt::BIH< T >::boundingBox [private]

Definition at line 27 of file BIH.hpp.

Referenced by rcrt::BIH< rcrt::Traceable >::getBoundingBox(), rcrt::BIH< rcrt::Traceable >::getCentroid(), and rcrt::BIH< rcrt::Traceable >::setTraceables().

template<class T>
BIHNode<T>* rcrt::BIH< T >::rootNode [private]

Definition at line 28 of file BIH.hpp.

Referenced by rcrt::BIH< rcrt::Traceable >::getTraceables(), rcrt::BIH< rcrt::Traceable >::intersect(), rcrt::BIH< rcrt::Traceable >::setTraceables(), and rcrt::BIH< rcrt::Traceable >::~BIH().


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 19:32:18 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3