00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GSTATE_H
00020 #define GSTATE_H
00021
00022 #include <qpoint.h>
00023 #include <qpen.h>
00024 #include <qbrush.h>
00025 #include <qfont.h>
00026 #include <qlist.h>
00027
00028 #include "State.h"
00029 #include "GObject.h"
00030 #include "GTransition.h"
00031 #include "DRect.h"
00032
00033 class ScrollView;
00034 class Machine;
00035 class TransitionInfo;
00036 class Project;
00037 class IOInfo;
00038
00039
00046 class GState : public State, public GObject
00047 {
00048 public:
00049 GState(Machine* m, const QString, QString, int, double , double , int , QPen, bool end );
00050 GState(Machine* m);
00051 GState();
00052
00054 QPen& getPen() { return pen; };
00056 void setPen(const QPen& p) { pen = p; };
00058 QBrush& getBrush() { return brush; };
00060 void setBrush(const QBrush& b) { brush = b; };
00061
00062
00064
00066
00068
00070
00072
00074
00075
00076 void copyTransitions(GState*, bool =FALSE);
00077 void copyTransitionAttributes(GState*, QList<GTransition>*);
00078 void copyAttributes(GState*);
00079 void debugTransitions();
00080
00081 void addTransition(Project*, GState* , TransitionInfo*, double , double,
00082 double, double, double, double, double, double, QString, bool straight=TRUE,
00083 bool withundo=TRUE);
00084 void addTransition(Project*, GTransition* t, bool withundo=TRUE);
00085 void move(double , double, ScrollView* , Machine* m, bool redraw=TRUE,
00086 bool firstRedraw=FALSE);
00087 void removeTransition(GTransition* );
00088 void removeTransitionEnd(GTransition* );
00089 DRect getMaxRect();
00090 int countTransitions();
00091 int countRefTransitions();
00092 void setTransitionsToRadius(Machine*, int );
00093
00094 QString getToolTipInfo();
00095 QRect getToolTipRect(const QPoint& );
00096
00097 static void circleEdge(double , double, int, double, double,
00098 double& , double& , double addphi=0);
00099 static void calcLoop(double, double, int, double, double, double&,
00100 double&, double&, double&);
00101
00102 GState* next(IOInfo* in);
00103
00105 QList<GTransition> tlist;
00107 QList<GTransition> reflist;
00108
00109
00110 private:
00112 QPen pen;
00114 QBrush brush;
00116 int radius;
00117 };
00118
00119 #endif