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