NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkBitmapOverlay.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkBitmapOverlay_h
16 #define niftkBitmapOverlay_h
17 
18 #include "niftkIGIOverlayEditorExports.h"
19 #include <mitkBaseData.h>
20 #include <mitkDataNode.h>
21 #include <mitkDataStorage.h>
22 #include <vtkSmartPointer.h>
23 
24 class vtkRenderer;
25 class vtkRenderWindow;
26 class vtkMapper;
27 class vtkImageActor;
28 class vtkImageMapper;
29 
30 namespace niftk
31 {
32 
37 class NIFTKIGIOVERLAYEDITOR_EXPORT BitmapOverlay : public itk::Object
38 {
39 public:
40 
41  mitkClassMacroItkParent( BitmapOverlay, itk::Object )
42  itkNewMacro( Self )
43 
44 
47  void SetDataStorage (mitk::DataStorage::Pointer);
48 
52  virtual vtkRenderer* GetVtkRenderer();
53 
58  virtual void SetRenderWindow( vtkRenderWindow* renderWindow );
59 
63  itkGetMacro(RenderWindow, vtkRenderWindow*);
64 
68  void SetOpacity(const double& opacity);
69  itkGetMacro(Opacity, double);
70 
74  itkSetMacro(FlipViewUp, bool);
75  itkGetMacro(FlipViewUp, bool);
76 
80  virtual bool IsEnabled();
81 
86  virtual void Enable();
87 
92  virtual void Disable();
93 
97  virtual void SetEnabled(const bool& enable);
98 
104  virtual bool SetNode(const mitk::DataNode* node);
105 
110  void SetupCamera();
111 
115  void NodeChanged(const mitk::DataNode* node);
116 
120  void NodeAdded(const mitk::DataNode* node);
121 
125  void NodeRemoved(const mitk::DataNode* node);
126 
127  void SetClippingRange(const double& nearZ, const double& farZ);
128  void GetClippingRange(double& nearZ, double& farZ);
129 
130 protected:
131 
132  BitmapOverlay(); // Purposefully hidden.
133  virtual ~BitmapOverlay(); // Purposefully hidden.
134 
135  BitmapOverlay(const BitmapOverlay&); // Purposefully not implemented.
136  BitmapOverlay& operator=(const BitmapOverlay&); // Purposefully not implemented.
137 
138 private:
139 
140  // We don't own this, so neither do we delete this.
141  vtkRenderWindow* m_RenderWindow;
142 
143  vtkSmartPointer<vtkRenderer> m_BackRenderer;
144  vtkSmartPointer<vtkRenderer> m_FrontRenderer;
145  vtkSmartPointer<vtkImageActor> m_BackActor;
146  vtkSmartPointer<vtkImageActor> m_FrontActor;
147 
148  mitk::DataStorage::Pointer m_DataStorage;
149  mitk::DataNode::Pointer m_ImageDataNode;
150  bool m_IsEnabled;
151  double m_Opacity;
152  bool m_FlipViewUp;
153  double m_ClippingRange[2];
154 };
155 
156 } // end namespace
157 
158 #endif
Used to draw a 2D image into the background of a VTK Render Window.
Definition: niftkBitmapOverlay.h:37
GLboolean enable
Definition: glew.h:2642
Definition: niftkExceptionObject.h:21