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 =========================================================================*/ 00084 #ifndef __vtkAbstractPicker_h 00085 #define __vtkAbstractPicker_h 00086 00087 #include "vtkObject.h" 00088 #include "vtkRenderer.h" 00089 00090 class VTK_RENDERING_EXPORT vtkAbstractPicker : public vtkObject 00091 { 00092 public: 00093 vtkTypeMacro(vtkAbstractPicker,vtkObject); 00094 void PrintSelf(ostream& os, vtkIndent indent); 00095 00097 00098 vtkGetObjectMacro(Renderer,vtkRenderer); 00100 00102 00104 vtkGetVectorMacro(SelectionPoint,float,3); 00106 00108 00109 vtkGetVectorMacro(PickPosition,float,3); 00111 00113 00117 virtual int Pick(float selectionX, float selectionY, float selectionZ, 00118 vtkRenderer *renderer) = 0; 00120 00122 00125 int Pick(float selectionPt[3], vtkRenderer *ren) 00126 {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);}; 00128 00130 void SetStartPickMethod(void (*f)(void *), void *arg); 00131 00133 void SetPickMethod(void (*f)(void *), void *arg); 00134 00137 void SetEndPickMethod(void (*f)(void *), void *arg); 00138 00140 void SetStartPickMethodArgDelete(void (*f)(void *)); 00141 00143 void SetPickMethodArgDelete(void (*f)(void *)); 00144 00146 void SetEndPickMethodArgDelete(void (*f)(void *)); 00147 00149 00152 vtkSetMacro(PickFromList,int); 00153 vtkGetMacro(PickFromList,int); 00154 vtkBooleanMacro(PickFromList,int); 00156 00158 void InitializePickList(); 00159 00161 void AddPickList(vtkProp *); 00162 00164 void DeletePickList(vtkProp *); 00165 00167 vtkPropCollection *GetPickList() {return this->PickList;} 00168 00169 protected: 00170 vtkAbstractPicker(); 00171 ~vtkAbstractPicker(); 00172 00173 virtual void Initialize(); 00174 00175 vtkRenderer *Renderer; //pick occurred in this renderer's viewport 00176 float SelectionPoint[3]; //selection point in window (pixel) coordinates 00177 float PickPosition[3]; //selection point in world coordinates 00178 00179 // the following are used to manage invocation of pick methods 00180 unsigned long StartPickTag; 00181 unsigned long PickTag; 00182 unsigned long EndPickTag; 00183 00184 // use the following to control picking from a list 00185 int PickFromList; 00186 vtkPropCollection *PickList; 00187 private: 00188 vtkAbstractPicker(const vtkAbstractPicker&); // Not implemented. 00189 void operator=(const vtkAbstractPicker&); // Not implemented. 00190 }; 00191 00192 #endif 00193 00194
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001