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

crystaldoc.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemisty Utils
00005  * crystaldoc.h 
00006  *
00007  * Copyright (C) 2002-2004
00008  *
00009  * Developed by Jean Bréfort <jean.brefort@normalesup.org>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2.1 of the License, or (at your option) any later version.
00015  *
00016  * This library 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 GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this library; if not, write to the 
00023  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00024  * Boston, MA  02111-1307, USA.
00025  */
00026 
00027 #ifndef CRYSTAL_DOC_H
00028 #define CRYSTAL_DOC_H
00029 
00030 #include <libxml/tree.h>
00031 #include <glib.h>
00032 #include "chemistry.h"
00033 #include "crystalatom.h"
00034 #include "crystalbond.h"
00035 #include "crystalline.h"
00036 #include "crystalcleavage.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
00082 {
00083 public:
00087         CrystalDoc ();
00091         virtual ~CrystalDoc ();
00092 
00103         void ParseXMLTree (xmlNode* xml);
00108         void Update ();
00112         CrystalView* GetView ();
00116         bool IsDirty () {return m_bDirty;}
00120         virtual void SetDirty ();
00124         void Draw ();
00128         gdouble GetMaxDist () {return m_dDist;}
00135         virtual CrystalView* CreateNewView ();
00142         virtual CrystalAtom* CreateNewAtom ();
00149         virtual CrystalLine* CreateNewLine ();
00155         virtual CrystalCleavage* CreateNewCleavage ();
00160         xmlDocPtr BuildXMLTree ();
00166         virtual const char* GetProgramId ();
00167         
00168 protected:
00172         void Init ();
00176         void Reinit ();
00182         virtual bool LoadNewView (xmlNodePtr node);
00183 
00184 private:
00185         void Duplicate (CrystalAtom& Atom);
00186         void Duplicate (CrystalLine& Line);
00187 
00188 protected:
00192         gcLattices m_lattice;
00196         gdouble m_a;
00200         gdouble m_b;
00204         gdouble m_c;
00208         gdouble m_alpha;
00212         gdouble m_beta;
00216         gdouble m_gamma;
00220         gdouble m_xmin;
00224         gdouble m_ymin;
00228         gdouble m_zmin;
00232         gdouble m_xmax;
00236         gdouble m_ymax;
00240         gdouble m_zmax;
00244         gdouble m_dDist; //maximum distance between an object and the center
00248         gboolean m_bFixedSize;  //true if cleavages must not change positions in the view
00252         CrystalAtomList AtomDef;
00256         CrystalAtomList Atoms;
00260         CrystalLineList LineDef;
00264         CrystalLineList Lines;
00268         CrystalCleavageList Cleavages;
00272         list <CrystalView *> m_Views;
00277         bool m_bDirty;
00281         bool m_bEmpty;
00282 };
00283         
00284 } //namespace gcu
00285 
00286 #endif //CRYSTAL_DOC_H

Generated on Mon Jun 27 16:44:12 2005 for The Gnome Chemistry Utils by  doxygen 1.4.1