gcu/bond.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_BOND_H
00026 #define GCU_BOND_H
00027
00028 #include <list>
00029 #include "object.h"
00030
00032 namespace gcu
00033 {
00034
00035 class Atom;
00036 class Cycle;
00037
00042 class Bond: public Object
00043 {
00044 public:
00048 Bond ();
00057 Bond (Atom* first, Atom* last, unsigned char order);
00061 virtual ~Bond ();
00062
00068 virtual Atom* GetAtom (int which) const;
00075 virtual Atom* GetAtom (Atom* pAtom, int which = 0) const;
00076
00080 unsigned char GetOrder () const;
00086 void SetOrder (unsigned char Order);
00091 virtual xmlNodePtr Save (xmlDocPtr xml) const;
00097 virtual bool Load (xmlNodePtr node);
00103 virtual void IncOrder (int n = 1);
00110 virtual bool LoadNode (xmlNodePtr node);
00118 virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node) const;
00126 virtual void Move (double x, double y, double z = 0.);
00134 virtual void Transform2D (Matrix2D& m, double x, double y);
00135
00143 bool SetProperty (unsigned property, char const *value);
00144
00151 std::string GetProperty (unsigned property) const;
00152
00156 virtual void AddCycle (Cycle* pCycle);
00157
00161 virtual void RemoveCycle (Cycle* pCycle);
00162
00166 virtual void RemoveAllCycles ();
00167
00171 unsigned IsCyclic () {return m_Cycles.size ();}
00172
00180 Cycle* GetFirstCycle (std::list<Cycle*>::iterator& i, Cycle * pCycle);
00181
00189 Cycle* GetNextCycle (std::list<Cycle*>::iterator& i, Cycle * pCycle);
00190
00196 bool IsInCycle (Cycle* pCycle);
00197
00201 double Get2DLength ();
00202
00208 double GetAngle2DRad (Atom* pAtom);
00209
00217 bool ReplaceAtom (Atom* oldAtom, Atom* newAtom);
00218
00222 void OnLoaded ();
00223
00227 std::string Name ();
00228
00229 protected:
00233 unsigned char m_order;
00237 Atom *m_Begin;
00241 Atom *m_End;
00242
00246 std::list<Cycle*> m_Cycles;
00247 };
00248
00249 }
00250
00251 #endif // GCU_BOND_H