SensorSampler.h
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @class SensorSampler 00003 @author Travis Fischer (fisch0920@gmail.com) 00004 @author Matthew Jacobs (jacobs.mh@gmail.com) 00005 @date Fall 2008 00006 00007 @brief 00008 Sampler which selects a point on a sensor (camera) in the scene. 00009 Successive invocations of SensorSampler 00010 <!-------------------------------------------------------------------->**/ 00011 00012 #ifndef SENSOR_SAMPLER_H_ 00013 #define SENSOR_SAMPLER_H_ 00014 00015 #include <stats/Sampler.h> 00016 00017 class Camera; 00018 00019 class SensorSampler : public Sampler { 00020 00021 public: 00022 ///@name Constructors 00023 //@{----------------------------------------------------------------- 00024 00025 inline SensorSampler(Camera *camera) 00026 : Sampler(), m_camera(camera) 00027 { } 00028 00029 virtual ~SensorSampler() 00030 { } 00031 00032 00033 //@}----------------------------------------------------------------- 00034 ///@name Initialization 00035 //@{----------------------------------------------------------------- 00036 00037 /** 00038 * @brief 00039 * Should perform any initialization of this random variable which 00040 * may be necessary to speed or prepare sampling 00041 * 00042 * @note should be called before calling sample or getPdf 00043 */ 00044 virtual void init(); 00045 00046 00047 //@}----------------------------------------------------------------- 00048 ///@name Main usage interface 00049 //@{----------------------------------------------------------------- 00050 00051 /** 00052 * @returns a randomly chosen event x, sampled from this random 00053 * variable's sample space 00054 * @note consecutive calls to sample are expected to return 00055 * independent, identically distributed (IID) samples 00056 */ 00057 virtual Event sample(); 00058 00059 /** 00060 * @returns the probability density with which the given event would be 00061 * sampled according to the underlying probability density function 00062 * @note the given event is assumed to lie within this random variable's 00063 * sample space 00064 */ 00065 virtual real_t getPdf(const Event &event) PURE_FUNCTION; 00066 00067 00068 //@}----------------------------------------------------------------- 00069 00070 protected: 00071 Camera *m_camera; 00072 }; 00073 00074 #endif // SENSOR_SAMPLER_H_ 00075
Generated on 28 Feb 2009 for Milton by
1.5.6