Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
Medical Imaging Interaction Toolkit
mitkBoundingShapeVtkMapper2D.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 mitkBoundingShapeVtkMapper2D_h
14 #define mitkBoundingShapeVtkMapper2D_h
15 
16 #include <mitkVtkMapper.h>
17 
19 
20 #include <vtkActor2D.h>
21 #include <vtkCutter.h>
22 #include <vtkPlane.h>
23 #include <vtkPolyDataMapper2D.h>
24 #include <vtkPropAssembly.h>
25 #include <vtkSmartPointer.h>
26 #include <vtkSphereSource.h>
27 
28 namespace mitk
29 {
31  {
32  class LocalStorage : public Mapper::BaseLocalStorage
33  {
34  public:
35  LocalStorage();
36  ~LocalStorage() override;
37 
38  bool IsUpdateRequired(mitk::BaseRenderer *renderer, mitk::Mapper *mapper, mitk::DataNode *dataNode);
39 
40  vtkSmartPointer<vtkActor> m_Actor;
41  vtkSmartPointer<vtkActor2D> m_HandleActor;
42  vtkSmartPointer<vtkActor2D> m_SelectedHandleActor;
43  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
44  vtkSmartPointer<vtkPolyDataMapper2D> m_HandleMapper;
45  vtkSmartPointer<vtkPolyDataMapper2D> m_SelectedHandleMapper;
46  vtkSmartPointer<vtkCutter> m_Cutter;
47  vtkSmartPointer<vtkPlane> m_CuttingPlane;
48  unsigned int m_LastSliceNumber;
49  std::vector<vtkSmartPointer<vtkSphereSource>> m_Handles;
50  vtkSmartPointer<vtkPropAssembly> m_PropAssembly;
51  double m_ZoomFactor;
52 
53  private:
54  LocalStorage(const LocalStorage &);
55  LocalStorage &operator=(const LocalStorage &);
56  };
57 
58  public:
59  static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer = nullptr, bool overwrite = false);
60 
62  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
63 
64  void ApplyColorAndOpacityProperties(BaseRenderer *, vtkActor *) override;
65  vtkProp *GetVtkProp(BaseRenderer *renderer) override;
66 
67  private:
69  ~BoundingShapeVtkMapper2D() override;
70 
72  Self &operator=(const Self &);
73 
74  void GenerateDataForRenderer(BaseRenderer *renderer) override;
75  void Update(mitk::BaseRenderer *renderer) override;
76 
77  class Impl;
78  Impl *m_Impl;
79  };
80 }
81 
82 #endif
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:193
#define MITKBOUNDINGSHAPE_EXPORT
Organizes the rendering process.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
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
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64