Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

bond.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * bond.h 
00006  *
00007  * Copyright (C) 2002-2004
00008  *
00009  * Developed by Jean Bréfort <jean.brefort@normalesup.org>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2.1 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this library; if not, write to the 
00023  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00024  * Boston, MA  02111-1307, USA.
00025  */
00026 
00027 #ifndef GCU_BOND_H
00028 #define GCU_BOND_H
00029 
00030 #include <list>
00031 #include "object.h"
00032 
00033 using namespace std;
00034 
00035 namespace gcu
00036 {
00037 
00038 class Atom;
00039 
00044 class Bond: public Object
00045 {
00046 public:
00050         Bond ();
00059         Bond (Atom* first, Atom* last, unsigned char order);
00063         virtual ~Bond ();
00064         
00070         virtual Atom* GetAtom (int which); //0 = first, 1 = last, others reserved (for multicentered bonds?)
00077         virtual Atom* GetAtom (Atom* pAtom, int which = 0);     //"which" is just a place holder for multicenter bonds; returns an atom different from pAtom
00078                                                                                                                         //i.e. the other end of the bond
00082         unsigned char GetOrder ();
00088         void SetOrder (unsigned char Order);
00093         virtual xmlNodePtr Save (xmlDocPtr xml);
00099         virtual bool Load (xmlNodePtr node);
00105         virtual void IncOrder (int n = 1);
00112         virtual bool LoadNode (xmlNodePtr node);
00120         virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node);
00128         virtual void Move (double x, double y, double z = 0.);
00136         virtual void Transform2D (Matrix2D& m, double x, double y);
00137 
00138 protected:
00142         unsigned char m_order;
00146         Atom *m_Begin;
00150         Atom *m_End;// only 2 centered bonds, other bonds should be covered by derived classes
00151 };
00152 
00153 } // namespace gcu
00154 
00155 #endif // GCU_BOND_H

Generated on Wed Mar 16 12:28:16 2005 for The Gnome Chemistry Utils by  doxygen 1.4.1