Main Page Class Hierarchy Compound List File List Compound Members Related Pages

# atominfo.h

    00001 //
    00002 // atominfo.h
    00003 //
    00004 // Copyright (C) 1996 Limit Point Systems, Inc.
    00005 //
    00006 // Author: Curtis Janssen <cljanss@limitpt.com>
    00007 // Maintainer: LPS
    00008 //
    00009 // This file is part of the SC Toolkit.
    00010 //
    00011 // The SC Toolkit is free software; you can redistribute it and/or modify
    00012 // it under the terms of the GNU Library General Public License as published by
    00013 // the Free Software Foundation; either version 2, or (at your option)
    00014 // any later version.
    00015 //
    00016 // The SC Toolkit is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00019 // GNU Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public License
    00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
    00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00024 //
    00025 // The U.S. Government is granted a limited license as per AL 91-7.
    00026 //
    00027
    00028 #ifndef _chemistry_molecule_atominfo_h
    00029 #define _chemistry_molecule_atominfo_h
    00030
    00031 #include <util/class/class.h>
    00032 #include <util/keyval/keyval.h>
    00033
    00034 namespace sc {
    00035
    00036 class Units;
    00037
    00041 class AtomInfo: public SavableState {
    00042   private:
    00043     enum { MaxZ = 107+1 };
    00044
    00045     struct atomname
    00046     {
    00047       char *name;
    00048       char *symbol;
    00049     };
    00050
    00051     static struct atomname names_[MaxZ];
    00052     double  mass_[MaxZ];
    00053     double  atomic_radius_[MaxZ];
    00054     double  vdw_radius_[MaxZ];
    00055     double  bragg_radius_[MaxZ];
    00056     double  maxprob_radius_[MaxZ];
    00057     double  rgb_[MaxZ][3];
    00058     double  ip_[MaxZ];
    00059     double  atomic_radius_scale_;
    00060     double  vdw_radius_scale_;
    00061     double  bragg_radius_scale_;
    00062     double  maxprob_radius_scale_;
    00063
    00064     char *overridden_values_;
    00065
    00066     void load_library_values();
    00067     void override_library_values(const Ref<KeyVal> &keyval);
    00068     void load_values(const Ref<KeyVal>& keyval, int override);
    00069     void load_values(double *array, double *scale, const char *keyword,
    00070                      const Ref<KeyVal> &keyval, int override,
    00071                      const Ref<Units> &);
    00072     void load_values(double array[][3], const char *keyword,
    00073                      const Ref<KeyVal> &keyval, int override);
    00074     void add_overridden_value(const char *assignment);
    00075   public:
    00076     AtomInfo();
    00077     AtomInfo(const Ref<KeyVal>&);
    00078     AtomInfo(StateIn&);
    00079     ~AtomInfo();
    00080     void save_data_state(StateOut& s);
    00081
    00083     double vdw_radius(int Z) const { return vdw_radius_[Z]*vdw_radius_scale_; }
    00084     double bragg_radius(int Z) const { return bragg_radius_[Z]*bragg_radius_scale_; }
    00085     double atomic_radius(int Z) const { return atomic_radius_[Z]*atomic_radius_scale_; }
    00086     double maxprob_radius(int Z) const { return maxprob_radius_[Z]*maxprob_radius_scale_; }
    00087
    00089     double ip(int Z) const { return ip_[Z]; }
    00090
    00092     double vdw_radius_scale() const { return vdw_radius_scale_; }
    00094     double bragg_radius_scale() const { return bragg_radius_scale_; }
    00096     double atomic_radius_scale() const { return atomic_radius_scale_; }
    00098     double maxprob_radius_scale() const { return maxprob_radius_scale_; }
    00099
    00102     double rgb(int Z, int color) const { return rgb_[Z][color]; }
    00103     double red(int Z) const { return rgb_[Z][0]; }
    00104     double green(int Z) const { return rgb_[Z][1]; }
    00105     double blue(int Z) const { return rgb_[Z][2]; }
    00106
    00108     double mass(int Z) const { return mass_[Z]; }
    00109
    00111     static const char *name(int Z) { return names_[Z].name; }
    00113     static const char *symbol(int Z) { return names_[Z].symbol; }
    00114
    00116     static int string_to_Z(const char *, int allow_exceptions = 1);
    00117 };
    00118
    00119 }
    00120
    00121 #endif
    00122
    00123 // Local Variables:
    00124 // mode: c++
    00125 // c-file-style: "CLJ"
    00126 // End: