rl_Multilayer.h

00001 #ifndef rl_Multilayer_h_INCLUDED
00002 #define rl_Multilayer_h_INCLUDED
00003 
00004 // File:   rl_Multilayer.h
00005 // Author: Terry Gaetz
00006 
00007 /* --8<--8<--8<--8<--
00008  *
00009  * Copyright (C) 2006, 2007 Smithsonian Astrophysical Observatory
00010  *
00011  * This file is part of rl_raylib
00012  *
00013  * rl_raylib is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU General Public License
00015  * as published by the Free Software Foundation; either version 2
00016  * of the License, or (at your option) any later version.
00017  *
00018  * rl_raylib is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the 
00025  *       Free Software Foundation, Inc. 
00026  *       51 Franklin Street, Fifth Floor
00027  *       Boston, MA  02110-1301, USA
00028  *
00029  * -->8-->8-->8-->8-- */
00030 
00031 /****************************************************************************
00032  * encapsulate the multilayer surface properties:
00033  *    . multilayer properties
00034  *    . complex reflection coefficient
00035  *
00036  * History
00037  *--------
00038  * 1.0.1 2004-Dec-07  tjg  simplify/remove include guards
00039  * 0.0.0 1998-Jun-24  tjg  original version
00040  */
00041 
00042 #include <cstdlib>                          // size_t
00043 #include <rl_raylib/rl_Traits.h>            // rl_Traits::EInterpMode complex
00044 #include <rl_raylib/rl_DielectricLayer.h>   // rl_Traits::EInterpMode complex
00045 
00046 class rl_ReflectionCoefPOD;                 // forward declaration
00047 
00048 //########################################################################
00049 // rl_Multilayer
00050 //########################################################################
00051 
00060 class rl_Multilayer
00061 {
00062 private:
00063 
00065   rl_Multilayer();
00067   rl_Multilayer( rl_Multilayer const& );
00069   rl_Multilayer& operator=( rl_Multilayer const& );
00070 
00071 protected:
00072 
00074   int                   num_layers_;
00076   rl_DielectricLayer    vacuum_;
00078   rl_DielectricLayer*   layer_;
00080   rl_Traits::Bool       own_data_;
00081 
00082 public:
00083 
00085   typedef rl_Traits::EInterpMode EInterpMode;
00086 
00092   virtual ~rl_Multilayer();
00093 
00104   rl_Multilayer( int                 num_layers, 
00105                  rl_DielectricLayer* layers,
00106                  rl_Traits::Bool     adopt_data = rl_Traits::True );
00107 
00119   void 
00120   init( int                 num_layers, 
00121         rl_DielectricLayer* layers,
00122         rl_Traits::Bool     adopt_data = rl_Traits::True );
00123 
00133   int
00134   multilayer_reflect_coef( 
00135                            rl_ReflectionCoefPOD& rfl, 
00136                                             //out: reflection coefficient
00137                            double energy,   // in:  energy of ray
00138                            double sg        // in:  sine graze angle
00139                          );
00140 
00170   int 
00171   multilayer_reflectivity( double& rfl,    // out: multilayer reflectivity
00172                            double  energy, // in:  energy of ray
00173                            double  sg,     // in:  sine graze angle
00174                            double  polarization_factor = 0.0 // in:
00175                          );
00176 
00180   rl_DielectricLayer const& layer( int layer_no ) const;
00181 
00185   int num_layers() const;
00186 
00197   std::ostream& dump_on( std::ostream& os, int layer_no,
00198                                            char const pre[] = "",
00199                                            char const pst[] = "" ) const;
00200 
00209   void cdump_on( std::FILE* of, int layer_no,
00210                                 char const pre[] = "",
00211                                 char const pst[] = "" ) const;
00212 };
00213 
00214 //########################################################################
00215 //########################################################################
00216 //
00217 //    #    #    #  #          #    #    #  ######   ####
00218 //    #    ##   #  #          #    ##   #  #       #
00219 //    #    # #  #  #          #    # #  #  #####    ####
00220 //    #    #  # #  #          #    #  # #  #            #
00221 //    #    #   ##  #          #    #   ##  #       #    #
00222 //    #    #    #  ######     #    #    #  ######   ####
00223 //
00224 //########################################################################
00225 //########################################################################
00226 
00227 
00228 //=========================================================================
00229 // accessors
00230 inline int rl_Multilayer::
00231 num_layers() const
00232 {
00233   return num_layers_;
00234 }
00235 
00236 // rl_Multilayer_h_INCLUDED
00237 #endif

Generated on Mon Nov 3 18:15:05 2008 for rl_raylib by  doxygen 1.5.6