Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

GState.h

00001 /*
00002 Copyright (C) 2000,2001 Stefan Duffner 
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 //    QString& getSCode() { return scode; };
00062 //    void setSCode(const QString s) { scode = s; };
00064     int getRadius() { return radius; };
00066     void setRadius(const int r) { radius = r; };
00068     int getLineWidth() { return pen.width(); };
00070     void setLineWidth(const int l) { pen.setWidth(l); };
00072     QColor getColor() { return pen.color(); };
00074     void setColor(QColor c) { pen.setColor(c); };
00075 
00076     void copyTransitions(GState*, bool =FALSE);
00077     void copyTransitionAttributes(GState*, QList<GTransition>*);
00078     void copyAttributes(GState*);
00079     void debugTransitions(/*int, int numout */);
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

Generated at Fri Apr 11 22:37:13 2003 for Qfsm by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001