rcrt::Light Class Reference

#include <Light.h>

Inheritance diagram for rcrt::Light:

Inheritance graph
[legend]
Collaboration diagram for rcrt::Light:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Light (const RGBColor &p=RGBColor(0), const int &minS=1)
virtual ~Light ()
virtual const RGBColorgetPower () const
virtual void setPower (const RGBColor &pow)
virtual LightSample illuminate (const Point3D &p, const Vec3D &no) const =0
virtual void illuminate (const Point3D &p, const Vec3D &no, std::vector< LightSample > &samples, const int &noSamples, Scene *s=0) const =0
virtual RGBColor getEmitted (const Vec3D &dir, const Point3D &pos) const =0
virtual void setSampler (LightSampler *ls)
virtual LightSamplergetSampler () const
virtual bool hasSampler () const
const int & getMinSamples () const
virtual ObjectgetObject ()
virtual void emitPhoton (Photon *photon) const =0

Protected Attributes

RGBColor power
int minSamples
LightSamplersampler


Detailed Description

The base class for all lights.

Definition at line 17 of file Light.h.


Constructor & Destructor Documentation

rcrt::Light::Light ( const RGBColor p = RGBColor(0),
const int &  minS = 1 
)

Definition at line 6 of file Light.cpp.

rcrt::Light::~Light (  )  [virtual]

Definition at line 11 of file Light.cpp.


Member Function Documentation

const RGBColor & rcrt::Light::getPower (  )  const [virtual]

Definition at line 15 of file Light.cpp.

References power.

void rcrt::Light::setPower ( const RGBColor pow  )  [virtual]

Definition at line 21 of file Light.cpp.

References power.

virtual LightSample rcrt::Light::illuminate ( const Point3D p,
const Vec3D no 
) const [pure virtual]

Parameters:
p the point to illuminate
no the normal at the point
Returns:
A single sample of the light source.

Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().

virtual void rcrt::Light::illuminate ( const Point3D p,
const Vec3D no,
std::vector< LightSample > &  samples,
const int &  noSamples,
Scene s = 0 
) const [pure virtual]

Parameters:
p the point to illuminate
no the normal at the given point
samples the vector to be filled with samples
noSamples the number of samples to generate
s (Optional) if used, it is up to the light to decide whether to cast shadow rays and what to use to test for occlusion.

Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.

virtual RGBColor rcrt::Light::getEmitted ( const Vec3D dir,
const Point3D pos 
) const [pure virtual]

Parameters:
pos the position on the light
dir the direction in which to emit
Returns:
the emitted light on the given point in the given direction

Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.

Referenced by rcrt::LightMaterial::getEmitted().

void rcrt::Light::setSampler ( LightSampler ls  )  [virtual]

Parameters:
ls A special sampler that samples the light source.

Definition at line 31 of file Light.cpp.

References sampler.

LightSampler * rcrt::Light::getSampler (  )  const [virtual]

Definition at line 36 of file Light.cpp.

References sampler.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().

bool rcrt::Light::hasSampler (  )  const [virtual]

Definition at line 41 of file Light.cpp.

References sampler.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().

const int & rcrt::Light::getMinSamples (  )  const

Returns:
the minimum samples that should be cast to illuminate a point with this light.

Definition at line 26 of file Light.cpp.

References minSamples.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), and rcrt::RayCaster::trace().

Object * rcrt::Light::getObject (  )  [virtual]

Returns:
An object, if any, that is a physical representation of the light in the scene.

Reimplemented in rcrt::AreaLight.

Definition at line 46 of file Light.cpp.

Referenced by rcrt::SceneLoader::goToFrame(), and rcrt::SceneLoader::nextFrame().

virtual void rcrt::Light::emitPhoton ( Photon photon  )  const [pure virtual]

Emits a (random) photon.

Parameters:
photon the photon in which to store initial position, direction and power

Implemented in rcrt::AreaLight, rcrt::DirLight, rcrt::PointLight, and rcrt::SphericalLight.

Referenced by rcrt::PhotonMap::generateJob().


Member Data Documentation

RGBColor rcrt::Light::power [protected]

Definition at line 20 of file Light.h.

Referenced by rcrt::PointLight::emitPhoton(), rcrt::AreaLight::emitPhoton(), rcrt::SphericalLight::getEmitted(), rcrt::PointLight::getEmitted(), rcrt::DirLight::getEmitted(), rcrt::AreaLight::getEmitted(), getPower(), rcrt::AreaLight::getSample(), rcrt::SphericalLight::illuminate(), rcrt::PointLight::illuminate(), rcrt::DirLight::illuminate(), and setPower().

int rcrt::Light::minSamples [protected]

Definition at line 21 of file Light.h.

Referenced by rcrt::AreaLight::AreaLight(), and getMinSamples().

LightSampler* rcrt::Light::sampler [protected]

Lights may use special sampling strategies.

Definition at line 26 of file Light.h.

Referenced by getSampler(), hasSampler(), and setSampler().


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