VTK
dox/Rendering/vtkResliceCursorPicker.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPicker.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00032 #ifndef __vtkResliceCursorPicker_h
00033 #define __vtkResliceCursorPicker_h
00034 
00035 #include "vtkPicker.h"
00036 
00037 class vtkPolyData;
00038 class vtkGenericCell;
00039 class vtkResliceCursorPolyDataAlgorithm;
00040 class vtkIdList;
00041 class vtkMatrix4x4;
00042 class vtkPlane;
00043 
00044 class VTK_RENDERING_EXPORT vtkResliceCursorPicker : public vtkPicker
00045 {
00046 public:
00047   static vtkResliceCursorPicker *New();
00048   vtkTypeMacro(vtkResliceCursorPicker, vtkPicker);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00056   virtual int Pick(double selectionX, double selectionY, double selectionZ,
00057                    vtkRenderer *renderer);
00059 
00061 
00062   vtkGetMacro( PickedAxis1, int );
00063   vtkGetMacro( PickedAxis2, int );
00064   vtkGetMacro( PickedCenter, int );
00066 
00068 
00069   virtual void SetResliceCursorAlgorithm(
00070       vtkResliceCursorPolyDataAlgorithm * );
00071   vtkGetObjectMacro( ResliceCursorAlgorithm,
00072                      vtkResliceCursorPolyDataAlgorithm );
00074 
00075   virtual void SetTransformMatrix( vtkMatrix4x4 * );
00076 
00078 
00081   void Pick(
00082     double displayPos[2], double world[3], vtkRenderer *ren );
00084 
00085 protected:
00086   vtkResliceCursorPicker();
00087   ~vtkResliceCursorPicker();
00088 
00089   virtual int IntersectPolyDataWithLine(
00090       double p1[3], double p2[3], vtkPolyData *, double tol );
00091   virtual int IntersectPointWithLine(
00092     double p1[3], double p2[3], double X[3], double tol );
00093 
00094   void TransformPlane();
00095   void TransformPoint( double pIn[4], double pOut[4] );
00096   void InverseTransformPoint( double pIn[4], double pOut[4] );
00097 
00098 private:
00099 
00100   vtkGenericCell *Cell; //used to accelerate picking
00101   vtkResliceCursorPolyDataAlgorithm * ResliceCursorAlgorithm;
00102 
00103   int PickedAxis1;
00104   int PickedAxis2;
00105   int PickedCenter;
00106   vtkIdList *PointIds;
00107   vtkMatrix4x4 * TransformMatrix;
00108   vtkPlane     * Plane;
00109 
00110 private:
00111   vtkResliceCursorPicker(const vtkResliceCursorPicker&);  // Not implemented.
00112   void operator=(const vtkResliceCursorPicker&);  // Not implemented.
00113 };
00114 
00115 #endif