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

ApproxRaytracer.hpp

00001 /*
00002  *  $Id: ApproxRaytracer_8hpp-source.html,v 1.1.1.1 2002/06/12 22:58:43 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_ApproxRaytracer_hpp
00024 #define LOSR_ApproxRaytracer_hpp
00025 
00026 #include <vector>
00027 
00028 #include "losr/Surface.hpp"
00029 #include "losr/OpticalSystem.hpp"
00030 
00031 namespace LOSR {
00032 
00039 struct Y_NU {
00040   Y_NU();
00041   Y_NU(const LOSR::Surface& inSurface);
00042 
00043   Y_NU& operator=(const LOSR::Surface& inSurface);
00044 
00045   long double mT;  
00046   long double mN;  
00047   long double mC;  
00048   long double mR;  
00049   long double mY;  
00050   long double mU;  
00051   long double mNU; 
00052 };
00053 
00054 
00067 class ApproxRaytracer : public std::vector<Y_NU> {
00068 
00069 public: 
00070   ApproxRaytracer(unsigned int inSize=0);
00071   ApproxRaytracer(const LOSR::OpticalSystem& inOpticalSystem);
00072   ~ApproxRaytracer() { }  
00073 
00074   ApproxRaytracer& operator=(const LOSR::OpticalSystem& inOpticalSystem);
00075 
00076   void initialize(const LOSR::OpticalSystem& inOpticalSystem);
00077   void read(std::istream& ioIs=std::cin);
00078   bool trace(ApproxRaytracer::iterator inStartingPoint);
00079   bool trace(ApproxRaytracer::iterator inStartingPoint,long double inY,long double inU);
00080   bool traceBackward(ApproxRaytracer::iterator inActualEntry,ApproxRaytracer::iterator inStopEntry);
00081   bool traceForward(ApproxRaytracer::iterator inActualEntry,ApproxRaytracer::iterator inStopEntry);
00082   void write(std::ostream& ioOs=std::cout) const;
00083 
00084 };
00085 
00086 }
00087 
00088 
00089 std::istream& operator>>(std::istream& ioIs, LOSR::Y_NU& outY_NU);
00090 std::ostream& operator<<(std::ostream& ioOs, const LOSR::Y_NU& inY_NU);
00091 
00092 
00098 inline std::istream& operator>>(
00099   std::istream& ioIs,                       
00100   LOSR::ApproxRaytracer& outApproxRaytracer 
00101 )
00102 {
00103   outApproxRaytracer.read(ioIs);
00104   return ioIs;
00105 }
00106 
00107 
00113 inline std::ostream& operator<<(
00114   std::ostream& ioOs,                      
00115   const LOSR::ApproxRaytracer& inApproxRaytracer  
00116 )
00117 {
00118   inApproxRaytracer.write(ioOs);
00119   return ioOs;
00120 }
00121 
00122 
00123 #endif // LOSR_ApproxRaytracer_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