00001 00033 #ifndef H_PHYSICS 00034 #define H_PHYSICS 00035 00040 namespace Physics { 00041 00046 typedef double Seconds_t; 00047 00052 typedef double Kelvin_t; 00053 00058 typedef double Wnum_t; 00059 00062 typedef double Cm_t; 00063 00068 typedef double Radiance_t; 00069 00070 00077 inline Radiance_t planckRadiance( Kelvin_t T, Wnum_t wnum ) 00078 { 00079 return Radiance_t( 0. ); 00080 } 00081 00082 00084 struct Constants_t 00085 { 00089 double planck; 00090 }; 00091 00093 struct Wnums_t 00094 { 00095 Wnum_t baseWnum; 00096 Wnum_t deltaWnum; 00097 unsigned wnumCount; 00098 00100 inline unsigned trunc( unsigned offset ) const 00101 { return (offset>=wnumCount)? wnumCount-1 : offset; } 00102 00104 inline double operator[]( unsigned offset ) const 00105 { return deltaWnum*double(trunc(offset))+baseWnum ; } 00106 }; 00107 00108 00114 class PlanckRadianceGenerator 00115 { 00116 const Constants_t &C; 00117 const Wnums_t &W; 00118 const Kelvin_t T; 00119 00120 public: 00121 PlanckRadianceGenerator( const Constants_t &_c, const Wnums_t &_w, Kelvin_t _t ): 00122 C(_c), W(_w), T(_t) 00123 { } 00124 00125 inline Radiance_t operator[]( unsigned offset ) const 00126 { 00127 return planckRadiance( T, W[offset] ); 00128 } 00129 }; 00130 00131 }; // namespace Physics 00132 00133 00134 #endif