Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkVtkLayerController.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 mitkVtkLayerController_h
14 #define mitkVtkLayerController_h
15 
16 #include <MitkCoreExports.h>
17 #include <map>
18 #include <vector>
19 #include <vtkSmartPointer.h>
20 
21 class vtkRenderWindow;
22 class vtkRenderer;
23 
24 namespace mitk
25 {
35  {
36  public:
37  static VtkLayerController *GetInstance(vtkSmartPointer<vtkRenderWindow> renWin);
38  static void AddInstance(vtkSmartPointer<vtkRenderWindow> renWin, vtkSmartPointer<vtkRenderer> mitkSceneRenderer);
39  static void RemoveInstance(vtkSmartPointer<vtkRenderWindow> renWin);
40 
42  virtual ~VtkLayerController();
43 
47  vtkSmartPointer<vtkRenderer> GetSceneRenderer();
48 
54  void InsertBackgroundRenderer(vtkSmartPointer<vtkRenderer> renderer, bool forceAbsoluteBackground);
55 
61  void InsertForegroundRenderer(vtkSmartPointer<vtkRenderer> renderer, bool forceAbsoluteForeground);
62 
67  void InsertSceneRenderer(vtkSmartPointer<vtkRenderer> renderer);
68 
72  void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renwin);
73 
78  void RemoveRenderer(vtkSmartPointer<vtkRenderer> renderer);
79 
83  bool IsRendererInserted(vtkSmartPointer<vtkRenderer> renderer);
84 
88  unsigned int GetNumberOfRenderers();
89 
90  void SetEraseForAllRenderers(int i);
91 
92  protected:
94 
95  private:
101  void UpdateLayers();
102 
103  // Layer Management
104  typedef std::vector<vtkSmartPointer<vtkRenderer>> RendererVectorType;
105  RendererVectorType m_BackgroundRenderers;
106  RendererVectorType m_SceneRenderers;
107  RendererVectorType m_ForegroundRenderers;
108 
109  typedef std::map<const vtkSmartPointer<vtkRenderWindow>, mitk::VtkLayerController *> vtkLayerControllerMapType;
110  static vtkLayerControllerMapType s_LayerControllerMap;
111  };
112 
113 } // Namespace MITK
114 #endif
mitk::VtkLayerController::m_RenderWindow
vtkSmartPointer< vtkRenderWindow > m_RenderWindow
Definition: mitkVtkLayerController.h:93
vtkSmartPointer< vtkRenderWindow >
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
mitk::VtkLayerController
Definition: mitkVtkLayerController.h:34
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15