59 #include "vtkCommonDataModelModule.h" 96 vtkSetMacro(MinCells,
int);
97 vtkGetMacro(MinCells,
int);
107 vtkGetMacro(NumberOfRegionsOrLess,
int);
108 vtkSetMacro(NumberOfRegionsOrLess,
int);
117 vtkGetMacro(NumberOfRegionsOrMore,
int);
118 vtkSetMacro(NumberOfRegionsOrMore,
int);
127 vtkGetMacro(FudgeFactor,
double);
128 vtkSetMacro(FudgeFactor,
double);
148 void OmitXPartitioning();
153 void OmitYPartitioning();
158 void OmitZPartitioning();
163 void OmitXYPartitioning();
168 void OmitYZPartitioning();
173 void OmitZXPartitioning();
178 void OmitNoPartitioning();
206 virtual void RemoveDataSet(
int index);
208 virtual void RemoveAllDataSets();
214 int GetNumberOfDataSets();
250 void GetBounds(
double* bounds);
260 void SetNewBounds(
double* bounds);
266 vtkGetMacro(NumberOfRegions,
int);
272 void GetRegionBounds(
int regionID,
double bounds[6]);
277 void GetRegionDataBounds(
int regionID,
double bounds[6]);
284 void PrintVerboseTree();
290 void PrintRegion(
int id);
304 void CreateCellLists(
int dataSetIndex,
int* regionReqList,
int reqListSize);
305 void CreateCellLists(
vtkDataSet*
set,
int* regionReqList,
int reqListSize);
306 void CreateCellLists(
int* regionReqList,
int listSize);
307 void CreateCellLists();
317 vtkSetMacro(IncludeRegionBoundaryCells,
vtkTypeBool);
318 vtkGetMacro(IncludeRegionBoundaryCells,
vtkTypeBool);
319 vtkBooleanMacro(IncludeRegionBoundaryCells,
vtkTypeBool);
325 void DeleteCellLists();
343 vtkIdList* GetBoundaryCellList(
int regionID);
382 int GetRegionContainingCell(
int set,
vtkIdType cellID);
383 int GetRegionContainingCell(
vtkIdType cellID);
394 int* AllGetRegionContainingCell();
399 int GetRegionContainingPoint(
double x,
double y,
double z);
422 int MinimalNumberOfConvexSubRegions(
vtkIntArray* regionIdList,
double** convexRegionBounds);
431 int ViewOrderAllRegionsInDirection(
432 const double directionOfProjection[3],
vtkIntArray* orderedList);
441 int ViewOrderRegionsInDirection(
451 int ViewOrderAllRegionsFromPosition(
452 const double directionOfProjection[3],
vtkIntArray* orderedList);
461 int ViewOrderRegionsFromPosition(
478 void BuildLocatorFromPoints(
vtkPointSet* pointset);
479 void BuildLocatorFromPoints(
vtkPoints* ptArray);
480 void BuildLocatorFromPoints(
vtkPoints** ptArray,
int numPtArrays);
506 vtkIdType FindPoint(
double x,
double y,
double z);
515 vtkIdType FindClosestPoint(
double* x,
double& dist2);
516 vtkIdType FindClosestPoint(
double x,
double y,
double z,
double& dist2);
524 vtkIdType FindClosestPointWithinRadius(
double radius,
const double x[3],
double& dist2);
532 vtkIdType FindClosestPointInRegion(
int regionId,
double* x,
double& dist2);
533 vtkIdType FindClosestPointInRegion(
int regionId,
double x,
double y,
double z,
double& dist2);
542 void FindPointsWithinRadius(
double R,
const double x[3],
vtkIdList* result);
552 void FindClosestNPoints(
int N,
const double x[3],
vtkIdList* result);
586 vtkBooleanMacro(GenerateRepresentationUsingDataBounds,
vtkTypeBool);
587 vtkSetMacro(GenerateRepresentationUsingDataBounds,
vtkTypeBool);
588 vtkGetMacro(GenerateRepresentationUsingDataBounds,
vtkTypeBool);
594 virtual void PrintTiming(ostream& os,
vtkIndent indent);
600 virtual int NewGeometry();
607 virtual int NewGeometry(
vtkDataSet** sets,
int numDataSets);
614 virtual void InvalidateGeometry();
629 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray =
true);
640 int ProcessUserDefinedCuts(
double* bounds);
642 void SetCuts(
vtkBSPCuts* cuts,
int userDefined);
649 void UpdateBuildTime();
658 int DivideTest(
int numberOfPoints,
int level);
674 static void DeleteAllDescendants(
vtkKdNode* nd);
676 void BuildRegionList();
677 virtual int SelectCutDirection(
vtkKdNode* kd);
685 void GetRegionsAtLevel(
int level,
vtkKdNode** nodes);
698 int GetNumberOfCells();
705 int GetDataSetsNumberOfCells(
int set1,
int set2);
714 void ComputeCellCenter(
vtkDataSet*
set,
int cellId,
double* center);
725 float* ComputeCellCenters();
726 float* ComputeCellCenters(
int set);
736 void UpdateProgress(
double amount);
742 vtkSetClampMacro(Progress,
double, 0.0, 1.0);
743 vtkGetMacro(Progress,
double);
757 void UpdateSubOperationProgress(
double amount);
759 static void _SetNewBounds(
vtkKdNode* kd,
double* b,
int* fixDim);
762 static void SetDataBoundsToSpatialBounds(
vtkKdNode* kd);
763 static void ZeroNumberOfPoints(
vtkKdNode* kd);
766 void FindPointsWithinRadius(
vtkKdNode* node,
double R2,
const double x[3],
vtkIdList* ids);
777 int DivideRegion(
vtkKdNode* kd,
float* c1,
int* ids,
int nlevels);
779 void DoMedianFind(
vtkKdNode* kd,
float* c1,
int* ids,
int d1,
int d2,
int d3);
793 void InitializeCellLists();
796 void ComputeCellCenter(
vtkCell* cell,
double* center,
double* weights);
798 void GenerateRepresentationDataBounds(
int level,
vtkPolyData* pd);
799 void _generateRepresentationDataBounds(
802 void GenerateRepresentationWholeSpace(
int level,
vtkPolyData* pd);
803 void _generateRepresentationWholeSpace(
808 void _printTree(
int verbose);
810 int SearchNeighborsForDuplicate(
811 int regionId,
float*
point,
int** pointsSoFar,
int* len,
float tolerance,
float tolerance2);
813 int SearchRegionForDuplicate(
float*
point,
int* pointsSoFar,
int len,
float tolerance2);
815 int _FindClosestPointInRegion(
int regionId,
double x,
double y,
double z,
double& dist2);
817 int FindClosestPointInSphere(
818 double x,
double y,
double z,
double radius,
int skipRegion,
double& dist2);
820 int _ViewOrderRegionsInDirection(
826 int _ViewOrderRegionsFromPosition(
830 vtkIntArray* IdsOfInterest,
const double pos[3],
int nextId);
835 void SetInputDataInfo(
int i,
int dims[3],
double origin[3],
double spacing[3]);
836 int CheckInputDataInfo(
int i,
int dims[3],
double origin[3],
double spacing[3]);
837 void ClearLastBuildCache();
839 static void __printTree(
vtkKdNode* kd,
int depth,
int verbose);
841 static int MidValue(
int dim,
float* c1,
int nvals,
double& coord);
843 static int Select(
int dim,
float* c1,
int* ids,
int nvals,
double& coord);
844 static float FindMaxLeftHalf(
int dim,
float* c1,
int K);
845 static void _Select(
int dim,
float* X,
int* ids,
int L,
int R,
int K);
848 static int SelfOrder(
int id,
vtkKdNode* kd);
849 static int findRegion(
vtkKdNode* node,
float x,
float y,
float z);
850 static int findRegion(
vtkKdNode* node,
double x,
double y,
double z);
854 static void AddNewRegions(
vtkKdNode* kd,
float* c1,
int midpt,
int dim,
double coord);
856 void NewPartitioningRequest(
int req);
862 double CellBoundsCache[6];
906 void operator=(
const vtkKdTree&) =
delete;
virtual void BuildLocator()=0
Build the locator from the input dataset.
vtkTypeBool IncludeRegionBoundaryCells
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
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
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
vtkTypeBool GenerateRepresentationUsingDataBounds
object to represent cell connectivity
vtkIdList ** boundaryCells
a Kd-tree spatial decomposition of a set of points
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
int * LocatorRegionLocation
vtkDataSetCollection * DataSets
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
vtkBSPIntersections * BSPCalculator
represent and manipulate 3D points
int NumberOfRegionsOrMore