gcp/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 GCHEMPAINT_MOLECULE_H
00026 #define GCHEMPAINT_MOLECULE_H
00027
00028 #include "fragment.h"
00029 #include <list>
00030 #include <gcu/molecule.h>
00031 #include <openbabel/mol.h>
00032
00034 namespace gcp {
00035
00036 class Bond;
00037
00038 class Molecule: public gcu::Molecule
00039 {
00040 public:
00041 Molecule (gcu::TypeId Type = gcu::MoleculeType);
00042 Molecule (Atom* pAtom);
00043 virtual ~Molecule ();
00044 void AddChild (gcu::Object* object);
00045 void AddAtom (gcu::Atom* pAtom);
00046 void AddFragment (Fragment* pFragment);
00047 void AddBond (gcu::Bond* pBond);
00048 void Add (GtkWidget* w) const;
00049 void Remove (gcu::Object* pObject);
00050 bool Merge (Molecule* pMolecule, bool RemoveDuplicates = false);
00051 bool Load (xmlNodePtr);
00052 xmlNodePtr Save (xmlDocPtr xml) const;
00053 void Clear ();
00054 void SetSelected (GtkWidget* w, int state);
00055 void Transform2D (gcu::Matrix2D& m, double x, double y);
00056 Object* GetAtomAt (double x, double y, double z = 0.);
00057 double GetYAlign ();
00058 bool BuildContextualMenu (GtkUIManager *UIManager, gcu::Object *object, double x, double y);
00059 bool OnSignal (gcu::SignalId Signal, gcu::Object *Child);
00060 void ExportToGhemical ();
00061 void SelectAlignmentItem (gcu::Object *child);
00062 std::string GetAlignmentId () {return (m_Alignment)? m_Alignment->GetId (): "";}
00063 void BuildOBMol (OpenBabel::OBMol &Mol);
00064 void BuildOBMol2D (OpenBabel::OBMol &Mol);
00065 void ShowInChI ();
00066 void BuildInChI ();
00067 void BuildSMILES ();
00068 void ShowWebBase (char const *uri_start, char const *uri_end);
00069 void OpenCalc ();
00070 void CheckCrossings (Bond *pBond);
00071 char const *GetInChI ();
00072 std::string GetRawFormula () const;
00073 void OnLoaded ();
00074 unsigned GetAtomsNumber () const;
00075
00076 private:
00077 std::list<Fragment*> m_Fragments;
00078 gcu::Object *m_Alignment;
00079 std::string m_InChI;
00080 bool m_Changed;
00081 bool m_IsResidue;
00082 };
00083
00084 }
00085
00086 #endif // GCHEMPAINT_MOLECULE_H