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
00041 class Molecule: public gcu::Molecule
00042 {
00043 public:
00047 Molecule (gcu::TypeId Type = gcu::MoleculeType);
00054 Molecule (Atom* pAtom);
00058 virtual ~Molecule ();
00064 void AddChild (gcu::Object* object);
00070 void AddAtom (gcu::Atom* pAtom);
00076 void AddFragment (Fragment* pFragment);
00082 void AddBond (gcu::Bond* pBond);
00089 void Add (GtkWidget* w) const;
00095 void Remove (gcu::Object* pObject);
00106 bool Merge (Molecule* pMolecule, bool RemoveDuplicates = false);
00113 bool Load (xmlNodePtr node);
00120 xmlNodePtr Save (xmlDocPtr xml) const;
00124 void Clear ();
00133 void Transform2D (gcu::Matrix2D& m, double x, double y);
00142 Object* GetAtomAt (double x, double y, double z = 0.);
00147 double GetYAlign ();
00157 bool BuildContextualMenu (GtkUIManager *UIManager, gcu::Object *object, double x, double y);
00166 bool OnSignal (gcu::SignalId Signal, gcu::Object *Child);
00171 void ExportToGhemical ();
00179 void SelectAlignmentItem (gcu::Object *child);
00183 std::string GetAlignmentId () {return (m_Alignment)? m_Alignment->GetId (): "";}
00191 void BuildOBMol (OpenBabel::OBMol &Mol);
00198 void BuildOBMol2D (OpenBabel::OBMol &Mol);
00203 void ShowInChI ();
00207 void BuildInChI ();
00212 void BuildSMILES ();
00220 void ShowWebBase (char const *uri_start, char const *uri_end);
00225 void OpenCalc ();
00232 void CheckCrossings (Bond *pBond);
00237 char const *GetInChI ();
00242 std::string GetRawFormula () const;
00246 void OnLoaded ();
00251 unsigned GetAtomsNumber () const;
00252
00253 private:
00254 std::list<Fragment*> m_Fragments;
00255 gcu::Object *m_Alignment;
00256 std::string m_InChI;
00257 bool m_Changed;
00258 bool m_IsResidue;
00259 };
00260
00261 }
00262
00263 #endif // GCHEMPAINT_MOLECULE_H