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

vtkPicker.h

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