00001 #ifndef FASTSHOWER_TRIANGLEPROCESSOR_H 00002 #define FASTSHOWER_TRIANGLEPROCESSOR_H 00003 00004 #ifndef FASTSHOWER_IDISTPROCESSOR_H 00005 #include "FastShowerUtils/IDistProcessor.h" 00006 #endif 00007 00008 #ifndef STD_ASSERT_H 00009 #define STD_ASSERT_H 00010 #include <assert.h> 00011 #endif 00012 00013 namespace FastShower{ 00021 class TriangleProcessor: public IDistProcessor{ 00022 public: 00023 // The following typdef's is an attempt to give 00024 // a somewhat more meaningful names to the triangle 00025 // base limits. 00026 // 00027 // EndPoint1: refers to the limit with zero height 00028 // EndPoint2: refers to the limit with max height (f.ex. h) 00029 // 00030 // The area, in this case, is: 00031 // A = 0.5 * h * ABS(EndPoint2 - EndPoint1) 00032 // 00033 // To be noted: 00034 // EndPoint2 < EndPoint1 => right triangle (points to the right) 00035 // EndPoint1 > EndPoint2 => left triangle (points to the left) 00036 00037 typedef double EndPoint1; 00038 typedef double EndPoint2; 00039 00041 TriangleProcessor(EndPoint1 endPoint1, EndPoint2 endPoint2): 00042 m_endPoint1(endPoint1),m_endPoint2(endPoint2){assert( fabs(m_endPoint1 - m_endPoint2)>0 );} 00043 ~TriangleProcessor(){} 00044 00046 virtual double process(double) const; 00047 private: 00048 EndPoint1 m_endPoint1; 00049 EndPoint2 m_endPoint2; 00050 }; 00051 } 00052 #endif