gcu/molecule.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 GCU_MOLECULE_H
00026 #define GCU_MOLECULE_H
00027
00028 #include "object.h"
00029
00031 namespace gcu {
00032
00033 class Atom;
00034 class Bond;
00035 class Chain;
00036 class Cycle;
00037 class Formula;
00038
00042 class Molecule: public Object
00043 {
00044 public:
00051 Molecule (TypeId Type = MoleculeType);
00058 Molecule (Atom* pAtom);
00062 virtual ~Molecule ();
00063
00069 void AddChild (Object* object);
00075 virtual void AddAtom (Atom* pAtom);
00081 virtual void AddBond (Bond* pBond);
00087 virtual void Remove (gcu::Object* pObject);
00093 void UpdateCycles (Bond* pBond);
00097 void UpdateCycles ();
00103 bool operator== (Molecule const& molecule) const;
00107 virtual unsigned GetAtomsNumber () const {return m_Atoms.size ();}
00118 static Molecule *MoleculeFromFormula (Document *Doc, Formula const &formula, bool add_pseudo = true);
00119
00123 void Clear ();
00129 Atom const *GetFirstAtom (std::list<Atom*>::const_iterator &i) const;
00135 Atom const *GetNextAtom (std::list<Atom*>::const_iterator &i) const;
00141 Bond const *GetFirstBond (std::list<Bond*>::const_iterator &i) const;
00147 Bond const *GetNextBond(std::list<Bond*>::const_iterator &i) const;
00148
00149 void SetName (char const *name, char const *convention);
00150 char const *GetName (char const *convention = NULL);
00151
00152 protected:
00156 std::list<Cycle*> m_Cycles;
00160 std::list<Chain*> m_Chains;
00164 std::list<Atom*> m_Atoms;
00168 std::list<Bond*> m_Bonds;
00169
00170 private:
00171 std::map <std::string, std::string> m_Names;
00172 };
00173
00174 }
00175
00176 #endif // GCU_MOLECULE_H