IrradianceCache Class Reference

#include <IrradianceCache.h>

List of all members.

Public Member Functions

 IrradianceCache (float mError, float rootSize) throw (out_of_range)
virtual ~IrradianceCache ()
void addValue (const Vector3 &pos, const Vector3 &normal, const Color3f &irrad, float meanDistance) throw (out_of_range)
void getValue (const Vector3 &pos, const Vector3 &normal, vector< IrradianceCache::Value * > &buffer) const throw (out_of_range)
unsigned int getNumStoredValues () const
unsigned int getNumNodes () const
const IrradianceCache::ValuegetNextValuePointer ()
void resetValuePointer ()

Protected Member Functions

bool isInside (const Vector3 &position) const

Protected Attributes

const float maxError
 declaration
IrradianceCache::Noderoot
 octree root
vector< vector< IrradianceCache::Value * > * > treeValuesBuffer

Classes

class  Node
class  Value


Detailed Description

Irradiance cache stores preciselly computed values of indirect illumination in octree for later use.

Reference: Ward G. J., Rubistein F. M., Clear R. D.: A Ray Tracing Solution for Diffuse Interreflection, SIGGRAPH'88, p. 85-92, August 1988

Definition at line 21 of file IrradianceCache.h.


Constructor & Destructor Documentation

IrradianceCache float  mError,
float  rootSize
throw (out_of_range)
 

Constructor.

Parameters:
mError Max. allowed error.
rootSize side length of the octree root (scene distance)
Exceptions:
out_of_range if the root's side length <= 0, or if the constant mError <= 0
runtime_error due to memmory allocation error

Definition at line 6 of file IrradianceCache.cc.

~IrradianceCache  )  [virtual]
 

Destructor.

Definition at line 25 of file IrradianceCache.cc.

References IrradianceCache::root, and IrradianceCache::treeValuesBuffer.


Member Function Documentation

void addValue const Vector3 pos,
const Vector3 normal,
const Color3f &  irrad,
float  meanDistance
throw (out_of_range)
 

Stores irradiance value.

Parameters:
pos location of irradiance value
normal normalized surface normal of irradiance value
r irrad irradiance
meanDistance Harmonic mean distance to visible object
Exceptions:
out_of_range if meanDistance <= 0; if root's side legth condition fails; if teh irrad. value is outside the root

Definition at line 42 of file IrradianceCache.cc.

const IrradianceCache::Value * getNextValuePointer  ) 
 

Iterates through all irradiance values.

Returns:
pointer to actual irradiance value or NULL when finished

Definition at line 100 of file IrradianceCache.cc.

References IrradianceCache::Node::getNodeValues(), IrradianceCache::root, and IrradianceCache::treeValuesBuffer.

unsigned int getNumNodes  )  const
 

Returns:
number of nodes of the octree

Definition at line 95 of file IrradianceCache.cc.

References IrradianceCache::Node::getNumNodes(), and IrradianceCache::root.

unsigned int getNumStoredValues  )  const
 

Returns:
number of stored irradiance values.

Definition at line 90 of file IrradianceCache.cc.

References IrradianceCache::Node::getNumStoredValues(), and IrradianceCache::root.

void getValue const Vector3 pos,
const Vector3 normal,
vector< IrradianceCache::Value * > &  buffer
const throw (out_of_range)
 

Returns stored valid irradiance values from the domain of a given 3D point.

Parameters:
pos location of point in space
normal normalized normal the space point
buffer Container of found irradiance values
Exceptions:
out_of_ange if the point [posX, posY, posZ] is outside of the root's area

Definition at line 75 of file IrradianceCache.cc.

bool isInside const Vector3 position  )  const [protected]
 

Determines whether a 3D point is inside the octree

Parameters:
position 3D space point
Returns:
true if point is inside the octree, false otherwise

Definition at line 32 of file IrradianceCache.cc.

References IrradianceCache::Node::getSize(), and IrradianceCache::root.

void resetValuePointer  )  [inline]
 

Initializes iteration through all irradiance values. The getNextValuePointer() will return the first value.

Definition at line 129 of file IrradianceCache.h.


Member Data Documentation

const float maxError [protected]
 

declaration

Constant affecting the placement of irradiance values in

Definition at line 25 of file IrradianceCache.h.

IrradianceCache::Node* root [protected]
 

octree root

Octree root

Definition at line 36 of file IrradianceCache.h.

Referenced by IrradianceCache::getNextValuePointer(), IrradianceCache::getNumNodes(), IrradianceCache::getNumStoredValues(), IrradianceCache::isInside(), and IrradianceCache::~IrradianceCache().

vector< vector<IrradianceCache::Value*>* > treeValuesBuffer [protected]
 

Definition at line 38 of file IrradianceCache.h.

Referenced by IrradianceCache::getNextValuePointer(), and IrradianceCache::~IrradianceCache().


The documentation for this class was generated from the following files:
Generated on Wed Jun 28 12:24:33 2006 for esg by  doxygen 1.4.6