42 #ifndef vtkCellLocator_h 43 #define vtkCellLocator_h 46 #include "vtkCommonDataModelModule.h" 48 class vtkNeighborCells;
81 int IntersectWithLine(
const double a0[3],
const double a1[3],
double tol,
double& t,
double x[3],
97 vtkIdType& cellId,
int& subId,
double& dist2)
override;
129 virtual int GetNumberOfBuckets(
void);
137 double x[3],
double tol2,
vtkGenericCell* GenCell,
double pcoords[3],
double* weights)
override;
155 const double p1[3],
const double p2[3],
double tolerance,
vtkIdList* cells)
override;
163 virtual void BuildLocatorIfNeeded();
164 virtual void ForceBuildLocator();
165 virtual void BuildLocatorInternal();
173 void GetBucketNeighbors(
int ijk[3],
int ndivs,
int level);
174 void GetOverlappingBuckets(
175 const double x[3],
int ijk[3],
double dist,
int prevMinLevel[3],
int prevMaxLevel[3]);
177 void ClearCellHasBeenVisited();
178 void ClearCellHasBeenVisited(
vtkIdType id);
180 double Distance2ToBucket(
const double x[3],
int nei[3]);
181 double Distance2ToBounds(
const double x[3],
double bounds[6]);
190 void MarkParents(
void*,
int,
int,
int,
int,
int);
191 void GetChildren(
int idx,
int level,
int children[8]);
192 int GenerateIndex(
int offset,
int numDivs,
int i,
int j,
int k,
vtkIdType& idx);
200 void ComputeOctantBounds(
int i,
int j,
int k);
201 double OctantBounds[6];
204 if (this->OctantBounds[0] - tol <= x[0] && x[0] <= this->OctantBounds[1] + tol &&
205 this->OctantBounds[2] - tol <= x[1] && x[1] <= this->OctantBounds[3] + tol &&
206 this->OctantBounds[4] - tol <= x[2] && x[2] <= this->OctantBounds[5] + tol)
int IsInOctantBounds(const double x[3], double tol=0.0)
virtual void BuildLocator()=0
Build the locator from the input dataset.
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...
virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells)
Return a list of unique cell ids inside of a given bounding box.
vtkNeighborCells * Buckets
virtual void SetNumberOfCellsPerNode(int)
Specify the preferred/maximum number of cells in each node/bucket.
an abstract base class for locators which find cells
int GetNumberOfCellsPerBucket()
void SetNumberOfCellsPerBucket(int N)
Specify the average number of cells in each octant.
concrete dataset represents vertices, lines, polygons, and triangle strips
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
provides thread-safe access to cells
virtual void FindClosestPoint(const 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.
unsigned char * CellHasBeenVisited
octree-based spatial search object to quickly locate cells
virtual int IntersectWithLine(const double p1[3], const 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.
a simple class to control print indentation
virtual vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
list of point or cell ids
unsigned char QueryNumber
object to represent cell connectivity
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void FindCellsAlongLine(const double p1[3], const double p2[3], double tolerance, vtkIdList *cells)
Given a finite line defined by the two points (p1,p2), return the list of unique cell ids in the buck...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
represent and manipulate 3D points