VTK
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 =========================================================================*/
32 #ifndef __vtkResliceCursorPicker_h
33 #define __vtkResliceCursorPicker_h
34 
35 #include "vtkPicker.h"
36 
37 class vtkPolyData;
38 class vtkGenericCell;
40 class vtkIdList;
41 class vtkMatrix4x4;
42 class vtkPlane;
43 
45 {
46 public:
47  static vtkResliceCursorPicker *New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
56  virtual int Pick(double selectionX, double selectionY, double selectionZ,
57  vtkRenderer *renderer);
59 
61 
62  vtkGetMacro( PickedAxis1, int );
63  vtkGetMacro( PickedAxis2, int );
64  vtkGetMacro( PickedCenter, int );
66 
68 
69  virtual void SetResliceCursorAlgorithm(
71  vtkGetObjectMacro( ResliceCursorAlgorithm,
74 
75  virtual void SetTransformMatrix( vtkMatrix4x4 * );
76 
78 
81  void Pick(
82  double displayPos[2], double world[3], vtkRenderer *ren );
84 
85 protected:
88 
89  virtual int IntersectPolyDataWithLine(
90  double p1[3], double p2[3], vtkPolyData *, double tol );
91  virtual int IntersectPointWithLine(
92  double p1[3], double p2[3], double X[3], double tol );
93 
94  void TransformPlane();
95  void TransformPoint( double pIn[4], double pOut[4] );
96  void InverseTransformPoint( double pIn[4], double pOut[4] );
97 
98 private:
99 
100  vtkGenericCell *Cell; //used to accelerate picking
101  vtkResliceCursorPolyDataAlgorithm * ResliceCursorAlgorithm;
102 
103  int PickedAxis1;
104  int PickedAxis2;
105  int PickedCenter;
106  vtkIdList *PointIds;
107  vtkMatrix4x4 * TransformMatrix;
108  vtkPlane * Plane;
109 
110 private:
111  vtkResliceCursorPicker(const vtkResliceCursorPicker&); // Not implemented.
112  void operator=(const vtkResliceCursorPicker&); // Not implemented.
113 };
114 
115 #endif