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