Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::ParticleTracer Class Reference

Abstract particle tracer implementation. More...

#include <mitsuba/render/particleproc.h>

+ Inheritance diagram for mitsuba::ParticleTracer:

Public Member Functions

virtual void handleEmission (const PositionSamplingRecord &pRec, const Medium *medium, const Spectrum &weight)
 Handle a particle emission event. More...
 
virtual void handleNewParticle ()
 Handle a 'new particle generated' event. More...
 
virtual void handleSurfaceInteraction (int depth, int nullInteractions, bool delta, const Intersection &its, const Medium *medium, const Spectrum &weight)
 Handle a surface interaction event. More...
 
virtual void handleMediumInteraction (int depth, int nullInteractions, bool delta, const MediumSamplingRecord &mRec, const Medium *medium, const Vector &wi, const Spectrum &weight)
 Handle a medium interaction event. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
Implementation of the WorkProcessor interface
virtual ref< WorkUnitcreateWorkUnit () const
 Create a work unit of the proper type and size. More...
 
virtual void prepare ()
 Called once before processing starts. More...
 
virtual void process (const WorkUnit *workUnit, WorkResult *workResult, const bool &stop)
 Process a work unit and store the computed results. More...
 
void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this object to a stream. More...
 
- Public Member Functions inherited from mitsuba::WorkProcessor
virtual ref< WorkResultcreateWorkResult () const =0
 Create a work result of the proper type and size. More...
 
virtual ref< WorkProcessorclone () const =0
 Create a copy of this work processor instance. More...
 
- Public Member Functions inherited from mitsuba::SerializableObject
 SerializableObject (Stream *stream, InstanceManager *manager)
 Unserialize a serializable object. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::WorkProcessor
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::SerializableObject
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

 ParticleTracer (int maxDepth, int rrDepth, bool emissionEvents)
 Protected constructor. More...
 
 ParticleTracer (Stream *stream, InstanceManager *manager)
 Protected constructor. More...
 
virtual ~ParticleTracer ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::WorkProcessor
virtual ~WorkProcessor ()
 Virtual destructor. More...
 
 WorkProcessor ()
 Protected constructors. More...
 
 WorkProcessor (Stream *stream, InstanceManager *manager)
 
SerializableObjectgetResource (const std::string &name)
 Look up a named resource, which has been bound to the associated parallel process. More...
 
- Protected Member Functions inherited from mitsuba::SerializableObject
 SerializableObject ()
 Construct a serializable object. More...
 
virtual ~SerializableObject ()
 Virtual deconstructor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

ref< Scenem_scene
 
ref< Samplerm_sampler
 
int m_maxDepth
 
int m_rrDepth
 
bool m_emissionEvents
 
- Protected Attributes inherited from mitsuba::WorkProcessor
std::map< std::string,
SerializableObject * > 
m_resources
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 

Detailed Description

Abstract particle tracer implementation.

Traces particles and performs a customizable action every time a surface or volume interaction occurs.

Constructor & Destructor Documentation

mitsuba::ParticleTracer::ParticleTracer ( int  maxDepth,
int  rrDepth,
bool  emissionEvents 
)
protected

Protected constructor.

mitsuba::ParticleTracer::ParticleTracer ( Stream stream,
InstanceManager manager 
)
protected

Protected constructor.

virtual mitsuba::ParticleTracer::~ParticleTracer ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

virtual ref<WorkUnit> mitsuba::ParticleTracer::createWorkUnit ( ) const
virtual

Create a work unit of the proper type and size.

Implements mitsuba::WorkProcessor.

virtual const Class* mitsuba::ParticleTracer::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::WorkProcessor.

virtual void mitsuba::ParticleTracer::handleEmission ( const PositionSamplingRecord pRec,
const Medium medium,
const Spectrum weight 
)
virtual

Handle a particle emission event.

To be overridden in a subclass. The default implementation does nothing

Parameters
pRecPosition sampling record associated with the emission event
mediumPointer to the current medium
weightInitial weight/power of the particle
virtual void mitsuba::ParticleTracer::handleMediumInteraction ( int  depth,
int  nullInteractions,
bool  delta,
const MediumSamplingRecord mRec,
const Medium medium,
const Vector wi,
const Spectrum weight 
)
virtual

Handle a medium interaction event.

To be overridden in a subclass. The default implementation does nothing

Parameters
depthDepth of the interaction in path space (with 1 corresponding to the first bounce)
nullInteractionsSpecifies how many of these interactions were of type BSDF::ENull (i.e. index-matched medium transitions)
deltaDenotes if the previous scattering event was a degenerate specular reflection or refraction.
mRecAssociated medium sampling record
mediumPointer to the current medium
weightWeight/power of the particle after having gone through all preceding interactions except for the current medium interaction.
virtual void mitsuba::ParticleTracer::handleNewParticle ( )
virtual

Handle a 'new particle generated' event.

To be overridden in a subclass. The default implementation does nothing.

Note that this event will only be delivered if emissionEvents=false. In that case, it is a substitute to let the subclass know that a new particle was created, but without providing detailed information about the emission.

virtual void mitsuba::ParticleTracer::handleSurfaceInteraction ( int  depth,
int  nullInteractions,
bool  delta,
const Intersection its,
const Medium medium,
const Spectrum weight 
)
virtual

Handle a surface interaction event.

To be overridden in a subclass. The default implementation does nothing

Parameters
depthDepth of the interaction in path space (with 1 corresponding to the first bounce)
nullInteractionsSpecifies how many of these interactions were of type BSDF::ENull (i.e. index-matched medium transitions)
deltaDenotes if the previous scattering event was a degenerate specular reflection or refraction.
itsAssociated intersection record
mediumPointer to the current medium before the surface interaction
weightWeight/power of the particle after having gone through all preceding interactions except for the current surface interaction.
virtual void mitsuba::ParticleTracer::prepare ( )
virtual

Called once before processing starts.

This is useful for allocating scratch space or resolving references to resource objects. Lengthy computations should be performed in process() instead of here, since this this method will be called while the central scheduler lock is held. A thrown exception will lead to the termination of the parallel process.

Implements mitsuba::WorkProcessor.

virtual void mitsuba::ParticleTracer::process ( const WorkUnit workUnit,
WorkResult workResult,
const bool stop 
)
virtual

Process a work unit and store the computed results.

The active parameter can be used to signal a premature stop of the execution flow. In this case, the work result is allowed to be undefined (it will simply be ignored). A thrown exception will lead to the termination of the parallel process.

Implements mitsuba::WorkProcessor.

void mitsuba::ParticleTracer::serialize ( Stream stream,
InstanceManager manager 
) const
virtual

Serialize this object to a stream.

Implements mitsuba::SerializableObject.

Member Data Documentation

bool mitsuba::ParticleTracer::m_emissionEvents
protected
int mitsuba::ParticleTracer::m_maxDepth
protected
int mitsuba::ParticleTracer::m_rrDepth
protected
ref<Sampler> mitsuba::ParticleTracer::m_sampler
protected
ref<Scene> mitsuba::ParticleTracer::m_scene
protected
Class* mitsuba::ParticleTracer::m_theClass
static

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