forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkResliceCursorLineRepresentation.h
142 lines (116 loc) · 4.61 KB
/
vtkResliceCursorLineRepresentation.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*=========================================================================
Program: Visualization Toolkit
Module: vtkResliceCursorLineRepresentation.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkResliceCursorLineRepresentation
* @brief represent the vtkResliceCursorWidget
*
* This class provides a representation for the reslice cursor widget. It
* consists of two cross sectional hairs, with an optional thickness. The
* hairs may have a hole in the center. These may be translated or rotated
* independent of each other in the view. The result is used to reslice
* the data along these cross sections. This allows the user to perform
* multi-planar thin or thick reformat of the data on an image view, rather
* than a 3D view.
* @sa
* vtkResliceCursorWidget vtkResliceCursor vtkResliceCursorPolyDataAlgorithm
* vtkResliceCursorRepresentation vtkResliceCursorThickLineRepresentation
* vtkResliceCursorActor vtkImagePlaneWidget
*/
#ifndef vtkResliceCursorLineRepresentation_h
#define vtkResliceCursorLineRepresentation_h
#include "vtkInteractionWidgetsModule.h" // For export macro
#include "vtkResliceCursorRepresentation.h"
class vtkPolyData;
class vtkResliceCursorActor;
class vtkResliceCursorPolyDataAlgorithm;
class vtkResliceCursorPicker;
class vtkResliceCursor;
class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorLineRepresentation : public vtkResliceCursorRepresentation
{
public:
/**
* Instantiate the class.
*/
static vtkResliceCursorLineRepresentation *New();
//@{
/**
* Standard VTK methods.
*/
vtkTypeMacro(vtkResliceCursorLineRepresentation,vtkResliceCursorRepresentation);
void PrintSelf(ostream& os, vtkIndent indent) override;
//@}
//@{
/**
* These are methods that satisfy vtkWidgetRepresentation's API.
*/
void BuildRepresentation() override;
int ComputeInteractionState(int X, int Y, int modify=0) override;
void StartWidgetInteraction(double startEventPos[2]) override;
void WidgetInteraction(double e[2]) override;
void Highlight(int highlightOn) override;
//@}
//@{
/**
* Methods required by vtkProp superclass.
*/
void ReleaseGraphicsResources(vtkWindow *w) override;
int RenderOverlay(vtkViewport *viewport) override;
int RenderOpaqueGeometry(vtkViewport *viewport) override;
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
vtkTypeBool HasTranslucentPolygonalGeometry() override;
//@}
/**
* Get the bounds of this prop. This simply returns the bounds of the
* reslice cursor object.
*/
double * GetBounds() override;
//@{
/**
* Get the reslice cursor actor. You must set the reslice cursor on this
* class
*/
vtkGetObjectMacro( ResliceCursorActor, vtkResliceCursorActor );
//@}
/**
* Get the reslice cursor.
*/
vtkResliceCursor * GetResliceCursor() override;
/**
* Set the user matrix on all the internal actors.
*/
virtual void SetUserMatrix( vtkMatrix4x4 *matrix);
protected:
vtkResliceCursorLineRepresentation();
~vtkResliceCursorLineRepresentation() override;
vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm() override;
double RotateAxis( double evenPos[2], int axis );
void RotateAxis( int axis, double angle );
void RotateVectorAboutVector( double vectorToBeRotated[3],
double axis[3], // vector about which we rotate
double angle, // angle in radians
double o[3] );
int DisplayToReslicePlaneIntersection(
double displayPos[2], double intersectionPos[3] );
vtkResliceCursorActor * ResliceCursorActor;
vtkResliceCursorPicker * Picker;
double StartPickPosition[3];
double StartCenterPosition[3];
// Transformation matrices. These have no offset. Offset is recomputed
// based on the cursor, so that the center of the cursor has the same
// location in transformed space as it does in physical space.
vtkMatrix4x4 * MatrixReslice;
vtkMatrix4x4 * MatrixView;
vtkMatrix4x4 * MatrixReslicedView;
private:
vtkResliceCursorLineRepresentation(const vtkResliceCursorLineRepresentation&) = delete;
void operator=(const vtkResliceCursorLineRepresentation&) = delete;
};
#endif