Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitkGizmoMapper2D.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 mitkGizmoMapper2D_h
14 #define mitkGizmoMapper2D_h
15 
16 #include <mitkVtkMapper.h>
17 
18 #include <vtkPolyDataMapper.h>
19 
20 namespace mitk
21 {
22  // forward declaration
23  class Gizmo;
24 
36  {
37  public:
39  itkFactorylessNewMacro(Self);
40  itkCloneMacro(Self);
41 
47  static void SetDefaultProperties(mitk::DataNode *node,
48  mitk::BaseRenderer *renderer = nullptr,
49  bool overwrite = false);
50 
52  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override { return m_LSH.GetLocalStorage(renderer)->m_Actor; }
54  void ResetMapper(mitk::BaseRenderer *renderer) override;
55 
58  vtkPolyData *GetVtkPolyData(mitk::BaseRenderer *renderer);
59 
60  private:
62  const Gizmo *GetInput();
63 
65  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
66 
68  void ApplyVisualProperties(BaseRenderer *renderer);
69 
71  class LocalStorage : public Mapper::BaseLocalStorage
72  {
73  public:
75  vtkSmartPointer<vtkActor> m_Actor;
76 
79  vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
80 
82  itk::TimeStamp m_LastUpdateTime;
83 
84  LocalStorage();
85  };
86 
89  };
90 
91 } // namespace
92 
93 #endif
L * GetLocalStorage(mitk::BaseRenderer *forRenderer)
Retrieves a LocalStorage for a specific BaseRenderer.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:193
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
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:49
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
Return the vtkProp that represents the "rendering result".
void ResetMapper(mitk::BaseRenderer *renderer) override
"Resets" the mapper, setting its result to invisible.
vtkPolyData * GetVtkPolyData(mitk::BaseRenderer *renderer)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
mitkClassMacro(GizmoMapper2D, VtkMapper)