Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ExactRaytracer.hpp

00001 /*
00002  *  $Id: ExactRaytracer_8hpp-source.html,v 1.1.1.1 2002/06/12 22:58:44 cgagne Exp $
00003  *
00004  *  LOSR -- Library for Optical Systems Raytracing
00005  *  Copyright (C) 2001 by Christian Gagné and Julie Beaulieu
00006  *
00007  *  This library is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU Lesser General Public
00009  *  License as published by the Free Software Foundation; either
00010  *  version 2.1 of the License, or (at your option) any later version.
00011  *
00012  *  This library is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU Lesser General Public
00018  *  License along with this library; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated at Sat Dec 22 10:58:13 2001 for Library for Optical Systems Raytracing by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001