Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
mitknnInteractiveInteractor.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 mitknnInteractiveInteractor_h
14 #define mitknnInteractiveInteractor_h
15 
16 #include <mitknnInteractiveEnums.h>
17 #include <mitkMessage.h>
18 
19 namespace mitk
20 {
21  class DataStorage;
22  class InteractionEvent;
23  class ToolManager;
24 }
25 
26 namespace mitk::nnInteractive
27 {
58  {
59  public:
60  virtual ~Interactor();
61 
67  InteractionType GetType() const;
68 
76  void SetToolManager(ToolManager* toolManager);
77 
84  void HandleEvent(InteractionEvent* event);
85 
99  void Enable(PromptType promptType);
100 
110  void Disable();
111 
114  bool IsEnabled() const;
115 
125  void Reset();
126 
133  std::string GetIcon() const;
134 
141  std::string GetCursor(PromptType promptType) const;
142 
148  virtual bool HasInteractions() const = 0;
149 
155 
156  protected:
171 
179  virtual void OnSetToolManager() {};
180 
190  virtual void OnHandleEvent(InteractionEvent* /*event*/) {};
191 
199  virtual void OnEnable() = 0;
200 
208  virtual void OnDisable() = 0;
209 
220  virtual void OnReset() = 0;
221 
228  ToolManager* GetToolManager() const;
229 
236  DataStorage* GetDataStorage() const;
237 
244  PromptType GetCurrentPromptType() const;
245 
246  private:
247  class Impl;
248  std::unique_ptr<Impl> m_Impl;
249  };
250 }
251 
252 #endif
mitk::nnInteractive::InteractionMode
InteractionMode
Specifies the interaction modes for interactors.
Definition: mitknnInteractiveEnums.h:55
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::nnInteractive
Definition: mitknnInteractiveBoxInteractor.h:23
mitk::Message1< bool >
mitk::nnInteractive::PromptType
PromptType
Specifies the types of prompts used in nnInteractive.
Definition: mitknnInteractiveEnums.h:72
mitk::nnInteractive::InteractionType
InteractionType
Specifies the types of interactions available.
Definition: mitknnInteractiveEnums.h:34
mitk::nnInteractive::Interactor::UpdatePreviewEvent
Message1< bool > UpdatePreviewEvent
Event triggered after an interaction has occurred.
Definition: mitknnInteractiveInteractor.h:154
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ToolManager
Manages and coordinates instances of mitk::Tool.
Definition: mitkToolManager.h:78
mitk::nnInteractive::InteractionMode::Default
@ Default
MITKPYTHONSEGMENTATION_EXPORT
#define MITKPYTHONSEGMENTATION_EXPORT
Definition: MitkPythonSegmentationExports.h:15
mitkMessage.h
mitknnInteractiveEnums.h
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitk::nnInteractive::Interactor
Base class for all nnInteractive interactors.
Definition: mitknnInteractiveInteractor.h:57
mitk::nnInteractive::Interactor::OnSetToolManager
virtual void OnSetToolManager()
Called when a ToolManager is assigned.
Definition: mitknnInteractiveInteractor.h:179
mitk::nnInteractive::Interactor::OnHandleEvent
virtual void OnHandleEvent(InteractionEvent *)
Called when an interaction event for a tool is received.
Definition: mitknnInteractiveInteractor.h:190