00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LOSR_ExactRaytracer_hpp
00024 #define LOSR_ExactRaytracer_hpp
00025
00026 #include <vector>
00027 #include <iostream>
00028
00029 #include "losr/Surface.hpp"
00030 #include "losr/OpticalSystem.hpp"
00031
00032 namespace LOSR {
00033
00040 struct QU {
00041 QU();
00042 QU(const LOSR::Surface& inSurface);
00043
00044 QU& operator=(const LOSR::Surface& inSurface);
00045
00046 long double mT;
00047 long double mN;
00048 long double mC;
00049 long double mR;
00050 long double mY;
00051 long double mU;
00052 long double mQ;
00053 long double mSinU;
00054 long double mCosU;
00055 long double mSinI;
00056 long double mCosI;
00057 long double mSinI_U;
00058 long double mCosI_U;
00059 long double mSinIp;
00060 long double mCosIp;
00061 long double mSinUp;
00062 long double mCosUp;
00063 long double mQp;
00064 };
00065
00066
00080 class ExactRaytracer : public std::vector<QU> {
00081
00082 public:
00083 ExactRaytracer(unsigned int inSize=0);
00084 ExactRaytracer(const LOSR::OpticalSystem& inOpticalSystem);
00085 ~ExactRaytracer() { }
00086
00087 ExactRaytracer& operator=(const LOSR::OpticalSystem& inOpticalSystem);
00088
00089 void initialize(const LOSR::OpticalSystem& inOpticalSystem);
00090 void read(std::istream& ioIs=std::cin);
00091 bool trace(ExactRaytracer::iterator inStartingPoint);
00092 bool trace(ExactRaytracer::iterator inStartingPoint,long double inY,long double inU);
00093 bool traceBackward(ExactRaytracer::iterator inActualEntry,ExactRaytracer::iterator inStopEntry);
00094 bool traceForward(ExactRaytracer::iterator inActualEntry,ExactRaytracer::iterator inStopEntry);
00095 void write(std::ostream& ioOs=std::cout) const;
00096
00097 };
00098
00099 }
00100
00101
00102 std::istream& operator>>(std::istream& ioIs, LOSR::QU& outQU);
00103 std::ostream& operator<<(std::ostream& ioOs, const LOSR::QU& inQU);
00104
00111 inline std::istream& operator>>(
00112 std::istream& ioIs,
00113 LOSR::ExactRaytracer& outExactRaytracer
00114 )
00115 {
00116 outExactRaytracer.read(ioIs);
00117 return ioIs;
00118 }
00119
00120
00127 inline std::ostream& operator<<(
00128 std::ostream& ioOs,
00129 const LOSR::ExactRaytracer& inExactRaytracer
00130 )
00131 {
00132 inExactRaytracer.write(ioOs);
00133 return ioOs;
00134 }
00135
00136
00137 #endif // LOSR_ExactRaytracer_hpp