Medical Imaging Interaction Toolkit  2024.06.99-c1478648
Medical Imaging Interaction Toolkit
mitkVtkEventProvider.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 mitkVtkEventProvider_h
14 #define mitkVtkEventProvider_h
15 
16 #include "mitkRenderWindow.h"
17 #include <MitkCoreExports.h>
18 
19 #include "vtkInteractorObserver.h"
20 
21 namespace mitk
22 {
28  class MITKCORE_EXPORT vtkEventProvider : public vtkInteractorObserver
29  {
30  public:
31  static vtkEventProvider *New();
32  vtkTypeMacro(vtkEventProvider, vtkInteractorObserver);
33 
34  // Satisfy the superclass API. Enable/disable listening for events.
35  void SetEnabled(int) override;
36  void SetInteractor(vtkRenderWindowInteractor *iren) override;
37 
38  // Interface to MITK
39  virtual void SetMitkRenderWindow(mitk::RenderWindow *renWin);
40  mitk::RenderWindow *GetRenderWindow();
41 
42  protected:
44  ~vtkEventProvider() override;
45 
46  // methods for processing events - callback for the observer/command pattern of vtkCommand
47  static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata);
48 
50 
51  // adds the MITK interaction event types to the VTK observer/command pattern
52  void AddInteractionEvent(unsigned long ievent);
53  // removes the MITK interaction event types
54  void RemoveInteractionEvent(unsigned long ievent);
55  typedef std::vector<unsigned long> InteractionEventsVectorType;
57 
58  private:
59  vtkEventProvider(const vtkEventProvider &); // Not implemented.
60  void operator=(const vtkEventProvider &); // Not implemented.
61  };
62 }
63 #endif
mitkRenderWindow.h
mitk::vtkEventProvider::m_RenderWindow
mitk::RenderWindow * m_RenderWindow
Definition: mitkVtkEventProvider.h:49
mitk::RenderWindow
mitkRenderWindow integrates the MITK rendering mechanism into VTK and is NOT QT dependent
Definition: mitkRenderWindow.h:31
mitk::vtkEventProvider::InteractionEventsVectorType
std::vector< unsigned long > InteractionEventsVectorType
Definition: mitkVtkEventProvider.h:55
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::vtkEventProvider
Integrates into the VTK event mechanism to generate MITK specific events. This class is NON-QT depend...
Definition: mitkVtkEventProvider.h:28
MitkCoreExports.h
mitk::vtkEventProvider::m_InteractionEventsVector
InteractionEventsVectorType m_InteractionEventsVector
Definition: mitkVtkEventProvider.h:56
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15