Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSurfaceVtkMapper3D.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 mitkSurfaceVtkMapper3D_h
18 #define mitkSurfaceVtkMapper3D_h
19 
20 #include "mitkBaseRenderer.h"
22 #include "mitkVtkMapper.h"
23 #include <MitkCoreExports.h>
24 #include <mitkSurface.h>
25 
26 #include <vtkActor.h>
27 #include <vtkDepthSortPolyData.h>
28 #include <vtkPainterPolyDataMapper.h>
29 #include <vtkPlaneCollection.h>
30 #include <vtkPolyDataMapper.h>
31 #include <vtkPolyDataNormals.h>
32 #include <vtkSmartPointer.h>
33 
34 namespace mitk
35 {
80  {
81  public:
83 
84  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
85 
86  itkSetMacro(GenerateNormals, bool);
87 
88  itkGetMacro(GenerateNormals, bool);
89 
90  virtual const mitk::Surface *GetInput();
91 
92  virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
93 
94  virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
95 
96  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = NULL, bool overwrite = false);
97 
98  protected:
100 
101  virtual ~SurfaceVtkMapper3D();
102 
103  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
104 
105  virtual void ResetMapper(mitk::BaseRenderer *renderer) override;
106 
109  virtual void CheckForClippingProperty(mitk::BaseRenderer *renderer, mitk::BaseProperty *property);
110 
111  bool m_GenerateNormals;
112 
113  public:
115  {
116  public:
117  vtkSmartPointer<vtkActor> m_Actor;
118  vtkSmartPointer<vtkPainterPolyDataMapper> m_VtkPolyDataMapper;
119  vtkSmartPointer<vtkPolyDataNormals> m_VtkPolyDataNormals;
120  vtkSmartPointer<vtkPlaneCollection> m_ClippingPlaneCollection;
121  vtkSmartPointer<vtkDepthSortPolyData> m_DepthSort;
122  itk::TimeStamp m_ShaderTimestampUpdate;
123 
125  {
126  m_VtkPolyDataMapper = vtkSmartPointer<vtkPainterPolyDataMapper>::New();
127  m_VtkPolyDataNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
128  m_Actor = vtkSmartPointer<vtkActor>::New();
129  m_ClippingPlaneCollection = vtkSmartPointer<vtkPlaneCollection>::New();
130 
131  m_Actor->SetMapper(m_VtkPolyDataMapper);
132 
134  }
135 
137  };
138 
140 
141  static void ApplyMitkPropertiesToVtkProperty(mitk::DataNode *node,
142  vtkProperty *property,
143  mitk::BaseRenderer *renderer);
144  static void SetDefaultPropertiesForVtkProperty(mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite);
145  };
146 } // namespace mitk
147 
148 #endif /* mitkSurfaceVtkMapper3D_h */
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:32
vtkSmartPointer< vtkDepthSortPolyData > m_DepthSort
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:200
#define MITKCORE_EXPORT
mitk::LocalStorageHandler< LocalStorage > m_LSH
vtkSmartPointer< vtkPlaneCollection > m_ClippingPlaneCollection
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:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
Abstract base class for properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Vtk-based mapper for Surfaces.
vtkSmartPointer< vtkPolyDataNormals > m_VtkPolyDataNormals
vtkSmartPointer< vtkPainterPolyDataMapper > m_VtkPolyDataMapper
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.