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
00068 #ifndef __vtkPicker_h
00069 #define __vtkPicker_h
00070
00071 #include "vtkObject.h"
00072 #include "vtkAbstractPropPicker.h"
00073 #include "vtkRenderer.h"
00074 #include "vtkActor.h"
00075 #include "vtkActorCollection.h"
00076 #include "vtkProp3DCollection.h"
00077 #include "vtkMapper.h"
00078 #include "vtkTransform.h"
00079
00080 class VTK_RENDERING_EXPORT vtkPicker : public vtkAbstractPropPicker
00081 {
00082 public:
00083 static vtkPicker *New();
00084 vtkTypeMacro(vtkPicker,vtkAbstractPropPicker);
00085 void PrintSelf(ostream& os, vtkIndent indent);
00086
00088
00091 vtkSetMacro(Tolerance,float);
00092 vtkGetMacro(Tolerance,float);
00094
00096
00098 vtkGetVectorMacro(MapperPosition,float,3);
00100
00102
00103 vtkGetObjectMacro(Mapper,vtkAbstractMapper3D);
00105
00107
00109 vtkGetObjectMacro(DataSet,vtkDataSet);
00111
00114 vtkProp3DCollection *GetProp3Ds() {return this->Prop3Ds;};
00115
00117
00120 vtkActorCollection *GetActors() {
00121 if (this->Actors->GetNumberOfItems() !=
00122 this->PickedPositions->GetNumberOfPoints()) {
00123 vtkWarningMacro(<<"Not all Prop3Ds are actors, use GetProp3Ds instead");}
00124 return this->Actors; };
00126
00130 vtkPoints *GetPickedPositions() {return this->PickedPositions;};
00131
00133
00137 virtual int Pick(float selectionX, float selectionY, float selectionZ,
00138 vtkRenderer *renderer);
00140
00142
00146 int Pick(float selectionPt[3], vtkRenderer *ren)
00147 {return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren);};
00149
00150 protected:
00151 vtkPicker();
00152 ~vtkPicker();
00153
00154 void MarkPicked(vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m,
00155 float tMin, float mapperPos[3]);
00156 virtual float IntersectWithLine(float p1[3], float p2[3], float tol,
00157 vtkAssemblyPath *path, vtkProp3D *p,
00158 vtkAbstractMapper3D *m);
00159 virtual void Initialize();
00160
00161 float Tolerance;
00162 float MapperPosition[3];
00163
00164 vtkAbstractMapper3D *Mapper;
00165 vtkDataSet *DataSet;
00166
00167 float GlobalTMin;
00168 vtkTransform *Transform;
00169 vtkActorCollection *Actors;
00170 vtkProp3DCollection *Prop3Ds;
00171 vtkPoints *PickedPositions;
00172
00173 private:
00174 vtkPicker(const vtkPicker&);
00175 void operator=(const vtkPicker&);
00176 };
00177
00178
00179 #endif
00180
00181