Medical Imaging Interaction Toolkit  2023.12.99-77685e7b
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
14 #define mitkEnhancedPointSetVtkMapper3D_h
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
mitk::EnhancedPointSetVtkMapper3D::m_ConeSources
ConeSourceMap m_ConeSources
Definition: mitkEnhancedPointSetVtkMapper3D.h:107
mitk::PointSet::PointIdentifier
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:129
mitk::EnhancedPointSetVtkMapper3D::CylinderSourceMap
std::map< PointIdentifier, vtkCylinderSource * > CylinderSourceMap
Definition: mitkEnhancedPointSetVtkMapper3D.h:100
mitk::EnhancedPointSetVtkMapper3D::m_PointActors
ActorMap m_PointActors
Definition: mitkEnhancedPointSetVtkMapper3D.h:109
mitk::EnhancedPointSetVtkMapper3D::m_SphereSources
SphereSourceMap m_SphereSources
Definition: mitkEnhancedPointSetVtkMapper3D.h:105
mitk::EnhancedPointSetVtkMapper3D::m_Contour
vtkActor * m_Contour
Definition: mitkEnhancedPointSetVtkMapper3D.h:112
MitkMapperExtExports.h
mitk::EnhancedPointSetVtkMapper3D::m_CubeSources
CubeSourceMap m_CubeSources
Definition: mitkEnhancedPointSetVtkMapper3D.h:106
mitk::EnhancedPointSetVtkMapper3D::ActorMap
std::map< PointIdentifier, ActorAndPointType > ActorMap
Definition: mitkEnhancedPointSetVtkMapper3D.h:103
mitk::EnhancedPointSetVtkMapper3D::m_ContourSource
vtkTubeFilter * m_ContourSource
Definition: mitkEnhancedPointSetVtkMapper3D.h:113
mitk::EnhancedPointSetVtkMapper3D::m_CylinderSources
CylinderSourceMap m_CylinderSources
Definition: mitkEnhancedPointSetVtkMapper3D.h:108
mitkPointSet.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::LocalStorageHandler< BaseLocalStorage >
mitk::EnhancedPointSetVtkMapper3D::SphereSourceMap
std::map< PointIdentifier, vtkSphereSource * > SphereSourceMap
Definition: mitkEnhancedPointSetVtkMapper3D.h:97
mitk::EnhancedPointSetVtkMapper3D::CubeSourceMap
std::map< PointIdentifier, vtkCubeSource * > CubeSourceMap
Definition: mitkEnhancedPointSetVtkMapper3D.h:98
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::EnhancedPointSetVtkMapper3D::ActorAndPointType
std::pair< vtkActor *, mitk::PointSpecificationType > ActorAndPointType
Definition: mitkEnhancedPointSetVtkMapper3D.h:102
mitkCommon.h
mitk::EnhancedPointSetVtkMapper3D::PointIdentifier
mitk::PointSet::PointIdentifier PointIdentifier
Definition: mitkEnhancedPointSetVtkMapper3D.h:96
mitk::EnhancedPointSetVtkMapper3D::m_LSH
LocalStorageHandler< BaseLocalStorage > m_LSH
Definition: mitkEnhancedPointSetVtkMapper3D.h:80
mitkVtkMapper.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::EnhancedPointSetVtkMapper3D
Alternative Vtk-based 3D mapper for mitk::PointSet.
Definition: mitkEnhancedPointSetVtkMapper3D.h:63
mitk::PointSet
Data structure which stores a set of points.
Definition: mitkPointSet.h:71
mitk::EnhancedPointSetVtkMapper3D::m_PropAssembly
vtkAssembly * m_PropAssembly
Definition: mitkEnhancedPointSetVtkMapper3D.h:115
mitkVector.h
mitk::EnhancedPointSetVtkMapper3D::ConeSourceMap
std::map< PointIdentifier, vtkConeSource * > ConeSourceMap
Definition: mitkEnhancedPointSetVtkMapper3D.h:99
mitkBaseRenderer.h
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
MITKMAPPEREXT_EXPORT
#define MITKMAPPEREXT_EXPORT
Definition: MitkMapperExtExports.h:15
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.