Medical Imaging Interaction Toolkit  2024.06.00
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 <vtkCubeSource.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 
41  vtkSmartPointer<vtkActor2D> m_HandleActor;
42  vtkSmartPointer<vtkActor2D> m_SelectedHandleActor;
45  vtkSmartPointer<vtkPolyDataMapper2D> m_SelectedHandleMapper;
47  vtkSmartPointer<vtkPlane> m_CuttingPlane;
48  unsigned int m_LastSliceNumber;
49  std::vector<vtkSmartPointer<vtkCubeSource>> 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);
63  itkCloneMacro(Self);
64 
65  void ApplyColorAndOpacityProperties(BaseRenderer *, vtkActor *) override;
66  vtkProp *GetVtkProp(BaseRenderer *renderer) override;
67 
68  private:
70  ~BoundingShapeVtkMapper2D() override;
71 
73  Self &operator=(const Self &);
74 
75  void GenerateDataForRenderer(BaseRenderer *renderer) override;
76  void Update(mitk::BaseRenderer *renderer) override;
77 
78  class Impl;
79  Impl *m_Impl;
80  };
81 }
82 
83 #endif
MITKBOUNDINGSHAPE_EXPORT
#define MITKBOUNDINGSHAPE_EXPORT
Definition: MitkBoundingShapeExports.h:15
mitk::BoundingShapeVtkMapper2D
Definition: mitkBoundingShapeVtkMapper2D.h:30
vtkSmartPointer< vtkActor >
MitkBoundingShapeExports.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
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::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.