EmitterSampler Class Reference

Sampler which selects a point on an emitter (light source) in the scene with probability proportional to radiant exitance. More...

#include <EmitterSampler.h>

Inheritance diagram for EmitterSampler:

Sampler

List of all members.

Public Member Functions

Constructors
 EmitterSampler (Scene *scene)
 EmitterSampler (const EmitterSampler &copy)
virtual ~EmitterSampler ()
Initialization
virtual void init (ShapeSet *lights)
 Should perform any initialization of this random variable which may be necessary to speed or prepare sampling.
Main usage interface
virtual Event sample ()
virtual real_t getPdf (const Event &event) PURE_FUNCTION
Main usage interface
real_t getTotalSurfaceArea () const

Protected Attributes

Scenem_scene
ShapeSetm_lights
real_tm_cdf
unsigned m_n
real_t m_area


Detailed Description

Sampler which selects a point on an emitter (light source) in the scene with probability proportional to radiant exitance.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 20 of file EmitterSampler.h.


Constructor & Destructor Documentation

EmitterSampler::EmitterSampler ( Scene scene  )  [inline]

Definition at line 26 of file EmitterSampler.h.

EmitterSampler::EmitterSampler ( const EmitterSampler copy  )  [inline]

Definition at line 30 of file EmitterSampler.h.

virtual EmitterSampler::~EmitterSampler (  )  [inline, virtual]

Definition at line 38 of file EmitterSampler.h.


Member Function Documentation

void EmitterSampler::init ( ShapeSet lights  )  [virtual]

Should perform any initialization of this random variable which may be necessary to speed or prepare sampling.

Note:
should be called before calling sample or getPdf

Definition at line 18 of file EmitterSampler.cpp.

Event EmitterSampler::sample (  )  [virtual]

Returns:
a randomly chosen SurfacePoint, initialized to lie on an Emitter; the returned event is of type SurfacePoint* and it is up to the caller to ensure the returned SurfacePoint is deleted appropriately
Note:
the returned SurfacePoint is completely initialized, and the actual light source that the sample lies on can be obtained via the shape field of the returned SurfacePoint

consecutive calls to sample are expected to return independent, identically distributed (IID) samples

Implements Sampler.

Definition at line 50 of file EmitterSampler.cpp.

real_t EmitterSampler::getPdf ( const Event event  )  [virtual]

Returns:
the probability density with which the given event would be sampled according to the underlying probability density function
Note:
the given event is assumed to lie within this random variable's sample space

Implements Sampler.

Definition at line 62 of file EmitterSampler.cpp.

real_t EmitterSampler::getTotalSurfaceArea (  )  const [inline]

Returns:
the total surface area of all emitters in the scene

Definition at line 90 of file EmitterSampler.h.


Member Data Documentation

Definition at line 98 of file EmitterSampler.h.

Definition at line 101 of file EmitterSampler.h.

Definition at line 104 of file EmitterSampler.h.

unsigned EmitterSampler::m_n [protected]

Definition at line 107 of file EmitterSampler.h.

Definition at line 110 of file EmitterSampler.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6