Base class for drawing algorithms, provides basic graph algorithms. More...
#include <drawAlgorithm.h>
Public Types | |
typedef QMap< QString, unsigned int > | TDistanceMap |
typedef QMap< QString, QString > | TPredecessorMap |
Protected Member Functions | |
QString | charactersToLabel (const QSharedPointer< IAutomaton > &automaton, const QSharedPointer< ITransition > &transition) const |
void | drawTransitions (Editor *editor, const Editor::TStateMap &states, const QSharedPointer< IAutomaton > &automaton, const ITransition::TITransitionList &transitions, const QPoint &startPos) const |
void | fillDijkstraShortestPaths (const QSharedPointer< IAutomaton > &automaton, const QString &fromStateName, TDistanceMap &distances, TPredecessorMap &predecessors) const |
IState::TIStateList | getBFSSortedStates (const QSharedPointer< IAutomaton > &automaton) const |
unsigned int | getMaxDistance (const TDistanceMap &distances) const |
IState::TIStateNameSet | getStatesInDistance (unsigned int distance, const TDistanceMap &distances) const |
void | initPaths (const IState::TIStateList &states, const QString &fromStateName, TDistanceMap &distances, TPredecessorMap &predecessors) const |
void | relax (const QString &u, const QString &v, TDistanceMap &distances, TPredecessorMap &predecessors) const |
Static Protected Attributes | |
static const int | X_STEP = GRID_STEP*3 |
static const int | Y_STEP = GRID_STEP*3 |
Base class for drawing algorithms, provides basic graph algorithms.
Definition at line 12 of file drawAlgorithm.h.
typedef QMap<QString, unsigned int> BaseDrawAlgorithm::TDistanceMap |
Definition at line 15 of file drawAlgorithm.h.
typedef QMap<QString, QString> BaseDrawAlgorithm::TPredecessorMap |
Definition at line 16 of file drawAlgorithm.h.
QString BaseDrawAlgorithm::charactersToLabel | ( | const QSharedPointer< IAutomaton > & | automaton, | |
const QSharedPointer< ITransition > & | transition | |||
) | const [protected] |
Definition at line 392 of file drawAlgorithm.cpp.
Referenced by drawTransitions().
void BaseDrawAlgorithm::drawTransitions | ( | Editor * | editor, | |
const Editor::TStateMap & | states, | |||
const QSharedPointer< IAutomaton > & | automaton, | |||
const ITransition::TITransitionList & | transitions, | |||
const QPoint & | startPos | |||
) | const [protected] |
Definition at line 336 of file drawAlgorithm.cpp.
References Transition::adjust(), Transition::assign(), charactersToLabel(), TransitionManager::createOneStateTransition(), TransitionManager::createTwoStatesTransition(), DBGLOG_DRAW, DBGPAR, TransitionManager::getInstance(), Editor::getStateByName(), NORTH, Transition::setArcAngle(), setParams(), X_STEP, and Y_STEP.
void BaseDrawAlgorithm::fillDijkstraShortestPaths | ( | const QSharedPointer< IAutomaton > & | automaton, | |
const QString & | fromStateName, | |||
TDistanceMap & | distances, | |||
TPredecessorMap & | predecessors | |||
) | const [protected] |
Definition at line 133 of file drawAlgorithm.cpp.
References initPaths(), and relax().
IState::TIStateList BaseDrawAlgorithm::getBFSSortedStates | ( | const QSharedPointer< IAutomaton > & | automaton | ) | const [protected] |
Definition at line 64 of file drawAlgorithm.cpp.
Referenced by NaiveDrawAlgorithm::drawAutomaton().
unsigned int BaseDrawAlgorithm::getMaxDistance | ( | const TDistanceMap & | distances | ) | const [protected] |
Definition at line 188 of file drawAlgorithm.cpp.
IState::TIStateNameSet BaseDrawAlgorithm::getStatesInDistance | ( | unsigned int | distance, | |
const TDistanceMap & | distances | |||
) | const [protected] |
Definition at line 174 of file drawAlgorithm.cpp.
void BaseDrawAlgorithm::initPaths | ( | const IState::TIStateList & | states, | |
const QString & | fromStateName, | |||
TDistanceMap & | distances, | |||
TPredecessorMap & | predecessors | |||
) | const [protected] |
Definition at line 94 of file drawAlgorithm.cpp.
References DBGLOG_DRAW, and DBGPAR.
Referenced by fillDijkstraShortestPaths().
void BaseDrawAlgorithm::relax | ( | const QString & | u, | |
const QString & | v, | |||
TDistanceMap & | distances, | |||
TPredecessorMap & | predecessors | |||
) | const [protected] |
Definition at line 106 of file drawAlgorithm.cpp.
Referenced by fillDijkstraShortestPaths().
const int BaseDrawAlgorithm::X_STEP = GRID_STEP*3 [static, protected] |
Definition at line 49 of file drawAlgorithm.h.
Referenced by drawTransitions().
const int BaseDrawAlgorithm::Y_STEP = GRID_STEP*3 [static, protected] |
Definition at line 50 of file drawAlgorithm.h.
Referenced by drawTransitions().