00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GCU_ELEMENT_H
00028 #define GCU_ELEMENT_H
00029
00030 #include <glib.h>
00031 #include <string>
00032 #include <vector>
00033 #include "chemistry.h"
00034
00035 using namespace std;
00036
00037
00041 namespace gcu
00042 {
00043
00044 class EltTable;
00045
00052 class Element
00053 {
00054 friend class EltTable;
00055 private:
00062 Element (int Z, const char* Symbol);
00063 virtual ~Element ();
00064
00065 public:
00070 static const gchar* Symbol (gint Z);
00078 static bool BestSide (gint Z);
00083 static gint Z (const gchar* symbol);
00088 static Element* GetElement (gint Z);
00093 static Element* GetElement (const gchar* symbol);
00110 static bool GetRadius (GcuAtomicRadius* radius);
00123 static bool GetElectronegativity (GcuElectronegativity* en);
00131 static unsigned GetMaxBonds (gint Z);
00132
00136 int GetZ () {return m_Z;}
00140 const char* GetSymbol () {return m_Symbol;}
00145 char GetDefaultValence () {return m_DefaultValence;}
00151 unsigned GetMaxBonds () {return m_MaxBonds;}
00157 bool GetBestSide () {return m_BestSide;}
00162 double* GetDefaultColor () {return m_DefaultColor;}
00166 const char* GetName () {return name.c_str();}
00171 const GcuAtomicRadius** GetRadii ();
00176 const GcuElectronegativity** GetElectronegativities ();
00180 unsigned GetValenceElectrons () {return m_nve;}
00185 unsigned GetTotalValenceElectrons () {return m_tve;}
00190 unsigned GetMaxValenceElectrons () {return m_maxve;}
00191
00192 private:
00193 unsigned char m_Z, m_nve, m_tve, m_maxve;
00194 char m_Symbol[4];
00195 char m_DefaultValence;
00196 unsigned char m_MaxBonds;
00197 bool m_BestSide;
00198 double m_DefaultColor[3];
00199 string name;
00200 vector<GcuAtomicRadius*> m_radii;
00201 vector<GcuElectronegativity*> m_en;
00202 };
00203
00204 }
00205
00206 #endif // GCU_ELEMENT_H