Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

element.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * element.h 
00006  *
00007  * Copyright (C) 2002-2005
00008  *
00009  * Developed by Jean Bréfort <jean.brefort@normalesup.org>
00010  *
00011  * This program is free software; you can redistribute it and/or 
00012  * modify it under the terms of the GNU General Public License as 
00013  * published by the Free Software Foundation; either version 2 of the
00014  * License, or (at your option) any later version.
00015  *
00016  * This program 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 General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00024  * USA
00025  */
00026 
00027 #ifndef GCU_ELEMENT_H
00028 #define GCU_ELEMENT_H
00029 
00030 #include <glib.h>
00031 #include <map>
00032 #include <string>
00033 #include <vector>
00034 #include "chemistry.h"
00035 #include "isotope.h"
00036 
00037 using namespace std;
00038 
00042 namespace gcu
00043 {
00044 
00045 class EltTable;
00046 
00053 class Element
00054 {
00055 friend class EltTable;
00056 private:
00063         Element (int Z, const char* Symbol);
00064         virtual ~Element ();
00065 
00066 public:
00071         static const gchar* Symbol (gint Z);
00079         static bool BestSide (gint Z);
00084         static gint Z (const gchar* symbol);
00089         static Element* GetElement (gint Z);
00094         static Element* GetElement (const gchar* symbol);
00101         double  GetWeight (int Z, int &prec);
00118         static bool GetRadius (GcuAtomicRadius* radius);
00131         static bool GetElectronegativity (GcuElectronegativity* en);
00139         static unsigned GetMaxBonds (gint Z);
00143         static void LoadRadii ();
00147         static void LoadElectronicProps ();
00151         static void LoadIsotopes ();
00155         static void LoadAllData ();
00156 
00160         int GetZ () {return m_Z;}
00164         const char* GetSymbol () {return m_Symbol;}
00169         char GetDefaultValence () {return m_DefaultValence;}
00175         unsigned GetMaxBonds () {return m_MaxBonds;}
00181         bool GetBestSide () {return m_BestSide;}
00186         double* GetDefaultColor () {return m_DefaultColor;}
00190         const char* GetName () {return name.c_str();}
00195         const GcuAtomicRadius** GetRadii ();
00200         const GcuElectronegativity** GetElectronegativities ();
00204         unsigned GetValenceElectrons () {return m_nve;}
00209         unsigned GetTotalValenceElectrons () {return m_tve;}
00214         unsigned GetMaxValenceElectrons () {return m_maxve;}
00220         double GetWeight (int& prec) {prec = m_WeightPrec; return m_Weight;}
00227         IsotopicPattern *GetIsotopicPattern (unsigned natoms);
00228         string const& GetElectronicConfiguration () {return ElecConfig;}
00229         map<string, string> const& GetNames () {return names;}
00230         GcuDimensionalValue const *GetIonizationEnergy (unsigned rank = 1);
00231         GcuDimensionalValue const *GetElectronAffinity (unsigned rank = 1);
00232 
00233 private:
00234         unsigned char m_Z, m_nve, m_tve, m_maxve;
00235         char m_Symbol[4];
00236         double m_Weight;
00237         int m_WeightPrec;
00238         char m_DefaultValence;
00239         unsigned char m_MaxBonds;
00240         bool m_BestSide;
00241         double m_DefaultColor[3];
00242         string name;
00243         vector<GcuAtomicRadius*> m_radii;
00244         vector<GcuElectronegativity*> m_en;
00245         vector<Isotope*> m_isotopes;
00246         vector<IsotopicPattern*> m_patterns;
00247         vector<GcuDimensionalValue> m_ei;
00248         vector<GcuDimensionalValue> m_ae;
00249         map<string, string> names;
00250         string ElecConfig;
00251 };
00252 
00253 } // namespace gcu
00254 
00255 #endif // GCU_ELEMENT_H

Generated on Sun Jan 1 14:15:49 2006 for The Gnome Chemistry Utils by  doxygen 1.4.1