204#ifndef vtkModifiedBSPTree_h
205#define vtkModifiedBSPTree_h
208#include "vtkFiltersFlowPathsModule.h"
211class Sorted_cell_extents_Lists;
261 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
262 double pcoords[3],
int& subId,
vtkIdType& cellId)
override;
268 int IntersectWithLine(
const double p1[3],
const double p2[3],
double tol,
double& t,
double x[3],
287 double x[3],
double tol2,
vtkGenericCell* GenCell,
double pcoords[3],
double* weights)
override;
317 const double tol,
double& t,
double ipt[3],
double pcoords[3],
int& subId);
332#ifndef DOXYGEN_SHOULD_SKIP_THIS
340 mChild[0] = mChild[1] = mChild[2] =
nullptr;
341 for (
int i = 0; i < 6; i++)
342 sorted_cell_lists[i] =
nullptr;
343 for (
int i = 0; i < 3; i++)
352 for (
int i = 0; i < 3; i++)
354 for (
int i = 0; i < 6; i++)
355 delete[] sorted_cell_lists[i];
358 void setMin(
double minx,
double miny,
double minz)
360 this->Bounds[0] = minx;
361 this->Bounds[2] = miny;
362 this->Bounds[4] = minz;
365 void setMax(
double maxx,
double maxy,
double maxz)
367 this->Bounds[1] = maxx;
368 this->Bounds[3] = maxy;
369 this->Bounds[5] = maxz;
372 bool Inside(
double point[3])
const;
388 void Classify(
const double origin[3],
const double dir[3],
double& rDist, BSPNode*& Near,
389 BSPNode*& Mid, BSPNode*& Far)
const;
391 bool RayMinMaxT(
const double origin[3],
const double dir[3],
double& rTmin,
double& rTmax)
const;
394 friend class vtkParticleBoxTree;
397 static bool VTKFILTERSFLOWPATHS_EXPORT RayMinMaxT(
const double bounds[6],
const double origin[3],
398 const double dir[3],
double& rTmin,
double& rTmax);
399 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.
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()
vtkIdListCollection * GetLeafNodeCellInformation()
After subdivision has completed, one may wish to query the tree to find which cells are in which leaf...
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)
void FreeSearchStructure() override
Free tree memory.
void BuildLocatorInternal()
void BuildLocator() override
Build Tree.
static vtkModifiedBSPTree * New()
Construct with maximum 32 cells per node.
represent and manipulate 3D points
concrete dataset represents vertices, lines, polygons, and triangle strips