44 #ifndef vtkCellLocator_h
45 #define vtkCellLocator_h
47 #include "vtkCommonDataModelModule.h"
50 class vtkNeighborCells;
84 double& t,
double x[3],
double pcoords[3],
100 double x[3],
double closestPoint[3],
102 int &subId,
double& dist2) VTK_OVERRIDE;
122 double x[3],
double radius,
double closestPoint[3],
124 int &subId,
double& dist2,
int &inside) VTK_OVERRIDE;
144 double pcoords[3],
double *weights) VTK_OVERRIDE;
161 double tolerance,
vtkIdList *cells) VTK_OVERRIDE;
168 void BuildLocator() VTK_OVERRIDE;
169 virtual
void BuildLocatorIfNeeded();
170 virtual
void ForceBuildLocator();
171 virtual
void BuildLocatorInternal();
179 void GetBucketNeighbors(
int ijk[3],
int ndivs,
int level);
180 void GetOverlappingBuckets(
double x[3],
int ijk[3],
double dist,
181 int prevMinLevel[3],
int prevMaxLevel[3]);
183 void ClearCellHasBeenVisited();
184 void ClearCellHasBeenVisited(
int id);
186 double Distance2ToBucket(
double x[3],
int nei[3]);
187 double Distance2ToBounds(
double x[3],
double bounds[6]);
193 int NumberOfDivisions;
196 void MarkParents(
void*,
int,
int,
int,
int,
int);
197 void GetChildren(
int idx,
int level,
int children[8]);
198 int GenerateIndex(
int offset,
int numDivs,
int i,
int j,
int k,
200 void GenerateFace(
int face,
int numDivs,
int i,
int j,
int k,
203 vtkNeighborCells *Buckets;
204 unsigned char *CellHasBeenVisited;
205 unsigned char QueryNumber;
207 void ComputeOctantBounds(
int i,
int j,
int k);
208 double OctantBounds[6];
209 int IsInOctantBounds(
double x[3],
double tol = 0.0)
211 if ( this->OctantBounds[0]-tol <= x[0] && x[0] <= this->OctantBounds[1]+tol &&
212 this->OctantBounds[2]-tol <= x[1] && x[1] <= this->OctantBounds[3]+tol &&
213 this->OctantBounds[4]-tol <= x[2] && x[2] <= this->OctantBounds[5]+tol )
an abstract base class for locators which find cells
virtual vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
virtual void FindClosestPoint(double x[3], double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point and the cell which is closest to the point x.
virtual void SetNumberOfCellsPerNode(int)
Specify the preferred/maximum number of cells in each node/bucket.
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
Return intersection point (if any) of finite line with cells contained in cell locator.
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point within a specified radius and the cell which is closest to the point x.
object to represent cell connectivity
octree-based spatial search object to quickly locate cells
void FindClosestPoint(double x[3], double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2) override
Return the closest point and the cell which is closest to the point x.
void FreeSearchStructure() override
Satisfy vtkLocator abstract interface.
int GetNumberOfCellsPerBucket()
virtual int GetNumberOfBuckets(void)
Return number of buckets available.
void SetNumberOfCellsPerBucket(int N)
Specify the average number of cells in each octant.
void FindCellsWithinBounds(double *bbox, vtkIdList *cells) override
Return a list of unique cell ids inside of a given bounding box.
void FindCellsAlongLine(double p1[3], double p2[3], double tolerance, vtkIdList *cells) override
Given a finite line defined by the two points (p1,p2), return the list of unique cell ids in the buck...
vtkIdType FindCell(double x[3], double tol2, vtkGenericCell *GenCell, double pcoords[3], double *weights) override
Find the cell containing a given point.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCellLocator * New()
Construct with automatic computation of divisions, averaging 25 cells per bucket.
int IntersectWithLine(double a0[3], double a1[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell) override
Return intersection point (if any) AND the cell which was intersected by the finite line.
virtual vtkIdList * GetCells(int bucket)
Get the cells in a particular bucket.
vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2, int &inside) override
Return the closest point within a specified radius and the cell which is closest to the point x.
provides thread-safe access to cells
list of point or cell ids
a simple class to control print indentation
represent and manipulate 3D points
concrete dataset represents vertices, lines, polygons, and triangle strips