Medical Imaging Interaction Toolkit  2021.02.99-4e0dbe47
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 (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 MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
14 #define MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
15 
16 #include "mitkBaseRenderer.h"
17 #include "mitkVtkMapper.h"
18 #include <MitkCoreExports.h>
19 #include <vtkSmartPointer.h>
20 
21 class vtkActor;
22 class vtkCellArray;
23 class vtkPropAssembly;
24 class vtkAppendPolyData;
25 class vtkPolyData;
26 class vtkTubeFilter;
27 class vtkPolyDataMapper;
28 class vtkTransformPolyDataFilter;
29 
30 namespace mitk
31 {
32  class PointSet;
33 
91  {
92  public:
94 
95  itkFactorylessNewMacro(Self);
96 
97  itkCloneMacro(Self);
98 
99  virtual const mitk::PointSet *GetInput();
100 
101  // overwritten from VtkMapper3D to be able to return a
102  // m_PointsAssembly which is much faster than a vtkAssembly
103  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
104  void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
105 
106  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
107 
108  /*
109  * \deprecatedSince{2013_12} Use ReleaseGraphicsResources(mitk::BaseRenderer* renderer) instead
110  */
111  DEPRECATED(void ReleaseGraphicsResources(vtkWindow *renWin));
112 
113  void ReleaseGraphicsResources(mitk::BaseRenderer *renderer) override;
114 
116 
117  protected:
119 
120  ~PointSetVtkMapper3D() override;
121 
122  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
123  void ResetMapper(BaseRenderer *renderer) override;
124  virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
125  virtual void CreateContour(vtkPoints *points, vtkCellArray *connections);
126  virtual void CreateVTKRenderObjects();
127 
129  vtkSmartPointer<vtkPoints> m_WorldPositions;
131  vtkSmartPointer<vtkCellArray> m_PointConnections;
132 
133  vtkSmartPointer<vtkAppendPolyData> m_vtkSelectedPointList;
134  vtkSmartPointer<vtkAppendPolyData> m_vtkUnselectedPointList;
135 
136  vtkSmartPointer<vtkPoints> m_VtkPoints;
137  vtkSmartPointer<vtkCellArray> m_VtkPointConnections;
138 
139  vtkSmartPointer<vtkTransformPolyDataFilter> m_VtkPointsTransformer;
140 
141  vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
142  vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
143 
144  vtkSmartPointer<vtkActor> m_SelectedActor;
145  vtkSmartPointer<vtkActor> m_UnselectedActor;
146  vtkSmartPointer<vtkActor> m_ContourActor;
147 
148  vtkSmartPointer<vtkPropAssembly> m_PointsAssembly;
149 
150  // help for contour between points
151  vtkSmartPointer<vtkAppendPolyData> m_vtkTextList;
152 
153  // variables to be able to log, how many inputs have been added to PolyDatas
156 
157  // variables to check if an update of the vtk objects is needed
160  };
161 
162 } // namespace mitk
163 
164 #endif /* MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273 */
vtkSmartPointer< vtkPropAssembly > m_PointsAssembly
#define MITKCORE_EXPORT
LocalStorageHandler< BaseLocalStorage > m_LSH
double ScalarType
vtkSmartPointer< vtkTransformPolyDataFilter > m_VtkPointsTransformer
vtkSmartPointer< vtkPolyDataMapper > m_VtkUnselectedPolyDataMapper
Organizes the rendering process.
vtkSmartPointer< vtkCellArray > m_VtkPointConnections
DataCollection - Class to facilitate loading/accessing structured data.
vtkSmartPointer< vtkActor > m_ContourActor
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:48
vtkSmartPointer< vtkAppendPolyData > m_vtkUnselectedPointList
vtkSmartPointer< vtkAppendPolyData > m_vtkTextList
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:49
#define DEPRECATED(func)
Definition: mitkCommon.h:179
vtkSmartPointer< vtkPolyDataMapper > m_VtkSelectedPolyDataMapper
vtkSmartPointer< vtkActor > m_UnselectedActor
Data structure which stores a set of points.
Definition: mitkPointSet.h:71
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
vtkSmartPointer< vtkPoints > m_VtkPoints
vtkSmartPointer< vtkPoints > m_WorldPositions
All point positions, already in world coordinates.
vtkSmartPointer< vtkActor > m_SelectedActor
vtkSmartPointer< vtkAppendPolyData > m_vtkSelectedPointList
Vtk-based mapper for PointSet.
vtkSmartPointer< vtkCellArray > m_PointConnections
All connections between two points (used for contour drawing)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57