Medical Imaging Interaction Toolkit  2024.06.00
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 (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 mitkSurfaceVtkMapper3D_h
14 #define mitkSurfaceVtkMapper3D_h
15 
16 #include "mitkBaseRenderer.h"
18 #include "mitkVtkMapper.h"
19 #include <MitkCoreExports.h>
20 #include <mitkSurface.h>
21 
22 #include <vtkActor.h>
23 #include <vtkDepthSortPolyData.h>
24 #include <vtkPlaneCollection.h>
25 #include <vtkPolyDataMapper.h>
26 #include <vtkPolyDataNormals.h>
27 #include <vtkSmartPointer.h>
28 
29 namespace mitk
30 {
75  {
76  public:
78 
79  itkFactorylessNewMacro(Self);
80 
81  itkCloneMacro(Self);
82 
83  itkSetMacro(GenerateNormals, bool);
84 
85  itkGetMacro(GenerateNormals, bool);
86 
87  virtual const mitk::Surface *GetInput();
88 
89  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
90 
91  virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
92 
93  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
94 
95  protected:
97 
98  ~SurfaceVtkMapper3D() override;
99 
100  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
101 
102  void ResetMapper(mitk::BaseRenderer *renderer) override;
103 
106  virtual void CheckForClippingProperty(mitk::BaseRenderer *renderer, mitk::BaseProperty *property);
107 
109 
110  public:
112  {
113  public:
119  itk::TimeStamp m_ShaderTimestampUpdate;
120 
122  {
123  m_VtkPolyDataMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
124  m_VtkPolyDataNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
125  m_Actor = vtkSmartPointer<vtkActor>::New();
126  m_ClippingPlaneCollection = vtkSmartPointer<vtkPlaneCollection>::New();
127 
128  m_Actor->SetMapper(m_VtkPolyDataMapper);
129 
131  }
132 
133  ~LocalStorage() override {}
134  };
135 
137 
138  static void ApplyMitkPropertiesToVtkProperty(mitk::DataNode *node,
139  vtkProperty *property,
140  mitk::BaseRenderer *renderer);
141  static void SetDefaultPropertiesForVtkProperty(mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite);
142  };
143 } // namespace mitk
144 
145 #endif
mitk::SurfaceVtkMapper3D::LocalStorage::m_ClippingPlaneCollection
vtkSmartPointer< vtkPlaneCollection > m_ClippingPlaneCollection
Definition: mitkSurfaceVtkMapper3D.h:117
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:36
mitkLocalStorageHandler.h
mitk::SurfaceVtkMapper3D::LocalStorage::m_VtkPolyDataNormals
vtkSmartPointer< vtkPolyDataNormals > m_VtkPolyDataNormals
Definition: mitkSurfaceVtkMapper3D.h:116
mitk::SurfaceVtkMapper3D::m_GenerateNormals
bool m_GenerateNormals
Definition: mitkSurfaceVtkMapper3D.h:108
vtkSmartPointer< vtkActor >
mitk::SurfaceVtkMapper3D::LocalStorage
Definition: mitkSurfaceVtkMapper3D.h:111
mitk::Surface
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:28
mitk::SurfaceVtkMapper3D::m_LSH
mitk::LocalStorageHandler< LocalStorage > m_LSH
Definition: mitkSurfaceVtkMapper3D.h:136
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitkSurface.h
mitk::LocalStorageHandler< LocalStorage >
mitk::SurfaceVtkMapper3D::LocalStorage::~LocalStorage
~LocalStorage() override
Definition: mitkSurfaceVtkMapper3D.h:133
mitk::SurfaceVtkMapper3D::LocalStorage::m_Actor
vtkSmartPointer< vtkActor > m_Actor
Definition: mitkSurfaceVtkMapper3D.h:114
MitkCoreExports.h
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::SurfaceVtkMapper3D::LocalStorage::m_DepthSort
vtkSmartPointer< vtkDepthSortPolyData > m_DepthSort
Definition: mitkSurfaceVtkMapper3D.h:118
mitk::SurfaceVtkMapper3D::LocalStorage::m_VtkPolyDataMapper
vtkSmartPointer< vtkPolyDataMapper > m_VtkPolyDataMapper
Definition: mitkSurfaceVtkMapper3D.h:115
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::Mapper::BaseLocalStorage
Base class for mapper specific rendering resources.
Definition: mitkMapper.h:190
mitkVtkMapper.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::SurfaceVtkMapper3D::LocalStorage::m_ShaderTimestampUpdate
itk::TimeStamp m_ShaderTimestampUpdate
Definition: mitkSurfaceVtkMapper3D.h:119
mitkBaseRenderer.h
mitk::SurfaceVtkMapper3D
Vtk-based mapper for Surfaces.
Definition: mitkSurfaceVtkMapper3D.h:74
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.
mitk::SurfaceVtkMapper3D::LocalStorage::LocalStorage
LocalStorage()
Definition: mitkSurfaceVtkMapper3D.h:121