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>

Public Member Functions | |
Constructors | |
| EmitterSampler (Scene *scene) | |
| EmitterSampler (const EmitterSampler ©) | |
| 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 | |
| Scene * | m_scene |
| ShapeSet * | m_lights |
| real_t * | m_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.
- 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.
- 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
Scene* EmitterSampler::m_scene [protected] |
Definition at line 98 of file EmitterSampler.h.
ShapeSet* EmitterSampler::m_lights [protected] |
Definition at line 101 of file EmitterSampler.h.
real_t* EmitterSampler::m_cdf [protected] |
Definition at line 104 of file EmitterSampler.h.
unsigned EmitterSampler::m_n [protected] |
Definition at line 107 of file EmitterSampler.h.
real_t EmitterSampler::m_area [protected] |
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
1.5.6