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;
127 bool LoadStateMachine(
const std::string &filename,
const us::Module *module =
nullptr);
165 void AddActionFunction(
const std::string &action,
const ActionFunctionDelegate &delegate);
167 void AddConditionFunction(
const std::string &condition,
const ConditionFunctionDelegate &delegate);
175 void ResetToStartState();
183 virtual void ConnectActionsAndFunctions();
216 void SetMouseCursor(
const char *xpm[],
int hotspotX,
int hotspotY);
223 void ResetMouseCursor();
250 typedef std::map<std::string, ActionFunctionDelegate *> ActionDelegatesMapType;
251 typedef std::map<std::string, ConditionFunctionDelegate *> ConditionDelegatesMapType;
254 *m_StateMachineContainer;
255 std::map<std::string, TActionFunctor *> m_ActionFunctionsMap;
256 ActionDelegatesMapType m_ActionDelegatesMap;
257 ConditionDelegatesMapType m_ConditionDelegatesMap;
258 StateMachineStateType m_CurrentState;
260 bool m_MouseCursorSet;
Base class of ActionFunctors, to provide an easy to connect actions with functions.
MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
DataCollection - Class to facilitate loading/accessing structured data.
void EnableInteraction(bool enable)
Enables/disables the state machine. In un-enabled state it won't react to any events.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
std::map< std::string, TActionFunctor * > ActionFunctionsMapType
Connects two states, and holds references to corresponding actions and conditions.
UndoController * m_UndoController
void EnableUndo(bool enable)
Enables or disabled Undo.
itk::SmartPointer< StateMachineState > StateMachineStateType
Represents a condition, that has to be fulfilled in order to execute a state machine transition after...
MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
Class for nodes of the DataTree.
virtual ~TActionFunctor()
Super-class that provides the functionality of a StateMachine to DataInteractors. ...