Computer Assited Medical Intervention Tool Kit  version 4.0
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ActionStateMachine Class Reference

This Class describes ActionStateMachine MainWindow extension. More...

#include <ActionStateMachine.h>

Inherits camitk::Application.

Public Member Functions

 ActionStateMachine (int &argc, char **argv, QString inputFileName="", QString outputDirectory="") throw (camitk::AbortException)
 construtor More...
 
QString getSaveDirectory ()
 where to save the files More...
 
virtual ~ActionStateMachine ()
 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...
 
virtual ~Application ()
 destructor More...
 
PropertyObjectgetPropertyObject ()
 Get the property object of the application. More...
 
PropertygetAutoloadLastOpenedComponentsProperty ()
 Get the CamiTK property associated with auto loading last opened component when the application starts. More...
 
PropertygetDefaultTargetedComponentProperty ()
 Get the CamiTK property associated with the new component frame policy. More...
 
void setMainWindow (MainWindow *mw)
 set the main window. More...
 

Protected Member Functions

void checkSCXMLFile (QString filename) throw (camitk::AbortException)
 check that the file is a SCXML file (simple checking, no XML Schema validation yet) More...
 
void initMainWindow ()
 initialized main window More...
 
QString parseSCXMLTree () throw (camitk::AbortException)
 parse the XML file (using Qt DOM API) More...
 

Protected Attributes

Attributes
QString name
 Application's name. More...
 
QStateMachine machine
 Actual state machine. More...
 
camitk::MainWindowmainWindow
 main window More...
 
QDomDocument scxmlDoc
 XML tree containing infos. More...
 
QMap< QString, ActionState * > * statesMap
 Map of action state to build transitions. More...
 
QFinalState * theEnd
 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 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) throw (camitk::AbortException)
 
void createTransitions (QDomNodeList nodeList) throw (camitk::AbortException)
 
void setCamiTKAction (ActionState *actionState, QDomElement actionElement) throw (camitk::AbortException)
 
void setCamiTKSaveAction (SaveActionState *actionState, QDomElement actionElement) throw (camitk::AbortException)
 
QVector< camitk::Action::ApplyStatusstringToStatus (QString listOfStatus)
 

Additional Inherited Members

- Public Types inherited from camitk::Application
enum  TargetPositionningMethods { SAME_TRANSFORMATION, NO_TRANSFORMATION, SUBFRAME }
 
- Static Public Member Functions inherited from camitk::Application
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 const ComponentListgetSelectedComponents ()
 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 ActiongetAction (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 TargetPositionningMethods getDefaultTargetPositionningMethod ()
 Get the default target positionning method. More...
 
static void setDefaultTargetPositionningMethod (TargetPositionningMethods method)
 Set the default target positionning method. More...
 
static Componentopen (const QString &)
 load the filename and returns the corresponding top level Component (return NULL if an error occurs) More...
 
static ComponentopenDirectory (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 ComponentListgetTopLevelComponents ()
 get the current application wide list of instanciated top-level Components. More...
 
static const ComponentListgetAllComponents ()
 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 MainWindowgetMainWindow ()
 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 eventId, void *clientData, void *callData)
 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...
 

Detailed Description

This Class describes ActionStateMachine MainWindow extension.

This application use a modified version of SCXML that describes a pipeline of CamiTK actions.

Constructor & Destructor Documentation

◆ ActionStateMachine()

ActionStateMachine::ActionStateMachine ( int &  argc,
char **  argv,
QString  inputFileName = "",
QString  outputDirectory = "" 
)
throw (camitk::AbortException
)

construtor

◆ ~ActionStateMachine()

ActionStateMachine::~ActionStateMachine ( )
virtual

destructor

References camitk::logFile.

Member Function Documentation

◆ checkSCXMLFile()

void ActionStateMachine::checkSCXMLFile ( QString  filename)
throw (camitk::AbortException
)
protected

check that the file is a SCXML file (simple checking, no XML Schema validation yet)

References CAMITK_ERROR.

◆ createAllActionStates()

void ActionStateMachine::createAllActionStates ( QDomNodeList  nodeList)
throw (camitk::AbortException
)
private

◆ createTransitions()

void ActionStateMachine::createTransitions ( QDomNodeList  nodeList)
throw (camitk::AbortException
)
private

◆ getDomNodeLocation()

QString ActionStateMachine::getDomNodeLocation ( QDomNode  inputNode)
private

build a specific error message containing the line and column if available

◆ getSaveDirectory()

QString ActionStateMachine::getSaveDirectory ( )

where to save the files

◆ initMainWindow()

void ActionStateMachine::initMainWindow ( )
protected

◆ parseSCXMLTree()

QString ActionStateMachine::parseSCXMLTree ( )
throw (camitk::AbortException
)
protected

parse the XML file (using Qt DOM API)

References ActionStateViewer::getActionStateViewer(), camitk::logFile, and ActionStateViewer::setState().

◆ setCamiTKAction()

void ActionStateMachine::setCamiTKAction ( ActionState actionState,
QDomElement  actionElement 
)
throw (camitk::AbortException
)
private

◆ setCamiTKSaveAction()

void ActionStateMachine::setCamiTKSaveAction ( SaveActionState actionState,
QDomElement  actionElement 
)
throw (camitk::AbortException
)
private

◆ stringToStatus()

QVector< Action::ApplyStatus > ActionStateMachine::stringToStatus ( QString  listOfStatus)
private

Member Data Documentation

◆ logFile

QFile* ActionStateMachine::logFile
protected

Log file.

◆ logStream

QTextStream* ActionStateMachine::logStream
protected

Log stream to write report on logFile.

◆ machine

QStateMachine ActionStateMachine::machine
protected

Actual state machine.

◆ mainWindow

camitk::MainWindow* ActionStateMachine::mainWindow
protected

main window

◆ name

QString ActionStateMachine::name
protected

Application's name.

◆ saveDirectory

QDir ActionStateMachine::saveDirectory
protected

Where to save all files.

◆ scxmlDoc

QDomDocument ActionStateMachine::scxmlDoc
protected

XML tree containing infos.

◆ startTime

QTime* ActionStateMachine::startTime
protected

To get track of the Action State Machine the duration.

◆ statesMap

QMap<QString, ActionState *>* ActionStateMachine::statesMap
protected

Map of action state to build transitions.

◆ theEnd

QFinalState* ActionStateMachine::theEnd
protected

Final State.


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