Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPointSetVtkMapper3D.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 MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
18 #define MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
19 
20 #include "mitkBaseRenderer.h"
21 #include "mitkVtkMapper.h"
22 #include <MitkCoreExports.h>
23 #include <vtkSmartPointer.h>
24 
25 class vtkActor;
26 class vtkCellArray;
27 class vtkPropAssembly;
28 class vtkAppendPolyData;
29 class vtkPolyData;
30 class vtkTubeFilter;
31 class vtkPolyDataMapper;
32 class vtkTransformPolyDataFilter;
33 
34 namespace mitk
35 {
36  class PointSet;
37 
95  {
96  public:
98 
99  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
100 
101  virtual const mitk::PointSet *GetInput();
102 
103  // overwritten from VtkMapper3D to be able to return a
104  // m_PointsAssembly which is much faster than a vtkAssembly
105  virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
106  virtual void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
107 
108  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = NULL, bool overwrite = false);
109 
110  /*
111  * \deprecatedSince{2013_12} Use ReleaseGraphicsResources(mitk::BaseRenderer* renderer) instead
112  */
113  DEPRECATED(void ReleaseGraphicsResources(vtkWindow *renWin));
114 
115  void ReleaseGraphicsResources(mitk::BaseRenderer *renderer) override;
116 
118 
119  protected:
121 
122  virtual ~PointSetVtkMapper3D();
123 
124  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
125  virtual void ResetMapper(BaseRenderer *renderer) override;
126  virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
127  virtual void CreateContour(vtkPoints *points, vtkCellArray *connections);
128  virtual void CreateVTKRenderObjects();
129  virtual void VertexRendering();
130 
132  vtkSmartPointer<vtkPoints> m_WorldPositions;
134  vtkSmartPointer<vtkCellArray> m_PointConnections;
135 
136  vtkSmartPointer<vtkAppendPolyData> m_vtkSelectedPointList;
137  vtkSmartPointer<vtkAppendPolyData> m_vtkUnselectedPointList;
138 
139  vtkSmartPointer<vtkPoints> m_VtkPoints;
140  vtkSmartPointer<vtkCellArray> m_VtkPointConnections;
141 
142  vtkSmartPointer<vtkTransformPolyDataFilter> m_VtkPointsTransformer;
143 
144  vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
145  vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
146 
147  vtkSmartPointer<vtkActor> m_SelectedActor;
148  vtkSmartPointer<vtkActor> m_UnselectedActor;
149  vtkSmartPointer<vtkActor> m_ContourActor;
150 
151  vtkSmartPointer<vtkPropAssembly> m_PointsAssembly;
152 
153  // help for contour between points
154  vtkSmartPointer<vtkAppendPolyData> m_vtkTextList;
155 
156  // variables to be able to log, how many inputs have been added to PolyDatas
157  unsigned int m_NumberOfSelectedAdded;
158  unsigned int m_NumberOfUnselectedAdded;
159 
160  // variables to check if an update of the vtk objects is needed
161  ScalarType m_PointSize;
162  ScalarType m_ContourRadius;
163  bool m_VertexRendering;
164  };
165 
166 } // namespace mitk
167 
168 #endif /* MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273 */
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:200
#define MITKCORE_EXPORT
double ScalarType
Templated class for management of LocalStorage implementations in Mappers.
Organizes the rendering process.
DataCollection - Class to facilitate loading/accessing structured data.
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
#define DEPRECATED(func)
Definition: mitkCommon.h:183
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Vtk-based mapper for PointSet.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66