/
vtkMRMLAbstractSliceViewDisplayableManager.h
100 lines (71 loc) · 4.02 KB
/
vtkMRMLAbstractSliceViewDisplayableManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*==============================================================================
Program: 3D Slicer
Copyright (c) Kitware Inc.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
and was partially funded by NIH grant 3P41RR013218-12S1
==============================================================================*/
#ifndef __vtkMRMLAbstractSliceViewDisplayableManager_h
#define __vtkMRMLAbstractSliceViewDisplayableManager_h
// MRMLDisplayableManager includes
#include "vtkMRMLAbstractDisplayableManager.h"
#include "vtkMRMLDisplayableManagerExport.h"
class vtkMRMLSliceNode;
/// \brief Superclass for displayable manager classes.
///
/// A displayable manager class is responsible to represent a
/// MRMLDisplayable node in a renderer.
class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractSliceViewDisplayableManager :
public vtkMRMLAbstractDisplayableManager
{
public:
typedef vtkMRMLAbstractSliceViewDisplayableManager Self;
static vtkMRMLAbstractSliceViewDisplayableManager *New();
void PrintSelf(ostream& os, vtkIndent indent) override;
vtkTypeMacro(vtkMRMLAbstractSliceViewDisplayableManager,
vtkMRMLAbstractDisplayableManager);
/// Get MRML SliceNode
vtkMRMLSliceNode * GetMRMLSliceNode();
/// Convert device coordinates (display) to XYZ coordinates (viewport).
/// Parameter \a xyz is double[3]
/// \sa ConvertDeviceToXYZ(vtkRenderWindowInteractor *, vtkMRMLSliceNode *, double x, double y, double xyz[3])
void ConvertDeviceToXYZ(double x, double y, double xyz[3]);
/// Convenience function allowing to convert device coordinates (display) to XYZ coordinates (viewport).
/// Parameter \a xyz is double[3]
static void ConvertDeviceToXYZ(vtkRenderWindowInteractor * interactor,
vtkMRMLSliceNode * sliceNode, double x, double y, double xyz[3]);
/// Convenience function allowing to convert device coordinates (display) to XYZ coordinates (viewport).
/// Parameter \a xyz is double[3]
static void ConvertDeviceToXYZ(vtkRenderer * renderer,
vtkMRMLSliceNode * sliceNode, double x, double y, double xyz[3]);
/// Convert RAS to XYZ coordinates (viewport).
/// Parameters \a ras and \a xyz are double[3]. \a xyz[2] is the lightbox id.
/// \sa ConvertRASToXYZ(vtkMRMLSliceNode * sliceNode, double ras[3], double xyz[3])
void ConvertRASToXYZ(double ras[3], double xyz[3]);
/// Convenience function allowing to convert RAS to XYZ coordinates (viewport).
/// Parameters \a ras and \a xyz are double[3]. \a xyz[2] is the lightbox id.
static void ConvertRASToXYZ(vtkMRMLSliceNode * sliceNode, double ras[3], double xyz[3]);
/// Convert XYZ (viewport) to RAS coordinates.
/// Parameters \a ras and \a xyz are double[3]. \a xyz[2] is the lightbox id.
/// \sa ConvertXYZToRAS(vtkMRMLSliceNode * sliceNode, double xyz[3], double ras[3])
void ConvertXYZToRAS(double xyz[3], double ras[3]);
/// Convenience function allowing to Convert XYZ (viewport) to RAS coordinates.
/// Parameters \a ras and \a xyz are double[3]. \a xyz[2] is the lightbox id.
static void ConvertXYZToRAS(vtkMRMLSliceNode * sliceNode, double xyz[3], double ras[3]);
protected:
vtkMRMLAbstractSliceViewDisplayableManager();
~vtkMRMLAbstractSliceViewDisplayableManager() override;
void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller) override;
/// Could be overloaded if DisplayableManager subclass
virtual void OnMRMLSliceNodeModifiedEvent(){}
private:
vtkMRMLAbstractSliceViewDisplayableManager(const vtkMRMLAbstractSliceViewDisplayableManager&) = delete;
void operator=(const vtkMRMLAbstractSliceViewDisplayableManager&) = delete;
};
#endif