|
Open PaperOpt
|
00001 #ifndef COMPONENT_H 00002 #define COMPONENT_H 00003 #include "StructureObject.h" 00004 #include "Basesheet.h" 00005 #include "WavePacket.h" 00006 #include "Distribution.h" 00007 #include "Fluorescence.h" 00008 #include <vector> 00009 #include "Transform.h" 00010 #include "utilities.h" 00011 #include <complex> 00012 using namespace std; 00019 class Component 00020 { 00021 public: 00022 Fluorescence* mpFluorescence; 00023 void SetFluorescent(Fluorescence* pFluor) { mpFluorescence = pFluor; } 00024 00025 protected: 00026 Component(); 00027 00045 Component(const StructureObject* const pStructureObject, vector<complex_LC>* pRefrIndex, 00046 vector<double>* pQScat, vector<double>* pQAbs, vector<double>* pQAbsFluo, 00047 Distributions::Distribution* pDistScat, double ContactReduction, V2<float>* pRoughness); 00048 00049 public: 00053 virtual ~Component(void); 00054 00060 virtual int Process(WavePacket& wp) const=0; 00061 virtual int Process(WavePacket& wp, int ComponentNumber, bool EntryScattering = false, complex_LC* pPrevRefrIndex = 0) const = 0; 00062 00063 protected: 00064 enum Occurrence 00065 { 00066 NOTHING, 00067 SCATTERING, 00068 ABSORPTION 00069 }; 00070 00071 const StructureObject *mpStructureObject; 00072 00073 vector<complex_LC> *mpRefrIndex; 00074 00075 V2<float>* mRoughness; 00076 00077 00078 vector<double>* mpQScat; 00079 vector<double>* mpQAbs; 00080 vector<double>* mpQAbsFluo; 00081 vector<double> mpQExt; //No point in having this as a pointer since it is not passed into constructor. 00082 Distributions::Distribution *mpDistScat; 00094 Occurrence CheckFreePath(const V3<double>& rPrevPos, V3<double>& rCurPos, int NbrLambda, double* pT) const; 00095 00108 int ScatterEnvelope(V3<double>& rDirection, V3<double>& rPolarization, double Lambda, complex_LC N1, complex_LC N2, const V3<double>& rNormal) const; 00109 00110 /* 00111 * Scatter direction. 00112 * 00113 * Estimates new direction after a scattering according to the distribution in m_dist_scat. 00114 * 00115 * @param rDir Current direction vector. 00116 * @param rPol Current polarization vector. 00117 * @param NbrLambda Wavelength number. 00118 * 00119 * @return void 00120 */ 00121 void ScatterDirection(V3<double>& rDir, V3<double>& rPol, int NbrLambda = 0) const; 00122 virtual int WhatWillHappenNext(double Depth, int ComponentNumber) const; 00123 00124 // Distributions::Distribution* mpDistScat; 00125 double mContactReduction; 00126 00131 long mIterationLimit; 00132 00139 bool mAbsFluoOrNot; 00140 00141 00142 }; // Component 00143 00144 #endif // COMPONENT_H