Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
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 MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
14 #define MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
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;
208  ActorList m_ImageActors;
209 
210  // responsiblity to remove the observer upon its destruction
211  typedef itk::MemberCommand<PlaneGeometryDataVtkMapper3D> MemberCommandType;
212  MemberCommandType::Pointer m_ImageMapperDeletedCommand;
213  };
214 } // namespace mitk
215 #endif /* MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F */
itk::MemberCommand< PlaneGeometryDataVtkMapper3D > MemberCommandType
vtkActor * m_FrontNormalsActor
Actor to hold the normals arrows.
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:28
Data management class that handles &#39;was created by&#39; relations.
std::map< ImageVtkMapper2D *, ActorInfo > ActorList
List holding the vtkActor to map the image into 3D for each ImageMapper.
#define MITKCORE_EXPORT
PlaneGeometryDataToSurfaceFilter::Pointer m_SurfaceCreator
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
The DataStorage defines which part of the data tree is traversed for renderering. ...
vtkTransformPolyDataFilter * m_NormalsTransformer
Transforms the suface before applying the glyph filter.
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
vtkPolyDataMapper * m_BackgroundMapper
Mapper for black plane background.
std::multimap< int, vtkActor * > LayerSortedActorList
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
#define DEPRECATED(func)
Definition: mitkCommon.h:175
vtkAssembly * m_Prop3DAssembly
general PropAssembly to hold the entire scene
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
vtkPolyDataMapper * m_EdgeMapper
Mapper for the tube-shaped frame.
Data class containing PlaneGeometry objects.
vtkHedgeHog * m_FrontHedgeHog
Generates lines for surface normals.
Vtk-based mapper to display a PlaneGeometry in a 3D windowUses a PlaneGeometryDataToSurfaceFilter obj...
vtkAssembly * m_ImageAssembly
PropAssembly to hold the planes.
vtkFeatureEdges * m_Edges
Edge extractor for tube-shaped frame.
BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer
vtkTubeFilter * m_EdgeTuber
Source to create the tube-shaped frame.
vtkTransformPolyDataFilter * m_EdgeTransformer
Filter to apply object transform to the extracted edges.
vtkActor * m_BackgroundActor
Actor for black plane background.
vtkPolyDataMapper * m_FrontNormalsMapper
Mapper for normals representation (thin lines)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
vtkActor * m_EdgeActor
Actor for the tube-shaped frame.