00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GTRANSITION_H
00020 #define GTRANSITION_H
00021
00022 #include "GObject.h"
00023 #include "Transition.h"
00024
00025 class State;
00026 class TransitionInfo;
00027
00028
00034 class GTransition : public GObject, public Transition
00035 {
00036 public:
00037 GTransition();
00038
00039 GTransition(State* , State* , TransitionInfo*, double , double, double,
00040 double , QString, bool str=TRUE);
00041 GTransition(State* , State* , TransitionInfo*, double , double, double,
00042 double, double, double, double, double , QString, bool str=TRUE);
00043
00044 void setStartPos(double , double );
00045 void setEndPos(double x, double y);
00046 void setEndPosX(double x);
00047 void setEndPosY(double y);
00049 void getEndPos(double& x, double& y) { x = endx; y = endy; };
00051 void setCPoint1(double x, double y) { control1x = x; control1y = y; };
00053 void setCPoint1X(double x) { control1x = x; };
00055 void setCPoint1Y(double y) { control1y = y; };
00057 void getCPoint1(double& x, double& y) { x = control1x; y = control1y; };
00059 void setCPoint2(double x, double y) { control2x = x; control2y = y; };
00061 void setCPoint2X(double x) { control2x = x; };
00063 void setCPoint2Y(double y) { control2y = y; };
00065 void getCPoint2(double& x, double& y) { x = control2x; y = control2y; };
00067 bool isStraight() { return straight; };
00070 void setStraight(bool s=TRUE) { straight = s; };
00071
00072 void move(double , double );
00073 void moveStart(double , double, bool move_cont_rel=TRUE,
00074 bool move_cont=FALSE, bool move_cont_both=TRUE);
00075 void moveEnd(double , double , bool move_cont_rel=TRUE,
00076 bool move_cont=FALSE, bool move_cont_both=TRUE);
00077 void moveCPoint1(double , double );
00078 void moveCPoint2(double , double );
00079
00080 bool contains(double , double);
00081 void bezierCurve(double, double& , double&);
00082 int onControlPoint(double, double, double);
00083
00084 void straighten();
00085
00086 QString getToolTipInfo();
00087 QRect getToolTipRect(const QPoint& );
00088
00090 QString getDescription() {return description; };
00092 void setDescription(QString d) {description = d; };
00093
00094 private:
00096 double control1x;
00098 double control1y;
00100 double control2x;
00102 double control2y;
00104 double endx;
00106 double endy;
00108 bool straight;
00110 QString description;
00111 };
00112
00113
00114 #endif