43 #ifndef __vtkCellLocator_h
44 #define __vtkCellLocator_h
46 #include "vtkCommonDataModelModule.h"
47 #include "vtkAbstractCellLocator.h"
49 class vtkNeighborCells;
51 class VTKCOMMONDATAMODEL_EXPORT
vtkCellLocator :
public vtkAbstractCellLocator
55 void PrintSelf(ostream& os,
vtkIndent indent);
64 { this->SetNumberOfCellsPerNode(N); }
66 {
return this->NumberOfCellsPerNode; }
82 double a0[3],
double a1[3],
double tol,
83 double& t,
double x[3],
double pcoords[3],
87 IntersectWithLine(a0, a1, tol,t, x, pcoords, subId);
94 double a0[3],
double a1[3],
double tol,
95 double& t,
double x[3],
double pcoords[3],
99 IntersectWithLine(a0, a1, tol,t, x, pcoords, subId, cellId);
106 const double a0[3],
const double a1[3],
110 IntersectWithLine(a0, a1, points, cellIds);
119 virtual int IntersectWithLine(
double a0[3],
double a1[3],
double tol,
120 double& t,
double x[3],
double pcoords[3],
128 double x[3],
double closestPoint[3],
129 vtkIdType &cellId,
int &subId,
double& dist2)
132 FindClosestPoint(x, closestPoint, cellId, subId, dist2);
146 virtual void FindClosestPoint(
147 double x[3],
double closestPoint[3],
149 int &subId,
double& dist2);
155 double x[3],
double radius,
156 double closestPoint[3],
vtkIdType &cellId,
157 int &subId,
double& dist2)
159 return Superclass::FindClosestPointWithinRadius
160 (x, radius, closestPoint, cellId, subId, dist2);
167 double x[3],
double radius,
168 double closestPoint[3],
170 int &subId,
double& dist2)
172 return Superclass::FindClosestPointWithinRadius
173 (x, radius, closestPoint, cell, cellId, subId, dist2);
194 virtual vtkIdType FindClosestPointWithinRadius(
195 double x[3],
double radius,
double closestPoint[3],
197 int &subId,
double& dist2,
int &inside);
205 virtual int GetNumberOfBuckets(
void);
211 {
return this->Superclass::FindCell(x); }
220 double pcoords[3],
double *weights);
226 virtual void FindCellsWithinBounds(
double *bbox,
vtkIdList *cells);
234 virtual void FindCellsAlongLine(
235 double p1[3],
double p2[3],
double tolerance,
vtkIdList *cells);
240 virtual void FreeSearchStructure();
241 virtual void BuildLocator();
242 virtual void BuildLocatorIfNeeded();
243 virtual void ForceBuildLocator();
244 virtual void BuildLocatorInternal();
245 virtual void GenerateRepresentation(
int level, vtkPolyData *pd);
252 void GetBucketNeighbors(
int ijk[3],
int ndivs,
int level);
253 void GetOverlappingBuckets(
double x[3],
int ijk[3],
double dist,
254 int prevMinLevel[3],
int prevMaxLevel[3]);
256 void ClearCellHasBeenVisited();
257 void ClearCellHasBeenVisited(
int id);
259 double Distance2ToBucket(
double x[3],
int nei[3]);
260 double Distance2ToBounds(
double x[3],
double bounds[6]);
269 void MarkParents(
void*,
int,
int,
int,
int,
int);
270 void GetChildren(
int idx,
int level,
int children[8]);
271 int GenerateIndex(
int offset,
int numDivs,
int i,
int j,
int k,
273 void GenerateFace(
int face,
int numDivs,
int i,
int j,
int k,
280 void ComputeOctantBounds(
int i,
int j,
int k);
281 double OctantBounds[6];
284 if ( this->OctantBounds[0] <= x[0] && x[0] <= this->OctantBounds[1] &&
285 this->OctantBounds[2] <= x[1] && x[1] <= this->OctantBounds[3] &&
286 this->OctantBounds[4] <= x[2] && x[2] <= this->OctantBounds[5] )
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2)
int IsInOctantBounds(double x[3])
vtkNeighborCells * Buckets
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
virtual int IntersectWithLine(double a0[3], double a1[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
int GetNumberOfCellsPerBucket()
void SetNumberOfCellsPerBucket(int N)
provides thread-safe access to cells
unsigned char * CellHasBeenVisited
octree-based spatial search object to quickly locate cells
virtual vtkIdType FindCell(double x[3])
a simple class to control print indentation
list of point or cell ids
unsigned char QueryNumber
virtual int IntersectWithLine(const double a0[3], const double a1[3], vtkPoints *points, vtkIdList *cellIds)
virtual int IntersectWithLine(double a0[3], double a1[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId)
represent and manipulate 3D points
virtual void FindClosestPoint(double x[3], double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)