143 #ifndef vtkModifiedBSPTree_h
144 #define vtkModifiedBSPTree_h
147 #include "vtkFiltersFlowPathsModule.h"
150 class Sorted_cell_extents_Lists;
200 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
201 double pcoords[3],
int& subId,
vtkIdType& cellId)
override;
207 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
226 double x[3],
double tol2,
vtkGenericCell* GenCell,
double pcoords[3],
double* weights)
override;
256 const double tol,
double& t,
double ipt[3],
double pcoords[3],
int& subId);
271 #ifndef DOXYGEN_SHOULD_SKIP_THIS
279 mChild[0] = mChild[1] = mChild[2] =
nullptr;
280 for (
int i = 0; i < 6; i++)
281 sorted_cell_lists[i] =
nullptr;
282 for (
int i = 0; i < 3; i++)
291 for (
int i = 0; i < 3; i++)
293 for (
int i = 0; i < 6; i++)
294 delete[] sorted_cell_lists[i];
297 void setMin(
double minx,
double miny,
double minz)
299 this->Bounds[0] = minx;
300 this->Bounds[2] = miny;
301 this->Bounds[4] = minz;
304 void setMax(
double maxx,
double maxy,
double maxz)
306 this->Bounds[1] = maxx;
307 this->Bounds[3] = maxy;
308 this->Bounds[5] = maxz;
311 bool Inside(
double point[3])
const;
327 void Classify(
const double origin[3],
const double dir[3],
double& rDist, BSPNode*& Near,
328 BSPNode*& Mid, BSPNode*& Far)
const;
330 bool RayMinMaxT(
const double origin[3],
const double dir[3],
double& rTmin,
double& rTmax)
const;
333 friend class vtkParticleBoxTree;
336 static bool VTKFILTERSFLOWPATHS_EXPORT RayMinMaxT(
const double bounds[6],
const double origin[3],
337 const double dir[3],
double& rTmin,
double& rTmax);
338 static int VTKFILTERSFLOWPATHS_EXPORT getDominantAxis(
const double dir[3]);
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 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.
abstract class to specify dataset behavior
provides thread-safe access to cells
maintain an ordered list of IdList objects
list of point or cell ids
a simple class to control print indentation
Generate axis aligned BBox tree for raycasting and other Locator based searches.
virtual int IntersectCellInternal(vtkIdType cell_ID, const double p1[3], const double p2[3], const double tol, double &t, double ipt[3], double pcoords[3], int &subId)
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId) override
Return intersection point (if any) AND the cell which was intersected by the finite line.
vtkIdType FindCell(double x[3], double tol2, vtkGenericCell *GenCell, double pcoords[3], double *weights) override
Test a point to find if it is inside a cell.
int IntersectWithLine(const double p1[3], const double p2[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 int IntersectWithLine(const double p1[3], const double p2[3], const double tol, vtkPoints *points, vtkIdList *cellIds)
Take the passed line segment and intersect it with the data set.
~vtkModifiedBSPTree() override
void GenerateRepresentation(int level, vtkPolyData *pd) override
Generate BBox representation of Nth level.
vtkIdListCollection * GetLeafNodeCellInformation()
After subdivision has completed, one may wish to query the tree to find which cells are in which leaf...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool InsideCellBounds(double x[3], vtkIdType cell_ID) override
Quickly test if a point is inside the bounds of a particular cell.
void BuildLocatorIfNeeded()
virtual void GenerateRepresentationLeafs(vtkPolyData *pd)
Generate BBox representation of all leaf nodes.
void Subdivide(BSPNode *node, Sorted_cell_extents_Lists *lists, vtkDataSet *dataSet, vtkIdType nCells, int depth, int maxlevel, vtkIdType maxCells, int &MaxDepth)
static vtkModifiedBSPTree * New()
Construct with maximum 32 cells per node.
void FreeSearchStructure() override
Free tree memory.
void BuildLocatorInternal()
void BuildLocator() override
Build Tree.
represent and manipulate 3D points
concrete dataset represents vertices, lines, polygons, and triangle strips