NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
mitkImage2DToTexturePlaneMapper3D.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 mitk2DImageToTexturePlaneMapper3D_h
16 #define mitk2DImageToTexturePlaneMapper3D_h
17 
18 #include "niftkIGIExports.h"
19 
20 #include <mitkVtkMapper.h>
21 #include <mitkBaseRenderer.h>
22 #include <vtkSmartPointer.h>
23 #include <mitkLocalStorageHandler.h>
24 
25 class vtkPoints;
26 class vtkFloatArray;
27 class vtkCellArray;
28 class vtkPolyData;
29 class vtkTexture;
30 class vtkPolyDataMapper;
31 class vtkActor;
32 
33 namespace mitk {
34 
35 class Image;
36 
40 class NIFTKIGI_EXPORT Image2DToTexturePlaneMapper3D : public VtkMapper
41 {
42 public:
43  mitkClassMacro(Image2DToTexturePlaneMapper3D, VtkMapper)
44  itkNewMacro(Self)
45 
46  virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
47  virtual const mitk::Image* GetInput();
48 
49 protected:
52 
57  class LocalStorage : public mitk::Mapper::BaseLocalStorage
58  {
59  public:
60 
61  LocalStorage();
62  ~LocalStorage();
63 
64  vtkSmartPointer<vtkFloatArray> m_PointArray;
65  vtkSmartPointer<vtkFloatArray> m_TextureArray;
66  vtkSmartPointer<vtkFloatArray> m_NormalsArray;
67  vtkSmartPointer<vtkPoints> m_Points;
68  vtkSmartPointer<vtkCellArray> m_CellArray;
69  vtkSmartPointer<vtkPolyData> m_PolyData;
70  vtkSmartPointer<vtkTexture> m_Texture;
71  vtkSmartPointer<vtkPolyDataMapper> m_PolyDataMapper;
72  vtkSmartPointer<vtkActor> m_Actor;
73 
74  unsigned long int m_NumberOfPoints;
75 
76  itk::TimeStamp m_ShaderTimestampUpdate;
77  };
78 
79  mitk::LocalStorageHandler<LocalStorage> m_LocalStorage;
80 
81  virtual void GenerateDataForRenderer(mitk::BaseRenderer* renderer) override;
82  virtual void ResetMapper( mitk::BaseRenderer* renderer ) override;
83 
84 };
85 
86 } // namespace mitk
87 
88 #endif
89 
vtkSmartPointer< vtkFloatArray > m_PointArray
Definition: mitkImage2DToTexturePlaneMapper3D.h:64
Contains the VTK objects necessary to render the mitk::Image.
Definition: mitkImage2DToTexturePlaneMapper3D.h:57
itk::TimeStamp m_ShaderTimestampUpdate
Definition: mitkImage2DToTexturePlaneMapper3D.h:76
vtkSmartPointer< vtkPolyDataMapper > m_PolyDataMapper
Definition: mitkImage2DToTexturePlaneMapper3D.h:71
vtkSmartPointer< vtkFloatArray > m_TextureArray
Definition: mitkImage2DToTexturePlaneMapper3D.h:65
Definition: ReceptorMemberCommandTest.cxx:25
vtkSmartPointer< vtkPoints > m_Points
Definition: mitkImage2DToTexturePlaneMapper3D.h:67
mitk::LocalStorageHandler< LocalStorage > m_LocalStorage
Definition: mitkImage2DToTexturePlaneMapper3D.h:79
Vtk-based mapper for a 2D image, that displays a texture mapped plane in 3D space.
Definition: mitkImage2DToTexturePlaneMapper3D.h:40
vtkSmartPointer< vtkActor > m_Actor
Definition: mitkImage2DToTexturePlaneMapper3D.h:72
unsigned long int m_NumberOfPoints
Definition: mitkImage2DToTexturePlaneMapper3D.h:74
vtkSmartPointer< vtkCellArray > m_CellArray
Definition: mitkImage2DToTexturePlaneMapper3D.h:68
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
vtkSmartPointer< vtkPolyData > m_PolyData
Definition: mitkImage2DToTexturePlaneMapper3D.h:69
vtkSmartPointer< vtkTexture > m_Texture
Definition: mitkImage2DToTexturePlaneMapper3D.h:70
vtkSmartPointer< vtkFloatArray > m_NormalsArray
Definition: mitkImage2DToTexturePlaneMapper3D.h:66