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
00048
00055 xmlNodePtr Save (xmlDocPtr xml) const;
00062 bool Load (xmlNodePtr node);
00070 void Transform2D (gcu::Matrix2D& m, double x, double y);
00071
00072
00076 void AddItem ();
00084 void SetSelected (int state);
00085
00089 void OnUnlink (Object *object);
00090
00091 private:
00092 double m_CPx1, m_CPy1, m_CPx2, m_CPy2;
00093
00094 GCU_RO_PROP (gcu::Object *, Source)
00095 GCU_RO_PROP (gcu::Object *, SourceAux)
00096 GCU_RO_PROP (gcu::Object *, Target)
00097 GCU_RO_PROP (bool, ShowControls)
00098 GCU_RO_PROP (bool, Pair);
00099 };
00100
00101 }
00102
00103 #endif // GCHEMPAINT_MECHANISM_ARROW_H