mechanism-arrow.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_MECHANISM_ARROW_H
00026 #define GCHEMPAINT_MECHANISM_ARROW_H
00027
00030 #include <gccv/item-client.h>
00031 #include <gcu/object.h>
00032
00033 namespace gcp {
00034
00038 extern gcu::TypeId MechanismArrowType;
00039
00045 class MechanismArrow: public gcu::Object, public gccv::ItemClient
00046 {
00047 public:
00051 MechanismArrow ();
00055 virtual ~MechanismArrow ();
00056
00063 void SetSource (gcu::Object *source);
00072 void SetSourceAux (gcu::Object *aux);
00078 void SetTarget (gcu::Object *target);
00088 void SetControlPoint (int num, double dx, double dy);
00095 void SetShowControls (bool show);
00102 void SetPair (bool is_pair);
00109 void SetEndAtNewBondCenter (bool end_at_new_bond_center);
00110
00111
00118 xmlNodePtr Save (xmlDocPtr xml) const;
00125 bool Load (xmlNodePtr node);
00133 void Transform2D (gcu::Matrix2D& m, double x, double y);
00134
00135
00139 void AddItem ();
00147 void SetSelected (int state);
00148
00152 void OnUnlink (Object *object);
00153
00157 void OnLoaded ();
00158
00162 std::string Name ();
00163
00164 private:
00165 double m_CPx1, m_CPy1, m_CPx2, m_CPy2;
00166
00171 GCU_RO_PROP (gcu::Object *, Source)
00175 GCU_RO_PROP (gcu::Object *, SourceAux)
00179 GCU_RO_PROP (gcu::Object *, Target)
00183 GCU_RO_PROP (bool, ShowControls)
00187 GCU_RO_PROP (bool, Pair)
00192 GCU_RO_PROP (bool, EndAtNewBondCenter)
00193 };
00194
00195 }
00196
00197 #endif // GCHEMPAINT_MECHANISM_ARROW_H