Medical Imaging Interaction Toolkit  2024.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 
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 
62  DataNode *GetDataNode() const;
63  virtual void SetDataNode(DataNode *dataNode); // TODO: Remove virtual, use DataNodeChanged instead in subclasses
64 
65  int GetLayer() const;
66 
67  ProcessEventMode GetMode() const;
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
mitk::GRABINPUT
@ GRABINPUT
Definition: mitkDataInteractor.h:36
mitk::DataInteractor::IntDeactivateMe
static const std::string IntDeactivateMe
Definition: mitkDataInteractor.h:52
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::EventStateMachine
‍**
Definition: mitkEventStateMachine.h:111
mitk::PREFERINPUT
@ PREFERINPUT
Definition: mitkDataInteractor.h:37
MitkCoreExports.h
mitk::REGULAR
@ REGULAR
Definition: mitkDataInteractor.h:35
mitk::DataInteractor::IntLeaveWidget
static const std::string IntLeaveWidget
Definition: mitkDataInteractor.h:53
mitkCommon.h
mitk::ProcessEventMode
ProcessEventMode
Definition: mitkDataInteractor.h:34
mitkWeakPointer.h
mitkEventStateMachine.h
mitk::CONNECTEDMOUSEACTION
@ CONNECTEDMOUSEACTION
Definition: mitkDataInteractor.h:38
mitk::DataInteractor::IntEnterWidget
static const std::string IntEnterWidget
Definition: mitkDataInteractor.h:54
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::DataInteractor
Base class from with interactors that handle DataNodes are to be derived.
Definition: mitkDataInteractor.h:48
mitk::WeakPointer
Definition: mitkWeakPointer.h:22
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::itkEventMacroDeclaration
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)