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

GTransition Class Reference

The graphical Object of a transition (arrow). More...

#include <GTransition.h>

Inheritance diagram for GTransition::

GObject Transition List of all members.

Public Methods

 GTransition ()
 Standard constructor.

 GTransition (State *, State *, TransitionInfo *, double, double, double, double, QString, bool str=TRUE)
 Constructor. More...

 GTransition (State *, State *, TransitionInfo *, double, double, double, double, double, double, double, double, QString, bool str=TRUE)
 Contructor. More...

void setStartPos (double, double)
 Sets the start position of the transition. More...

void setEndPos (double x, double y)
 Sets the end point of the transition. More...

void setEndPosX (double x)
 Sets the x coordinate of the position of the end point.

void setEndPosY (double y)
 Sets the y coordinate of the position of the end point.

void getEndPos (double &x, double &y)
 Returns the end position (arrowhead) of the transition.

void setCPoint1 (double x, double y)
 Sets the position of the first control point.

void setCPoint1X (double x)
 Sets the x coordinate of the position of the first control point.

void setCPoint1Y (double y)
 Sets the y coordinate of the position of the first control point.

void getCPoint1 (double &x, double &y)
 Returns the position of the first control point.

void setCPoint2 (double x, double y)
 Sets the position of the second control point.

void setCPoint2X (double x)
 Sets the x coordinate of the position of the second control point.

void setCPoint2Y (double y)
 Sets the y coordinate of the position of the second control point.

void getCPoint2 (double &x, double &y)
 Returns the position of the first control point.

bool isStraight ()
 Returns TRUE if the transition is straight otherwise FALSE.

void setStraight (bool s=TRUE)
 If s is TRUE declares the transition as straight otherwise declare it as not straight.

void move (double, double)
 Moves the transition with all its points by x rightwards and y downwards.

void moveStart (double, double, bool move_cont_rel=TRUE, bool move_cont=FALSE, bool move_cont_both=TRUE)
 Moves the start point of the transition. More...

void moveEnd (double, double, bool move_cont_rel=TRUE, bool move_cont=FALSE, bool move_cont_both=TRUE)
 Moves the end point of the transition. More...

void moveCPoint1 (double, double)
 Moves the first control point.

void moveCPoint2 (double, double)
 Moves the second control point.

bool contains (double, double)
 Returns TRUE if the point with the coordinates x and y lies on the transition.

void bezierCurve (double, double &, double &)
 Bezier curve function. More...

int onControlPoint (double, double, double)
 Returns the number of the control point which lies on x, y at the specified scale scale. More...

void straighten ()
 Straightens the transition. More...

QString getToolTipInfo ()
 Returns the tooltip string for this object.

QRect getToolTipRect (const QPoint &)
 Returns the tooltip rectangle (if the mouse leaves this rectangle the TT is closed).

QString getDescription ()
 Returns the description of the transition.

void setDescription (QString d)
 Sets the descriptionn of the transition.


Private Attributes

double control1x
 X coordinate of the first control point.

double control1y
 Y coordinate of the first control point.

double control2x
 X coordinate of the second control point.

double control2y
 Y coordinate of the second control point.

double endx
 X coordinate of the end point.

double endy
 Y coordinate of the end point.

bool straight
 If TRUE the transition will be drawn as straight line (not as bezier curve).

QString description
 Description.


Detailed Description

The graphical Object of a transition (arrow).


Constructor & Destructor Documentation

GTransition::GTransition State * s,
State * e,
TransitionInfo * i,
double startx,
double starty,
double ex,
double ey,
QString d,
bool str = TRUE
 

Constructor.

Initialises a new transition object setting the control points between start and end point.

Parameters:
s   starting state
e   end state
i   info about the transition (condition)
startx   x coordinate of starting point
starty   y coordinate of starting point
ex   x coordinate of end point
ey   y coordinate of end point
str   if TRUE declares the transition as straight otherwise declares it as not straight

GTransition::GTransition State * s,
State * e,
TransitionInfo * i,
double startx,
double starty,
double c1x,
double c1y,
double c2x,
double c2y,
double ex,
double ey,
QString d,
bool str = TRUE
 

Contructor.

Initialises a new transition object.

Parameters:
s   starting state
e   end state
i   info about the transition (condition)
startx   x coordinate of starting point
starty   y coordinate of starting point
c1x   x coordinate of first control point
c1y   y coordinate of first control point
c2x   x coordinate of second control point
c2y   y coordinate of second control point
ex   x coordinate of end point
ey   y coordinate of end point
str   if TRUE declares the transition as straight otherwise declares it as not straight


Member Function Documentation

void GTransition::bezierCurve double t,
double & x,
double & y
 

Bezier curve function.

Parameters:
t   parameter (ranges from 0 to 1)
x   resulting x coordinate
y   resulting y coordinate

void GTransition::moveEnd double x,
double y,
bool move_cont_rel = TRUE,
bool move_cont = FALSE,
bool move_cont_both = TRUE
 

Moves the end point of the transition.

Parameters:
x   x value to move by
y   y value to move by
move_cont_rel   if TRUE and transition is straight the control points are moved relative to the start and end point otherwise the control points aren't moved relatively
move_cont   if TRUE moves the control points by x, y otherwise the control points aren't moved at all
move_cont_both   if TRUE both control points are moved otherwise only the second one is moved

void GTransition::moveStart double x,
double y,
bool move_cont_rel = TRUE,
bool move_cont = FALSE,
bool move_cont_both = TRUE
 

Moves the start point of the transition.

Parameters:
x   x value to move by
y   y value to move by
move_cont_rel   if TRUE and transition is straight the control points are moved relative to the start and end point otherwise the control points aren't moved relatively
move_cont   if TRUE moves the control points by x, y otherwise the control points aren't moved at all
move_cont_both   if TRUE both control points are moved otherwise only the first one is moved

int GTransition::onControlPoint double x,
double y,
double scale
 

Returns the number of the control point which lies on x, y at the specified scale scale.

1: start point 2: first control point 3: second control point 4: end point

void GTransition::setEndPos double x,
double y
 

Sets the end point of the transition.

If the transition is straight the control points are set accordingly.

void GTransition::setStartPos double x,
double y
 

Sets the start position of the transition.

If the transition is straight the control points are set accordingly.

void GTransition::straighten
 

Straightens the transition.

If start and end state are the same a loop is generated.


The documentation for this class was generated from the following files:
Generated at Fri Apr 11 22:37:16 2003 for Qfsm by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001