Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkPlaneGeometryDataVtkMapper3D.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 mitkPlaneGeometryDataVtkMapper3D_h
14 #define mitkPlaneGeometryDataVtkMapper3D_h
15 
16 #include "mitkDataStorage.h"
18 #include "mitkVtkMapper.h"
19 #include "mitkWeakPointer.h"
20 #include <MitkCoreExports.h>
21 
22 #include <vtkCleanPolyData.h>
23 #include <vtkSystemIncludes.h>
24 
25 class vtkActor;
26 class vtkPolyDataMapper;
27 class vtkAssembly;
28 class vtkFeatureEdges;
29 class vtkTubeFilter;
30 class vtkTransformPolyDataFilter;
31 class vtkHedgeHog;
32 
33 namespace mitk
34 {
35  class PlaneGeometryData;
36  class BaseRenderer;
37  class ImageVtkMapper2D;
38  class DataStorage;
39 
43 
89  {
90  public:
92 
93  itkFactorylessNewMacro(Self);
94 
95  itkCloneMacro(Self);
96 
102  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
103  void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
104 
108  virtual const PlaneGeometryData *GetInput();
109 
117  virtual void SetDataStorageForTexture(mitk::DataStorage *storage);
118 
119  protected:
120  typedef std::multimap<int, vtkActor *> LayerSortedActorList;
121 
123 
124  ~PlaneGeometryDataVtkMapper3D() override;
125 
126  void GenerateDataForRenderer(BaseRenderer *renderer) override;
127 
128  void ProcessNode(DataNode *node, BaseRenderer *renderer, Surface *surface, LayerSortedActorList &layerSortedActors);
129 
130  void ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject &event);
131 
133  vtkAssembly *m_Prop3DAssembly;
134 
136  vtkAssembly *m_ImageAssembly;
137 
139 
140  BoundingBox::Pointer m_SurfaceCreatorBoundingBox;
141 
142  BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer;
143 
145  vtkFeatureEdges *m_Edges;
146 
148  vtkTransformPolyDataFilter *m_EdgeTransformer;
149 
151  vtkTubeFilter *m_EdgeTuber;
152 
154  vtkPolyDataMapper *m_EdgeMapper;
155 
157  vtkActor *m_EdgeActor;
158 
160  vtkPolyDataMapper *m_BackgroundMapper;
161 
163  vtkActor *m_BackgroundActor;
164 
166  vtkTransformPolyDataFilter *m_NormalsTransformer;
167 
169  vtkPolyDataMapper *m_FrontNormalsMapper;
170  vtkPolyDataMapper *m_BackNormalsMapper;
171 
173  vtkHedgeHog *m_FrontHedgeHog;
174  vtkHedgeHog *m_BackHedgeHog;
175 
179 
181  vtkCleanPolyData *m_Cleaner;
182 
185 
188 
190  {
191  public:
192  vtkActor *m_Actor;
193  // we do not need a smart-pointer, because we delete our
194  // connection, when the referenced mapper is destroyed
195  itk::Object *m_Sender;
196  unsigned long m_ObserverID;
197 
198  void Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command);
199 
200  ActorInfo();
201  ~ActorInfo();
202  };
203 
207  typedef std::map<ImageVtkMapper2D *, ActorInfo> ActorList;
209 
210  // responsibility to remove the observer upon its destruction
211  typedef itk::MemberCommand<PlaneGeometryDataVtkMapper3D> MemberCommandType;
212  MemberCommandType::Pointer m_ImageMapperDeletedCommand;
213  };
214 } // namespace mitk
215 #endif
mitk::PlaneGeometryDataVtkMapper3D::m_EdgeActor
vtkActor * m_EdgeActor
Actor for the tube-shaped frame.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:157
mitk::PlaneGeometryDataVtkMapper3D::m_EdgeTuber
vtkTubeFilter * m_EdgeTuber
Source to create the tube-shaped frame
Definition: mitkPlaneGeometryDataVtkMapper3D.h:151
mitk::PlaneGeometryDataVtkMapper3D::ActorInfo::m_Actor
vtkActor * m_Actor
Definition: mitkPlaneGeometryDataVtkMapper3D.h:192
mitk::PlaneGeometryDataVtkMapper3D
Vtk-based mapper to display a PlaneGeometry in a 3D window.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:88
mitk::PlaneGeometryDataVtkMapper3D::m_FrontHedgeHog
vtkHedgeHog * m_FrontHedgeHog
Generates lines for surface normals.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:173
mitkDataStorage.h
mitk::PlaneGeometryDataVtkMapper3D::m_ImageActors
ActorList m_ImageActors
Definition: mitkPlaneGeometryDataVtkMapper3D.h:208
mitk::PlaneGeometryDataVtkMapper3D::m_BackNormalsMapper
vtkPolyDataMapper * m_BackNormalsMapper
Definition: mitkPlaneGeometryDataVtkMapper3D.h:170
DEPRECATED
#define DEPRECATED(func)
Definition: mitkCommon.h:175
itk::SmartPointer< Self >
mitk::PlaneGeometryDataVtkMapper3D::ActorInfo::m_Sender
itk::Object * m_Sender
Definition: mitkPlaneGeometryDataVtkMapper3D.h:195
mitk::PlaneGeometryDataVtkMapper3D::ActorInfo::m_ObserverID
unsigned long m_ObserverID
Definition: mitkPlaneGeometryDataVtkMapper3D.h:196
mitk::PlaneGeometryDataVtkMapper3D::m_EdgeTransformer
vtkTransformPolyDataFilter * m_EdgeTransformer
Filter to apply object transform to the extracted edges.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:148
mitk::Surface
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:28
mitk::PlaneGeometryDataVtkMapper3D::LayerSortedActorList
std::multimap< int, vtkActor * > LayerSortedActorList
Definition: mitkPlaneGeometryDataVtkMapper3D.h:120
mitk::PlaneGeometryDataVtkMapper3D::m_FrontNormalsActor
vtkActor * m_FrontNormalsActor
Actor to hold the normals arrows.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:177
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlaneGeometryDataVtkMapper3D::m_ImageAssembly
vtkAssembly * m_ImageAssembly
PropAssembly to hold the planes.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:136
mitk::PlaneGeometryDataVtkMapper3D::m_DataStorage
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
The DataStorage defines which part of the data tree is traversed for rendering.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:187
mitk::PlaneGeometryDataVtkMapper3D::m_SurfaceCreatorPointsContainer
BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer
Definition: mitkPlaneGeometryDataVtkMapper3D.h:142
mitkPlaneGeometryDataToSurfaceFilter.h
mitk::PlaneGeometryDataVtkMapper3D::m_NormalsActorAdded
bool m_NormalsActorAdded
Definition: mitkPlaneGeometryDataVtkMapper3D.h:184
MitkCoreExports.h
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::PlaneGeometryDataVtkMapper3D::m_Cleaner
vtkCleanPolyData * m_Cleaner
Definition: mitkPlaneGeometryDataVtkMapper3D.h:181
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::PlaneGeometryDataVtkMapper3D::m_BackNormalsActor
vtkActor * m_BackNormalsActor
Definition: mitkPlaneGeometryDataVtkMapper3D.h:178
mitk::PlaneGeometryData
Data class containing PlaneGeometry objects.
Definition: mitkPlaneGeometryData.h:30
mitk::PlaneGeometryDataVtkMapper3D::ActorInfo
Definition: mitkPlaneGeometryDataVtkMapper3D.h:189
mitk::PlaneGeometryDataVtkMapper3D::m_SurfaceCreator
PlaneGeometryDataToSurfaceFilter::Pointer m_SurfaceCreator
Definition: mitkPlaneGeometryDataVtkMapper3D.h:138
mitk::PlaneGeometryDataVtkMapper3D::m_Edges
vtkFeatureEdges * m_Edges
Edge extractor for tube-shaped frame.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:145
mitk::PlaneGeometryDataVtkMapper3D::m_ImageMapperDeletedCommand
MemberCommandType::Pointer m_ImageMapperDeletedCommand
Definition: mitkPlaneGeometryDataVtkMapper3D.h:212
mitk::PlaneGeometryDataVtkMapper3D::m_NormalsTransformer
vtkTransformPolyDataFilter * m_NormalsTransformer
Transforms the surface before applying the glyph filter.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:166
mitk::PlaneGeometryDataVtkMapper3D::m_BackHedgeHog
vtkHedgeHog * m_BackHedgeHog
Definition: mitkPlaneGeometryDataVtkMapper3D.h:174
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitkVtkMapper.h
mitkWeakPointer.h
mitk::PlaneGeometryDataVtkMapper3D::MemberCommandType
itk::MemberCommand< PlaneGeometryDataVtkMapper3D > MemberCommandType
Definition: mitkPlaneGeometryDataVtkMapper3D.h:211
mitk::PlaneGeometryDataVtkMapper3D::m_BackgroundActor
vtkActor * m_BackgroundActor
Actor for black plane background.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:163
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::PlaneGeometryDataVtkMapper3D::m_EdgeMapper
vtkPolyDataMapper * m_EdgeMapper
Mapper for the tube-shaped frame
Definition: mitkPlaneGeometryDataVtkMapper3D.h:154
mitk::PlaneGeometryDataVtkMapper3D::m_FrontNormalsMapper
vtkPolyDataMapper * m_FrontNormalsMapper
Mapper for normals representation (thin lines)
Definition: mitkPlaneGeometryDataVtkMapper3D.h:169
mitk::PlaneGeometryDataVtkMapper3D::m_SurfaceCreatorBoundingBox
BoundingBox::Pointer m_SurfaceCreatorBoundingBox
Definition: mitkPlaneGeometryDataVtkMapper3D.h:140
mitk::PlaneGeometryDataVtkMapper3D::m_Prop3DAssembly
vtkAssembly * m_Prop3DAssembly
general PropAssembly to hold the entire scene
Definition: mitkPlaneGeometryDataVtkMapper3D.h:133
mitk::PlaneGeometryDataVtkMapper3D::m_BackgroundMapper
vtkPolyDataMapper * m_BackgroundMapper
Mapper for black plane background.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:160
mitk::WeakPointer< mitk::DataStorage >
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::PlaneGeometryDataVtkMapper3D::ActorList
std::map< ImageVtkMapper2D *, ActorInfo > ActorList
List holding the vtkActor to map the image into 3D for each ImageMapper.
Definition: mitkPlaneGeometryDataVtkMapper3D.h:207