![]() |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
This Class describes ActionStateMachine MainWindow extension. More...
#include <ActionStateMachine.h>
Inherits camitk::Application.
Public Slots | |
| void | autoNext () |
| Automatically loop to apply to next state for all states. More... | |
Public Member Functions | |
| ActionStateMachine (int &argc, char **argv, QString inputFileName="", QString outputDirectory="") | |
| construtor. More... | |
| QString | getSaveDirectory () |
| where to save the files More... | |
| virtual | ~ActionStateMachine ()=default |
| destructor More... | |
Public Member Functions inherited from camitk::Application | |
| Application (QString name, int &argc, char **argv, bool autoloadExtension=true, bool registerFileExtension=false) | |
| Initializes the window system and constructs a CamiTK application object with argc command line arguments in argv. More... | |
| ~Application () override | |
| destructor More... | |
| bool | notify (QObject *, QEvent *) override |
| reimplemented from QApplication to catch all exception from external libs used in CEP (e.g. from ITK) and avoid crashes... More... | |
| void | setMainWindow (MainWindow *mw) |
| set the main window. More... | |
Protected Member Functions | |
| void | checkSCXMLFile (QString filename) |
| check that the file is a SCXML file (simple checking, no XML Schema validation yet) This method may throw an AbortException if a problem occurs. More... | |
| void | initMainWindow () |
| initialized main window More... | |
| QString | parseSCXMLTree () |
| parse the XML file (using Qt DOM API) This method may throw an AbortException if a problem occurs. More... | |
Protected Member Functions inherited from camitk::Application | |
| bool | eventFilter (QObject *object, QEvent *event) override |
| Event filter of this class instance to watch its properties instances. More... | |
Protected Attributes | |
Attributes | |
| QString | name |
| Application's name. More... | |
| QStateMachine | machine |
| Actual state machine. More... | |
| camitk::MainWindow * | mainWindow |
| main window More... | |
| QDomDocument | scxmlDoc |
| XML tree containing infos. More... | |
| QMap< QString, ActionState * > * | statesMap |
| Map of action state to build transitions. More... | |
| QFinalState * | finalState |
| Final State. More... | |
| QDir | saveDirectory |
| Where to save all files. More... | |
| QTime * | startTime |
| To get track of the Action State Machine the duration. More... | |
| QTextStream * | logStream |
| Log stream to write report on logFile. More... | |
| QFile * | logFile |
| Log file. More... | |
Private Slots | |
| void | finished () |
| finish everything properly when the state machine entered the final state and quit More... | |
Private Member Functions | |
| QString | getDomNodeLocation (QDomNode) |
| build a specific error message containing the line and column if available More... | |
Tool methods used, see parseSCXMLTree() | |
| void | createAllActionStates (QDomNodeList nodeList) |
| This method may throw an AbortException if a problem occurs. More... | |
| void | createTransitions (QDomNodeList nodeList) |
| This method may throw an AbortException if a problem occurs. More... | |
| void | setCamiTKAction (ActionState *actionState, QDomElement actionElement) |
| This method may throw an AbortException if a problem occurs. More... | |
| void | setCamiTKSaveAction (SaveActionState *actionState, QDomElement actionElement) |
| This method may throw an AbortException if a problem occurs. More... | |
| QVector< camitk::Action::ApplyStatus > | stringToStatus (QString listOfStatus) |
Additional Inherited Members | |
Public Types inherited from camitk::Application | |
| enum | TargetPositionningPolicy { SAME_TRANSFORMATION, NO_TRANSFORMATION, SUBFRAME } |
| : Policy to determine how a newly instanciated component's frame should be initialized regarding of its parent's component. More... | |
Static Public Member Functions inherited from camitk::Application | |
| static const ComponentList & | getSelectedComponents () |
| get the currently selected Components. More... | |
| static void | clearSelectedComponents () |
| clear all the selection, i.e call setSelected(false) for all the previously selected components and clear the list. More... | |
| static Action * | getAction (QString) |
| get a registered action given its name More... | |
| static const ActionList | getActions () |
| get all the actions registered in the application (note: the returned ActionList is garanteed to be sorted by action name and to contain no duplicates) More... | |
| static ActionList | getActions (Component *) |
| get all the actions that can be applied on a given component (note: the returned ActionList is garanteed to be sorted by action name and to contain no duplicates) More... | |
| static ActionList | getActions (ComponentList) |
| Get all the actions that can be applied on any components of the given list of components (note: the returned ActionList is garanteed to be sorted by action name and to contain no duplicates) More... | |
| static ActionList | getActions (ComponentList, QString) |
| get all the actions that of a given tag (note: the returned ActionList is guaranteed to be sorted by action name and to contain no duplicates) More... | |
| static int | registerAllActions (ActionExtension *) |
| register all actions from the given ActionExtension More... | |
| static int | unregisterAllActions (ActionExtension *) |
| unregister all actions from the given ActionExtension More... | |
| static QString | getSelectedLanguage () |
| Returns for the current CamiTK application, the selected language (stored in its .ini configuration file) More... | |
| static Component * | open (const QString &) |
| load the filename and returns the corresponding top level Component (return NULL if an error occurs) More... | |
| static Component * | openDirectory (const QString &dirName, const QString &pluginName) |
| load a directory and returns the corresponding Component (return NULL if an error occurs) More... | |
| static bool | close (Component *component) |
| Close a Component: if it has been changed, ask the user for more information, then if everything is ok, delete it. More... | |
| static bool | save (Component *component) |
| save a component to its file (as given by component->getFileName()). More... | |
| static const ComponentList & | getTopLevelComponents () |
| get the current application wide list of instantiated top-level Components. More... | |
| static const ComponentList & | getAllComponents () |
| get the current application wide list of all Components. More... | |
| static bool | isAlive (Component *) |
| does this Component still exists? More... | |
| static bool | hasModified () |
| Return true if at least one of the opened components has been modified, false otherwise. More... | |
| static PropertyObject * | getPropertyObject () |
| Get the property object of the application. More... | |
| static QString | getName () |
| get the application name More... | |
| static QSettings & | getSettings () |
| Get the Core wide settings. More... | |
| static int | exec () |
| Overriden from QApplication: Enters the main event loop and waits until exit() is called, then returns the value that was set to exit() (which is 0 if exit() is called via quit()). More... | |
| static const QDir | getLastUsedDirectory () |
| Get the last used directory (e.g. More... | |
| static void | setLastUsedDirectory (QDir) |
| set (force) the last used directory More... | |
| static void | addRecentDocument (QFileInfo) |
| Add a document to the list of recent documents (e.g. More... | |
| static const QList< QFileInfo > | getRecentDocuments () |
| Get the list of recent documents. More... | |
| static const int | getMaxRecentDocuments () |
| get the maximal number of recent documents stored More... | |
| static MainWindow * | getMainWindow () |
| get the main window More... | |
| static void | refresh () |
| refresh the main window (this will call the refresh method of all viewers) More... | |
| static void | showStatusBarMessage (QString msg, int timeout=0) |
| Set a message to the status bar. More... | |
| static void | resetProgressBar () |
| Resets the progress bar if it exists. More... | |
| static void | setProgressBarValue (int) |
| set the progress bar value, value should be in [0..100]. More... | |
| static void | vtkProgressFunction (vtkObject *caller, long unsigned int, void *, void *) |
| Observer function to be called by vtkFilters and to update progress bar Example of use: More... | |
| static void | addHistoryItem (HistoryItem item) |
| Add the history item to the application history. More... | |
| static HistoryItem | removeLastHistoryItem () |
| Remove the last pushed actions in the history of the current pipeline. More... | |
| static void | saveHistoryAsSXML () |
| Save the history as an SCXML file, stored using. More... | |
This Class describes ActionStateMachine MainWindow extension.
This application use a modified version of SCXML that describes a pipeline of CamiTK actions.
| ActionStateMachine::ActionStateMachine | ( | int & | argc, |
| char ** | argv, | ||
| QString | inputFileName = "", |
||
| QString | outputDirectory = "" |
||
| ) |
construtor.
This method may throw an AbortException if a problem occurs.
References checkSCXMLFile(), initMainWindow(), machine, mainWindow, name, parseSCXMLTree(), saveDirectory, startTime, and statesMap.
|
virtualdefault |
destructor
|
slot |
Automatically loop to apply to next state for all states.
References ActionTransition::autoNext(), ActionTransition::isNamed(), and machine.
|
protected |
check that the file is a SCXML file (simple checking, no XML Schema validation yet) This method may throw an AbortException if a problem occurs.
References CAMITK_ERROR, getDomNodeLocation(), and scxmlDoc.
Referenced by ActionStateMachine().
|
private |
This method may throw an AbortException if a problem occurs.
References CAMITK_ERROR, CAMITK_WARNING, finalState, logStream, machine, saveDirectory, ActionState::setAlternativeDesc(), setCamiTKAction(), setCamiTKSaveAction(), statesMap, and stringToStatus().
Referenced by parseSCXMLTree().
|
private |
This method may throw an AbortException if a problem occurs.
References ActionState::addActionTransition(), ActionTransition::addComponentToClose(), CAMITK_ERROR, finalState, getDomNodeLocation(), ActionState::getName(), statesMap, and stringToStatus().
Referenced by parseSCXMLTree().
|
privateslot |
finish everything properly when the state machine entered the final state and quit
References logFile, and startTime.
Referenced by parseSCXMLTree().
|
private |
build a specific error message containing the line and column if available
Referenced by checkSCXMLFile(), createTransitions(), and setCamiTKAction().
| QString ActionStateMachine::getSaveDirectory | ( | ) |
where to save the files
References saveDirectory.
|
protected |
initialized main window
References camitk::MainWindow::addDockViewer(), ActionStateViewer::getActionStateViewer(), mainWindow, name, camitk::MainWindow::redirectToConsole(), camitk::MainWindow::setCentralViewer(), camitk::Application::setMainWindow(), and camitk::MainWindow::showStatusBar().
Referenced by ActionStateMachine().
|
protected |
parse the XML file (using Qt DOM API) This method may throw an AbortException if a problem occurs.
References createAllActionStates(), createTransitions(), finished(), ActionStateViewer::getActionStateViewer(), logFile, logStream, machine, saveDirectory, scxmlDoc, ActionStateViewer::setState(), and statesMap.
Referenced by ActionStateMachine().
|
private |
This method may throw an AbortException if a problem occurs.
References CAMITK_ERROR, getDomNodeLocation(), and ActionState::setAction().
Referenced by createAllActionStates().
|
private |
This method may throw an AbortException if a problem occurs.
References CAMITK_ERROR, SaveActionState::saveComponentsInfo::directory, SaveActionState::saveComponentsInfo::extension, SaveActionState::saveComponentsInfo::name, SaveActionState::setInput(), and SaveActionState::saveComponentsInfo::type.
Referenced by createAllActionStates().
|
private |
Referenced by createAllActionStates(), and createTransitions().
|
protected |
Final State.
Referenced by createAllActionStates(), and createTransitions().
|
protected |
Log file.
Referenced by finished(), and parseSCXMLTree().
|
protected |
Log stream to write report on logFile.
Referenced by createAllActionStates(), and parseSCXMLTree().
|
protected |
Actual state machine.
Referenced by ActionStateMachine(), autoNext(), createAllActionStates(), and parseSCXMLTree().
|
protected |
main window
Referenced by ActionStateMachine(), and initMainWindow().
|
protected |
Application's name.
Referenced by ActionStateMachine(), and initMainWindow().
|
protected |
Where to save all files.
Referenced by ActionStateMachine(), createAllActionStates(), getSaveDirectory(), and parseSCXMLTree().
|
protected |
XML tree containing infos.
Referenced by checkSCXMLFile(), and parseSCXMLTree().
|
protected |
To get track of the Action State Machine the duration.
Referenced by ActionStateMachine(), and finished().
|
protected |
Map of action state to build transitions.
Referenced by ActionStateMachine(), createAllActionStates(), createTransitions(), and parseSCXMLTree().
1.8.13