00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00064 #ifndef __vtkPicker_h
00065 #define __vtkPicker_h
00066
00067 #include "vtkObject.h"
00068 #include "vtkAbstractPropPicker.h"
00069 #include "vtkRenderer.h"
00070 #include "vtkActor.h"
00071 #include "vtkActorCollection.h"
00072 #include "vtkProp3DCollection.h"
00073 #include "vtkMapper.h"
00074 #include "vtkTransform.h"
00075
00076 class VTK_EXPORT vtkPicker : public vtkAbstractPropPicker
00077 {
00078 public:
00079 static vtkPicker *New();
00080 vtkTypeMacro(vtkPicker,vtkAbstractPropPicker);
00081 void PrintSelf(ostream& os, vtkIndent indent);
00082
00086 vtkSetMacro(Tolerance,float);
00087 vtkGetMacro(Tolerance,float);
00088
00091 vtkGetVectorMacro(MapperPosition,float,3);
00092
00094 vtkGetObjectMacro(Mapper,vtkAbstractMapper3D);
00095
00098 vtkGetObjectMacro(DataSet,vtkDataSet);
00099
00102 vtkProp3DCollection *GetProp3Ds() {return this->Prop3Ds;};
00103
00107 vtkActorCollection *GetActors() {
00108 if (this->Actors->GetNumberOfItems() !=
00109 this->PickedPositions->GetNumberOfPoints()) {
00110 vtkWarningMacro(<<"Not all Prop3Ds are actors, use GetProp3Ds instead");}
00111 return this->Actors; };
00112
00116 vtkPoints *GetPickedPositions() {return this->PickedPositions;};
00117
00122 virtual int Pick(float selectionX, float selectionY, float selectionZ,
00123 vtkRenderer *renderer);
00124
00129 int Pick(float selectionPt[3], vtkRenderer *ren)
00130 {return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren);};
00131
00132 protected:
00133 vtkPicker();
00134 ~vtkPicker();
00135 vtkPicker(const vtkPicker&) {};
00136 void operator=(const vtkPicker&) {};
00137
00138 void MarkPicked(vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m,
00139 float tMin, float mapperPos[3]);
00140 virtual float IntersectWithLine(float p1[3], float p2[3], float tol,
00141 vtkAssemblyPath *path, vtkProp3D *p,
00142 vtkAbstractMapper3D *m);
00143 virtual void Initialize();
00144
00145 float Tolerance;
00146 float MapperPosition[3];
00147
00148 vtkAbstractMapper3D *Mapper;
00149 vtkDataSet *DataSet;
00150
00151 float GlobalTMin;
00152 vtkTransform *Transform;
00153 vtkActorCollection *Actors;
00154 vtkProp3DCollection *Prop3Ds;
00155 vtkPoints *PickedPositions;
00156
00157 };
00158
00159
00160 #endif
00161
00162