Medical Imaging Interaction Toolkit  2025.12.02
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 
49  {
50  public:
51  // Predefined internal events/signals
52  static const std::string IntDeactivateMe;
53  static const std::string IntLeaveWidget;
54  static const std::string IntEnterWidget;
55 
57 
58  itkFactorylessNewMacro(Self);
59 
60  itkCloneMacro(Self);
61 
63  virtual void SetDataNode(DataNode *dataNode); // TODO: Remove virtual, use DataNodeChanged instead in subclasses
64 
65  int GetLayer() const;
66 
68 
69  protected:
71  ~DataInteractor() override;
72 
86  void ConnectActionsAndFunctions() override;
87 
95  virtual void DataNodeChanged();
96 
100  void virtual NotifyStart();
101 
107  void virtual NotifyResultReady();
108 
109  private:
110  WeakPointer<DataNode> m_DataNode;
111  };
112 }
113 #endif
#define MITKCORE_EXPORT
Base class from with interactors that handle DataNodes are to be derived.
virtual void NotifyResultReady()
NotifyResultReady Sends ResultReady event via the mitk::DataNode.
ProcessEventMode GetMode() const
static const std::string IntEnterWidget
mitkClassMacro(DataInteractor, EventStateMachine)
DataNode * GetDataNode() const
virtual void SetDataNode(DataNode *dataNode)
static const std::string IntLeaveWidget
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
static const std::string IntDeactivateMe
virtual void NotifyStart()
Sends StartInteraction event via the mitk::DataNode.
void ConnectActionsAndFunctions() override
Overwrite this function to connect actions from StateMachine description with functions.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Find image slices visible on a given plane.
@ CONNECTEDMOUSEACTION
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)