VTK  9.2.6
vtkResliceCursorLineRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResliceCursorLineRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
38 #ifndef vtkResliceCursorLineRepresentation_h
39 #define vtkResliceCursorLineRepresentation_h
40 
41 #include "vtkInteractionWidgetsModule.h" // For export macro
43 
44 class vtkPolyData;
48 class vtkResliceCursor;
49 
50 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorLineRepresentation
52 {
53 public:
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  void BuildRepresentation() override;
72  int ComputeInteractionState(int X, int Y, int modify = 0) override;
73  void StartWidgetInteraction(double startEventPos[2]) override;
74  void WidgetInteraction(double e[2]) override;
75  void Highlight(int highlightOn) override;
77 
79 
82  void ReleaseGraphicsResources(vtkWindow* w) override;
83  int RenderOverlay(vtkViewport* viewport) override;
84  int RenderOpaqueGeometry(vtkViewport* viewport) override;
85  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
88 
93  double* GetBounds() override;
94 
96 
100  vtkGetObjectMacro(ResliceCursorActor, vtkResliceCursorActor);
102 
107 
111  virtual void SetUserMatrix(vtkMatrix4x4* matrix);
112 
116  void SetTolerance(int t) override;
117 
118 protected:
121 
123 
124  double RotateAxis(double evenPos[2], int axis);
125  double TranslateAxis(double evenPos[2], int axis);
126 
127  void RotateAxis(int axis, double angle);
128 
129  void RotateVectorAboutVector(double vectorToBeRotated[3],
130  double axis[3], // vector about which we rotate
131  double angle, // angle in radians
132  double o[3]);
133  int DisplayToReslicePlaneIntersection(double displayPos[2], double intersectionPos[3]);
134 
135  void ApplyTolerance();
136 
139 
140  double StartPickPosition[3];
141  double StartCenterPosition[3];
142 
143  // Transformation matrices. These have no offset. Offset is recomputed
144  // based on the cursor, so that the center of the cursor has the same
145  // location in transformed space as it does in physical space.
149 
150 private:
152  void operator=(const vtkResliceCursorLineRepresentation&) = delete;
153 };
154 
155 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:55
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:90
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:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:39
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.