Medical Imaging Interaction Toolkit  2021.10.99-fd647480
Medical Imaging Interaction Toolkit
mitkDisplayActionEventHandler.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 MITKDISPLAYACTIONEVENTHANDLER_H
14 #define MITKDISPLAYACTIONEVENTHANDLER_H
15 
16 #include <MitkCoreExports.h>
17 
18 // mitk core
21 #include "mitkStdFunctionCommand.h"
22 
23 namespace mitk
24 {
34  {
35  public:
36 
37  using OberserverTagType = unsigned long;
38 
39  virtual ~DisplayActionEventHandler();
40 
52  void SetObservableBroadcast(DisplayActionEventBroadcast* observableBroadcast);
53 
70  OberserverTagType ConnectDisplayActionEvent(const DisplayActionEvent& displayActionEvent,
71  const StdFunctionCommand::ActionFunction& actionFunction,
72  const StdFunctionCommand::FilterFunction& filterFunction = [](const itk::EventObject&) { return true; });
73 
84  void DisconnectObserver(OberserverTagType observerTag);
85 
86  const std::vector<OberserverTagType>& GetAllObserverTags() { return m_ObserverTags; }
87 
98  void InitActions();
99 
100  protected:
101 
106  virtual void InitActionsImpl() { }
107 
109  std::vector<OberserverTagType> m_ObserverTags;
110 
111  };
112 
113 } // end namespace mitk
114 
115 #endif // MITKDISPLAYACTIONEVENTHANDLER_H
std::vector< OberserverTagType > m_ObserverTags
#define MITKCORE_EXPORT
const std::vector< OberserverTagType > & GetAllObserverTags()
virtual void InitActionsImpl()
Sub-classes need to implement this function to define a customized behavior for default action pre-de...
DataCollection - Class to facilitate loading/accessing structured data.
This class simplifies the process of adding an itkEventObject-itkCommand pair as an observer of a Dis...
std::function< void(const itk::EventObject &)> ActionFunction
WeakPointer< DisplayActionEventBroadcast > m_ObservableBroadcast
This class serves as an event state machine while simultaneously observing interaction events...
std::function< bool(const itk::EventObject &)> FilterFunction