rcrt::BIHNode< T > Class Template Reference

#include <BIHNode.hpp>

Collaboration diagram for rcrt::BIHNode< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 B ()
 B (const AABB &bbox, std::vector< T * > *trList, int left, int right, int depth=0, int singleD=0)
virtual ~BIHNode ()
virtual Intersection intersect (Ray &r, const float &tMin, const float &tMax) const
bool isLeaf () const
bool isSingle () const
bool isEmpty () const
std::vector< T * > * getTraceables ()

Static Public Member Functions

static BIHSplit getSplitPlane (const AABB &box)

Private Member Functions

Intersection leafIntersect (Ray &r, const float &tMin, const float &tMax) const
void initNodeAsLeaf (std::vector< T * > *trList, int left, int right)
void initNode (const AABB &bbox, std::vector< T * > *trList, int left, int right, int depth, int singleDepth=0)

Private Attributes

BIHNode< T > * children [2]
std::vector< T * > * traceables
int leftIndex
int rightIndex
float clip [2]
Axis splitAxis


Detailed Description

template<class T>
class rcrt::BIHNode< T >

A templated node in a BIH. Provides a recursive implementation of the BIH.

Definition at line 35 of file BIHNode.hpp.


Constructor & Destructor Documentation

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

Definition at line 253 of file BIHNode.hpp.


Member Function Documentation

template<class T>
Intersection rcrt::BIHNode< T >::leafIntersect ( Ray r,
const float &  tMin,
const float &  tMax 
) const [inline, private]

Parameters:
r the ray
tMin minimum distance
tMax maximum distance
Returns:
the closest Intersection with the objects in this leaf node, or an invalid one

Definition at line 80 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().

template<class T>
void rcrt::BIHNode< T >::initNodeAsLeaf ( std::vector< T * > *  trList,
int  left,
int  right 
) [inline, private]

Parameters:
trList the vector of objects in this BIH.
left the index of the leftmost object in the vector that is part of this leaf node.
right the index of the rightmost object in the vector that is part of this leaf node.

Definition at line 111 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode().

template<class T>
void rcrt::BIHNode< T >::initNode ( const AABB bbox,
std::vector< T * > *  trList,
int  left,
int  right,
int  depth,
int  singleDepth = 0 
) [inline, private]

Actual construction code implementation.

Parameters:
bbox Bounding Box in which to check for split planes.
trList vector of objects in this tree
left index to leftmost object in the current range
right index to rightmost object in the current range
depth tree depth
singleDepth depth of single nodes(those that clip in the nonstandard way, see clip member documentation). There is a maximum on this depth.

Definition at line 129 of file BIHNode.hpp.

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

template<class T>
rcrt::BIHNode< T >::B ( const AABB bbox,
std::vector< T * > *  trList,
int  left,
int  right,
int  depth = 0,
int  singleD = 0 
) [inline]

This constructor creates a node of the tree.

Parameters:
bbox Bounding Box in which to check for split planes.
trList vector of objects in this tree
left index to leftmost object in the current range
right index to rightmost object in the current range
depth tree depth
singleDepth depth of single nodes(those that clip in the nonstandard way, see clip member documentation). There is a maximum on this depth.

template<class T>
virtual Intersection rcrt::BIHNode< T >::intersect ( Ray r,
const float &  tMin,
const float &  tMax 
) const [inline, virtual]

Definition at line 260 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().

template<class T>
bool rcrt::BIHNode< T >::isLeaf (  )  const [inline]

Definition at line 352 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().

template<class T>
bool rcrt::BIHNode< T >::isSingle (  )  const [inline]

Definition at line 357 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().

template<class T>
bool rcrt::BIHNode< T >::isEmpty (  )  const [inline]

Definition at line 362 of file BIHNode.hpp.

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

Definition at line 367 of file BIHNode.hpp.

template<class T>
static BIHSplit rcrt::BIHNode< T >::getSplitPlane ( const AABB box  )  [inline, static]

Definition at line 372 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode().


Member Data Documentation

template<class T>
BIHNode<T>* rcrt::BIHNode< T >::children[2] [private]

The left and right child of this node. Will be NULL for a leaf. There are special nodes which clip in another way (see clip member documentation) for which children[1] will be 0 and children[0] another BIHNode.

Definition at line 43 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), rcrt::BIHNode< rcrt::Traceable >::intersect(), rcrt::BIHNode< rcrt::Traceable >::isLeaf(), rcrt::BIHNode< rcrt::Traceable >::isSingle(), and rcrt::BIHNode< rcrt::Traceable >::~BIHNode().

template<class T>
std::vector<T*>* rcrt::BIHNode< T >::traceables [private]

A pointer to the vector of traceable objects contained in this BIH.

Definition at line 48 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::getTraceables(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), rcrt::BIHNode< rcrt::Traceable >::isEmpty(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().

template<class T>
int rcrt::BIHNode< T >::leftIndex [private]

Index to the leftmost element in the vector of traceables that is contained by this node.

Definition at line 53 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().

template<class T>
int rcrt::BIHNode< T >::rightIndex [private]

Index to the rightmost element in the vector of traceables that is contained by this node.

Definition at line 58 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().

template<class T>
float rcrt::BIHNode< T >::clip[2] [private]

This encodes the intervals of this node. The left interval is (-infinity,clip[0]], the right interval [clip[1],infinity). In a special case a node clips [clip[0], clip[1]] to cut away empty space on both sides of tightly packed objects.

Definition at line 66 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::intersect().

template<class T>
Axis rcrt::BIHNode< T >::splitAxis [private]

The axis along which this BIHNode clips.

Definition at line 71 of file BIHNode.hpp.

Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::intersect().


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