mechanism-arrow.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * GChemPaint library
00005  * mechanism-arrow.h 
00006  *
00007  * Copyright (C) 2009-2010 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 GCHEMPAINT_MECHANISM_ARROW_H
00026 #define GCHEMPAINT_MECHANISM_ARROW_H
00027 
00028 #include <gccv/item-client.h>
00029 #include <gcu/object.h>
00030 
00031 namespace gcp {
00032 
00033 extern gcu::TypeId MechanismArrowType;
00034 
00035 class MechanismArrow: public gcu::Object, public gccv::ItemClient
00036 {
00037 public:
00038         MechanismArrow ();
00039         virtual ~MechanismArrow ();
00040 
00041         void SetSource (gcu::Object *source);
00042         void SetSourceAux (gcu::Object *aux);
00043         void SetTarget (gcu::Object *target);
00044         void SetControlPoint (int num, double dx, double dy);
00045         void SetShowControls (bool show);
00046         void SetPair (bool is_pair);
00047         void SetEndAtNewBondCenter (bool end_at_new_bond_center);
00048 
00049         // virtual gcu::Object methods
00056         xmlNodePtr Save (xmlDocPtr xml) const;
00063         bool Load (xmlNodePtr node);
00071         void Transform2D (gcu::Matrix2D& m, double x, double y);
00072 
00073         // virtual gccv::ItemClient methods
00077         void AddItem ();
00085         void SetSelected (int state);
00086 
00090         void OnUnlink (Object *object);
00091 
00095         void OnLoaded ();
00096 
00097         std::string Name ();
00098 
00099 private:
00100         double m_CPx1, m_CPy1, m_CPx2, m_CPy2;
00101 
00102 GCU_RO_PROP (gcu::Object *, Source)
00103 GCU_RO_PROP (gcu::Object *, SourceAux)
00104 GCU_RO_PROP (gcu::Object *, Target)
00105 GCU_RO_PROP (bool, ShowControls)
00106 GCU_RO_PROP (bool, Pair)
00107 GCU_RO_PROP (bool, EndAtNewBondCenter)
00108 };
00109 
00110 }       //      namespace gcp
00111 
00112 #endif  //      GCHEMPAINT_MECHANISM_ARROW_H
Generated on Tue Apr 13 14:55:01 2010 for The Gnome Chemistry Utils by  doxygen 1.6.3