Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

Transition Class Reference

#include <transition.h>

Inheritance diagram for Transition:
Collaboration diagram for Transition:

List of all members.

Public Types

typedef QList< LabelX * > TLabelXList

Public Member Functions

 Transition (Editor *parent, State *ss, State *es, bool dimmed)
virtual ~Transition ()
void addNextLabel (LabelX *pLabel)
virtual void adjust ()=0
 The only method where graphics changes are computed.
virtual void assign ()=0
 Assign to all referenced states (to theirs trList).
virtual QRectF boundingRect () const
virtual int getArcAngle () const
virtual int getArcAngleB () const
QColor getColor ()
virtual int getDirection () const
EditorgetEditor () const
virtual StategetEndState () const
QString getEndStateName () const
virtual QString getGraphMLParams () const
 GraphML export.
LabelXgetLabel () const
QColor getLabelColor ()
float getLabelPos () const
QString getLabelText () const
virtual float getNCurv () const
const TLabelXListgetNextLabels () const
virtual QString getNextLabelsVCCommand () const
StategetStartState () const
QString getStartStateName () const
virtual QString getTypeName () const =0
virtual QString getTypeNameSuffix () const
virtual QString getVCCommand () const =0
 VauCanSon-G transition command.
bool getVCParams (QTextStream &out, EdgePrevParams &prevParams) const
 VauCanSon-G params.
bool hasEndState () const
 Pay attention to Loop - doesn't have end state, but getEndState() returns startState due to automaton sence.
bool isDimmed ()
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
virtual void paintSelectionDecoration (QPainter *painter)
virtual QPainterPath path () const
 Return path mapped to scene.
void removeNextLabel (LabelX *pLabel)
virtual void setArcAngle (int)
 for VArc and VCurve
virtual void setArcAngleB (int)
 only for VCurve
void setChecked (bool checked=true)
void setDimEdgeLineCoef (float lineCoef)
void setDimmed (bool dim)
virtual void setDirection (int)
void setEdgeLabelScale (float labelScale)
void setEdgeLineWidth (float lineWidth)
void setEndState (State *state)
void setLabelPos (float pos)
 ??? Check return type correctness!!!
virtual void setLabelPosition (LabelX *pLabel, float pos, bool isLeft, int width, int height)
virtual void setLabelPosition ()
void setLabelText (const QString &label)
virtual void setNCurv (float)
void setSelected (bool selected=true)
void setStartState (State *state)
virtual QPainterPath shape () const
virtual void unassign ()=0

Protected Types

enum  EIntersectionFindMethod {
  eFIND_FIRST,
  eFIND_TWO,
  eFIND_ALL
}

Protected Member Functions

QPainterPath createShape (const QPainterPath &path, int bounds) const
void createStrokes (const QPainterPath &path)
QPolygonF getArrowPolygon (const QPainterPath &path)
const QPainterPath & getClickPath () const
const QPainterPath & getSelectionPath () const
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)=0

Static Protected Member Functions

static QPolygonF findIntersectedPoints (const QPolygonF &curve, const QPolygonF &polygon, const EIntersectionFindMethod method)

Protected Attributes

bool checked
 coloring when selected
const QColor checkedColor
bool dimmed
Editoreditor
QPointF endPoint
StateendState
LabelXlabel
bool leftOriented
QPolygonF m_arrowPoints
 default transition arrow, angle 0 degrees, pointing to point 0,0
QPainterPath m_clickPath
 holds area for mouse click
int m_labelFontSize
EMouseClick m_lastMouseClickType
float m_lineWidth
QPainterPath m_selectionPath
 holds area showed when item is selected
TLabelXList nextLabels
 next labels (command , ) - stored as pair item + isLeft
QPainterPath p
 path of transition
QPolygonF pa
 arrow polygon -> transformed and rotatted m_arrowPoints
QPointF startPoint
StatestartState
edge parameters

Qt::PenStyle edgeLineStyle
float edgeLineWidth
QString edgeLineColor
QString edgeLabelColor
float edgeLabelScale
bool edgeLineDblStatus
transition parameters preset

float edgeLineBorderCoef
QString edgeLineBorderColor
float edgeLineDblCoef
float edgeLineDblSep
transition parameters dimmed

Qt::PenStyle dimEdgeLineStyle
QString dimEdgeLineColor
float dimEdgeLineCoef
QString dimEdgeLabelColor

Friends

void Editor::exportToGraphML (const QString &fn)
class NextLabelsDialog
class Parser
class TransitionEditExtendedCommand
class TransitionEditWithDelCommand
class TransitionExtendedDialog
struct TransitionSerializer
class TransitionStyleChangeCommand

Support methods for ITransition



QString getSourceState () const
QString getDestinationState () const
void getCharactersOccurences (ITransition::TCharSet &characters) const
bool getCharacters (ITransition::TCharSet &characters, const ITransition::TCharSet &alphabet, const QString &alphabetSymbol, const QString &epsilonSymbol) const
 Returns character on which transition passes.
void showErrorReport (const QString &reportText=QString("")) const
void dismemberCharacters (const QStringList &occurences, ITransition::TCharSet &characters) const
 Dismembers characters (found specific smybols and fill occurences param).

Detailed Description

Definition at line 37 of file transition.h.


Member Typedef Documentation

typedef QList<LabelX *> Transition::TLabelXList

Definition at line 40 of file transition.h.


Member Enumeration Documentation

Enumerator:
eFIND_FIRST 
eFIND_TWO 
eFIND_ALL 

Definition at line 141 of file transition.h.


Constructor & Destructor Documentation

Transition::Transition ( Editor parent,
State ss,
State es,
bool  dimmed 
)
Transition::~Transition (  )  [virtual]

Definition at line 98 of file transition.cpp.

References DBGLOG, label, and nextLabels.


Member Function Documentation

void Transition::addNextLabel ( LabelX pLabel  ) 

Definition at line 193 of file transition.cpp.

References dimEdgeLabelColor, dimmed, edgeLabelColor, nextLabels, and LabelX::setColor().

Referenced by Editor::addToListAndScene(), TransitionSerializer::createTransition(), and Parser::Label_r().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Transition::adjust (  )  [pure virtual]
virtual void Transition::assign (  )  [pure virtual]
QRectF Transition::boundingRect (  )  const [virtual]

Definition at line 243 of file transition.cpp.

References LabelX::boundingRect(), getClickPath(), label, nextLabels, and pa.

Referenced by Editor::getExpandedGridRect(), TransitionLoop::paint(), and paint().

Here is the call graph for this function:

Here is the caller graph for this function:

QPainterPath Transition::createShape ( const QPainterPath &  path,
int  bounds 
) const [protected]

Definition at line 208 of file transition.cpp.

References LabelX::boundingRect(), label, nextLabels, pa, and LabelX::text().

Referenced by createStrokes().

Here is the call graph for this function:

Here is the caller graph for this function:

void Transition::createStrokes ( const QPainterPath &  path  )  [protected]
void Transition::dismemberCharacters ( const QStringList &  occurences,
ITransition::TCharSet characters 
) const [protected]

Dismembers characters (found specific smybols and fill occurences param).

Definition at line 904 of file transition.cpp.

Referenced by getCharactersOccurences().

Here is the caller graph for this function:

QPolygonF Transition::findIntersectedPoints ( const QPolygonF &  curve,
const QPolygonF &  polygon,
const EIntersectionFindMethod  method 
) [static, protected]

Definition at line 693 of file transition.cpp.

References DBGLOG, DBGPAR, eFIND_FIRST, eFIND_TWO, and RELLOG.

Referenced by TransitionVCurve::adjust(), TransitionVArc::adjust(), TransitionLoop::adjust(), TransitionLine::adjust(), and TransitionArc::adjust().

Here is the caller graph for this function:

virtual int Transition::getArcAngle (  )  const [inline, virtual]

Reimplemented in TransitionVArc, and TransitionVCurve.

Definition at line 93 of file transition.h.

Referenced by Editor::editTransition(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the caller graph for this function:

virtual int Transition::getArcAngleB (  )  const [inline, virtual]

Reimplemented in TransitionVCurve.

Definition at line 98 of file transition.h.

Referenced by Editor::editTransition(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the caller graph for this function:

QPolygonF Transition::getArrowPolygon ( const QPainterPath &  path  )  [protected]

Sincle transition path starts in circuit of state, only path is need This computes arrow points from anlge of last part of transition

Definition at line 677 of file transition.cpp.

References m_arrowPoints.

Referenced by TransitionVCurve::adjust(), TransitionVArc::adjust(), TransitionLoop::adjust(), TransitionLine::adjust(), and TransitionArc::adjust().

Here is the caller graph for this function:

bool Transition::getCharacters ( ITransition::TCharSet characters,
const ITransition::TCharSet alphabet,
const QString &  alphabetSymbol,
const QString &  epsilonSymbol 
) const

Returns character on which transition passes.

Definition at line 842 of file transition.cpp.

References LabelSyntaxChecker::checkSyntax(), LabelX::getCharacterList(), LabelSyntaxChecker::getCharacters(), LabelSyntaxChecker::getPattern(), LabelSyntaxChecker::getReport(), label, nextLabels, and showErrorReport().

Referenced by Editor::getAutomaton().

Here is the call graph for this function:

Here is the caller graph for this function:

void Transition::getCharactersOccurences ( ITransition::TCharSet characters  )  const

Returns all character occurences, supposed to be inspected to find alphabet and epsilon symbol. Used when automata setting detection is required.

See also:
Editor::getAutomata()

Definition at line 885 of file transition.cpp.

References dismemberCharacters(), LabelX::getCharacters(), label, and nextLabels.

Referenced by Editor::detectAutomataSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

const QPainterPath & Transition::getClickPath (  )  const [protected]

Definition at line 667 of file transition.cpp.

References m_clickPath.

Referenced by boundingRect(), and shape().

Here is the caller graph for this function:

QColor Transition::getColor (  )  [inline]

Definition at line 65 of file transition.h.

References dimEdgeLineColor, dimmed, and edgeLineColor.

QString Transition::getDestinationState (  )  const

Definition at line 827 of file transition.cpp.

References getEndStateName().

Referenced by showErrorReport(), and transitionCountBetween().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int Transition::getDirection (  )  const [inline, virtual]

Reimplemented in TransitionSELine, and TransitionLoop.

Definition at line 89 of file transition.h.

Referenced by Editor::editTransition(), and OneStateTransition::getTypeNameSuffix().

Here is the caller graph for this function:

Editor* Transition::getEditor (  )  const [inline]

Definition at line 119 of file transition.h.

References editor.

virtual State* Transition::getEndState (  )  const [inline, virtual]

Reimplemented in TransitionLoop.

Definition at line 107 of file transition.h.

References endState.

Referenced by Editor::editTransition(), Editor::exportToGraphML(), State::getAccessibleStates(), and getEndStateName().

Here is the caller graph for this function:

QString Transition::getEndStateName (  )  const

Definition at line 114 of file transition.cpp.

References getEndState(), and State::getName().

Referenced by Editor::getAutomaton(), getDestinationState(), and TransitionSerializer::TransitionSerializer().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QString Transition::getGraphMLParams (  )  const [inline, virtual]

GraphML export.

Reimplemented in TransitionVArc, and TransitionVCurve.

Definition at line 128 of file transition.h.

Referenced by Editor::exportToGraphML().

Here is the caller graph for this function:

LabelX * Transition::getLabel (  )  const

Definition at line 120 of file transition.cpp.

References label.

QColor Transition::getLabelColor (  )  [inline]

Definition at line 66 of file transition.h.

References dimEdgeLabelColor, dimmed, and edgeLabelColor.

Referenced by NextLabelsDialog::addLabel(), TransitionSerializer::createTransition(), and Parser::Label_r().

Here is the caller graph for this function:

float Transition::getLabelPos (  )  const

Definition at line 187 of file transition.cpp.

References label, and LabelX::posParam().

Referenced by Editor::editTransition(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the call graph for this function:

Here is the caller graph for this function:

QString Transition::getLabelText (  )  const

Definition at line 125 of file transition.cpp.

References label, and LabelX::text().

Referenced by Editor::editTransition(), Editor::exportToGraphML(), Editor::showPopup(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual float Transition::getNCurv (  )  const [inline, virtual]

Reimplemented in TransitionVArc, and TransitionVCurve.

Definition at line 94 of file transition.h.

Referenced by Editor::editTransition(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the caller graph for this function:

const TLabelXList& Transition::getNextLabels (  )  const [inline]

Definition at line 60 of file transition.h.

References nextLabels.

Referenced by TransitionSerializer::TransitionSerializer().

Here is the caller graph for this function:

QString Transition::getNextLabelsVCCommand (  )  const [virtual]
const QPainterPath & Transition::getSelectionPath (  )  const [protected]

Definition at line 672 of file transition.cpp.

References m_selectionPath.

Referenced by paintSelectionDecoration().

Here is the caller graph for this function:

QString Transition::getSourceState (  )  const

Definition at line 822 of file transition.cpp.

References getStartStateName().

Referenced by showErrorReport().

Here is the call graph for this function:

Here is the caller graph for this function:

State* Transition::getStartState (  )  const [inline]
QString Transition::getStartStateName (  )  const

Definition at line 108 of file transition.cpp.

References State::getName(), and startState.

Referenced by Editor::getAutomaton(), getSourceState(), and TransitionSerializer::TransitionSerializer().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QString Transition::getTypeName (  )  const [pure virtual]
virtual QString Transition::getTypeNameSuffix (  )  const [inline, virtual]

Reimplemented in OneStateTransition, and TwoStatesTransition.

Definition at line 82 of file transition.h.

Referenced by Editor::editTransition(), Editor::exportToGraphML(), and Editor::insertTransition().

Here is the caller graph for this function:

virtual QString Transition::getVCCommand (  )  const [pure virtual]

VauCanSon-G transition command.

Implemented in TransitionArc, TransitionSELine, TransitionLine, TransitionLoop, TransitionVArc, and TransitionVCurve.

Referenced by Editor::saveGraph().

Here is the caller graph for this function:

bool Transition::getVCParams ( QTextStream &  out,
EdgePrevParams prevParams 
) const
bool Transition::hasEndState (  )  const [inline]

Pay attention to Loop - doesn't have end state, but getEndState() returns startState due to automaton sence.

Definition at line 110 of file transition.h.

References endState.

Referenced by Editor::exportToGraphML(), and TransitionSerializer::TransitionSerializer().

Here is the caller graph for this function:

bool Transition::isDimmed (  ) 

Definition at line 348 of file transition.cpp.

References dimmed.

Referenced by Editor::editTransition(), Editor::exportToGraphML(), Editor::saveGraph(), and TwoStatesTransitionEditCommand::TwoStatesTransitionEditCommand().

Here is the caller graph for this function:

void Transition::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 398 of file transition.cpp.

References DBGLOG_ME, editor, Editor::getAction(), m_lastMouseClickType, and setChecked().

Here is the call graph for this function:

void Transition::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 387 of file transition.cpp.

References DBGLOG_ME, m_lastMouseClickType, and setChecked().

Here is the call graph for this function:

virtual void Transition::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, pure virtual]
void Transition::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [virtual]

Reimplemented in TransitionLoop, and TwoStatesTransition.

Definition at line 274 of file transition.cpp.

References boundingRect(), checked, checkedColor, dimEdgeLineColor, dimEdgeLineStyle, dimmed, edgeLineColor, edgeLineStyle, m_lineWidth, p, pa, paintSelectionDecoration(), and shape().

Here is the call graph for this function:

void Transition::paintSelectionDecoration ( QPainter *  painter  )  [virtual]

Definition at line 262 of file transition.cpp.

References SelectedColor::a, SelectedColor::b, SelectedColor::g, getSelectionPath(), and SelectedColor::r.

Referenced by TransitionLoop::paint(), and paint().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QPainterPath Transition::path (  )  const [inline, virtual]

Return path mapped to scene.

Reimplemented in TransitionLoop.

Definition at line 74 of file transition.h.

References p.

Referenced by StateImpl::getStatesAndPathsOn().

Here is the caller graph for this function:

void Transition::removeNextLabel ( LabelX pLabel  ) 

Definition at line 202 of file transition.cpp.

References nextLabels, and RELLOG.

Referenced by Editor::removeFromListAndScene().

Here is the caller graph for this function:

virtual void Transition::setArcAngle ( int   )  [inline, virtual]
virtual void Transition::setArcAngleB ( int   )  [inline, virtual]
void Transition::setChecked ( bool  checked = true  ) 
void Transition::setDimEdgeLineCoef ( float  lineCoef  ) 
void Transition::setDimmed ( bool  dim  ) 
virtual void Transition::setDirection ( int   )  [inline, virtual]

Reimplemented in TransitionSELine, and TransitionLoop.

Definition at line 88 of file transition.h.

Referenced by OneStateTransitionEditCommand::redo(), and OneStateTransitionEditCommand::undo().

Here is the caller graph for this function:

void Transition::setEdgeLabelScale ( float  labelScale  ) 
void Transition::setEdgeLineWidth ( float  lineWidth  ) 
void Transition::setEndState ( State state  ) 

Definition at line 414 of file transition.cpp.

References adjust(), endState, and RELLOG.

Here is the call graph for this function:

void Transition::setLabelPos ( float  pos  ) 

??? Check return type correctness!!!

Definition at line 182 of file transition.cpp.

References label, and LabelX::setPosParam().

Referenced by Editor::editTransition(), Parser::EndTransitionDeclaration(), Editor::insertTransition(), Parser::OneStateTransition(), TwoStatesTransitionEditCommand::redo(), OneStateTransitionEditCommand::redo(), TwoStatesTransitionEditCommand::undo(), and OneStateTransitionEditCommand::undo().

Here is the call graph for this function:

Here is the caller graph for this function:

void Transition::setLabelPosition (  )  [virtual]

Reimplemented in TransitionArc, TransitionLine, TransitionLoop, TransitionVArc, and TransitionVCurve.

Definition at line 171 of file transition.cpp.

References nextLabels.

Referenced by TransitionSELine::adjust(), Parser::Label_r(), setEdgeLabelScale(), and setLabelText().

Here is the caller graph for this function:

void Transition::setLabelPosition ( LabelX pLabel,
float  pos,
bool  isLeft,
int  width,
int  height 
) [virtual]

Definition at line 146 of file transition.cpp.

References p, and TEXT_DISTANCE.

void Transition::setLabelText ( const QString &  label  ) 

Definition at line 133 of file transition.cpp.

References label, RELLOG, setLabelPosition(), and LabelX::setText().

Referenced by TwoStatesTransitionEditCommand::redo(), OneStateTransitionEditCommand::redo(), TwoStatesTransitionEditCommand::undo(), and OneStateTransitionEditCommand::undo().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Transition::setNCurv ( float   )  [inline, virtual]
void Transition::setSelected ( bool  selected = true  ) 

Definition at line 372 of file transition.cpp.

References label, nextLabels, and LabelX::text().

Referenced by Editor::generateGraph(), and Editor::paste().

Here is the call graph for this function:

Here is the caller graph for this function:

void Transition::setStartState ( State state  ) 
Note:
Neded too if state type is changed

Definition at line 408 of file transition.cpp.

References adjust(), and startState.

Here is the call graph for this function:

QPainterPath Transition::shape (  )  const [virtual]

Definition at line 238 of file transition.cpp.

References getClickPath().

Referenced by TransitionLoop::paint(), and paint().

Here is the call graph for this function:

Here is the caller graph for this function:

void Transition::showErrorReport ( const QString &  reportText = QString("")  )  const [protected]

Definition at line 833 of file transition.cpp.

References editor, getDestinationState(), and getSourceState().

Referenced by getCharacters().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Transition::unassign (  )  [pure virtual]

Implemented in OneStateTransition, and TwoStatesTransition.

Referenced by State::deleteTransitions(), and Editor::removeFromListsAndScene().

Here is the caller graph for this function:


Friends And Related Function Documentation

void Editor::exportToGraphML ( const QString &  fn  )  [friend]
friend class NextLabelsDialog [friend]

Definition at line 47 of file transition.h.

friend class Parser [friend]

Definition at line 45 of file transition.h.

friend class TransitionEditExtendedCommand [friend]

Definition at line 49 of file transition.h.

friend class TransitionEditWithDelCommand [friend]

Definition at line 48 of file transition.h.

friend class TransitionExtendedDialog [friend]

Definition at line 46 of file transition.h.

friend struct TransitionSerializer [friend]

Definition at line 51 of file transition.h.

friend class TransitionStyleChangeCommand [friend]

Definition at line 50 of file transition.h.


Member Data Documentation

bool Transition::checked [protected]

coloring when selected

Definition at line 207 of file transition.h.

Referenced by TransitionLoop::paint(), paint(), and setChecked().

const QColor Transition::checkedColor [protected]

Definition at line 208 of file transition.h.

Referenced by TransitionLoop::paint(), paint(), and setChecked().

QString Transition::dimEdgeLabelColor [protected]
float Transition::dimEdgeLineCoef [protected]
QString Transition::dimEdgeLineColor [protected]
Qt::PenStyle Transition::dimEdgeLineStyle [protected]
bool Transition::dimmed [protected]
QString Transition::edgeLabelColor [protected]
float Transition::edgeLabelScale [protected]
float Transition::edgeLineBorderCoef [protected]
QString Transition::edgeLineBorderColor [protected]
QString Transition::edgeLineColor [protected]
float Transition::edgeLineDblCoef [protected]
float Transition::edgeLineDblSep [protected]
Qt::PenStyle Transition::edgeLineStyle [protected]
float Transition::edgeLineWidth [protected]
Editor* Transition::editor [protected]
QPointF Transition::endPoint [protected]
State * Transition::endState [protected]
LabelX* Transition::label [protected]
bool Transition::leftOriented [protected]

Reimplemented in TwoStatesTransition.

Definition at line 176 of file transition.h.

Referenced by TransitionLoop::TransitionLoop().

QPolygonF Transition::m_arrowPoints [protected]

default transition arrow, angle 0 degrees, pointing to point 0,0

Definition at line 159 of file transition.h.

Referenced by TransitionSELine::adjust(), getArrowPolygon(), and Transition().

QPainterPath Transition::m_clickPath [protected]

holds area for mouse click

Definition at line 150 of file transition.h.

Referenced by createStrokes(), and getClickPath().

int Transition::m_labelFontSize [protected]
float Transition::m_lineWidth [protected]
QPainterPath Transition::m_selectionPath [protected]

holds area showed when item is selected

Definition at line 151 of file transition.h.

Referenced by createStrokes(), and getSelectionPath().

QPainterPath Transition::p [protected]
QPolygonF Transition::pa [protected]
QPointF Transition::startPoint [protected]

The documentation for this class was generated from the following files: