Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkEnhancedPointSetVtkMapper3D.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 MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
14 #define MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
15 
16 #include "MitkMapperExtExports.h"
17 #include "mitkBaseRenderer.h"
18 #include "mitkCommon.h"
19 #include "mitkPointSet.h"
20 #include "mitkVector.h"
21 #include "mitkVtkMapper.h"
22 
23 class vtkActor;
24 class vtkAssembly;
25 class vtkSphereSource;
26 class vtkCubeSource;
27 class vtkConeSource;
28 class vtkCylinderSource;
29 class vtkTubeFilter;
30 class vtkProp;
31 
32 namespace mitk
33 {
64  {
65  public:
67 
68  itkFactorylessNewMacro(Self);
69 
70  itkCloneMacro(Self);
71 
72  virtual const mitk::PointSet *GetInput();
73 
74  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
75 
76  void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
77 
78  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
79 
81 
82  protected:
84 
85  ~EnhancedPointSetVtkMapper3D() override;
86 
87  void RemoveEntryFromSourceMaps(mitk::PointSet::PointIdentifier pointID);
88  void DeleteVtkObject(vtkObject *o); // functor for stl_each in destructor
89 
90  // update all vtk sources, mappers, actors with current data and properties
91  void UpdateVtkObjects();
92 
93  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
94  void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
95 
97  typedef std::map<PointIdentifier, vtkSphereSource *> SphereSourceMap;
98  typedef std::map<PointIdentifier, vtkCubeSource *> CubeSourceMap;
99  typedef std::map<PointIdentifier, vtkConeSource *> ConeSourceMap;
100  typedef std::map<PointIdentifier, vtkCylinderSource *> CylinderSourceMap;
101 
102  typedef std::pair<vtkActor *, mitk::PointSpecificationType> ActorAndPointType;
103  typedef std::map<PointIdentifier, ActorAndPointType> ActorMap;
104 
105  SphereSourceMap m_SphereSources; // stores all sphere sources
106  CubeSourceMap m_CubeSources; // stores all cube sources
107  ConeSourceMap m_ConeSources; // stores all cone sources
108  CylinderSourceMap m_CylinderSources; // stores all cylinder sources
109  ActorMap m_PointActors; // stores an actor for each point(referenced by its ID) and the currently used pointspec =
110  // which source type is generating the polydata
111 
112  vtkActor *m_Contour;
113  vtkTubeFilter *m_ContourSource;
114 
115  vtkAssembly *m_PropAssembly; // this contains everything, this will be returned by GetVtkProp()
116  };
117 } // namespace mitk
118 
119 #endif /* MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273 */
std::map< PointIdentifier, ActorAndPointType > ActorMap
std::map< PointIdentifier, vtkConeSource * > ConeSourceMap
std::map< PointIdentifier, vtkCubeSource * > CubeSourceMap
#define MITKMAPPEREXT_EXPORT
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:48
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:49
std::map< PointIdentifier, vtkCylinderSource * > CylinderSourceMap
std::map< PointIdentifier, vtkSphereSource * > SphereSourceMap
Alternative Vtk-based 3D mapper for mitk::PointSet.
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:133
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:75
mitk::PointSet::PointIdentifier PointIdentifier
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
std::pair< vtkActor *, mitk::PointSpecificationType > ActorAndPointType
LocalStorageHandler< BaseLocalStorage > m_LSH
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57