Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkAbstractPicker.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkAbstractPicker.h,v $
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 =========================================================================*/
00069 #ifndef __vtkAbstractPicker_h
00070 #define __vtkAbstractPicker_h
00071 
00072 #include "vtkObject.h"
00073 
00074 class vtkRenderer;
00075 class vtkProp;
00076 class vtkPropCollection;
00077 
00078 class VTK_RENDERING_EXPORT vtkAbstractPicker : public vtkObject
00079 {
00080 public:
00081   vtkTypeRevisionMacro(vtkAbstractPicker,vtkObject);
00082   void PrintSelf(ostream& os, vtkIndent indent);
00083 
00085 
00086   vtkGetObjectMacro(Renderer,vtkRenderer);
00088 
00090 
00092   vtkGetVectorMacro(SelectionPoint,double,3);
00094 
00096 
00097   vtkGetVectorMacro(PickPosition,double,3);
00099 
00101 
00105   virtual int Pick(double selectionX, double selectionY, double selectionZ, 
00106                    vtkRenderer *renderer) = 0;
00108 
00110 
00113   int Pick(double selectionPt[3], vtkRenderer *ren)
00114     {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};  
00116 
00118 
00121   vtkSetMacro(PickFromList,int);
00122   vtkGetMacro(PickFromList,int);
00123   vtkBooleanMacro(PickFromList,int);
00125 
00127   void InitializePickList();
00128 
00130   void AddPickList(vtkProp *);
00131 
00133   void DeletePickList(vtkProp *);
00134   
00136   vtkPropCollection *GetPickList() {return this->PickList;}
00137 
00138 protected:
00139   vtkAbstractPicker();
00140   ~vtkAbstractPicker();
00141 
00142   virtual void Initialize();
00143 
00144   vtkRenderer *Renderer; //pick occurred in this renderer's viewport
00145   double SelectionPoint[3]; //selection point in window (pixel) coordinates
00146   double PickPosition[3]; //selection point in world coordinates
00147   
00148   // use the following to control picking from a list
00149   int PickFromList;
00150   vtkPropCollection *PickList;
00151 private:
00152   vtkAbstractPicker(const vtkAbstractPicker&);  // Not implemented.
00153   void operator=(const vtkAbstractPicker&);  // Not implemented.
00154 };
00155 
00156 #endif
00157 
00158