145 #ifndef vtkModifiedBSPTree_h
146 #define vtkModifiedBSPTree_h
149 #include "vtkFiltersFlowPathsModule.h"
152 class Sorted_cell_extents_Lists;
202 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
203 double pcoords[3],
int& subId,
vtkIdType& cellId)
override;
209 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
228 double x[3],
double tol2,
vtkGenericCell* GenCell,
double pcoords[3],
double* weights)
override;
258 const double tol,
double& t,
double ipt[3],
double pcoords[3],
int& subId);
273 #ifndef DOXYGEN_SHOULD_SKIP_THIS
281 mChild[0] = mChild[1] = mChild[2] =
nullptr;
282 for (
int i = 0; i < 6; i++)
283 sorted_cell_lists[i] =
nullptr;
284 for (
int i = 0; i < 3; i++)
293 for (
int i = 0; i < 3; i++)
295 for (
int i = 0; i < 6; i++)
296 delete[] sorted_cell_lists[i];
299 void setMin(
double minx,
double miny,
double minz)
301 this->Bounds[0] = minx;
302 this->Bounds[2] = miny;
303 this->Bounds[4] = minz;
306 void setMax(
double maxx,
double maxy,
double maxz)
308 this->Bounds[1] = maxx;
309 this->Bounds[3] = maxy;
310 this->Bounds[5] = maxz;
313 bool Inside(
double point[3])
const;
329 void Classify(
const double origin[3],
const double dir[3],
double& rDist, BSPNode*& Near,
330 BSPNode*& Mid, BSPNode*& Far)
const;
332 bool RayMinMaxT(
const double origin[3],
const double dir[3],
double& rTmin,
double& rTmax)
const;
335 friend class vtkParticleBoxTree;
338 static bool VTKFILTERSFLOWPATHS_EXPORT RayMinMaxT(
const double bounds[6],
const double origin[3],
339 const double dir[3],
double& rTmin,
double& rTmax);
340 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
Standard Type-Macro.
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