Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkDataInteractor.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDataInteractor_h
14 #define mitkDataInteractor_h
15 
16 #include <MitkCoreExports.h>
17 #include <mitkCommon.h>
18 #include <mitkEventStateMachine.h>
19 #include <mitkWeakPointer.h>
20 #include <string>
21 
22 namespace mitk
23 {
24  class DataNode;
25 
26  itkEventMacroDeclaration(DataInteractorEvent, itk::AnyEvent);
27 
29  itkEventMacroDeclaration(StartInteraction, DataInteractorEvent);
30 
32  itkEventMacroDeclaration(ResultReady, DataInteractorEvent);
33 
35  REGULAR = 0,
36  GRABINPUT = 1,
39  };
40 
60  {
61  public:
63  static const std::string IntDeactivateMe;
65  static const std::string IntLeaveWidget;
67  static const std::string IntEnterWidget;
68 
70 
71  itkFactorylessNewMacro(Self);
72 
73  itkCloneMacro(Self);
74 
80 
89  virtual void SetDataNode(DataNode *dataNode);
90 
98  int GetLayer() const;
99 
111 
112  protected:
114  ~DataInteractor() override;
115 
129  void ConnectActionsAndFunctions() override;
130 
138  virtual void DataNodeChanged();
139 
143  void virtual NotifyStart();
144 
150  void virtual NotifyResultReady();
151 
152  private:
153  WeakPointer<DataNode> m_DataNode;
154  };
155 }
156 #endif
#define MITKCORE_EXPORT
Base class for interactors that operate on DataNodes.
virtual void NotifyResultReady()
NotifyResultReady Sends ResultReady event via the mitk::DataNode.
ProcessEventMode GetMode() const
Get the current event processing mode from the state machine's current state.
static const std::string IntEnterWidget
Internal signal name indicating the pointer entered the widget area.
mitkClassMacro(DataInteractor, EventStateMachine)
DataNode * GetDataNode() const
Get the DataNode associated with this interactor.
virtual void SetDataNode(DataNode *dataNode)
Set the DataNode that this interactor operates on.
static const std::string IntLeaveWidget
Internal signal name indicating the pointer left the widget area.
virtual void DataNodeChanged()
Is called when a DataNode is initially set or changed To be implemented by sub-classes for initializa...
~DataInteractor() override
int GetLayer() const
Get the rendering layer of the associated DataNode.
static const std::string IntDeactivateMe
Internal signal name to request deactivation of this interactor.
virtual void NotifyStart()
Sends StartInteraction event via the mitk::DataNode.
void ConnectActionsAndFunctions() override
Overwrite this function to connect actions from StateMachine description with functions.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Provides state machine functionality for DataInteractors.
A weak pointer that observes an itk::Object without preventing its deletion.
Find image slices visible on a given plane.
@ CONNECTEDMOUSEACTION
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)