VTK  9.3.1
vtkResliceCursorPicker.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
21 #ifndef vtkResliceCursorPicker_h
22 #define vtkResliceCursorPicker_h
23 
24 #include "vtkInteractionWidgetsModule.h" // For export macro
25 #include "vtkPicker.h"
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkPolyData;
29 class vtkGenericCell;
31 class vtkMatrix4x4;
32 class vtkPlane;
33 
34 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorPicker : public vtkPicker
35 {
36 public:
37  static vtkResliceCursorPicker* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
47  int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
48 
50 
53  vtkGetMacro(PickedAxis1, int);
54  vtkGetMacro(PickedAxis2, int);
55  vtkGetMacro(PickedCenter, int);
57 
59 
62  virtual void SetResliceCursorAlgorithm(vtkResliceCursorPolyDataAlgorithm*);
63  vtkGetObjectMacro(ResliceCursorAlgorithm, vtkResliceCursorPolyDataAlgorithm);
65 
66  virtual void SetTransformMatrix(vtkMatrix4x4*);
67 
72  void Pick(double displayPos[2], double world[3], vtkRenderer* ren);
73 
74 protected:
76  ~vtkResliceCursorPicker() override;
77 
78  virtual int IntersectPolyDataWithLine(double p1[3], double p2[3], vtkPolyData*, double tol);
79  virtual int IntersectPointWithLine(double p1[3], double p2[3], double X[3], double tol);
80 
81  void TransformPlane();
82  void TransformPoint(double pIn[4], double pOut[4]);
83  void InverseTransformPoint(double pIn[4], double pOut[4]);
84 
85  // Helper members
86  vtkGenericCell* Cell; // used to accelerate picking
88 
94 
95 private:
97  void operator=(const vtkResliceCursorPicker&) = delete;
98 };
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
generates a 2D reslice cursor polydata
abstract specification for renderers
Definition: vtkRenderer.h:61
vtkResliceCursorPolyDataAlgorithm * ResliceCursorAlgorithm
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
provides thread-safe access to cells
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:50
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkPicker * New()
perform various plane computations
Definition: vtkPlane.h:25
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer) override
Perform pick operation with selection point provided.
ray-cast cell picker for the reslice cursor