VTK  9.3.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 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkPolyData;
37 class vtkResliceCursor;
38 
39 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorLineRepresentation
41 {
42 public:
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
60  void BuildRepresentation() override;
61  int ComputeInteractionState(int X, int Y, int modify = 0) override;
62  void StartWidgetInteraction(double startEventPos[2]) override;
63  void WidgetInteraction(double e[2]) override;
64  void Highlight(int highlightOn) override;
66 
68 
71  void ReleaseGraphicsResources(vtkWindow* w) override;
72  int RenderOverlay(vtkViewport* viewport) override;
73  int RenderOpaqueGeometry(vtkViewport* viewport) override;
74  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
77 
82  double* GetBounds() override;
83 
85 
89  vtkGetObjectMacro(ResliceCursorActor, vtkResliceCursorActor);
91 
96 
100  virtual void SetUserMatrix(vtkMatrix4x4* matrix);
101 
105  void SetTolerance(int t) override;
106 
107 protected:
110 
112 
113  double RotateAxis(double evenPos[2], int axis);
114  double TranslateAxis(double evenPos[2], int axis);
115 
116  void RotateAxis(int axis, double angle);
117 
118  void RotateVectorAboutVector(double vectorToBeRotated[3],
119  double axis[3], // vector about which we rotate
120  double angle, // angle in radians
121  double o[3]);
122  int DisplayToReslicePlaneIntersection(double displayPos[2], double intersectionPos[3]);
123 
124  void ApplyTolerance();
125 
128 
129  double StartPickPosition[3];
130  double StartCenterPosition[3];
131 
132  // Transformation matrices. These have no offset. Offset is recomputed
133  // based on the cursor, so that the center of the cursor has the same
134  // location in transformed space as it does in physical space.
138 
139 private:
141  void operator=(const vtkResliceCursorLineRepresentation&) = delete;
142 };
143 
144 VTK_ABI_NAMESPACE_END
145 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:44
virtual void StartWidgetInteraction(double eventPos[2])
generates a 2D reslice cursor polydata
virtual vtkResliceCursor * GetResliceCursor()=0
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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:27
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:28
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])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
represent the vtkResliceCursorWidget
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
Get the underlying cursor source.
Represent a reslice cursor.
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
virtual void SetTolerance(int)
The tolerance representing the distance to the representation (in pixels) in which the cursor is cons...
virtual void Highlight(int vtkNotUsed(highlightOn))
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.