00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00049 #ifndef __vtkAreaPicker_h
00050 #define __vtkAreaPicker_h
00051
00052 #include "vtkAbstractPropPicker.h"
00053
00054 class vtkRenderer;
00055 class vtkPoints;
00056 class vtkPlanes;
00057 class vtkProp3DCollection;
00058 class vtkAbstractMapper3D;
00059 class vtkDataSet;
00060 class vtkExtractSelectedFrustum;
00061 class vtkProp;
00062 class vtkImageActor;
00063
00064 class VTK_RENDERING_EXPORT vtkAreaPicker : public vtkAbstractPropPicker
00065 {
00066 public:
00067 static vtkAreaPicker *New();
00068 vtkTypeMacro(vtkAreaPicker,vtkAbstractPropPicker);
00069 void PrintSelf(ostream& os, vtkIndent indent);
00070
00072 void SetPickCoords(double x0, double y0, double x1, double y1);
00073
00075 void SetRenderer(vtkRenderer *);
00076
00078 virtual int Pick();
00079
00084 virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer *renderer = NULL);
00085
00087
00090 virtual int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer = NULL)
00091 {return this->AreaPick(x0, y0, x0+1.0, y0+1.0, renderer);};
00093
00095
00096 vtkGetObjectMacro(Mapper,vtkAbstractMapper3D);
00098
00100
00102 vtkGetObjectMacro(DataSet,vtkDataSet);
00104
00107 vtkProp3DCollection *GetProp3Ds() {return this->Prop3Ds;};
00108
00110
00113 vtkGetObjectMacro(Frustum, vtkPlanes);
00115
00117
00118 vtkGetObjectMacro(ClipPoints, vtkPoints);
00120
00121 protected:
00122 vtkAreaPicker();
00123 ~vtkAreaPicker();
00124
00125 virtual void Initialize();
00126 void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *renderer);
00127 virtual int PickProps(vtkRenderer *renderer);
00128 int TypeDecipher(vtkProp *, vtkImageActor **, vtkAbstractMapper3D **);
00129
00130 int ABoxFrustumIsect(double bounds[], double &mindist);
00131
00132 vtkPoints *ClipPoints;
00133 vtkPlanes *Frustum;
00134
00135 vtkProp3DCollection *Prop3Ds;
00136 vtkAbstractMapper3D *Mapper;
00137 vtkDataSet *DataSet;
00138
00139
00140 vtkExtractSelectedFrustum *FrustumExtractor;
00141
00142 double X0;
00143 double Y0;
00144 double X1;
00145 double Y1;
00146
00147 private:
00148 vtkAreaPicker(const vtkAreaPicker&);
00149 void operator=(const vtkAreaPicker&);
00150 };
00151
00152 #endif
00153
00154