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_DOC_H
00026 #define CRYSTAL_DOC_H
00027
00028 #include <libxml/tree.h>
00029 #include <glib.h>
00030 #include "chemistry.h"
00031 #include "crystalatom.h"
00032 #include "crystalbond.h"
00033 #include "crystalline.h"
00034 #include "crystalcleavage.h"
00035 #include "document.h"
00036 #include <gcu/gldocument.h>
00037
00038 namespace gcu
00039 {
00040
00041 class CrystalView;
00042
00062 enum gcLattices {cubic=0,
00063 body_centered_cubic,
00064 face_centered_cubic,
00065 hexagonal,
00066 tetragonal,
00067 body_centered_tetragonal,
00068 orthorhombic,
00069 base_centered_orthorhombic,
00070 body_centered_orthorhombic,
00071 face_centered_orthorhombic,
00072 rhombohedral,
00073 monoclinic,
00074 base_centered_monoclinic,
00075 triclinic
00076 };
00077
00081 class CrystalDoc: public GLDocument
00082 {
00083 public:
00087 CrystalDoc (Application *App);
00091 virtual ~CrystalDoc ();
00092
00103 void ParseXMLTree (xmlNode* xml);
00108 void Update ();
00112 CrystalView* GetView ();
00116 void Draw ();
00123 virtual CrystalView* CreateNewView ();
00130 virtual CrystalAtom* CreateNewAtom ();
00137 virtual CrystalLine* CreateNewLine ();
00143 virtual CrystalCleavage* CreateNewCleavage ();
00148 xmlDocPtr BuildXMLTree ();
00154 virtual const char* GetProgramId ();
00155
00156 protected:
00160 void Init ();
00164 void Reinit ();
00170 virtual bool LoadNewView (xmlNodePtr node);
00171
00172 private:
00173 void Duplicate (CrystalAtom& Atom);
00174 void Duplicate (CrystalLine& Line);
00175
00176 protected:
00180 gcLattices m_lattice;
00184 gdouble m_a;
00188 gdouble m_b;
00192 gdouble m_c;
00196 gdouble m_alpha;
00200 gdouble m_beta;
00204 gdouble m_gamma;
00208 gdouble m_xmin;
00212 gdouble m_ymin;
00216 gdouble m_zmin;
00220 gdouble m_xmax;
00224 gdouble m_ymax;
00228 gdouble m_zmax;
00232 gboolean m_bFixedSize;
00236 CrystalAtomList AtomDef;
00240 CrystalAtomList Atoms;
00244 CrystalLineList LineDef;
00248 CrystalLineList Lines;
00252 CrystalCleavageList Cleavages;
00256 list <CrystalView *> m_Views;
00257 };
00258
00259 }
00260
00261 #endif //CRYSTAL_DOC_H