Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Rendering/vtkAbstractPicker.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkAbstractPicker.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00072 #ifndef __vtkAbstractPicker_h
00073 #define __vtkAbstractPicker_h
00074 
00075 #include "vtkObject.h"
00076 
00077 class vtkRenderer;
00078 class vtkProp;
00079 class vtkPropCollection;
00080 
00081 class VTK_RENDERING_EXPORT vtkAbstractPicker : public vtkObject
00082 {
00083 public:
00084   vtkTypeRevisionMacro(vtkAbstractPicker,vtkObject);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00088 
00089   vtkGetObjectMacro(Renderer,vtkRenderer);
00091 
00093 
00095   vtkGetVectorMacro(SelectionPoint,float,3);
00097 
00099 
00100   vtkGetVectorMacro(PickPosition,float,3);
00102 
00104 
00108   virtual int Pick(float selectionX, float selectionY, float selectionZ, 
00109                    vtkRenderer *renderer) = 0;
00111 
00113 
00116   int Pick(float selectionPt[3], vtkRenderer *ren)
00117     {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};  
00119 
00121   void SetStartPickMethod(void (*f)(void *), void *arg);
00122 
00124   void SetPickMethod(void (*f)(void *), void *arg);
00125 
00128   void SetEndPickMethod(void (*f)(void *), void *arg);
00129 
00131   void SetStartPickMethodArgDelete(void (*f)(void *));
00132 
00134   void SetPickMethodArgDelete(void (*f)(void *));
00135 
00137   void SetEndPickMethodArgDelete(void (*f)(void *));
00138 
00140 
00143   vtkSetMacro(PickFromList,int);
00144   vtkGetMacro(PickFromList,int);
00145   vtkBooleanMacro(PickFromList,int);
00147 
00149   void InitializePickList();
00150 
00152   void AddPickList(vtkProp *);
00153 
00155   void DeletePickList(vtkProp *);
00156   
00158   vtkPropCollection *GetPickList() {return this->PickList;}
00159 
00160 protected:
00161   vtkAbstractPicker();
00162   ~vtkAbstractPicker();
00163 
00164   virtual void Initialize();
00165 
00166   vtkRenderer *Renderer; //pick occurred in this renderer's viewport
00167   float SelectionPoint[3]; //selection point in window (pixel) coordinates
00168   float PickPosition[3]; //selection point in world coordinates
00169   
00170   // the following are used to manage invocation of pick methods
00171   unsigned long StartPickTag;
00172   unsigned long PickTag;
00173   unsigned long EndPickTag;
00174   
00175   // use the following to control picking from a list
00176   int PickFromList;
00177   vtkPropCollection *PickList;
00178 private:
00179   vtkAbstractPicker(const vtkAbstractPicker&);  // Not implemented.
00180   void operator=(const vtkAbstractPicker&);  // Not implemented.
00181 };
00182 
00183 #endif
00184 
00185