mechanism-arrow.h
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
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
00056 xmlNodePtr Save (xmlDocPtr xml) const;
00063 bool Load (xmlNodePtr node);
00071 void Transform2D (gcu::Matrix2D& m, double x, double y);
00072
00073
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 }
00111
00112 #endif // GCHEMPAINT_MECHANISM_ARROW_H