VTK  9.0.1
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 =========================================================================*/
30 #ifndef vtkResliceCursorPicker_h
31 #define vtkResliceCursorPicker_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
34 #include "vtkPicker.h"
35 
36 class vtkPolyData;
37 class vtkGenericCell;
39 class vtkMatrix4x4;
40 class vtkPlane;
41 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorPicker : public vtkPicker
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
55  int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
56 
58 
61  vtkGetMacro(PickedAxis1, int);
62  vtkGetMacro(PickedAxis2, int);
63  vtkGetMacro(PickedCenter, int);
65 
67 
71  vtkGetObjectMacro(ResliceCursorAlgorithm, vtkResliceCursorPolyDataAlgorithm);
73 
75 
80  void Pick(double displayPos[2], double world[3], vtkRenderer* ren);
81 
82 protected:
85 
86  virtual int IntersectPolyDataWithLine(double p1[3], double p2[3], vtkPolyData*, double tol);
87  virtual int IntersectPointWithLine(double p1[3], double p2[3], double X[3], double tol);
88 
90  void TransformPoint(double pIn[4], double pOut[4]);
91  void InverseTransformPoint(double pIn[4], double pOut[4]);
92 
93 private:
94  vtkGenericCell* Cell; // used to accelerate picking
95  vtkResliceCursorPolyDataAlgorithm* ResliceCursorAlgorithm;
96 
97  int PickedAxis1;
98  int PickedAxis2;
99  int PickedCenter;
100  vtkMatrix4x4* TransformMatrix;
101  vtkPlane* Plane;
102 
103 private:
105  void operator=(const vtkResliceCursorPicker&) = delete;
106 };
107 
108 #endif
provides thread-safe access to cells
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:56
perform various plane computations
Definition: vtkPlane.h:32
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
abstract specification for renderers
Definition: vtkRenderer.h:59
ray-cast cell picker for the reslice cursor
void TransformPoint(double pIn[4], double pOut[4])
~vtkResliceCursorPicker() override
static vtkResliceCursorPicker * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Pick(double displayPos[2], double world[3], vtkRenderer *ren)
Overloaded pick method that returns the picked coordinates of the current resliced plane in world coo...
virtual void SetResliceCursorAlgorithm(vtkResliceCursorPolyDataAlgorithm *)
Set the reslice cursor algorithm.
virtual void SetTransformMatrix(vtkMatrix4x4 *)
virtual int IntersectPointWithLine(double p1[3], double p2[3], double X[3], double tol)
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer) override
Perform pick operation with selection point provided.
virtual int IntersectPolyDataWithLine(double p1[3], double p2[3], vtkPolyData *, double tol)
void InverseTransformPoint(double pIn[4], double pOut[4])
generates a 2D reslice cursor polydata