gcu/bond.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * bond.h 
00006  *
00007  * Copyright (C) 2002-2004 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_BOND_H
00026 #define GCU_BOND_H
00027 
00028 #include <list>
00029 #include "object.h"
00030 
00031 namespace gcu
00032 {
00033 
00034 class Atom;
00035 
00040 class Bond: public Object
00041 {
00042 public:
00046         Bond ();
00055         Bond (Atom* first, Atom* last, unsigned char order);
00059         virtual ~Bond ();
00060         
00066         virtual Atom* GetAtom (int which); //0 = first, 1 = last, others reserved (for multicentered bonds?)
00073         virtual Atom* GetAtom (Atom* pAtom, int which = 0);     //"which" is just a place holder for multicenter bonds; returns an atom different from pAtom
00074                                                                                                                         //i.e. the other end of the bond
00078         unsigned char GetOrder ();
00084         void SetOrder (unsigned char Order);
00089         virtual xmlNodePtr Save (xmlDocPtr xml);
00095         virtual bool Load (xmlNodePtr node);
00101         virtual void IncOrder (int n = 1);
00108         virtual bool LoadNode (xmlNodePtr node);
00116         virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node);
00124         virtual void Move (double x, double y, double z = 0.);
00132         virtual void Transform2D (Matrix2D& m, double x, double y);
00133 
00134 protected:
00138         unsigned char m_order;
00142         Atom *m_Begin;
00146         Atom *m_End;// only 2 centered bonds, other bonds should be covered by derived classes
00147 };
00148 
00149 } // namespace gcu
00150 
00151 #endif // GCU_BOND_H

Generated on Thu Dec 20 11:20:45 2007 for The Gnome Chemistry Utils by  doxygen 1.5.4