13 #ifndef mitkEventStateMachine_h
14 #define mitkEventStateMachine_h
16 #include <itkObject.h>
29 #define CONNECT_FUNCTION(a, f) \
30 ::mitk::EventStateMachine::AddActionFunction( \
32 ::mitk::MessageDelegate2<Self, ::mitk::StateMachineAction *, ::mitk::InteractionEvent *, void>(this, &Self::f));
34 #define CONNECT_CONDITION(a, f) \
35 ::mitk::EventStateMachine::AddConditionFunction( \
36 a, ::mitk::MessageDelegate1<Self, const ::mitk::InteractionEvent *, bool>(this, &Self::f));
45 class StateMachineTransition;
46 class StateMachineContainer;
47 class StateMachineAction;
48 class StateMachineCondition;
49 class InteractionEvent;
50 class StateMachineState;
219 typedef std::map<std::string, ActionFunctionDelegate *> ActionDelegatesMapType;
220 typedef std::map<std::string, ConditionFunctionDelegate *> ConditionDelegatesMapType;
223 *m_StateMachineContainer;
224 ActionDelegatesMapType m_ActionDelegatesMap;
225 ConditionDelegatesMapType m_ConditionDelegatesMap;
228 bool m_MouseCursorSet;
Central node class of the MITK data tree, associating a data object with properties and mappers.
Provides state machine functionality for DataInteractors.
bool LoadStateMachine(const std::string &filename, const us::Module *module=nullptr)
Load a state machine pattern from an XML resource file.
bool HandleEvent(InteractionEvent *event, DataNode *dataNode)
Process an incoming interaction event.
void ResetToStartState()
ResetToStartState Reset state machine to it initial starting state.
void EnableInteraction(bool enable)
Enable or disable the state machine.
StateMachineState * GetCurrentState() const
mitkClassMacro(EventStateMachine, InteractionEventHandler)
void EnableUndo(bool enable)
Enable or disable the undo mechanism for this state machine.
itk::SmartPointer< StateMachineState > StateMachineStateType
virtual void ExecuteAction(StateMachineAction *action, InteractionEvent *interactionEvent)
~EventStateMachine() override
void AddConditionFunction(const std::string &condition, const ConditionFunctionDelegate &delegate)
void AddActionFunction(const std::string &action, const ActionFunctionDelegate &delegate)
virtual bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode)
virtual bool CheckCondition(const StateMachineCondition &condition, const InteractionEvent *interactionEvent)
void ResetMouseCursor()
Resets the mouse cursor to its original state.
StateMachineTransition * GetExecutableTransition(InteractionEvent *event)
Returns the executable transition for the given event.
MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
void SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY)
Sets the specified mouse cursor.
virtual void ConnectActionsAndFunctions()
UndoController * m_UndoController
MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
Base class for all objects that handle mitk::InteractionEvents.
Base class for all interaction events in MITK.
Abstract base class for message delegates with one parameter.
Abstract base class for message delegates with two parameters.
Represents an action that is executed after a certain event in the state machine mechanism.
Represents a condition, that has to be fulfilled in order to execute a state machine transition after...
Parses XML state machine descriptions and builds the state machine structure.
Represents a state of a state machine pattern.
Connects two states, and holds references to corresponding actions and conditions.
Controller that manages undo/redo operations by delegating to an UndoModel.
Represents a CppMicroServices module.
Find image slices visible on a given plane.