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

Selection Class Reference

Class responsible for all informations and operations concerning the selection. More...

#include <Selection.h>

Inheritance diagram for Selection::

List of all members.

Signals

void updateAll ()
 Emited when the main window needs to be updated.


Public Methods

 Selection (QWidget *, const char *name=0)
 Constructor.

 ~Selection ()
 Destructor.

QList< GState > & getSList ()
 Returns a list containing all selected states.

QList< GTransition > & getTList ()
 Returns a list containing all selected transitions.

bool isITransSelected ()
 Returns TRUE if initial transition is selected otherwise FALSE.

void selectITrans (bool s=TRUE)
 If @s is TRUE selects initial transition otherwise deselects it.

bool isStateSelected (State *)
 Returns TRUE if state sels is selected, otherwise FALSE.

bool isTransitionSelected (Transition *)
 Returns TRUE if transition selt is selected, otherwise FALSE.

GObjectselect (ScrollView *, Machine *, QPoint, double, int &)
 Selects the object at point p. More...

void select (GState *, bool sel=TRUE)
 Selects/deselects the state s.

void select (GTransition *, bool sel=TRUE)
 Selects/deselects the transition t.

void select (GITransition *, bool sel=TRUE)
 Selects/deselects the initial transition t.

bool selectRect (Machine *, DRect &, bool add)
 Select all objects lying in the specified rectangle. More...

bool selectAdd (ScrollView *, Machine *, QPoint, double)
 Adds an object to the selection. More...

int selectControl (Machine *, QPoint, double, GTransition *&)
 Checks if a control point of a transition lies at point p. More...

bool selectAll (Machine *, DRect &bound)
 Selects all objects in the machine m and returns the bounding rectangle r.

bool deselect (GState *)
 Deselects the state s. More...

bool deselect (GTransition *)
 Deselects the transition t. More...

bool deselect (GITransition *)
 Deselects initial transition t. More...

void deselectAll (Machine *)
 Deselects all selected objects in the machine m.

bool onSelection (QPoint, double)
 Checks if point p lies on a selected object. More...

void move (double, double, ScrollView *, Machine *)
 Moves selection. More...

void getBoundingRect (double &, double &, double &, double &, GState *)
 Returns the bounding rectangle of the selection. More...

void updateBoundingRect (DRect &, GState *)
 Updates the bounding rectangle rect.

int countStates ()
 Returns the number of selected states.

int countTransitions ()
 Returns the number of selected transitions.

int count ()
 Returns the number of all selected objects.

void clear ()
 Deselects all selections.

void setContextObject (GObject *obj, int type)
 Sets the context object.

GObjectgetContextObject (int &type)
 Returns the context object.


Private Methods

void setMinMax (double, double, double &, double &, double &, double &)
 Updates the the maximum rectangle coordinates l, t, r b if @x and @y lye outside of the rectangle.


Private Attributes

QList< GStatessel_list
 List of selected states.

QList< GTransitiontsel_list
 List of selected transitions.

bool itrans
 If TRUE, the initial transition is selected.

GObjectcontext_object
 Context object (object under cursor when clicking the right mouse button).

int co_type
 Type of context object (see ObjectType).


Detailed Description

Class responsible for all informations and operations concerning the selection.


Member Function Documentation

bool Selection::deselect GITransition * t
 

Deselects initial transition t.

Returns:
TRUE if initial transition was selected otherwise FALSE.

bool Selection::deselect GTransition * t
 

Deselects the transition t.

Returns:
TRUE if transition was selected otherwise FALSE.

bool Selection::deselect GState * s
 

Deselects the state s.

Returns:
TRUE if state was selected otherwise FALSE.

void Selection::getBoundingRect double & l,
double & t,
double & r,
double & b,
GState * phantom
 

Returns the bounding rectangle of the selection.

Parameters:
l   x coordinate of left border
t   y coordinate of top border
r   x coordinate of right border
b   y coordinate of bottom border
phantom   pointer to phantom state

void Selection::move double x,
double y,
ScrollView * sv,
Machine * m
 

Moves selection.

Parameters:
x   x value to move rightwards
y   y value to move downwards
sv   pointer to scrollview
m   machine containing seleted objects

bool Selection::onSelection QPoint p,
double scale
 

Checks if point p lies on a selected object.

Parameters:
p   point on which an object will be looked for
scale   current scale
Returns:
TRUE if p is on a seleted object otherwise FALSE

GObject * Selection::select ScrollView * sview,
Machine * m,
QPoint p,
double scale,
int & otype
 

Selects the object at point p.

Parameters:
sview   pointer to scroll view
m   machine containing the objects
p   point on which will be look for an object
scale   current scale
otype   object type of resulting object

bool Selection::selectAdd ScrollView * sview,
Machine * m,
QPoint p,
double scale
 

Adds an object to the selection.

Searches for an object lying at point p and adds it to the current selection.

Parameters:
sview   pointer to scroll view
m   machine containing the objects
p   point on which will be looked for an object
scale   current scale
Returns:
TRUE if any object lies at point otherwise FALSE.

int Selection::selectControl Machine * m,
QPoint p,
double scale,
GTransition *& ctrans
 

Checks if a control point of a transition lies at point p.

Parameters:
m   machine containing the transitions
p   point on which will be looked for the control point
scale   current scale
ctrans   transition which owns the resulting control point. If no control point is found ctrans is NULL.
Returns:
Type of control point:
  • 1: start point
  • 2: first control point
  • 3: second control point
  • 4: end point

bool Selection::selectRect Machine * m,
DRect & r,
bool add
 

Select all objects lying in the specified rectangle.

Parameters:
m   machine containing the objects
r   rectangle which will be looked in
Returns:
TRUE if any object lies in the rectangle otherwise FALSE.


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