diff --git a/Core/Documentation/Doxygen/Concepts/DataInteractionTechnical.dox b/Core/Documentation/Doxygen/Concepts/DataInteractionTechnical.dox index 64b413a13b..45e2f161b5 100644 --- a/Core/Documentation/Doxygen/Concepts/DataInteractionTechnical.dox +++ b/Core/Documentation/Doxygen/Concepts/DataInteractionTechnical.dox @@ -1,116 +1,116 @@ /** \page DataInteractionTechnicalPage Interaction Concept Implementation \tableofcontents This page describes some technicalities of the implementation and the workflow, for a detailed list of tutorials see \ref FurtherReadingInteraction . \section DataInteractionTechnicalPage_Introduction Description of Interaction Concept Implementation in MITK \section DispatcherSection Dispatcher After an event is received by the Dispatcher it is given to a DataInteractor that has to decide if it can process this event. On a high level this is done by the mitk::EventStateMachine. First the state machine asks if the received event is known in the configuration. If it does the matching variant name is returned. Then the state machine checks if there exists a transition in its current state that is triggered by this event variant. If this is the case all actions that are associated with this transition are queried and executed. The actions themselves are implemented on DataInteractor level. The following diagram illustrates the process: \image html sm_and_config.png Each BaseRenderer creates a mitk::BindDispatcherInteractor object which encapsulates the connection between the DataStorage and the Dispatcher, and thereby allowing a DataInteractor to register with a Dispatcher when only knowing the DataNode. BindDispatcherInteractor creates a new Dispatcher object and registers for DataNode events at the DataStorage, as a callback function the Dispatchers AddDataInteractor() and RemoveDataInteractor() functions are set. \dot digraph { node [shape=record, fontname=Helvetica, fontsize=10]; a [ label="{BaseRenderer|m_BindDispatcherInteractor}"]; b [ label="{BindDispatcherInteractor|m_Dispatcher\n m_DataStorage}" ]; c [ label="Dispatcher" ]; d [ label="DataStorage" ]; a -> b; b -> c; b -> d; } \enddot This way the Dispatcher is notified about all changes regarding DataNodes that are shown in the BaseRenderer. When a node is added, remove or modified the Dispatcher can check it a DataInterator is set, and accordingly add or remove this DataInteractor from its internal list. \dot digraph { node [shape=record, fontname=Helvetica, fontsize=10]; d [ label="DataInteractor" ]; a [ label="DataNode" ]; b [ label="DataStorage" ]; c [ label="Dispatcher" ]; e [ label="BaseRenderer"] edge [fontname=Helvetica, fontsize=10] d -> a [label="SetDataInteractor(this)"]; a -> b [label="Modified()"]; b -> c [label="NodeModified(dataNode)"]; e -> c [label="HandleEvent(interactionEvent)"]; { rank=same; b c a } { rank=same; e } } \enddot Events that are generated within the scope of the BaseRenderer are sent to the associated Dispatcher to be handled. \subsection DispatcherEventDistSection Event Distribution A Dispatcher can operate in different processing modes, which determine how the interactor that receives an event is chosen. These modes are managed and set by the Dispatcher itself. \section StateMachineSection State Machine & Configuration A mitk::EventStateMachine points to a \b state, which in turn references \b transitions (which describe a change from one state to another) and \b actions (indicating which functions are executed when a transition is taken). \dot digraph { node [shape=record, fontname=Helvetica, fontsize=10]; d [ label="{StateMachine|m_CurrentState}" ]; a [ label="{StateMachineState|m_Transitions}" ]; b [ label="{StateMachineTransitions|m_Actions}"]; c [ label="{StateMachineAction}"]; edge [fontname=Helvetica, fontsize=10] d -> a [label="1 : 1"]; a -> b [label="1 : n"]; b -> c [label="1 : n"]; } \enddot */ \ No newline at end of file