Go to the documentation of this file.
146 #ifndef vtkModifiedBSPTree_h
147 #define vtkModifiedBSPTree_h
149 #include "vtkFiltersFlowPathsModule.h"
153 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],
221 const double p1[3],
const double p2[3],
const double tol,
229 double pcoords[3],
double *weights)
override;
259 const double tol,
double &t,
double ipt[3],
double pcoords[3],
int &subId);
273 #ifndef DOXYGEN_SHOULD_SKIP_THIS
279 mChild[0] = mChild[1] = mChild[2] =
nullptr;
280 for (
int i=0; i<6; i++) sorted_cell_lists[i] =
nullptr;
285 for (
int i=0; i<3; i++)
delete mChild[i];
286 for (
int i=0; i<6; i++)
delete []sorted_cell_lists[i];
289 void setMin(
double minx,
double miny,
double minz) {
290 this->Bounds[0] = minx; this->Bounds[2] = miny; this->Bounds[4] = minz;
293 void setMax(
double maxx,
double maxy,
double maxz) {
294 this->Bounds[1] = maxx; this->Bounds[3] = maxy; this->Bounds[5] = maxz;
297 bool Inside(
double point[3])
const;
312 void Classify(
const double origin[3],
const double dir[3],
313 double &rDist, BSPNode *&Near, BSPNode *&Mid, BSPNode *&Far)
const;
315 bool RayMinMaxT(
const double origin[3],
const double dir[3],
316 double &rTmin,
double &rTmax)
const;
319 friend class vtkParticleBoxTree;
321 static bool VTKFILTERSFLOWPATHS_EXPORT RayMinMaxT(
322 const double bounds[6],
const double origin[3],
const double dir[3],
double &rTmin,
double &rTmax);
323 static int VTKFILTERSFLOWPATHS_EXPORT getDominantAxis(
const double dir[3]);
represent and manipulate 3D points
~vtkModifiedBSPTree() override
void Subdivide(BSPNode *node, Sorted_cell_extents_Lists *lists, vtkDataSet *dataSet, vtkIdType nCells, int depth, int maxlevel, vtkIdType maxCells, int &MaxDepth)
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void BuildLocatorInternal()
virtual vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
void BuildLocator() override
Build Tree.
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)
bool InsideCellBounds(double x[3], vtkIdType cell_ID) override
Quickly test if a point is inside the bounds of a particular cell.
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.
vtkIdListCollection * GetLeafNodeCellInformation()
After subdivision has completed, one may wish to query the tree to find which cells are in which leaf...
void BuildLocatorIfNeeded()
virtual void GenerateRepresentationLeafs(vtkPolyData *pd)
Generate BBox representation of all leaf nodes.
void GenerateRepresentation(int level, vtkPolyData *pd) override
Generate BBox representation of Nth level.
a simple class to control print indentation
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.
list of point or cell ids
maintain an ordered list of IdList objects
an abstract base class for locators which find cells
abstract class to specify dataset behavior
static vtkModifiedBSPTree * New()
Construct with maximum 32 cells per node.
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.
concrete dataset represents vertices, lines, polygons, and triangle strips
provides thread-safe access to cells
void FreeSearchStructure() override
Free tree memory.
Generate axis aligned BBox tree for raycasting and other Locator based searches.
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.