Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::StateMachineContainer Class Reference

Parses XML state machine descriptions and builds the state machine structure. More...

#include <mitkStateMachineContainer.h>

Inheritance diagram for mitk::StateMachineContainer:
Collaboration diagram for mitk::StateMachineContainer:

Public Types

typedef std::vector< StateMachineState::Pointer > StateMachineCollectionType
 Type that holds all states of one state machine. More...
 

Public Member Functions

 vtkTypeMacro (StateMachineContainer, vtkXMLParser)
 
StateMachineState::Pointer GetStartState () const
 Return the start state of the state machine. More...
 
bool LoadBehavior (const std::string &fileName, const us::Module *module)
 Load a state machine pattern from an XML resource file. More...
 

Static Public Member Functions

static StateMachineContainer * New ()
 

Protected Member Functions

 StateMachineContainer ()
 
 ~StateMachineContainer () override
 
void StartElement (const char *elementName, const char **atts) override
 Handle the start of an XML element during parsing. More...
 
void EndElement (const char *elementName) override
 Handle the end of an XML element during parsing. More...
 

Detailed Description

Parses XML state machine descriptions and builds the state machine structure.

Reads state machine pattern XML files from module resources, creates the corresponding StateMachineState, StateMachineTransition, StateMachineAction, and StateMachineCondition objects, and connects them into a complete state machine graph.

Definition at line 43 of file mitkStateMachineContainer.h.

Member Typedef Documentation

◆ StateMachineCollectionType

typedef std::vector<StateMachineState::Pointer> mitk::StateMachineContainer::StateMachineCollectionType

Type that holds all states of one state machine.

Definition at line 50 of file mitkStateMachineContainer.h.

Constructor & Destructor Documentation

◆ StateMachineContainer()

mitk::StateMachineContainer::StateMachineContainer ( )
protected

◆ ~StateMachineContainer()

mitk::StateMachineContainer::~StateMachineContainer ( )
overrideprotected

Member Function Documentation

◆ EndElement()

void mitk::StateMachineContainer::EndElement ( const char *  elementName)
overrideprotected

Handle the end of an XML element during parsing.

Overridden from vtkXMLParser.

◆ GetStartState()

StateMachineState::Pointer mitk::StateMachineContainer::GetStartState ( ) const

Return the start state of the state machine.

Returns
Smart pointer to the start state, or nullptr if not found.

◆ LoadBehavior()

bool mitk::StateMachineContainer::LoadBehavior ( const std::string &  fileName,
const us::Module *  module 
)

Load a state machine pattern from an XML resource file.

Loads an XML resource file in the given module context. The files have to be placed in the Resources/Interaction folder of their respective module.

Parameters
[in]fileNamethe name of the XML file to load (without path).
[in]modulethe module context to load the resource from. If nullptr, the current module context is used.
Returns
True if the file was parsed successfully without errors.
Exceptions
mitk::Exceptionif the resource file cannot be found.

◆ New()

static StateMachineContainer* mitk::StateMachineContainer::New ( )
static

◆ StartElement()

void mitk::StateMachineContainer::StartElement ( const char *  elementName,
const char **  atts 
)
overrideprotected

Handle the start of an XML element during parsing.

Overridden from vtkXMLParser.

◆ vtkTypeMacro()

mitk::StateMachineContainer::vtkTypeMacro ( StateMachineContainer  ,
vtkXMLParser   
)

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