VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Core/vtkAbstractPicker.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAbstractPicker.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 =========================================================================*/
00057 #ifndef vtkAbstractPicker_h
00058 #define vtkAbstractPicker_h
00059 
00060 #include "vtkRenderingCoreModule.h" // For export macro
00061 #include "vtkObject.h"
00062 
00063 class vtkRenderer;
00064 class vtkProp;
00065 class vtkPropCollection;
00066 
00067 class VTKRENDERINGCORE_EXPORT vtkAbstractPicker : public vtkObject
00068 {
00069 public:
00070   vtkTypeMacro(vtkAbstractPicker,vtkObject);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00074 
00075   vtkGetObjectMacro(Renderer,vtkRenderer);
00077 
00079 
00081   vtkGetVectorMacro(SelectionPoint,double,3);
00083 
00085 
00086   vtkGetVectorMacro(PickPosition,double,3);
00088 
00090 
00094   virtual int Pick(double selectionX, double selectionY, double selectionZ,
00095                    vtkRenderer *renderer) = 0;
00097 
00099 
00102   int Pick(double selectionPt[3], vtkRenderer *ren)
00103     {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};
00105 
00107 
00110   vtkSetMacro(PickFromList,int);
00111   vtkGetMacro(PickFromList,int);
00112   vtkBooleanMacro(PickFromList,int);
00114 
00116   void InitializePickList();
00117 
00119   void AddPickList(vtkProp *);
00120 
00122   void DeletePickList(vtkProp *);
00123 
00125   vtkPropCollection *GetPickList() {return this->PickList;}
00126 
00127 protected:
00128   vtkAbstractPicker();
00129   ~vtkAbstractPicker();
00130 
00131   virtual void Initialize();
00132 
00133   vtkRenderer *Renderer; //pick occurred in this renderer's viewport
00134   double SelectionPoint[3]; //selection point in window (pixel) coordinates
00135   double PickPosition[3]; //selection point in world coordinates
00136 
00137   // use the following to control picking from a list
00138   int PickFromList;
00139   vtkPropCollection *PickList;
00140 private:
00141   vtkAbstractPicker(const vtkAbstractPicker&);  // Not implemented.
00142   void operator=(const vtkAbstractPicker&);  // Not implemented.
00143 };
00144 
00145 #endif
00146 
00147