VTK  9.0.20201030
vtkResliceCursorPicker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPicker.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 =========================================================================*/
33 #ifndef vtkResliceCursorPicker_h
34 #define vtkResliceCursorPicker_h
35 
36 #include "vtkInteractionWidgetsModule.h" // For export macro
37 #include "vtkPicker.h"
38 
39 class vtkPolyData;
40 class vtkGenericCell;
42 class vtkMatrix4x4;
43 class vtkPlane;
44 
45 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorPicker : public vtkPicker
46 {
47 public:
48  static vtkResliceCursorPicker* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
58  int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
59 
61 
64  vtkGetMacro(PickedAxis1, int);
65  vtkGetMacro(PickedAxis2, int);
66  vtkGetMacro(PickedCenter, int);
68 
70 
73  virtual void SetResliceCursorAlgorithm(vtkResliceCursorPolyDataAlgorithm*);
74  vtkGetObjectMacro(ResliceCursorAlgorithm, vtkResliceCursorPolyDataAlgorithm);
76 
77  virtual void SetTransformMatrix(vtkMatrix4x4*);
78 
83  void Pick(double displayPos[2], double world[3], vtkRenderer* ren);
84 
85 protected:
87  ~vtkResliceCursorPicker() override;
88 
89  virtual int IntersectPolyDataWithLine(double p1[3], double p2[3], vtkPolyData*, double tol);
90  virtual int IntersectPointWithLine(double p1[3], double p2[3], double X[3], double tol);
91 
92  void TransformPlane();
93  void TransformPoint(double pIn[4], double pOut[4]);
94  void InverseTransformPoint(double pIn[4], double pOut[4]);
95 
96  // Helper members
97  vtkGenericCell* Cell; // used to accelerate picking
99 
105 
106 private:
108  void operator=(const vtkResliceCursorPicker&) = delete;
109 };
110 
111 #endif
vtkPlane
perform various plane computations
Definition: vtkPlane.h:33
vtkResliceCursorPicker::PickedCenter
int PickedCenter
Definition: vtkResliceCursorPicker.h:102
vtkPicker::Pick
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer) override
Perform pick operation with selection point provided.
vtkResliceCursorPicker::PickedAxis2
int PickedAxis2
Definition: vtkResliceCursorPicker.h:101
vtkPicker::New
static vtkPicker * New()
vtkPicker
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:61
vtkResliceCursorPicker::Plane
vtkPlane * Plane
Definition: vtkResliceCursorPicker.h:104
vtkResliceCursorPicker::TransformMatrix
vtkMatrix4x4 * TransformMatrix
Definition: vtkResliceCursorPicker.h:103
vtkResliceCursorPolyDataAlgorithm
generates a 2D reslice cursor polydata
Definition: vtkResliceCursorPolyDataAlgorithm.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
vtkResliceCursorPicker::Cell
vtkGenericCell * Cell
Definition: vtkResliceCursorPicker.h:97
vtkResliceCursorPicker::PickedAxis1
int PickedAxis1
Definition: vtkResliceCursorPicker.h:100
vtkPicker::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPicker.h
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkResliceCursorPicker
ray-cast cell picker for the reslice cursor
Definition: vtkResliceCursorPicker.h:45
vtkResliceCursorPicker::ResliceCursorAlgorithm
vtkResliceCursorPolyDataAlgorithm * ResliceCursorAlgorithm
Definition: vtkResliceCursorPicker.h:98