VTK  9.7.1
vtkResliceCursorLineRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkResliceCursorLineRepresentation_h
27 #define vtkResliceCursorLineRepresentation_h
28 
29 #include "vtkInteractionWidgetsModule.h" // For export macro
31 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkPolyData;
38 class vtkResliceCursor;
39 
40 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkResliceCursorLineRepresentation
42 {
43 public:
48 
50 
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
61  void BuildRepresentation() override;
62  int ComputeInteractionState(int X, int Y, int modify = 0) override;
63  void StartWidgetInteraction(double startEventPos[2]) override;
64  void WidgetInteraction(double e[2]) override;
65  void Highlight(int highlightOn) override;
67 
69 
72  void ReleaseGraphicsResources(vtkWindow* w) override;
73  int RenderOverlay(vtkViewport* viewport) override;
74  int RenderOpaqueGeometry(vtkViewport* viewport) override;
75  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
78 
83  double* GetBounds() override;
84 
86 
90  vtkGetObjectMacro(ResliceCursorActor, vtkResliceCursorActor);
92 
97  vtkResliceCursor* GetResliceCursor() override;
98 
102  virtual void SetUserMatrix(vtkMatrix4x4* matrix);
103 
107  void SetTolerance(int t) override;
108 
109 protected:
111  ~vtkResliceCursorLineRepresentation() override;
112 
113  vtkResliceCursorPolyDataAlgorithm* GetCursorAlgorithm() override;
114 
115  double RotateAxis(double evenPos[2], int axis);
116  double TranslateAxis(double evenPos[2], int axis);
117 
118  void RotateAxis(int axis, double angle);
119 
120  void RotateVectorAboutVector(double vectorToBeRotated[3],
121  double axis[3], // vector about which we rotate
122  double angle, // angle in radians
123  double o[3]);
124  int DisplayToReslicePlaneIntersection(double displayPos[2], double intersectionPos[3]);
125 
126  void ApplyTolerance();
127 
128  vtkNew<vtkResliceCursorActor> ResliceCursorActor;
130 
131  double StartPickPosition[3];
132  double StartCenterPosition[3];
133 
134  // Transformation matrices. These have no offset. Offset is recomputed
135  // based on the cursor, so that the center of the cursor has the same
136  // location in transformed space as it does in physical space.
137  vtkMatrix4x4* MatrixReslice;
138  vtkMatrix4x4* MatrixView;
139  vtkMatrix4x4* MatrixReslicedView;
140 
141 private:
142  vtkResliceCursorLineRepresentation(const vtkResliceCursorLineRepresentation&) = delete;
143  void operator=(const vtkResliceCursorLineRepresentation&) = delete;
144 };
145 
146 VTK_ABI_NAMESPACE_END
147 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual void StartWidgetInteraction(double eventPos[2])
generates a 2D reslice cursor polydata
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
int RenderOverlay(vtkViewport *viewport) override
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
represent the vtkResliceCursorWidget
virtual void Highlight(int highlightOn)
#define VTK_MARSHALEXCLUDE(reason)
Represent a reslice cursor.
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Allocate and hold a VTK object.
#define VTK_MARSHALAUTO
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
ray-cast cell picker for the reslice cursor
represent the vtkResliceCursorWidget
Geometry for a reslice cursor.