37 #ifndef vtkCellTreeLocator_h 38 #define vtkCellTreeLocator_h 41 #include "vtkFiltersGeneralModule.h" 44 class vtkCellPointTraversal;
69 double* weights)
override;
75 int IntersectWithLine(
const double a0[3],
const double a1[3],
double tol,
double& t,
double x[3],
96 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
97 double pcoords[3],
int& subId)
override 99 return this->Superclass::IntersectWithLine(p1, p2, tol, t, x, pcoords, subId);
108 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
109 double pcoords[3],
int& subId,
vtkIdType& cellId)
override;
117 return this->Superclass::IntersectWithLine(p1, p2,
points, cellIds);
131 virtual void BuildLocatorInternal();
132 virtual void BuildLocatorIfNeeded();
133 virtual void ForceBuildLocator();
147 friend class vtkCellPointTraversal;
149 friend class vtkCellTreeBuilder;
178 friend class vtkCellPointTraversal;
179 friend class vtkCellTreeBuilder;
182 void MakeNode(
unsigned int left,
unsigned int d,
float b[2]);
183 void SetChildren(
unsigned int left);
185 unsigned int GetLeftChildIndex()
const;
186 unsigned int GetRightChildIndex()
const;
187 unsigned int GetDimension()
const;
188 const float& GetLeftMaxValue()
const;
189 const float& GetRightMinValue()
const;
190 void MakeLeaf(
unsigned int start,
unsigned int size);
192 unsigned int Start()
const;
193 unsigned int Size()
const;
201 bool RayMinMaxT(
const double origin[3],
const double dir[3],
double& rTmin,
double& rTmax);
203 bool RayMinMaxT(
const double bounds[6],
const double origin[3],
const double dir[3],
204 double& rTmin,
double& rTmax);
206 int getDominantAxis(
const double dir[3]);
209 void Classify(
const double origin[3],
const double dir[3],
double& rDist,
vtkCellTreeNode*& near,
217 virtual int IntersectCellInternal(
vtkIdType cell_ID,
const double p1[3],
const double p2[3],
218 const double tol,
double& t,
double ipt[3],
double pcoords[3],
int& subId);
224 friend class vtkCellPointTraversal;
226 friend class vtkCellTreeBuilder;
std::vector< vtkCellTreeNode > Nodes
virtual void BuildLocator()=0
Build the locator from the input dataset.
virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells)
Return a list of unique cell ids inside of a given bounding box.
Internal classes made public to allow subclasses to create customized some traversal algorithms...
an abstract base class for locators which find cells
dynamic, self-adjusting array of vtkIdType
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 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
std::vector< unsigned int > Leaves
vtkIdType FindCell(double x[3]) override
reimplemented from vtkAbstractCellLocator to support bad compilers
This class is the basic building block of the cell tree.
object to represent cell connectivity
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int IntersectWithLine(const double p1[3], const double p2[3], vtkPoints *points, vtkIdList *cellIds) override
reimplemented from vtkAbstractCellLocator to support bad compilers
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
This class implements the data structures, construction algorithms for fast cell location presented i...
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
reimplemented from vtkAbstractCellLocator to support bad compilers
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
represent and manipulate 3D points