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

dox/Rendering/vtkPicker.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPicker.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 =========================================================================*/
00044 #ifndef __vtkPicker_h
00045 #define __vtkPicker_h
00046 
00047 #include "vtkAbstractPropPicker.h"
00048 
00049 class vtkAbstractMapper3D;
00050 class vtkDataSet;
00051 class vtkTransform;
00052 class vtkActorCollection;
00053 class vtkProp3DCollection;
00054 class vtkPoints;
00055 
00056 class VTK_RENDERING_EXPORT vtkPicker : public vtkAbstractPropPicker
00057 {
00058 public:
00059   static vtkPicker *New();
00060   vtkTypeRevisionMacro(vtkPicker,vtkAbstractPropPicker);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00064 
00067   vtkSetMacro(Tolerance,float);
00068   vtkGetMacro(Tolerance,float);
00070 
00072 
00074   vtkGetVectorMacro(MapperPosition,float,3);
00076 
00078 
00079   vtkGetObjectMacro(Mapper,vtkAbstractMapper3D);
00081 
00083 
00085   vtkGetObjectMacro(DataSet,vtkDataSet);
00087 
00090   vtkProp3DCollection *GetProp3Ds() {return this->Prop3Ds;};
00091 
00095   vtkActorCollection *GetActors();
00096 
00100   vtkPoints *GetPickedPositions() {return this->PickedPositions;};
00101   
00103 
00107   virtual int Pick(float selectionX, float selectionY, float selectionZ, 
00108                    vtkRenderer *renderer);  
00110 
00112 
00116   int Pick(float selectionPt[3], vtkRenderer *ren)
00117     {return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren);};
00119       
00120 protected:
00121   vtkPicker();
00122   ~vtkPicker();
00123 
00124   void MarkPicked(vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m, 
00125                   float tMin, float mapperPos[3]);
00126   virtual float IntersectWithLine(float p1[3], float p2[3], float tol, 
00127                                   vtkAssemblyPath *path, vtkProp3D *p, 
00128                                   vtkAbstractMapper3D *m);
00129   virtual void Initialize();
00130 
00131   float Tolerance; //tolerance for computation (% of window)
00132   float MapperPosition[3]; //selection point in untransformed coordinates
00133 
00134   vtkAbstractMapper3D *Mapper; //selected mapper (if the prop has a mapper)
00135   vtkDataSet *DataSet; //selected dataset (if there is one)
00136 
00137   float GlobalTMin; //parametric coordinate along pick ray where hit occured
00138   vtkTransform *Transform; //use to perform ray transformation
00139   vtkActorCollection *Actors; //candidate actors (based on bounding box)
00140   vtkProp3DCollection *Prop3Ds; //candidate actors (based on bounding box)
00141   vtkPoints *PickedPositions; // candidate positions
00142   
00143 private:
00144   vtkPicker(const vtkPicker&);  // Not implemented.
00145   void operator=(const vtkPicker&);  // Not implemented.
00146 };
00147 
00148 
00149 #endif
00150 
00151