rl_DielectricData.h

00001 #ifndef rl_DielectricData_h_INCLUDED
00002 #define rl_DielectricData_h_INCLUDED
00003 
00004 // File:   rl_DielectricData.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  * Description: declare ReflectanceInfo, a descriptor for the reflectance
00033  *              information
00034  *
00035  * Note       : (1-alpha) is real part of complex dielectric constant
00036  *              (-gamma)  is imag part of complex dielectric constant
00037  *
00038  * History
00039  *--------
00040  * 1.0.1 2004-Dec-07  tjg  simplify/remove include guards
00041  * 1.0.0 1998-Jun-12  tjg  fold rflinfo_private.h back into rflinfo.h
00042  * 1.0.0 1998-Jun-12  tjg  fold rflinfo_private.h back into rflinfo.h
00043  * 0.0.0 1995-May-18  tjg  original version
00044  */
00045 
00046 #include <cstdlib>                    // size_t
00047 #include <cstring>                    // memcpy
00048 #include <cfloat>                     // DBL_MAX
00049 #include <rl_raylib/rl_Traits.h>      // rl_Traits::EInterpMode
00050 #include <rl_raylib/rl_Exception.h>   // rl_Exception
00051 
00052 // #define TEST_ALPHA_GAMMA
00053 
00054 //########################################################################
00055 // rl_DielectricData
00056 //########################################################################
00057 //
00064 class rl_DielectricData
00065 {
00066 public:
00067 
00073   struct rl_DielectricDataBinPOD
00074   {
00076     rl_Traits::rl_DielectricPOD lo_;
00078     rl_Traits::rl_DielectricPOD hi_;
00079   };
00080 
00081 private:
00082 
00084   size_t                    nelts_;
00086   rl_DielectricDataBinPOD*  decrement_;    // dielectric data
00088   double                    emin_;
00090   double                    emax_;
00092   double                    bulkdensity_;
00094   rl_Traits::EInterpMode    interp_mode_;
00095 
00097   rl_DielectricData& operator=( rl_DielectricData const& ); // PROHIBITED
00098 
00099 public:
00100 
00104  ~rl_DielectricData();
00105 
00110   rl_DielectricData();
00111 
00116   rl_DielectricData( rl_DielectricData const& other )
00117     throw ( rl_Exception );
00118 
00134   rl_DielectricData( rl_Traits::rl_DielectricPOD const* diel, 
00135                      size_t                             num_pts,
00136                      rl_Traits::EInterpMode             interp_mode,
00137                      double                             bulk_density = 1.0 )
00138     throw ( rl_Exception );
00139 
00155   void init( rl_Traits::rl_DielectricPOD const* diel, 
00156              size_t                             num_pts,
00157              rl_Traits::EInterpMode             interp_mode,
00158              double                             bulk_density = 1.0 )
00159     throw ( rl_Exception );
00160 
00172   int alpha_gamma( double energy, double& alpha, double& gamma );
00173 
00177   double energy_min() const;
00178 
00182   double energy_max() const;
00183 
00189   double bulk_density_factor() const;
00190 
00194   rl_Traits::Bool is_vacuum() const;
00195 };
00196 
00197 //########################################################################
00198 //########################################################################
00199 //
00200 //    #    #    #  #          #    #    #  ######   ####
00201 //    #    ##   #  #          #    ##   #  #       #
00202 //    #    # #  #  #          #    # #  #  #####    ####
00203 //    #    #  # #  #          #    #  # #  #            #
00204 //    #    #   ##  #          #    #   ##  #       #    #
00205 //    #    #    #  ######     #    #    #  ######   ####
00206 //
00207 //########################################################################
00208 //########################################################################
00209 
00210 //=========================================================================
00211 // ctors...
00212 
00213 //-------------------------------------------------------------------------
00214 inline rl_DielectricData::
00215 rl_DielectricData()
00216   : nelts_(0)
00217   , decrement_(0)
00218   , emin_(0.0)
00219   , emax_(DBL_MAX)
00220   , bulkdensity_(1.0)
00221   , interp_mode_(rl_Traits::ELinLin)
00222 {}
00223 
00224 //=========================================================================
00225 // accessors...
00226 
00227 //-------------------------------------------------------------------------
00228 inline double rl_DielectricData::
00229 energy_min() const
00230 { return emin_; }
00231 
00232 //-------------------------------------------------------------------------
00233 inline double rl_DielectricData::
00234 energy_max() const
00235 { return emax_; }
00236 
00237 //-------------------------------------------------------------------------
00238 inline double rl_DielectricData::
00239 bulk_density_factor() const
00240 { return bulkdensity_; }
00241 
00242 //-------------------------------------------------------------------------
00243 inline rl_Traits::Bool rl_DielectricData::
00244 is_vacuum() const
00245 { return rl_Traits::Bool(decrement_ == 0); }
00246 
00247 // rl_DielectricData_h_INCLUDED
00248 #endif

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