17 #ifndef MITKEVENTSTATEMACHINE_H_
18 #define MITKEVENTSTATEMACHINE_H_
20 #include "itkObject.h"
33 #define CONNECT_FUNCTION(a, f) \
34 ::mitk::EventStateMachine::AddActionFunction( \
36 ::mitk::MessageDelegate2<Self, ::mitk::StateMachineAction *, ::mitk::InteractionEvent *, void>(this, &Self::f));
38 #define CONNECT_CONDITION(a, f) \
39 ::mitk::EventStateMachine::AddConditionFunction( \
40 a, ::mitk::MessageDelegate1<Self, const ::mitk::InteractionEvent *, bool>(this, &Self::f));
49 class StateMachineTransition;
50 class StateMachineContainer;
51 class StateMachineAction;
52 class StateMachineCondition;
53 class InteractionEvent;
54 class StateMachineState;
131 bool LoadStateMachine(const
std::
string &
filename, const
us::Module *module =
nullptr);
151 void EnableUndo(
bool enable) { m_UndoEnabled = enable; }
169 void AddActionFunction(
const std::string &action,
const ActionFunctionDelegate &delegate);
171 void AddConditionFunction(
const std::string &condition,
const ConditionFunctionDelegate &delegate);
179 void ResetToStartState();
220 void SetMouseCursor(
const char *xpm[],
int hotspotX,
int hotspotY);
227 void ResetMouseCursor();
254 typedef std::map<std::string, ActionFunctionDelegate *> ActionDelegatesMapType;
255 typedef std::map<std::string, ConditionFunctionDelegate *> ConditionDelegatesMapType;
258 *m_StateMachineContainer;
259 std::map<std::string, TActionFunctor *> m_ActionFunctionsMap;
260 ActionDelegatesMapType m_ActionDelegatesMap;
261 ConditionDelegatesMapType m_ConditionDelegatesMap;
264 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.
virtual bool DoAction(StateMachineAction *, InteractionEvent *)=0
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
static const std::string filename
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
std::map< std::string, TActionFunctor * > ActionFunctionsMapType
Connects two states, and holds references to corresponding actions and conditions.
UndoController * m_UndoController
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. ...