NullSensor.h

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @class  NullSensor
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Null sensor which doesn't emit any importance
00009    <!-------------------------------------------------------------------->**/
00010 
00011 #ifndef NULL_SENSOR_H_
00012 #define NULL_SENSOR_H_
00013 
00014 #include <materials/Sensor.h>
00015 
00016 class NullSensor : public Sensor {
00017    public:
00018       ///@name Constructors
00019       //@{-----------------------------------------------------------------
00020       
00021       inline   NullSensor(SurfacePoint &pt, Material *parent = NULL)
00022          : Sensor(pt, parent)
00023       { }
00024       
00025       virtual ~NullSensor() 
00026       { }
00027       
00028       
00029       //@}-----------------------------------------------------------------
00030       ///@name Initialization
00031       //@{-----------------------------------------------------------------
00032       
00033       /**
00034        * @brief
00035        *    Performs any initialization that may be necessary before beginning 
00036        * to use this sensor
00037        */
00038       virtual void init();
00039       
00040       
00041       //@}-----------------------------------------------------------------
00042       ///@name Main usage interface
00043       //@{-----------------------------------------------------------------
00044       
00045       /**
00046        * @returns true iff this sensor emits importance (is a valid sensor)
00047        * 
00048        * @note if 'isSensor' returns false, 'getWe' and 'getImportance' must 
00049        *    return SpectralSampleSet::black
00050        */
00051       virtual bool isSensor();
00052       
00053       /**
00054        * @returns the spectral importance emitted along the given vector
00055        */
00056       virtual SpectralSampleSet getWe(const Vector3 &wo);
00057       
00058       /**
00059        * @returns the spectral importance of this sensor, representing the 
00060        *    total radiant energy emitted from surfaces associated with this 
00061        *    sensor; TODO: what units?
00062        * 
00063        * @note total We emitted by integrating 'getWe' over the the sphere of 
00064        *    exitant directions should equal the importance of this sensor
00065        */
00066       virtual SpectralSampleSet getImportance();
00067       
00068       
00069       //@}-----------------------------------------------------------------
00070       ///@name Sampling interface
00071       //@{-----------------------------------------------------------------
00072       
00073       /**
00074        * @brief
00075        *    Samples an exitent vector according to the underlying distribution 
00076        * of emitted importance at the surface point
00077        * 
00078        * @returns the sampled vector
00079        */
00080       virtual Event sample();
00081       
00082       /**
00083        * @returns the probability density of having sampled the given out 
00084        *    out vector 'event' with respect to whatever underlying sampling 
00085        *    strategy is being used to sample this sensor
00086        */
00087       virtual real_t getPdf(const Event &event);
00088       
00089       /**
00090        * @brief
00091        *    Mimics the behavior of a BSDF by separating emittance, We(x,wo), 
00092        * into two parts: We(x,wo,0) and We(x,wo,1).
00093        *    We(x,wo,0) is independent of 'wo' and represents the total 
00094        * importance emitted at point x.
00095        *    We(x,wo,1) represents We(x,w) / We(x,wo,0), or in words, the 
00096        * directional distribution of importance emitted at x, corresponding to 
00097        * the fraction of importance emitted in direction 'wo' with respect to the
00098        * total importance emitted at point x.
00099        * 
00100        * @returns the directional distribution of importance emitted in 
00101        *    direction 'wo'
00102        * @note all implementations should disregard 'wo', as it has no physical
00103        *    interpretation in the context of a sensor
00104        * @note for details, see Eric Veach's thesis, section 8.3.2
00105        */
00106       virtual SpectralSampleSet getBSDF(const Vector3 &wi, const Vector3 &wo);
00107       
00108       
00109       //@}-----------------------------------------------------------------
00110 };
00111 
00112 #endif // NULL_SENSOR_H_
00113 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6