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
00069 #ifndef __vtkPointLocator2D_h
00070 #define __vtkPointLocator2D_h
00071
00072 #include "vtkLocator.h"
00073 #include "vtkPoints.h"
00074 #include "vtkIdList.h"
00075
00076 class vtkNeighborPoints2D;
00077
00078 class VTK_COMMON_EXPORT vtkPointLocator2D : public vtkLocator
00079 {
00080 public:
00083 static vtkPointLocator2D *New();
00084
00085 vtkTypeMacro(vtkPointLocator2D,vtkLocator);
00086 void PrintSelf(ostream& os, vtkIndent indent);
00087
00089
00090 vtkSetVector2Macro(Divisions,int);
00091 vtkGetVectorMacro(Divisions,int,2);
00093
00095
00096 vtkSetClampMacro(NumberOfPointsPerBucket,int,1,VTK_LARGE_INTEGER);
00097 vtkGetMacro(NumberOfPointsPerBucket,int);
00099
00101 virtual int FindClosestPoint(float x[2]);
00102
00106 virtual int IsInsertedPoint(float x[2]);
00107
00109
00113 virtual void FindClosestNPoints(int N, float x[2], vtkIdList *result);
00114 virtual void FindClosestNPoints(int N, float x, float y,
00115 vtkIdList *result);
00117
00119
00122 virtual void FindDistributedPoints(int N, float x[2],
00123 vtkIdList *result, int M);
00124 virtual void FindDistributedPoints(int N, float x, float y,
00125 vtkIdList *result, int M);
00127
00129
00131 virtual void FindPointsWithinRadius(float R, float x[2], vtkIdList *result);
00132 virtual void FindPointsWithinRadius(float R, float x, float y,
00133 vtkIdList *result);
00134
00135
00136 void Initialize();
00137 void FreeSearchStructure();
00138 void BuildLocator();
00139 void GenerateRepresentation(int level, vtkPolyData *pd);
00141
00143
00144 vtkSetObjectMacro(Points,vtkPoints);
00145 vtkGetObjectMacro(Points,vtkPoints);
00147
00148 protected:
00149 vtkPointLocator2D();
00150 ~vtkPointLocator2D();
00151
00152
00153 void GetBucketNeighbors(int ijk[2], int ndivs[2], int level);
00154 void GetOverlappingBuckets(float x[2], int ijk[2], float dist, int level);
00155 void GenerateFace(int face, int i, int j, int k,
00156 vtkPoints *pts, vtkCellArray *polys);
00157
00158 vtkPoints *Points;
00159 int Divisions[2];
00160 int NumberOfPointsPerBucket;
00161 float Bounds[4];
00162 vtkIdList **HashTable;
00163 int NumberOfBuckets;
00164 float H[2];
00165 vtkNeighborPoints2D *Buckets;
00166 float InsertionTol2;
00167 private:
00168 vtkPointLocator2D(const vtkPointLocator2D&);
00169 void operator=(const vtkPointLocator2D&);
00170 };
00171
00172 #endif
00173
00174