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

GTransition.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 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 //    GTransition(const GTransition&);
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

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