//****************************************************************************** //** SCATMECH: Polarized Light Scattering C++ Class Library //** //** File: brdf.h //** //** Thomas A. Germer //** Optical Technology Division, National Institute of Standards and Technology //** 100 Bureau Dr. Stop 8443; Gaithersburg, MD 20899-8443 //** Phone: (301) 975-2876; FAX: (301) 975-6991 //** Email: thomas.germer@nist.gov //** //** Version: 6.00 (February 2008) //** //****************************************************************************** #ifndef SCATMECH_BRDF_H #define SCATMECH_BRDF_H #include "scatmech.h" #include "mueller.h" #include "dielfunc.h" #include "inherit.h" #include "vector3d.h" namespace SCATMECH { // // BRDF_Model is the virtual base class for all surface scattering models... // class BRDF_Model : public Model { public: // The following enum is used for defining how the basis set for // polarization is defined... enum Coordinate_System { psps, // p (TM) and s (TE) xyxy, // x and y (rotated from p and s by phis, to remove singularity at surface normal) plane // parallel and perpendicular to the scattering plane }; // The following enum is used for defining whether the calculation // is done in reflection or transmission... enum Type { REFLECTION = 0, TRANSMISSION = 1 }; // The constructor for BRDF_Model... BRDF_Model() { model_cs = psps; // The default polarization coordinate system is psps. } // // Public interfaces to the scattering model... // // Jones matrix for scattering: JonesMatrix Jones(double thetai, double thetas, double phis, double rotation, Coordinate_System cs = psps); // Mueller matrix for scattering: MuellerMatrix Mueller(double thetai, double thetas, double phis, double rotation, Coordinate_System cs = psps); // Jones matrix for scattering where the directions to the source, the viewer, // the surface normal, and the x-axis on the sample are specified by Vectors... JonesMatrix Jones(const Vector& source, const Vector& viewer, const Vector& normal, const Vector& xaxis=Vector(0,0,0), Coordinate_System cs=plane); // Mueller matrix for scattering where the directions to the source, the viewer, // the surface normal, and the x-axis on the sample are specified by Vectors... MuellerMatrix Mueller(const Vector& source, const Vector& viewer, const Vector& normal, const Vector& xaxis=Vector(0,0,0), Coordinate_System cs=plane); // The following function set the scattering geometry... // The returned value = 1 if the geometry is valid, 0 if not... int set_geometry(double _thetai,double _thetas,double _phis, double _rotation); int set_geometry(const Vector& source,const Vector& viewer,const Vector& normal,const Vector& xaxis); // The following returns the coordinate system used by the model... Coordinate_System get_model_cs() const {return model_cs;} DECLARE_MODEL(); // The wavelength of the light... DECLARE_PARAMETER(double,lambda); // The dielectric function of the substrate... DECLARE_PARAMETER(dielectric_function,substrate); // Type of model (Reflection or Transmission)... DECLARE_PARAMETER(int,type); protected: // Routine which does housekeeping if (recalc!=0) ... virtual void setup(); // Coordinate system for which the model is defined // (default: BRDF_Model_psps) // Note: there is no set_model_cs() function since it is up to the // model to define this. Coordinate_System model_cs; void convert(JonesMatrix& J,Coordinate_System to) const; void convert(MuellerMatrix& M,Coordinate_System to) const; // // The following variables are set by set_geometry... // // The incident angle is thetai (in radians). // The scattering polar angle is thetas (in radians). // The scattering azimuthal angle is phis (in radians). // The rotation of the sample is rotation (in radians). double thetai; double thetas; double phis; double rotation; // // Protected interfaces to model... // // Jones matrix for scattering... virtual JonesMatrix jones() { // Conversion is improper... error("Attempt to call jones() for depolarizing model."); return JonesMatrix(); } // Mueller matrix for scattering... virtual MuellerMatrix mueller() { // Typecasting handles conversion... return this->jones(); } // // The following is defined so that BRDF models that have other BRDF models // as parameters can synchronize those parameters. // This function is to be called before SETUP(). // void synchronize(Model_Ptr& name); }; typedef Model_Ptr BRDF_Model_Ptr; void Register(const BRDF_Model* x); } // namespace SCATMECH #endif