![]() |
Computer Assited Medical Intervention Tool Kit
version 4.0
|
This class handle a transition between two states (including previous/next buttons). More...
#include <ActionTransition.h>
Inherits QSignalTransition.
Public Member Functions | |
ActionTransition (QObject *sender, const char *signal, QState *sourceState=0, QString buttonText="", bool applyPreviousAction=true, QTextStream *logStream=NULL) | |
constructor: takes at least the state and signal considered for the transition More... | |
void | addComponentToClose (QString compName, QString compType, bool force=false) |
add a component's name and type to the list of component to close during the transition. More... | |
QString | getButtonText () |
get the transition button's text More... | |
virtual void | onTransition (QEvent *e) |
called during the transition More... | |
void | setButtonText (QString buttonText) |
the transition button's text More... | |
Private Attributes | |
bool | applyPreviousAction |
should the action be applied during the transition (default set to true) More... | |
QString | buttonText |
the text of the push button displayed in the ASM More... | |
QMap< QString, QString > | componentsToClose |
Map containing all the name/type of the components to be closed during the transition. More... | |
QStringList | componentsToForceClose |
list of the components' name that should be closed even if they are modified More... | |
QTextStream * | logStream |
local pointer to the log stream More... | |
QTime * | startTime |
Keep track of time (needed for the log) More... | |
This class handle a transition between two states (including previous/next buttons).
Specific things can happen for CamiTK SCXML transition (e.g., apply the selected action before going to the next, closing components...)
Example:
ActionTransition::ActionTransition | ( | QObject * | sender, |
const char * | signal, | ||
QState * | sourceState = 0 , |
||
QString | buttonText = "" , |
||
bool | applyPreviousAction = true , |
||
QTextStream * | logStream = NULL |
||
) |
constructor: takes at least the state and signal considered for the transition
References applyPreviousAction, buttonText, and logStream.
void ActionTransition::addComponentToClose | ( | QString | compName, |
QString | compType, | ||
bool | force = false |
||
) |
add a component's name and type to the list of component to close during the transition.
Set force to "true" in order to close the component independently of its modified flag.
References componentsToClose, and componentsToForceClose.
Referenced by ActionStateMachine::createTransitions().
QString ActionTransition::getButtonText | ( | ) |
get the transition button's text
References buttonText.
|
virtual |
called during the transition
References ActionState::applyAction(), applyPreviousAction, componentsToClose, componentsToForceClose, ActionStateViewer::getActionStateViewer(), logStream, ActionState::setPreviousActionStatus(), ActionStateViewer::setState(), and startTime.
void ActionTransition::setButtonText | ( | QString | buttonText | ) |
the transition button's text
References buttonText.
|
private |
should the action be applied during the transition (default set to true)
Referenced by ActionTransition(), and onTransition().
|
private |
the text of the push button displayed in the ASM
Referenced by ActionTransition(), getButtonText(), and setButtonText().
|
private |
Map containing all the name/type of the components to be closed during the transition.
Referenced by addComponentToClose(), and onTransition().
|
private |
list of the components' name that should be closed even if they are modified
Referenced by addComponentToClose(), and onTransition().
|
private |
local pointer to the log stream
Referenced by ActionTransition(), and onTransition().
|
private |
Keep track of time (needed for the log)
Referenced by onTransition().