00001
00002
00003
00004
00005
00006
00007 #ifndef IMPATOM_ELEMENT_H
00008 #define IMPATOM_ELEMENT_H
00009
00010 #include "atom_config.h"
00011 #include <IMP/base_types.h>
00012
00013 #include <IMP/log.h>
00014 #include <IMP/exception.h>
00015
00016 #include <boost/algorithm/string.hpp>
00017
00018 #include <string>
00019 #include <map>
00020
00021 IMPATOM_BEGIN_NAMESPACE
00022
00023
00024 enum Element {UNKNOWN_ELEMENT=0,
00025 #ifndef IMP_DOXYGEN
00026 OH=-1, H2O=-2,
00027 #endif
00028 H= 1, He= 2, Li= 3, Be= 4, B= 5, C= 6, N= 7,
00029 O= 8, F= 9, Ne= 10, Na= 11, Mg= 12, Al= 13, Si= 14,
00030 P= 15, S= 16, Cl= 17, Ar= 18, K= 19, Ca= 20, Sc= 21,
00031 Ti= 22, V= 23, Cr= 24, Mn= 25, Fe= 26, Co= 27, Ni= 28,
00032 Cu= 29, Zn= 30, Ga= 31, Ge= 32, As= 33, Se= 34, Br= 35,
00033 Kr= 36, Rb= 37, Sr= 38, Y= 39, Zr= 40, Nb= 41, Mo= 42,
00034 Tc= 43, Ru= 44, Rh= 45, Pd= 46, Ag= 47, Cd= 48, In= 49,
00035 Sn= 50, Sb= 51, Te= 52, I= 53, Xe= 54, Cs= 55, Ba= 56,
00036 La= 57, Ce= 58, Pr= 59, Nd= 60, Pm= 61, Sm= 62, Eu= 63,
00037 Gd= 64, Tb= 65, Dy= 66, Ho= 67, Er= 68, Tm= 69, Yb= 70,
00038 Lu= 71, Hf= 72, Ta= 73, W= 74, Re= 75, Os= 76, Ir= 77,
00039 Pt= 78, Au= 79, Hg= 80, Tl= 81, Pb= 82, Bi= 83, Po= 84,
00040 At= 85, Rn= 86, Fr= 87, Ra= 88, Ac= 89, Th= 90, Pa= 91,
00041 U= 92, Np= 93, Pu= 94, Am= 95, Cm= 96, Bk= 97, Cf= 98,
00042 Es= 99, Fm= 100, Md= 101, No= 102, Lr= 103, Db= 104, Jl= 105,
00043 Rf= 106
00044 #ifndef IMP_DOXYGEN
00045 , NUMBER_OF_ELEMENTS = 107
00046 #endif
00047 };
00048
00049
00050 class IMPATOMEXPORT ElementTable {
00051 public:
00052 ElementTable();
00053
00054
00055 Element get_element(const std::string& s) const;
00056
00057
00058 std::string get_name(Element e) const;
00059
00060
00061 Float get_mass(Element e) const { return mass_[e]; }
00062
00063 private:
00064 struct ElementString {
00065 std::string name;
00066 Element e;
00067 };
00068
00069 static ElementString element_strings_[];
00070 static Float mass_[];
00071 static std::map<std::string, Element> string_2_element_;
00072 static std::map<Element, std::string> element_2_string_;
00073 };
00074
00075 IMPATOMEXPORT ElementTable &get_element_table();
00076
00077 IMPATOM_END_NAMESPACE
00078
00079 #endif