64 #include "vtkCommonDataModelModule.h"
90 vtkBooleanMacro(Timing,
int);
91 vtkSetMacro(Timing,
int);
92 vtkGetMacro(Timing,
int);
97 vtkSetMacro(MinCells,
int);
98 vtkGetMacro(MinCells,
int);
106 vtkGetMacro(NumberOfRegionsOrLess,
int);
107 vtkSetMacro(NumberOfRegionsOrLess,
int);
113 vtkGetMacro(NumberOfRegionsOrMore,
int);
114 vtkSetMacro(NumberOfRegionsOrMore,
int);
121 vtkGetMacro(FudgeFactor,
double);
122 vtkSetMacro(FudgeFactor,
double);
136 void OmitXPartitioning();
139 void OmitYPartitioning();
142 void OmitZPartitioning();
145 void OmitXYPartitioning();
148 void OmitYZPartitioning();
151 void OmitZXPartitioning();
154 void OmitNoPartitioning();
174 virtual void RemoveDataSet(
int index);
176 virtual void RemoveAllDataSets();
180 int GetNumberOfDataSets();
204 void GetBounds(
double *bounds);
212 void SetNewBounds(
double *bounds);
216 vtkGetMacro(NumberOfRegions,
int);
220 void GetRegionBounds(
int regionID,
double bounds[6]);
223 void GetRegionDataBounds(
int regionID,
double bounds[6]);
228 void PrintVerboseTree();
232 void PrintRegion(
int id);
242 void CreateCellLists(
int dataSetIndex,
int *regionReqList,
244 void CreateCellLists(
vtkDataSet *
set,
int *regionReqList,
246 void CreateCellLists(
int *regionReqList,
int listSize);
247 void CreateCellLists();
254 vtkSetMacro(IncludeRegionBoundaryCells,
int);
255 vtkGetMacro(IncludeRegionBoundaryCells,
int);
256 vtkBooleanMacro(IncludeRegionBoundaryCells,
int);
260 void DeleteCellLists();
273 vtkIdList *GetBoundaryCellList(
int regionID);
303 int GetRegionContainingCell(
int set,
vtkIdType cellID);
304 int GetRegionContainingCell(
vtkIdType cellID);
311 int *AllGetRegionContainingCell();
314 int GetRegionContainingPoint(
double x,
double y,
double z);
332 int MinimalNumberOfConvexSubRegions(
vtkIntArray *regionIdList,
333 double **convexRegionBounds);
342 int ViewOrderAllRegionsInDirection(
const double directionOfProjection[3],
352 int ViewOrderRegionsInDirection(
vtkIntArray *regionIds,
353 const double directionOfProjection[3],
364 int ViewOrderAllRegionsFromPosition(
const double directionOfProjection[3],
374 int ViewOrderRegionsFromPosition(
vtkIntArray *regionIds,
375 const double directionOfProjection[3],
388 void BuildLocatorFromPoints(
vtkPointSet *pointset);
389 void BuildLocatorFromPoints(
vtkPoints *ptArray);
390 void BuildLocatorFromPoints(
vtkPoints **ptArray,
int numPtArrays);
409 vtkIdType FindPoint(
double x,
double y,
double z);
416 vtkIdType FindClosestPoint(
double *x,
double &dist2);
417 vtkIdType FindClosestPoint(
double x,
double y,
double z,
double &dist2);
425 double radius,
const double x[3],
double& dist2);
432 vtkIdType FindClosestPointInRegion(
int regionId,
double *x,
double &dist2);
433 vtkIdType FindClosestPointInRegion(
int regionId,
double x,
double y,
double z,
441 void FindPointsWithinRadius(
double R,
const double x[3],
vtkIdList *result);
449 void FindClosestNPoints(
int N,
const double x[3],
vtkIdList *result);
472 vtkBooleanMacro(GenerateRepresentationUsingDataBounds,
int);
473 vtkSetMacro(GenerateRepresentationUsingDataBounds,
int);
474 vtkGetMacro(GenerateRepresentationUsingDataBounds,
int);
478 virtual void PrintTiming(ostream& os,
vtkIndent indent);
482 virtual int NewGeometry();
486 virtual int NewGeometry(
vtkDataSet **sets,
int numDataSets);
491 virtual void InvalidateGeometry();
502 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray =
true);
514 int ProcessUserDefinedCuts(
double *bounds);
516 void SetCuts(
vtkBSPCuts *cuts,
int userDefined);
521 void UpdateBuildTime();
528 int DivideTest(
int numberOfPoints,
int level);
545 static void DeleteAllDescendants(
vtkKdNode *nd);
547 void BuildRegionList();
548 virtual int SelectCutDirection(
vtkKdNode *kd);
564 int GetNumberOfCells();
568 int GetDataSetsNumberOfCells(
int set1,
int set2);
583 float *ComputeCellCenters();
584 float *ComputeCellCenters(
int set);
593 void UpdateProgress(
double amount);
597 vtkSetClampMacro(Progress,
double,0.0,1.0);
598 vtkGetMacro(Progress,
double);
612 void UpdateSubOperationProgress(
double amount);
614 static void _SetNewBounds(
vtkKdNode *kd,
double *b,
int *fixDim);
617 static void SetDataBoundsToSpatialBounds(
vtkKdNode *kd);
618 static void ZeroNumberOfPoints(
vtkKdNode *kd);
622 void FindPointsWithinRadius(
vtkKdNode* node,
double R2,
634 int DivideRegion(
vtkKdNode *kd,
float *c1,
int *ids,
int nlevels);
636 void DoMedianFind(
vtkKdNode *kd,
float *c1,
int *ids,
int d1,
int d2,
int d3);
650 void InitializeCellLists();
653 void ComputeCellCenter(
vtkCell* cell,
double *
center,
double *weights);
665 void _printTree(
int verbose);
667 int SearchNeighborsForDuplicate(
int regionId,
float *
point,
668 int **pointsSoFar,
int *len,
669 float tolerance,
float tolerance2);
671 int SearchRegionForDuplicate(
float *
point,
int *pointsSoFar,
672 int len,
float tolerance2);
674 int _FindClosestPointInRegion(
int regionId,
675 double x,
double y,
double z,
double &dist2);
677 int FindClosestPointInSphere(
double x,
double y,
double z,
double radius,
678 int skipRegion,
double &dist2);
680 int _ViewOrderRegionsInDirection(
vtkIntArray *IdsOfInterest,
686 const double dir[3],
int nextId);
688 int _ViewOrderRegionsFromPosition(
vtkIntArray *IdsOfInterest,
694 const double pos[3],
int nextId);
699 void NewParitioningRequest(
int req);
700 void SetInputDataInfo(
int i,
701 int dims[3],
double origin[3],
double spacing[3]);
702 int CheckInputDataInfo(
int i,
703 int dims[3],
double origin[3],
double spacing[3]);
704 void ClearLastBuildCache();
707 static void __printTree(
vtkKdNode *kd,
int depth,
int verbose);
710 static int MidValue(
int dim,
float *c1,
int nvals,
double &coord);
712 static int Select(
int dim,
float *c1,
int *ids,
int nvals,
double &coord);
713 static float FindMaxLeftHalf(
int dim,
float *c1,
int K);
714 static void _Select(
int dim,
float *X,
int *ids,
int L,
int R,
int K);
718 static int SelfOrder(
int id,
vtkKdNode *kd);
719 static int findRegion(
vtkKdNode *node,
float x,
float y,
float z);
720 static int findRegion(
vtkKdNode *node,
double x,
double y,
double z);
726 static void AddNewRegions(
vtkKdNode *kd,
float *c1,
727 int midpt,
int dim,
double coord);
729 void NewPartitioningRequest(
int req);
735 double CellBoundsCache[6];