Medical Imaging Interaction Toolkit  2026.06.00
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 
76  virtual const mitk::PointSet *GetInput();
77 
83  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
84 
89  void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
90 
97  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
98 
100 
101  protected:
103 
105 
107  void DeleteVtkObject(vtkObject *o); // functor for stl_each in destructor
108 
109  // update all vtk sources, mappers, actors with current data and properties
111 
112  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
113  void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
114 
116  typedef std::map<PointIdentifier, vtkSphereSource *> SphereSourceMap;
117  typedef std::map<PointIdentifier, vtkCubeSource *> CubeSourceMap;
118  typedef std::map<PointIdentifier, vtkConeSource *> ConeSourceMap;
119  typedef std::map<PointIdentifier, vtkCylinderSource *> CylinderSourceMap;
120 
121  typedef std::pair<vtkActor *, mitk::PointSpecificationType> ActorAndPointType;
122  typedef std::map<PointIdentifier, ActorAndPointType> ActorMap;
123 
124  SphereSourceMap m_SphereSources; // stores all sphere sources
125  CubeSourceMap m_CubeSources; // stores all cube sources
126  ConeSourceMap m_ConeSources; // stores all cone sources
127  CylinderSourceMap m_CylinderSources; // stores all cylinder sources
128  ActorMap m_PointActors; // stores an actor for each point(referenced by its ID) and the currently used pointspec =
129  // which source type is generating the polydata
130 
131  vtkActor *m_Contour;
132  vtkTubeFilter *m_ContourSource;
133 
134  vtkAssembly *m_PropAssembly; // this contains everything, this will be returned by GetVtkProp()
135  };
136 } // namespace mitk
137 
138 #endif
#define MITKMAPPEREXT_EXPORT
Organizes the rendering process.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Alternative Vtk-based 3D mapper for mitk::PointSet.
std::pair< vtkActor *, mitk::PointSpecificationType > ActorAndPointType
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override
Apply color and opacity properties read from the PropertyList to the given vtkActor.
std::map< PointIdentifier, ActorAndPointType > ActorMap
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
Get the VTK prop assembly containing all point actors.
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override
Update the VTK transform for the given renderer.
void DeleteVtkObject(vtkObject *o)
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
mitk::PointSet::PointIdentifier PointIdentifier
std::map< PointIdentifier, vtkSphereSource * > SphereSourceMap
std::map< PointIdentifier, vtkConeSource * > ConeSourceMap
LocalStorageHandler< BaseLocalStorage > m_LSH
std::map< PointIdentifier, vtkCylinderSource * > CylinderSourceMap
virtual const mitk::PointSet * GetInput()
Get the PointSet input data.
void RemoveEntryFromSourceMaps(mitk::PointSet::PointIdentifier pointID)
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Set default rendering properties for enhanced point set visualization.
mitkClassMacro(EnhancedPointSetVtkMapper3D, VtkMapper)
std::map< PointIdentifier, vtkCubeSource * > CubeSourceMap
Data structure which stores a set of points.
Definition: mitkPointSet.h:71
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:143
Base class of all VTK-based Mappers for displaying primitives using VTK functionality.
Definition: mitkVtkMapper.h:53
Find image slices visible on a given plane.