Medical Imaging Interaction Toolkit  2016.11.0
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,
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 MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
18 #define MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
19 
20 #include "mitkDataStorage.h"
22 #include "mitkVtkMapper.h"
23 #include "mitkWeakPointer.h"
24 #include <MitkCoreExports.h>
25 
26 #include <vtkCleanPolyData.h>
27 #include <vtkSystemIncludes.h>
28 
29 class vtkActor;
30 class vtkPolyDataMapper;
31 class vtkAssembly;
32 class vtkFeatureEdges;
33 class vtkTubeFilter;
34 class vtkTransformPolyDataFilter;
35 class vtkHedgeHog;
36 
37 namespace mitk
38 {
39  class PlaneGeometryData;
40  class BaseRenderer;
41  class ImageVtkMapper2D;
42  class DataStorage;
43 
47 
99  {
100  public:
102 
103  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
104 
110  virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
111  virtual void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
112 
116  virtual const PlaneGeometryData *GetInput();
117 
125  virtual void SetDataStorageForTexture(mitk::DataStorage *storage);
126 
127  protected:
128  typedef std::multimap<int, vtkActor *> LayerSortedActorList;
129 
131 
132  virtual ~PlaneGeometryDataVtkMapper3D();
133 
134  virtual void GenerateDataForRenderer(BaseRenderer *renderer) override;
135 
136  void ProcessNode(DataNode *node, BaseRenderer *renderer, Surface *surface, LayerSortedActorList &layerSortedActors);
137 
138  void ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject &event);
139 
141  vtkAssembly *m_Prop3DAssembly;
142 
144  vtkAssembly *m_ImageAssembly;
145 
147 
148  BoundingBox::Pointer m_SurfaceCreatorBoundingBox;
149 
150  BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer;
151 
153  vtkFeatureEdges *m_Edges;
154 
156  vtkTransformPolyDataFilter *m_EdgeTransformer;
157 
159  vtkTubeFilter *m_EdgeTuber;
160 
162  vtkPolyDataMapper *m_EdgeMapper;
163 
165  vtkActor *m_EdgeActor;
166 
168  vtkPolyDataMapper *m_BackgroundMapper;
169 
171  vtkActor *m_BackgroundActor;
172 
174  vtkTransformPolyDataFilter *m_NormalsTransformer;
175 
177  vtkPolyDataMapper *m_FrontNormalsMapper;
178  vtkPolyDataMapper *m_BackNormalsMapper;
179 
181  vtkHedgeHog *m_FrontHedgeHog;
182  vtkHedgeHog *m_BackHedgeHog;
183 
185  vtkActor *m_FrontNormalsActor;
186  vtkActor *m_BackNormalsActor;
187 
189  vtkCleanPolyData *m_Cleaner;
190 
192  bool m_NormalsActorAdded;
193 
196 
198  {
199  public:
200  vtkActor *m_Actor;
201  // we do not need a smart-pointer, because we delete our
202  // connection, when the referenced mapper is destroyed
203  itk::Object *m_Sender;
204  unsigned long m_ObserverID;
205 
206  void Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command);
207 
208  ActorInfo();
209  ~ActorInfo();
210  };
211 
215  typedef std::map<ImageVtkMapper2D *, ActorInfo> ActorList;
216  ActorList m_ImageActors;
217 
218  // responsiblity to remove the observer upon its destruction
219  typedef itk::MemberCommand<PlaneGeometryDataVtkMapper3D> MemberCommandType;
221  };
222 } // namespace mitk
223 #endif /* MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F */
itk::MemberCommand< PlaneGeometryDataVtkMapper3D > MemberCommandType
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:32
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
Data management class that handles 'was created by' relations.
itk::SmartPointer< Self > Pointer
std::map< ImageVtkMapper2D *, ActorInfo > ActorList
List holding the vtkActor to map the image into 3D for each ImageMapper.
#define MITKCORE_EXPORT
Organizes the rendering process.
Superclass of all classes having a PlaneGeometryData as input and generating Images as output...
STL namespace.
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
std::multimap< int, vtkActor * > LayerSortedActorList
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
#define DEPRECATED(func)
Definition: mitkCommon.h:183
mitk::DataStorage::Pointer m_DataStorage
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Data class containing PlaneGeometry objects.
Implements a weak reference to an object.
Vtk-based mapper to display a PlaneGeometry in a 3D windowUses a PlaneGeometryDataToSurfaceFilter obj...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66