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

graphics/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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen.
00009 
00010 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
00011 The following terms apply to all files associated with the software unless
00012 explicitly disclaimed in individual files. This copyright specifically does
00013 not apply to the related textbook "The Visualization Toolkit" ISBN
00014 013199837-4 published by Prentice Hall which is covered by its own copyright.
00015 
00016 The authors hereby grant permission to use, copy, and distribute this
00017 software and its documentation for any purpose, provided that existing
00018 copyright notices are retained in all copies and that this notice is included
00019 verbatim in any distributions. Additionally, the authors grant permission to
00020 modify this software and its documentation for any purpose, provided that
00021 such modifications are not distributed without the explicit consent of the
00022 authors and that existing copyright notices are retained in all copies. Some
00023 of the algorithms implemented by this software are patented, observe all
00024 applicable patent law.
00025 
00026 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
00027 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
00028 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
00029 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 
00031 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
00032 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
00033 PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
00034 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
00035 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
00036 
00037 
00038 =========================================================================*/
00083 #ifndef __vtkAbstractPicker_h
00084 #define __vtkAbstractPicker_h
00085 
00086 #include "vtkObject.h"
00087 #include "vtkRenderer.h"
00088 
00089 class VTK_EXPORT vtkAbstractPicker : public vtkObject
00090 {
00091 public:
00092   vtkTypeMacro(vtkAbstractPicker,vtkObject);
00093   void PrintSelf(ostream& os, vtkIndent indent);
00094 
00096   vtkGetObjectMacro(Renderer,vtkRenderer);
00097 
00100   vtkGetVectorMacro(SelectionPoint,float,3);
00101 
00103   vtkGetVectorMacro(PickPosition,float,3);
00104 
00109   virtual int Pick(float selectionX, float selectionY, float selectionZ, 
00110          vtkRenderer *renderer) = 0;
00111 
00115   int Pick(float selectionPt[3], vtkRenderer *ren)
00116     {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};  
00117 
00119   void SetStartPickMethod(void (*f)(void *), void *arg);
00120 
00122   void SetPickMethod(void (*f)(void *), void *arg);
00123 
00126   void SetEndPickMethod(void (*f)(void *), void *arg);
00127 
00129   void SetStartPickMethodArgDelete(void (*f)(void *));
00130 
00132   void SetPickMethodArgDelete(void (*f)(void *));
00133 
00135   void SetEndPickMethodArgDelete(void (*f)(void *));
00136 
00140   vtkSetMacro(PickFromList,int);
00141   vtkGetMacro(PickFromList,int);
00142   vtkBooleanMacro(PickFromList,int);
00143 
00145   void InitializePickList();
00146 
00148   void AddPickList(vtkProp *);
00149 
00151   void DeletePickList(vtkProp *);
00152   
00154   vtkPropCollection *GetPickList() {return this->PickList;}
00155 
00156 protected:
00157   vtkAbstractPicker();
00158   ~vtkAbstractPicker();
00159   vtkAbstractPicker(const vtkAbstractPicker&) {};
00160   void operator=(const vtkAbstractPicker&) {};
00161 
00162   virtual void Initialize();
00163 
00164   vtkRenderer *Renderer; //pick occurred in this renderer's viewport
00165   float SelectionPoint[3]; //selection point in window (pixel) coordinates
00166   float PickPosition[3]; //selection point in world coordinates
00167   
00168   // the following are used to manage invocation of pick methods
00169   void (*StartPickMethod)(void *);
00170   void (*StartPickMethodArgDelete)(void *);
00171   void *StartPickMethodArg;
00172   void (*PickMethod)(void *);
00173   void *PickMethodArg;
00174   void (*PickMethodArgDelete)(void *);
00175   void (*EndPickMethod)(void *);
00176   void (*EndPickMethodArgDelete)(void *);
00177   void *EndPickMethodArg;
00178   
00179   // use the following to control picking from a list
00180   int PickFromList;
00181   vtkPropCollection *PickList;
00182 };
00183 
00184 #endif
00185 
00186 

Generated on Wed Nov 21 12:26:56 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001