Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
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 VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
14 #define VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
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;
56  InteractionEventsVectorType m_InteractionEventsVector;
57 
58  private:
59  vtkEventProvider(const vtkEventProvider &); // Not implemented.
60  void operator=(const vtkEventProvider &); // Not implemented.
61  };
62 }
63 #endif /* VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723 */
InteractionEventsVectorType m_InteractionEventsVector
std::vector< unsigned long > InteractionEventsVectorType
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Integrates into the VTK event mechanism to generate MITK specific events. This class is NON-QT depend...
mitk::RenderWindow * m_RenderWindow
mitkRenderWindow integrates the MITK rendering mechanism into VTK and is NOT QT dependent ...