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

LOSR.hpp

00001 /*
00002  *  $Id: LOSR_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_LOSR_hpp
00024 #define LOSR_LOSR_hpp
00025 
00026 #include <cstdio>
00027 #include <stdexcept>
00028 #include <string>
00029 
00030 #include "losr/Surface.hpp"
00031 #include "losr/OpticalSystem.hpp"
00032 #include "losr/ApproxRaytracer.hpp"
00033 #include "losr/ExactRaytracer.hpp"
00034 #include "losr/Analyzer.hpp"
00035 
00036 
00044 #define LOSR_RuntimeErrorM(MESSAGE) \
00045   std::runtime_error(         \
00046     std::string("Runtime Error (File: ")  + \
00047     std::string(__FILE__)   + \
00048     std::string(", line: ") + \
00049     int2string(__LINE__)    + \
00050     std::string("):\n\t")   + \
00051     std::string(MESSAGE)    + \
00052     std::string("\n")         \
00053   )
00054 
00055 
00056 namespace LOSR {
00057 
00058 
00066 inline std::string int2string(
00067   int inInt         
00068 )
00069 {
00070   char lBuf[128];
00071   std::sprintf(lBuf, "%i", inInt);
00072   return std::string(lBuf);
00073 }
00074 
00075 
00083 inline std::string double2string(
00084   double inDbl        
00085 )
00086 {
00087   char lBuf[512];
00088   std::sprintf(lBuf, "%.8f", inDbl);
00089   return std::string(lBuf);
00090 }
00091 
00092 }
00093 
00094 #endif // LOSR_LOSR_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