#ifndef GLOBALS_H #define GLOBALS_H #include #include #include #include "PerformanceData.h" #include using namespace std; struct SpecPair{ float nu; float A; }; struct Material{ vector nu; vector> eta; string name; }; enum SpecType {AbsorbanceSpecType, IntensitySpecType}; enum OpticsType {TransmissionOpticsType, ReflectionOpticsType}; extern PerformanceData PD; extern vector> RefSpectrum; extern int currentSpec; extern vector SimSpectrum; //IO Functions vector LoadSpectrum(string filename); vector SetReferenceSpectrum(char* text); void SaveState(); void LoadState(); void SetDefaults(); void SaveSimulation(string fileName); void SaveK(string fileName); void SaveN(string fileName); void LoadMaterial(string fileNameK, string fileNameN, string materialName); void LoadMaterial(string fileNameK, string materialName); //Display Functions void FitDisplay(); //Update Functions void UpdateDisplay(); void SimulateSpectrum(); void cudaKramersKronig(float* cpuN, float* cpuK, int nVals, float nuStart, float nuEnd, float nOffset); void cudaComputeSpectrum(float* cpuI, float* cpuB, float* alpha, int Nl, int nLambda, float oThetaI, float oThetaO, float cThetaI, float cThetaO, int nSamples); //Window Parameters extern float nuMin; extern float nuMax; extern float aMin; extern float aMax; extern float dNu; extern bool dispRefSpec; extern bool dispSimSpec; extern bool dispSimK; extern bool dispMatK; extern bool dispSimN; extern bool dispMatN; extern SpecType dispSimType; extern bool dispNormalize; extern float dispNormFactor; extern float dispScaleK; extern float dispScaleN; //material parameters extern float radius; extern float baseIR; extern float cA; extern vector EtaK; extern vector EtaN; extern bool applyMaterial; //extern vector KMaterial; //extern vector NMaterial; extern vector MaterialList; extern int currentMaterial; void ChangeAbsorbance(); void SetMaterial(); //optical parameters extern float cNAi; extern float cNAo; extern float oNAi; extern float oNAo; extern OpticsType opticsMode; extern bool pointDetector; extern int objectiveSamples; //fitting parameters extern float minMSE; extern int maxFitIter; void EstimateMaterial(); extern float scaleI0; extern float refSlope; float ComputeDistortion(); void MinimizeDistortion(); #endif