62 #include "vtkCommonDataModelModule.h"
92 vtkGetMacro(Timing,
int);
100 vtkGetMacro(MinCells,
int);
110 vtkGetMacro(NumberOfRegionsOrLess,
int);
120 vtkGetMacro(NumberOfRegionsOrMore,
int);
130 vtkGetMacro(FudgeFactor,
double);
269 vtkGetMacro(NumberOfRegions,
int);
323 vtkGetMacro(IncludeRegionBoundaryCells,
int);
428 double **convexRegionBounds);
437 int ViewOrderAllRegionsInDirection(const
double directionOfProjection[3],
448 const
double directionOfProjection[3],
458 int ViewOrderAllRegionsFromPosition(const
double directionOfProjection[3],
469 const
double directionOfProjection[3],
488 void BuildLocatorFromPoints(
vtkPoints **ptArray,
int numPtArrays);
524 vtkIdType FindClosestPoint(
double x,
double y,
double z,
double &dist2);
533 double radius, const
double x[3],
double& dist2);
541 vtkIdType FindClosestPointInRegion(
int regionId,
double *x,
double &dist2);
542 vtkIdType FindClosestPointInRegion(
int regionId,
double x,
double y,
double z,
552 void FindPointsWithinRadius(
double R, const
double x[3],
vtkIdList *result);
562 void FindClosestNPoints(
int N, const
double x[3],
vtkIdList *result);
574 void FreeSearchStructure() VTK_OVERRIDE;
587 void GenerateRepresentation(
int *regionList,
int len,
vtkPolyData *pd);
598 vtkGetMacro(GenerateRepresentationUsingDataBounds,
int);
604 virtual
void PrintTiming(ostream& os,
vtkIndent indent);
610 virtual
int NewGeometry();
624 virtual
void InvalidateGeometry();
639 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray = true);
651 int ProcessUserDefinedCuts(
double *bounds);
660 void UpdateBuildTime();
669 int DivideTest(
int numberOfPoints,
int level);
753 vtkSetClampMacro(Progress,
double,0.0,1.0);
754 vtkGetMacro(Progress,
double);
822 int **pointsSoFar,
int *len,
823 float tolerance,
float tolerance2);
826 int len,
float tolerance2);
829 double x,
double y,
double z,
double &dist2);
832 int skipRegion,
double &dist2);
840 const double dir[3],
int nextId);
848 const double pos[3],
int nextId);
855 int dims[3],
double origin[3],
double spacing[3]);
857 int dims[3],
double origin[3],
double spacing[3]);
862 static int MidValue(
int dim,
float *c1,
int nvals,
double &coord);
864 static int Select(
int dim,
float *c1,
int *ids,
int nvals,
double &coord);
866 static void _Select(
int dim,
float *X,
int *ids,
int L,
int R,
int K);
877 int midpt,
int dim,
double coord);
885 double CellBoundsCache[6];
887 int GenerateRepresentationUsingDataBounds;
This class represents an axis-aligned Binary Spatial Partitioning of a 3D space.
Perform calculations (mostly intersection calculations) on regions of a 3D binary spatial partitionin...
object to represent cell connectivity
abstract class to specify cell behavior
maintain an unordered list of dataset objects
abstract class to specify dataset behavior
list of point or cell ids
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
dynamic, self-adjusting array of int
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning.
a Kd-tree spatial decomposition of a set of points
void SelfRegister(vtkKdNode *kd)
void NewPartitioningRequest(int req)
void SetInputDataInfo(int i, int dims[3], double origin[3], double spacing[3])
virtual void RemoveAllDataSets()
static void __printTree(vtkKdNode *kd, int depth, int verbose)
float * ComputeCellCenters()
Compute and return a pointer to a list of all cell centers, in order by data set by cell Id.
int DivideRegion(vtkKdNode *kd, float *c1, int *ids, int nlevels)
static void CopyKdNode(vtkKdNode *to, vtkKdNode *from)
static void _SetNewBounds(vtkKdNode *kd, double *b, int *fixDim)
float * ComputeCellCenters(int set)
vtkDataSetCollection * DataSets
void CreateCellLists(int *regionReqList, int listSize)
int GetRegionContainingCell(vtkIdType cellID)
void GetRegionDataBounds(int regionID, double bounds[6])
Get the bounds of the data within the k-d tree region.
void InitializeCellLists()
void OmitYZPartitioning()
Omit partitions along the Y and Z axes, yielding slabs along X.
void NewParitioningRequest(int req)
static int SelfOrder(int id, vtkKdNode *kd)
void OmitZXPartitioning()
Omit partitions along the Z and X axes, yielding slabs along Y.
vtkIdType GetCellLists(vtkIntArray *regions, vtkDataSet *set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
vtkIdType GetCellLists(vtkIntArray *regions, int set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
For a list of regions, get two cell lists.
int _ViewOrderRegionsInDirection(vtkIntArray *IdsOfInterest, const double dop[3], vtkIntArray *orderedList)
void OmitNoPartitioning()
Partition along all three axes - this is the default.
static vtkKdNode ** _GetRegionsAtLevel(int level, vtkKdNode **nodes, vtkKdNode *kd)
void _printTree(int verbose)
int GetNumberOfCells()
Returns the total number of cells in all the data sets.
void GenerateRepresentationDataBounds(int level, vtkPolyData *pd)
void operator=(const vtkKdTree &) VTK_DELETE_FUNCTION
void SetDataSet(vtkDataSet *set) override
This class can compute a spatial decomposition based on the cells in a list of one or more input data...
int NumberOfRegionsOrLess
static int Select(int dim, float *c1, int *ids, int nvals, double &coord)
void UpdateSubOperationProgress(double amount)
vtkDataSet ** LastInputDataSets
void ComputeCellCenter(vtkCell *cell, double *center, double *weights)
double * LastInputDataInfo
int SearchNeighborsForDuplicate(int regionId, float *point, int **pointsSoFar, int *len, float tolerance, float tolerance2)
void AddAllPointsInRegion(vtkKdNode *node, vtkIdList *ids)
static float FindMaxLeftHalf(int dim, float *c1, int K)
int * LocatorRegionLocation
void CreateCellLists(int dataSetIndex, int *regionReqList, int reqListSize)
Create a list for each of the requested regions, listing the IDs of all cells whose centroid falls in...
vtkIdList * GetList(int regionId, vtkIdList **which)
void PrintTree()
Print out nodes of kd tree.
virtual void RemoveDataSet(vtkDataSet *set)
int CheckInputDataInfo(int i, int dims[3], double origin[3], double spacing[3])
static int findRegion(vtkKdNode *node, float x, float y, float z)
void DeleteCellLists()
Free the memory used by the cell lists.
vtkIdType * LastNumPoints
void _generateRepresentationWholeSpace(vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys, int level)
void ClearLastBuildCache()
void OmitYPartitioning()
Omit partitions along the Y axis, yielding shafts in the Y direction.
void GetBounds(double *bounds)
Get the spatial bounds of the entire k-d tree space.
int NumberOfLocatorPoints
static void SetDataBoundsToSpatialBounds(vtkKdNode *kd)
static void CopyChildNodes(vtkKdNode *to, vtkKdNode *from)
static void _Select(int dim, float *X, int *ids, int L, int R, int K)
int GetNumberOfDataSets()
Get the number of data sets included in spatial paritioning.
static int ComputeLevel(vtkKdNode *kd)
int GetRegionContainingCell(int set, vtkIdType cellID)
static int findRegion(vtkKdNode *node, double x, double y, double z)
void UpdateProgress(double amount)
Modelled on vtkAlgorithm::UpdateProgress().
int NumberOfRegionsOrMore
void SetNewBounds(double *bounds)
There are certain applications where you want the bounds of the k-d tree space to be at least as larg...
static void AddNewRegions(vtkKdNode *kd, float *c1, int midpt, int dim, double coord)
static int __ViewOrderRegionsInDirection(vtkKdNode *node, vtkIntArray *list, vtkIntArray *IdsOfInterest, const double dir[3], int nextId)
static int FoundId(vtkIntArray *idArray, int id)
void OmitZPartitioning()
Omit partitions along the Z axis, yielding shafts in the Z direction.
void AddAllPointsInRegion(vtkKdNode *node, vtkIdTypeArray *ids)
void FindPointsWithinRadius(vtkKdNode *node, double R2, const double x[3], vtkIdList *ids)
void ComputeCellCenter(vtkDataSet *set, int cellId, double *center)
void BuildLocator() override
Create the k-d tree decomposition of the cells of the data set or data sets.
int _ViewOrderRegionsFromPosition(vtkIntArray *IdsOfInterest, const double pos[3], vtkIntArray *orderedList)
vtkIdList * GetBoundaryCellList(int regionID)
The cell list obtained with GetCellList is the list of all cells such that their centroid is containe...
void _generateRepresentationDataBounds(vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys, int level)
vtkKdTree(const vtkKdTree &) VTK_DELETE_FUNCTION
static int MidValue(int dim, float *c1, int nvals, double &coord)
virtual int SelectCutDirection(vtkKdNode *kd)
vtkDataSet * GetDataSet() override
Return the 0'th data set.
static int __ViewOrderRegionsFromPosition(vtkKdNode *node, vtkIntArray *list, vtkIntArray *IdsOfInterest, const double pos[3], int nextId)
virtual void AddDataSet(vtkDataSet *set)
This class can compute a spatial decomposition based on the cells in a list of one or more input data...
int * AllGetRegionContainingCell()
Get a list (in order by data set by cell id) of the region IDs of the region containing the centroid ...
void ComputeCellCenter(vtkDataSet *set, int cellId, float *center)
Get or compute the center of one cell.
int IncludeRegionBoundaryCells
void CreateCellLists(vtkDataSet *set, int *regionReqList, int reqListSize)
void FindPointsInArea(vtkKdNode *node, double *area, vtkIdTypeArray *ids)
vtkDataSet * GetDataSet(int n)
Get the nth defined data set in the spatial partitioning.
int FindClosestPointInSphere(double x, double y, double z, double radius, int skipRegion, double &dist2)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdList * GetCellList(int regionID)
Get the cell list for a region.
int GetRegionContainingCell(vtkDataSet *set, vtkIdType cellID)
Get the id of the region containing the cell centroid.
void GetRegionsAtLevel(int level, vtkKdNode **nodes)
Get back a list of the nodes at a specified level, nodes must be preallocated to hold 2^^(level) node...
unsigned long * LastDataSetObserverTags
void OmitXPartitioning()
Omit partitions along the X axis, yielding shafts in the X direction.
static void GetLeafNodeIds(vtkKdNode *node, vtkIntArray *ids)
Adds to the vtkIntArray the list of region IDs of all leaf nodes in the given node.
static int __ConvexSubRegions(int *ids, int len, vtkKdNode *tree, vtkKdNode **nodes)
int _FindClosestPointInRegion(int regionId, double x, double y, double z, double &dist2)
void DoMedianFind(vtkKdNode *kd, float *c1, int *ids, int d1, int d2, int d3)
void PrintRegion(int id)
Print out leaf node data for given id.
float * ComputeCellCenters(vtkDataSet *set)
virtual void RemoveDataSet(int index)
Remove the given data set.
void OmitXYPartitioning()
Omit partitions along the X and Y axes, yielding slabs along Z.
void GenerateRepresentationWholeSpace(int level, vtkPolyData *pd)
int SearchRegionForDuplicate(float *point, int *pointsSoFar, int len, float tolerance2)
static void DeleteAllDescendants(vtkKdNode *nd)
void AddPolys(vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys)
vtkIdType GetCellLists(vtkIntArray *regions, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
void GetRegionBounds(int regionID, double bounds[6])
Get the spatial bounds of k-d tree region.
int GetRegionContainingPoint(double x, double y, double z)
Get the id of the region containing the specified location.
int GetDataSetsNumberOfCells(int set1, int set2)
Returns the total number of cells in data set 1 through data set 2.
void SetCuts(vtkBSPCuts *cuts)
Normally the k-d tree is computed from the dataset(s) provided in SetDataSet.
static void ZeroNumberOfPoints(vtkKdNode *kd)
int GetDataSetIndex(vtkDataSet *set)
Return the index of the given data set.
abstract base class for objects that accelerate spatial searches
abstract class for specifying dataset behavior
represent and manipulate 3D points
concrete dataset represents vertices, lines, polygons, and triangle strips
Timer support and logging.
vtkIdList ** boundaryCells
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.