62 #include "vtkCommonDataModelModule.h"
92 vtkGetMacro(Timing,
int);
100 vtkGetMacro(MinCells,
int);
110 vtkGetMacro(NumberOfRegionsOrLess,
int);
120 vtkGetMacro(NumberOfRegionsOrMore,
int);
130 vtkGetMacro(FudgeFactor,
double);
151 void OmitXPartitioning();
156 void OmitYPartitioning();
161 void OmitZPartitioning();
166 void OmitXYPartitioning();
171 void OmitYZPartitioning();
176 void OmitZXPartitioning();
181 void OmitNoPartitioning();
209 virtual void RemoveDataSet(
int index);
211 virtual void RemoveAllDataSets();
217 int GetNumberOfDataSets();
253 void GetBounds(
double *bounds);
263 void SetNewBounds(
double *bounds);
269 vtkGetMacro(NumberOfRegions,
int);
275 void GetRegionBounds(
int regionID,
double bounds[6]);
280 void GetRegionDataBounds(
int regionID,
double bounds[6]);
287 void PrintVerboseTree();
293 void PrintRegion(
int id);
307 void CreateCellLists(
int dataSetIndex,
int *regionReqList,
309 void CreateCellLists(
vtkDataSet *set,
int *regionReqList,
311 void CreateCellLists(
int *regionReqList,
int listSize);
312 void CreateCellLists();
323 vtkGetMacro(IncludeRegionBoundaryCells,
int);
330 void DeleteCellLists();
348 vtkIdList *GetBoundaryCellList(
int regionID);
387 int GetRegionContainingCell(
int set,
vtkIdType cellID);
388 int GetRegionContainingCell(
vtkIdType cellID);
399 int *AllGetRegionContainingCell();
404 int GetRegionContainingPoint(
double x,
double y,
double z);
427 int MinimalNumberOfConvexSubRegions(
vtkIntArray *regionIdList,
428 double **convexRegionBounds);
437 int ViewOrderAllRegionsInDirection(const
double directionOfProjection[3],
447 int ViewOrderRegionsInDirection(
vtkIntArray *regionIds,
448 const
double directionOfProjection[3],
458 int ViewOrderAllRegionsFromPosition(const
double directionOfProjection[3],
468 int ViewOrderRegionsFromPosition(
vtkIntArray *regionIds,
469 const
double directionOfProjection[3],
486 void BuildLocatorFromPoints(
vtkPointSet *pointset);
487 void BuildLocatorFromPoints(
vtkPoints *ptArray);
488 void BuildLocatorFromPoints(
vtkPoints **ptArray,
int numPtArrays);
514 vtkIdType FindPoint(
double x,
double y,
double z);
523 vtkIdType FindClosestPoint(
double *x,
double &dist2);
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);
597 vtkSetMacro(GenerateRepresentationUsingDataBounds,
int);
598 vtkGetMacro(GenerateRepresentationUsingDataBounds,
int);
604 virtual
void PrintTiming(ostream& os,
vtkIndent indent);
610 virtual
int NewGeometry();
617 virtual
int NewGeometry(
vtkDataSet **sets,
int numDataSets);
624 virtual
void InvalidateGeometry();
639 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray = true);
644 ~vtkKdTree() VTK_OVERRIDE;
651 int ProcessUserDefinedCuts(
double *bounds);
653 void SetCuts(
vtkBSPCuts *cuts,
int userDefined);
660 void UpdateBuildTime();
669 int DivideTest(
int numberOfPoints,
int level);
684 static void DeleteAllDescendants(
vtkKdNode *nd);
686 void BuildRegionList();
687 virtual int SelectCutDirection(
vtkKdNode *kd);
709 int GetNumberOfCells();
716 int GetDataSetsNumberOfCells(
int set1,
int set2);
736 float *ComputeCellCenters();
737 float *ComputeCellCenters(
int set);
747 void UpdateProgress(
double amount);
753 vtkSetClampMacro(Progress,
double,0.0,1.0);
754 vtkGetMacro(Progress,
double);
768 void UpdateSubOperationProgress(
double amount);
770 static void _SetNewBounds(
vtkKdNode *kd,
double *b,
int *fixDim);
773 static void SetDataBoundsToSpatialBounds(
vtkKdNode *kd);
774 static void ZeroNumberOfPoints(
vtkKdNode *kd);
777 void FindPointsWithinRadius(
vtkKdNode* node,
double R2,
789 int DivideRegion(
vtkKdNode *kd,
float *c1,
int *ids,
int nlevels);
791 void DoMedianFind(
vtkKdNode *kd,
float *c1,
int *ids,
int d1,
int d2,
int d3);
804 void InitializeCellLists();
807 void ComputeCellCenter(
vtkCell* cell,
double *
center,
double *weights);
819 void _printTree(
int verbose);
821 int SearchNeighborsForDuplicate(
int regionId,
float *
point,
822 int **pointsSoFar,
int *len,
823 float tolerance,
float tolerance2);
825 int SearchRegionForDuplicate(
float *
point,
int *pointsSoFar,
826 int len,
float tolerance2);
828 int _FindClosestPointInRegion(
int regionId,
829 double x,
double y,
double z,
double &dist2);
831 int FindClosestPointInSphere(
double x,
double y,
double z,
double radius,
832 int skipRegion,
double &dist2);
834 int _ViewOrderRegionsInDirection(
vtkIntArray *IdsOfInterest,
840 const double dir[3],
int nextId);
842 int _ViewOrderRegionsFromPosition(
vtkIntArray *IdsOfInterest,
848 const double pos[3],
int nextId);
853 void NewParitioningRequest(
int req);
854 void SetInputDataInfo(
int i,
855 int dims[3],
double origin[3],
double spacing[3]);
856 int CheckInputDataInfo(
int i,
857 int dims[3],
double origin[3],
double spacing[3]);
858 void ClearLastBuildCache();
860 static void __printTree(
vtkKdNode *kd,
int depth,
int verbose);
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);
865 static float FindMaxLeftHalf(
int dim,
float *c1,
int K);
866 static void _Select(
int dim,
float *X,
int *ids,
int L,
int R,
int K);
869 static int SelfOrder(
int id,
vtkKdNode *kd);
870 static int findRegion(
vtkKdNode *node,
float x,
float y,
float z);
871 static int findRegion(
vtkKdNode *node,
double x,
double y,
double z);
876 static void AddNewRegions(
vtkKdNode *kd,
float *c1,
877 int midpt,
int dim,
double coord);
879 void NewPartitioningRequest(
int req);
885 double CellBoundsCache[6];
929 void operator=(const
vtkKdTree&) VTK_DELETE_FUNCTION;
virtual void BuildLocator()=0
Build the locator from the input dataset.
vtkDataSet ** LastInputDataSets
maintain an unordered list of dataset objects
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning...
Perform calculations (mostly intersection calculations) on regions of a 3D binary spatial partitionin...
This class represents an axis-aligned Binary Spatial Partitioning of a 3D space.
abstract class to specify dataset behavior
int NumberOfLocatorPoints
static int ComputeLevel(vtkKdNode *kd)
abstract base class for objects that accelerate spatial searches
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
int NumberOfRegionsOrLess
abstract class for specifying dataset behavior
vtkDataSet * GetDataSet() override
Return the 0'th data set.
dynamic, self-adjusting array of vtkIdType
concrete dataset represents vertices, lines, polygons, and triangle strips
double * LastInputDataInfo
Timer support and logging.
virtual void SetDataSet(vtkDataSet *)
Build the locator from the points/cells defining this dataset.
abstract class to specify cell behavior
unsigned long * LastDataSetObserverTags
dynamic, self-adjusting array of int
virtual vtkDataSet * GetDataSet()
Build the locator from the points/cells defining this dataset.
a simple class to control print indentation
list of point or cell ids
vtkIdType * LastNumPoints
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
object to represent cell connectivity
vtkIdList ** boundaryCells
a Kd-tree spatial decomposition of a set of points
int IncludeRegionBoundaryCells
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
int * LocatorRegionLocation
int GenerateRepresentationUsingDataBounds
vtkDataSetCollection * DataSets
represent and manipulate 3D points
int NumberOfRegionsOrMore