Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
18 #define VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
19 
20 #include "mitkRenderWindow.h"
21 #include <MitkCoreExports.h>
22 
23 #include "vtkInteractorObserver.h"
24 
25 namespace mitk
26 {
32  class MITKCORE_EXPORT vtkEventProvider : public vtkInteractorObserver
33  {
34  public:
35  static vtkEventProvider *New();
36  vtkTypeMacro(vtkEventProvider, vtkInteractorObserver);
37 
38  // Satisfy the superclass API. Enable/disable listening for events.
39  virtual void SetEnabled(int) override;
40  virtual void SetInteractor(vtkRenderWindowInteractor *iren) override;
41 
42  // Interface to MITK
43  virtual void SetMitkRenderWindow(mitk::RenderWindow *renWin);
44  mitk::RenderWindow *GetRenderWindow();
45 
46  protected:
49 
50  // methods for processing events - callback for the observer/command pattern of vtkCommand
51  static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata);
52 
54 
55  // adds the MITK interaction event types to the VTK observer/command pattern
56  void AddInteractionEvent(unsigned long ievent);
57  // removes the MITK interaction event types
58  void RemoveInteractionEvent(unsigned long ievent);
59  typedef std::vector<unsigned long> InteractionEventsVectorType;
60  InteractionEventsVectorType m_InteractionEventsVector;
61 
62  private:
63  vtkEventProvider(const vtkEventProvider &); // Not implemented.
64  void operator=(const vtkEventProvider &); // Not implemented.
65  };
66 }
67 #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 ...
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.