Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPlaneGeometryDataMapper2D.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 mitkPlaneGeometryDataMapper2D_h
14 #define mitkPlaneGeometryDataMapper2D_h
15 
16 #include <mitkBaseRenderer.h>
17 #include <mitkVtkMapper.h>
18 #include <MitkCoreExports.h>
19 #include <vtkSmartPointer.h>
20 
21 class vtkActor2D;
22 class vtkPropAssembly;
23 class vtkCellArray;
24 class vtkPolyDataMapper2D;
25 
26 namespace mitk
27 {
48  {
49  public:
51 
52  itkFactorylessNewMacro(Self);
53 
54  itkCloneMacro(Self);
55 
57  virtual const mitk::PlaneGeometryData *GetInput() const;
58 
64  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
65 
70  virtual void ApplyAllProperties(BaseRenderer *renderer);
71 
78  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
79 
82  {
83  public:
84  /* constructor */
86 
87  /* destructor */
88  ~LocalStorage() override;
89 
90  // actor
98  };
99 
102 
103  protected:
104  /* constructor */
106 
107  /* destructor */
109 
111  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
112 
115 
117  static bool TestPointInPlaneGeometry(const PlaneGeometry *planeGeometry, const Point3D &point);
118 
120  static bool TestPointInReferenceGeometry(const BaseGeometry *referenceGeometry, const Point3D &point);
121 
123  static bool CutCrossLineWithPlaneGeometry(const PlaneGeometry *planeGeometry, Line3D &crossLine);
124 
126  static bool CutCrossLineWithReferenceGeometry(const BaseGeometry *referenceGeometry, Line3D &crossLine);
127 
129  void DrawLine(Point3D p0, Point3D p1, vtkCellArray *lines, vtkPoints *points);
130 
131  // member variables holding the current value of the properties used in this mapper
132  typedef std::vector<DataNode *> NodesVectorType;
134 
135  typedef std::set<Self *> AllInstancesContainer;
137 
140 
141  void ApplyColorAndOpacityProperties2D(BaseRenderer *renderer, vtkActor2D *actor);
143  vtkSmartPointer<vtkPoints> triPoints,
144  double triangleSizeMM,
145  Vector3D &orthogonalVector,
146  Point3D &point1,
147  Point3D &point2);
148  };
149 } // namespace mitk
150 #endif
#define MITKCORE_EXPORT
Abstract base class describing the geometry of a data object.
Organizes the rendering process.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Describes a line in N-dimensional space.
Definition: mitkLine.h:37
Base class for mapper-specific rendering resources.
Definition: mitkMapper.h:181
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
vtkSmartPointer< vtkPolyDataMapper2D > m_HelperLinesmapper
vtkSmartPointer< vtkPolyDataMapper2D > m_Arrowmapper
VTK-based 2D mapper for rendering a crosshair with the plane geometry.
mitkClassMacro(PlaneGeometryDataMapper2D, VtkMapper)
void CreateVtkCrosshair(BaseRenderer *renderer)
Create the VTK crosshair representation for the given renderer.
virtual void ApplyAllProperties(BaseRenderer *renderer)
Apply all visual properties specific to this mapper.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
static bool TestPointInReferenceGeometry(const BaseGeometry *referenceGeometry, const Point3D &point)
Test if a point lies within the given reference geometry bounds.
static bool CutCrossLineWithPlaneGeometry(const PlaneGeometry *planeGeometry, Line3D &crossLine)
Clip a crosshair line segment to the bounds of the given PlaneGeometry.
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Apply color and opacity properties, then create VTK render objects.
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
Get the VTK prop assembly for the given renderer.
void ApplyColorAndOpacityProperties2D(BaseRenderer *renderer, vtkActor2D *actor)
virtual const mitk::PlaneGeometryData * GetInput() const
Get the PlaneGeometryData input of this mapper.
void DrawOrientationArrow(vtkSmartPointer< vtkCellArray > triangles, vtkSmartPointer< vtkPoints > triPoints, double triangleSizeMM, Vector3D &orthogonalVector, Point3D &point1, Point3D &point2)
static AllInstancesContainer s_AllInstances
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Set the default properties for this mapper on the given node.
static bool CutCrossLineWithReferenceGeometry(const BaseGeometry *referenceGeometry, Line3D &crossLine)
Clip a crosshair line segment to the bounds of the given reference geometry.
void DrawLine(Point3D p0, Point3D p1, vtkCellArray *lines, vtkPoints *points)
Add a line segment between two 3D points to VTK data structures.
static bool TestPointInPlaneGeometry(const PlaneGeometry *planeGeometry, const Point3D &point)
Test if a point lies within the given PlaneGeometry bounds.
Data class containing PlaneGeometry objects.
Describes the geometry of a plane object.
Base class of all VTK-based Mappers for displaying primitives using VTK functionality.
Definition: mitkVtkMapper.h:53
Find image slices visible on a given plane.