Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkCrosshairVtkMapper2D.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 mitkCrosshairVtkMapper2D_h
14 #define mitkCrosshairVtkMapper2D_h
15 
16 #include <MitkCoreExports.h>
17 
18 #include <mitkBaseRenderer.h>
19 #include <mitkCrosshairData.h>
20 #include <mitkVtkMapper.h>
21 
22 #include <vtkSmartPointer.h>
23 
24 class vtkActor2D;
25 class vtkCellArray;
26 class vtkPropAssembly;
27 class vtkPolyDataMapper2D;
28 
29 namespace mitk
30 {
41  {
42  public:
43 
45  itkFactorylessNewMacro(Self);
46 
47  const CrosshairData* GetInput() const;
48 
50  void Update(mitk::BaseRenderer* renderer) override;
51 
52  vtkProp* GetVtkProp(BaseRenderer* renderer) override;
53 
54  static void SetDefaultProperties(DataNode* node, BaseRenderer* renderer = nullptr, bool overwrite = false);
55 
56  protected:
57 
59  ~CrosshairVtkMapper2D() override;
60 
63  {
64  public:
65 
66  LocalStorage();
67  ~LocalStorage() override;
68 
69  // actor
73  };
74 
77 
78  /* \brief Applies the color and opacity properties and calls CreateVTKRenderObjects */
79  void GenerateDataForRenderer(BaseRenderer *renderer) override;
80 
81  void CreateVtkCrosshair(BaseRenderer *renderer);
82 
83  void DrawLine(Point3D p0, Point3D p1, vtkCellArray* lines, vtkPoints* points);
84 
85  void ApplyAllProperties(BaseRenderer* renderer);
86  void ApplyColorAndOpacityProperties2D(BaseRenderer* renderer, vtkActor2D* actor);
87 
88  const int defaultGapSize;
89  };
90 
91 }
92 
93 #endif
mitk::CrosshairVtkMapper2D::LocalStorage::m_Mapper
vtkSmartPointer< vtkPolyDataMapper2D > m_Mapper
Definition: mitkCrosshairVtkMapper2D.h:71
vtkSmartPointer< vtkActor2D >
mitk::CrosshairVtkMapper2D::LocalStorage
Internal class holding the mapper, actor, etc. for each of the 2D render windows.
Definition: mitkCrosshairVtkMapper2D.h:62
mitk::CrosshairVtkMapper2D
Vtk-based 2D mapper for rendering a crosshair using vtk mapper.
Definition: mitkCrosshairVtkMapper2D.h:40
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::LocalStorageHandler< LocalStorage >
MitkCoreExports.h
mitk::CrosshairVtkMapper2D::m_LSH
LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all LocalStorages for the 2D render windows.
Definition: mitkCrosshairVtkMapper2D.h:76
mitk::Point< ScalarType, 3 >
mitk::CrosshairVtkMapper2D::LocalStorage::m_CrosshairAssembly
vtkSmartPointer< vtkPropAssembly > m_CrosshairAssembly
Definition: mitkCrosshairVtkMapper2D.h:72
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
mitk::CrosshairVtkMapper2D::LocalStorage::m_CrosshairActor
vtkSmartPointer< vtkActor2D > m_CrosshairActor
Definition: mitkCrosshairVtkMapper2D.h:70
mitk::CrosshairVtkMapper2D::defaultGapSize
const int defaultGapSize
Definition: mitkCrosshairVtkMapper2D.h:88
mitkVtkMapper.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::CrosshairData
Definition: mitkCrosshairData.h:21
mitkCrosshairData.h
mitkBaseRenderer.h
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.