crystalatom.h
Go to the documentation of this file.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 #ifndef CRYSTAL_ATOM_H
00026 #define CRYSTAL_ATOM_H
00027
00028 #include "atom.h"
00029 #include "chemistry.h"
00030 #include "macros.h"
00031 #include <libxml/parser.h>
00032 #include <libxml/parserInternals.h>
00033 #include <libxml/xmlmemory.h>
00034 #include <list>
00035
00037 namespace gcu
00038 {
00039
00040 #define PREC 1e-3
00041
00045 class CrystalAtom : public Atom
00046 {
00047 public:
00048
00049
00050
00051 CrystalAtom ();
00052
00053
00054
00055 virtual ~CrystalAtom ();
00056
00057 public :
00058
00059
00060
00061
00062
00063
00064
00065
00066 CrystalAtom (int Z, double x, double y, double z);
00072 CrystalAtom (CrystalAtom& caAtom);
00073
00074
00075
00076
00077
00078 CrystalAtom& operator= (CrystalAtom& caAtom);
00079
00088 void SetColor (float red, float green, float blue, float alpha);
00092 void SetDefaultColor ();
00096 bool HasCustomColor () {return m_bCustomColor;}
00106 void GetColor (double *red, double *green, double *blue, double *alpha);
00112 void SetSize (double r);
00116 double GetSize ();
00121 bool operator== (CrystalAtom& caAtom);
00126 void Cleave () {m_nCleave++;}
00135 double ScalProd (int h, int k, int l);
00148 void NetToCartesian (double a, double b, double c, double alpha, double beta, double gamma);
00161 double Distance (double x, double y, double z, bool bFixed);
00165 double r () {return m_Radius.value.value;}
00169 const GcuAtomicRadius& GetRadius () {return m_Radius;}
00173 void SetRadius (const GcuAtomicRadius& r);
00177 bool IsCleaved () {return m_nCleave != 0;}
00184 virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node) const;
00190 virtual bool LoadNode (xmlNodePtr node);
00191
00192 protected:
00196 float m_fBlue;
00200 float m_fRed;
00204 float m_fGreen;
00208 float m_fAlpha;
00212 bool m_bCustomColor;
00216 GcuAtomicRadius m_Radius;
00222 int m_nCleave;
00223
00231 bool SetProperty (unsigned property, char const *value);
00232
00239 std::string GetProperty (unsigned property) const;
00240
00241 GCU_PROP (double, EffectiveRadiusRatio);
00242 };
00243
00247 typedef std::list<CrystalAtom*> CrystalAtomList;
00248 }
00249
00250 #endif // CRYSTAL_ATOM_H