gcu/molecule.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * libs/gcu/molecule.h 
00006  *
00007  * Copyright (C) 2001-2008 Jean Bréfort <jean.brefort@normalesup.org>
00008  *
00009  * This program is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public License as 
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00022  * USA
00023  */
00024 
00025 #ifndef GCU_MOLECULE_H
00026 #define GCU_MOLECULE_H
00027 
00028 #include "object.h"
00029 
00030 namespace gcu {
00031 
00032 class Atom;
00033 class Bond;
00034 class Chain;
00035 class Cycle;
00036 class Formula;
00037 
00038 class Molecule: public Object
00039 {
00040 public:
00041         Molecule (TypeId Type = MoleculeType);
00042         Molecule (Atom* pAtom);
00043         virtual ~Molecule ();
00044 
00045         void AddChild (Object* object);
00046         virtual void AddAtom (Atom* pAtom);
00047         virtual void AddBond (Bond* pBond);
00048         virtual void Remove (gcu::Object* pObject);
00049         void UpdateCycles (Bond* pBond);
00050         void UpdateCycles ();
00051         bool operator== (Molecule const& molecule) const;
00052         virtual unsigned GetAtomsNumber () const {return m_Atoms.size ();}
00053         static Molecule *MoleculeFromFormula (Document *Doc, Formula const &formula, bool add_pseudo = true);
00054 
00055 protected:
00056         std::list<Cycle*> m_Cycles;
00057         std::list<Chain*> m_Chains;
00058         std::list<Atom*> m_Atoms;
00059         std::list<Bond*> m_Bonds;
00060 };
00061 
00062 }       //      namespace gcu
00063 
00064 #endif  //      GCU_MOLECULE_H

Generated on Sun Jun 22 13:26:05 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6