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

vtkPointLocator2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPointLocator2D.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00045 #ifndef __vtkPointLocator2D_h
00046 #define __vtkPointLocator2D_h
00047 
00048 #include "vtkLocator.h"
00049 
00050 class vtkCellArray;
00051 class vtkIdList;
00052 class vtkNeighborPoints2D;
00053 class vtkPoints;
00054 
00055 class VTK_COMMON_EXPORT vtkPointLocator2D : public vtkLocator
00056 {
00057 public:
00060   static vtkPointLocator2D *New();
00061 
00062   vtkTypeRevisionMacro(vtkPointLocator2D,vtkLocator);
00063   void PrintSelf(ostream& os, vtkIndent indent);
00064 
00066 
00067   vtkSetVector2Macro(Divisions,int);
00068   vtkGetVectorMacro(Divisions,int,2);
00070 
00072 
00073   vtkSetClampMacro(NumberOfPointsPerBucket,int,1,VTK_LARGE_INTEGER);
00074   vtkGetMacro(NumberOfPointsPerBucket,int);
00076 
00078   virtual int FindClosestPoint(float x[2]);
00079 
00083   virtual int IsInsertedPoint(float x[2]);
00084 
00086 
00090   virtual void FindClosestNPoints(int N, float x[2], vtkIdList *result);
00091   virtual void FindClosestNPoints(int N, float x, float y,
00092                                   vtkIdList *result);
00094 
00096 
00099   virtual void FindDistributedPoints(int N, float x[2], 
00100                                      vtkIdList *result, int M);
00101   virtual void FindDistributedPoints(int N, float x, float y, 
00102                                      vtkIdList *result, int M);
00104 
00106 
00108   virtual void FindPointsWithinRadius(float R, float x[2], vtkIdList *result);
00109   virtual void FindPointsWithinRadius(float R, float x, float y,
00110                                       vtkIdList *result);
00111   // Description:
00112   // See vtkLocator interface documentation.
00113   void Initialize();
00114   void FreeSearchStructure();
00115   void BuildLocator();
00116   void GenerateRepresentation(int level, vtkPolyData *pd);
00118 
00120 
00121   virtual void SetPoints(vtkPoints*);
00122   vtkGetObjectMacro(Points,vtkPoints);
00124   
00125 protected:
00126   vtkPointLocator2D();
00127   ~vtkPointLocator2D();
00128 
00129   // place points in appropriate buckets
00130   void GetBucketNeighbors(int ijk[2], int ndivs[2], int level);
00131   void GetOverlappingBuckets(float x[2], int ijk[2], float dist, int level);
00132   void GenerateFace(int face, int i, int j, int k, 
00133                     vtkPoints *pts, vtkCellArray *polys);
00134 
00135   vtkPoints *Points; // Used for merging points
00136   int Divisions[2]; // Number of sub-divisions in x-y-z directions
00137   int NumberOfPointsPerBucket; //Used with previous boolean to control subdivide
00138   float Bounds[4]; // bounds of points
00139   vtkIdList **HashTable; // lists of point ids in buckets
00140   int NumberOfBuckets; // total size of hash table
00141   float H[2]; // width of each bucket in x-y-z directions
00142   vtkNeighborPoints2D *Buckets;
00143   float InsertionTol2;
00144 private:
00145   vtkPointLocator2D(const vtkPointLocator2D&);  // Not implemented.
00146   void operator=(const vtkPointLocator2D&);  // Not implemented.
00147 };
00148 
00149 #endif
00150 
00151