Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
ActionStateMachine Class Reference

#include <ActionStateMachine.h>

+ Inheritance diagram for ActionStateMachine:

Public Member Functions

 ActionStateMachine (int &argc, char **argv) throw (AbortException)
 construtor
QString getSaveDirectory ()
 where to save the files
virtual ~ActionStateMachine ()
 destructor
- Public Member Functions inherited from camitk::Application
 Application (QString name, int &argc, char **argv, bool autoloadExtension=true)
 Initializes the window system and constructs a CamiTK application object with argc command line arguments in argv.
virtual ~Application ()
 destructor
void setMainWindow (MainWindow *mw)
 set the main window.

Protected Member Functions

void checkSCXMLFile (QString filename) throw (AbortException)
void initMainWindow ()
QString parseSCXMLTree () throw (AbortException)

Protected Attributes

QString name
 Attributes.
QStateMachine machine
 Actual state machine.
MainWindowmainWindow
 main window
QDomDocument scxmlDoc
 XML tree containing infos.
QMap< QString, ActionState * > * statesMap
 Map of action state to build transitions.
QFinalState * theEnd
 Final State.
QDir saveDirectory
 Where to save all files.
QTime * startTime
 To get track of the Action State Machine the duration.
QTextStream * logStream
 Log stream to write report on logFile.
QFile * logFile
 Log file.

Private Member Functions

void createAllActionStates (QDomNodeList nodeList) throw (AbortException)
 Tool methods used in parseSCXMLTree()
void createTransitions (QDomNodeList nodeList) throw (AbortException)
void setCamiTKAction (ActionState *actionState, QDomElement actionElement) throw (AbortException)
void setCamiTKSaveAction (SaveActionState *actionState, QDomElement actionElement) throw (AbortException)
QVector< Action::ApplyStatusstringToStatus (QString listOfStatus)

Additional Inherited Members

- Static Public Member Functions inherited from camitk::Application
static QString getName ()
 get the application name
static QSettings & getSettings ()
 Get the Core wide settings.
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()).
static const QDir getLastUsedDirectory ()
 Get the last used directory (e.g.
static void setLastUsedDirectory (QDir)
 set (force) the last used directory
static void addRecentDocument (QFileInfo)
 Add a document to the list of recent documents (e.g.
static const QList< QFileInfo > getRecentDocuments ()
 Get the list of recent documents.
static const int getMaxRecentDocuments ()
 get the maximal number of recent documents stored
static const ComponentListgetSelectedComponents ()
 get the currently selected Components.
static void clearSelectedComponents ()
 clear all the selection, i.e call setSelected(false) for all the previously selected components and clear the list.
static ActiongetAction (QString)
 get a registered action given its name
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)
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)
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)
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)
static int registerAllActions (ActionExtension *)
 register all actions from the given ActionExtension
static Componentopen (const QString &)
 load the filename and returns the corresponding Component (return NULL if an error occurs)
static ComponentopenDirectory (const QString &dirName, const QString &pluginName)
 load a directory and returns the corresponding Component (return NULL if an error occurs)
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.
static bool save (Component *component)
 save a component to its file (as given by component->getFileName()).
static const ComponentListgetTopLevelComponents ()
 get the current application wide list of instanciated top-level Components.
static const ComponentListgetAllComponents ()
 get the current application wide list of all Components.
static bool isAlive (Component *)
 does this Component still exists?
static bool hasModified ()
 Return true if at least one of the opened components has been modified, false otherwise.
static MainWindowgetMainWindow ()
 get the main window
static void refresh ()
 refresh the main window (this will call the refresh method of all viewers)
static void showStatusBarMessage (QString msg, int timeout=0)
 Set a message to the status bar.
static void resetProgressBar ()
 Resets the progress bar if it exists.
static void setProgressBarValue (int)
 set the progress bar value, value should be in [0..100].
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:
- Friends inherited from camitk::Application

Constructor & Destructor Documentation

ActionStateMachine::ActionStateMachine ( int &  argc,
char **  argv 
) throw (AbortException)

construtor

ActionStateMachine::~ActionStateMachine ( )
virtual

destructor

References logFile, and startTime.

Member Function Documentation

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

References CAMITK_ERROR.

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

Tool methods used in parseSCXMLTree()

References CAMITK_ERROR, and ActionState::setAleternativeDesc().

Referenced by parseSCXMLTree().

void ActionStateMachine::createTransitions ( QDomNodeList  nodeList) throw (AbortException)
private
QString ActionStateMachine::getSaveDirectory ( )

where to save the files

References saveDirectory.

void ActionStateMachine::initMainWindow ( )
protected
QString ActionStateMachine::parseSCXMLTree ( ) throw (AbortException)
protected
void ActionStateMachine::setCamiTKAction ( ActionState actionState,
QDomElement  actionElement 
) throw (AbortException)
private

References CAMITK_ERROR.

void ActionStateMachine::setCamiTKSaveAction ( SaveActionState actionState,
QDomElement  actionElement 
) throw (AbortException)
private
QVector< Action::ApplyStatus > ActionStateMachine::stringToStatus ( QString  listOfStatus)
private

Member Data Documentation

QFile* ActionStateMachine::logFile
protected

Log file.

Referenced by parseSCXMLTree(), and ~ActionStateMachine().

QTextStream* ActionStateMachine::logStream
protected

Log stream to write report on logFile.

Referenced by parseSCXMLTree().

QStateMachine ActionStateMachine::machine
protected

Actual state machine.

Referenced by parseSCXMLTree().

MainWindow* ActionStateMachine::mainWindow
protected

main window

Referenced by initMainWindow(), and parseSCXMLTree().

QString ActionStateMachine::name
protected

Attributes.

Application's name

Referenced by initMainWindow().

QDir ActionStateMachine::saveDirectory
protected

Where to save all files.

Referenced by getSaveDirectory(), and parseSCXMLTree().

QDomDocument ActionStateMachine::scxmlDoc
protected

XML tree containing infos.

Referenced by parseSCXMLTree().

QTime* ActionStateMachine::startTime
protected

To get track of the Action State Machine the duration.

Referenced by ~ActionStateMachine().

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

Map of action state to build transitions.

Referenced by parseSCXMLTree().

QFinalState* ActionStateMachine::theEnd
protected

Final State.


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