VTK
9.4.20241121
|
a Kd-tree spatial decomposition of a set of points More...
#include <vtkKdTree.h>
Classes | |
struct | cellList_ |
Public Types | |
typedef vtkLocator | Superclass |
Public Types inherited from vtkLocator | |
typedef vtkObject | Superclass |
Standard type and print methods. | |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Standard type and print methods. | |
vtkKdTree * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual int | GetNumberOfRegionsOrLess () |
Set/Get the number of spatial regions you want to get close to without going over. | |
virtual void | SetNumberOfRegionsOrLess (int) |
virtual int | GetNumberOfRegionsOrMore () |
Set/Get the number of spatial regions you want to get close to while having at least this many regions. | |
virtual void | SetNumberOfRegionsOrMore (int) |
virtual double | GetFudgeFactor () |
Some algorithms on k-d trees require a value that is a very small distance relative to the diameter of the entire space divided by the k-d tree. | |
virtual void | SetFudgeFactor (double) |
virtual vtkBSPCuts * | GetCuts () |
Get a vtkBSPCuts object, a general object representing an axis- aligned spatial partitioning. | |
void | SetCuts (vtkBSPCuts *cuts) |
Normally the k-d tree is computed from the dataset(s) provided in SetDataSet. | |
void | OmitXPartitioning () |
Omit partitions along the X axis, yielding shafts in the X direction. | |
void | OmitYPartitioning () |
Omit partitions along the Y axis, yielding shafts in the Y direction. | |
void | OmitZPartitioning () |
Omit partitions along the Z axis, yielding shafts in the Z direction. | |
void | OmitXYPartitioning () |
Omit partitions along the X and Y axes, yielding slabs along Z. | |
void | OmitYZPartitioning () |
Omit partitions along the Y and Z axes, yielding slabs along X. | |
void | OmitZXPartitioning () |
Omit partitions along the Z and X axes, yielding slabs along Y. | |
void | OmitNoPartitioning () |
Partition along all three axes - this is the default. | |
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 sets. | |
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 sets. | |
int | GetNumberOfDataSets () |
Get the number of data sets included in spatial partitioning. | |
vtkDataSet * | GetDataSet (int n) |
Get the nth defined data set in the spatial partitioning. | |
vtkDataSet * | GetDataSet () override |
Return the 0'th data set. | |
int | GetDataSetIndex (vtkDataSet *set) |
Return the index of the given data set. | |
void | GetBounds (double *bounds) |
Get the spatial bounds of the entire k-d tree space. | |
void | SetNewBounds (double *bounds) |
There are certain applications where you want the bounds of the k-d tree space to be at least as large as a specified box. | |
void | GetRegionBounds (int regionID, double bounds[6]) |
Get the spatial bounds of k-d tree region. | |
void | GetRegionDataBounds (int regionID, double bounds[6]) |
Get the bounds of the data within the k-d tree region. | |
void | PrintRegion (int id) |
Print out leaf node data for given id. | |
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 the region. | |
void | CreateCellLists (vtkDataSet *set, int *regionReqList, int reqListSize) |
void | CreateCellLists (int *regionReqList, int listSize) |
void | CreateCellLists () |
void | DeleteCellLists () |
Free the memory used by the cell lists. | |
vtkIdList * | GetCellList (int regionID) |
Get the cell list for a region. | |
vtkIdList * | GetBoundaryCellList (int regionID) |
The cell list obtained with GetCellList is the list of all cells such that their centroid is contained in the spatial region. | |
int * | AllGetRegionContainingCell () |
Get a list (in order by data set by cell id) of the region IDs of the region containing the centroid for each cell. | |
int | GetRegionContainingPoint (double x, double y, double z) |
Get the id of the region containing the specified location. | |
void | BuildLocator () override |
Create the k-d tree decomposition of the cells of the data set or data sets. | |
void | ForceBuildLocator () override |
Build the locator from the input dataset (even if UseExistingSearchStructure is on). | |
int | MinimalNumberOfConvexSubRegions (vtkIntArray *regionIdList, double **convexRegionBounds) |
Given a list of region IDs, determine the decomposition of these regions into the minimal number of convex subregions. | |
int | ViewOrderAllRegionsInDirection (const double directionOfProjection[3], vtkIntArray *orderedList) |
Given a direction of projection (typically obtained with vtkCamera::GetDirectionOfProjection()), this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction. | |
int | ViewOrderRegionsInDirection (vtkIntArray *regionIds, const double directionOfProjection[3], vtkIntArray *orderedList) |
Given a direction of projection and a list of k-d tree region IDs, this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction. | |
int | ViewOrderAllRegionsFromPosition (const double directionOfProjection[3], vtkIntArray *orderedList) |
Given a camera position (typically obtained with vtkCamera::GetPosition()), this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction. | |
int | ViewOrderRegionsFromPosition (vtkIntArray *regionIds, const double directionOfProjection[3], vtkIntArray *orderedList) |
Given a camera position and a list of k-d tree region IDs, this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction. | |
vtkIdTypeArray * | BuildMapForDuplicatePoints (float tolerance) |
This call returns a mapping from the original point IDs supplied to BuildLocatorFromPoints to a subset of those IDs that is unique within the specified tolerance. | |
vtkIdType | FindClosestPointWithinRadius (double radius, const double x[3], double &dist2) |
Given a position x and a radius r, return the id of the point closest to the point in that radius. | |
void | FindPointsWithinRadius (double R, const double x[3], vtkIdList *result) |
Find all points within a specified radius R of position x. | |
void | FindClosestNPoints (int N, const double x[3], vtkIdList *result) |
Find the closest N points to a position. | |
vtkIdTypeArray * | GetPointsInRegion (int regionId) |
Get a list of the original IDs of all points in a region. | |
void | FreeSearchStructure () override |
Delete the k-d tree data structure. | |
void | GenerateRepresentation (int level, vtkPolyData *pd) override |
Create a polydata representation of the boundaries of the k-d tree regions. | |
void | GenerateRepresentation (int *regionList, int len, vtkPolyData *pd) |
Generate a polygonal representation of a list of regions. | |
virtual void | PrintTiming (ostream &os, vtkIndent indent) |
Print timing of k-d tree build. | |
virtual int | NewGeometry () |
Return 1 if the geometry of the input data sets has changed since the last time the k-d tree was built. | |
virtual int | NewGeometry (vtkDataSet **sets, int numDataSets) |
Return 1 if the geometry of these data sets differs for the geometry of the last data sets used to build the k-d tree. | |
virtual void | InvalidateGeometry () |
Forget about the last geometry used. | |
void | FindPointsInArea (double *area, vtkIdTypeArray *ids, bool clearArray=true) |
Fill ids with points found in area. | |
virtual void | TimingOn () |
Turn on timing of the k-d tree build. | |
virtual void | TimingOff () |
Turn on timing of the k-d tree build. | |
virtual void | SetTiming (vtkTypeBool) |
Turn on timing of the k-d tree build. | |
virtual vtkTypeBool | GetTiming () |
Turn on timing of the k-d tree build. | |
virtual void | SetMinCells (int) |
Minimum number of cells per spatial region. | |
virtual int | GetMinCells () |
Minimum number of cells per spatial region. | |
virtual void | RemoveDataSet (int index) |
Remove the given data set. | |
virtual void | RemoveDataSet (vtkDataSet *set) |
Remove the given data set. | |
virtual void | RemoveAllDataSets () |
Remove the given data set. | |
virtual vtkDataSetCollection * | GetDataSets () |
Return a collection of all the data sets. | |
virtual int | GetNumberOfRegions () |
The number of leaf nodes of the tree, the spatial regions. | |
void | PrintTree () |
Print out nodes of kd tree. | |
void | PrintVerboseTree () |
Print out nodes of kd tree. | |
virtual void | SetIncludeRegionBoundaryCells (vtkTypeBool) |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region. | |
virtual vtkTypeBool | GetIncludeRegionBoundaryCells () |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region. | |
virtual void | IncludeRegionBoundaryCellsOn () |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region. | |
virtual void | IncludeRegionBoundaryCellsOff () |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region. | |
vtkIdType | GetCellLists (vtkIntArray *regions, int set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
For a list of regions, get two cell lists. | |
vtkIdType | GetCellLists (vtkIntArray *regions, vtkDataSet *set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
For a list of regions, get two cell lists. | |
vtkIdType | GetCellLists (vtkIntArray *regions, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
For a list of regions, get two cell lists. | |
int | GetRegionContainingCell (vtkDataSet *set, vtkIdType cellID) |
Get the id of the region containing the cell centroid. | |
int | GetRegionContainingCell (int set, vtkIdType cellID) |
Get the id of the region containing the cell centroid. | |
int | GetRegionContainingCell (vtkIdType cellID) |
Get the id of the region containing the cell centroid. | |
void | BuildLocatorFromPoints (vtkPointSet *pointset) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points. | |
void | BuildLocatorFromPoints (vtkPoints *ptArray) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points. | |
void | BuildLocatorFromPoints (vtkPoints **ptArray, int numPtArrays) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points. | |
vtkIdType | FindPoint (double *x) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints(). | |
vtkIdType | FindPoint (double x, double y, double z) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints(). | |
vtkIdType | FindClosestPoint (double *x, double &dist2) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints() which is closest to the given point. | |
vtkIdType | FindClosestPoint (double x, double y, double z, double &dist2) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints() which is closest to the given point. | |
vtkIdType | FindClosestPointInRegion (int regionId, double *x, double &dist2) |
Find the Id of the point in the given region which is closest to the given point. | |
vtkIdType | FindClosestPointInRegion (int regionId, double x, double y, double z, double &dist2) |
Find the Id of the point in the given region which is closest to the given point. | |
virtual void | GenerateRepresentationUsingDataBoundsOn () |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions. | |
virtual void | GenerateRepresentationUsingDataBoundsOff () |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions. | |
virtual void | SetGenerateRepresentationUsingDataBounds (vtkTypeBool) |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions. | |
virtual vtkTypeBool | GetGenerateRepresentationUsingDataBounds () |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions. | |
Public Member Functions inherited from vtkLocator | |
virtual void | Update () |
Cause the locator to rebuild itself if it or its input dataset has changed. | |
virtual void | Initialize () |
Initialize locator. | |
virtual void | BuildLocator ()=0 |
Build the locator from the input dataset. | |
virtual void | ForceBuildLocator () |
Build the locator from the input dataset (even if UseExistingSearchStructure is on). | |
virtual void | FreeSearchStructure ()=0 |
Free the memory required for the spatial data structure. | |
virtual void | GenerateRepresentation (int level, vtkPolyData *pd)=0 |
Method to build a representation at a particular level. | |
virtual void | SetMaxLevel (int) |
Set the maximum allowable level for the tree. | |
virtual int | GetMaxLevel () |
Set the maximum allowable level for the tree. | |
virtual int | GetLevel () |
Get the level of the locator (determined automatically if Automatic is true). | |
virtual void | SetAutomatic (vtkTypeBool) |
Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. | |
virtual vtkTypeBool | GetAutomatic () |
Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. | |
virtual void | AutomaticOn () |
Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. | |
virtual void | AutomaticOff () |
Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. | |
virtual void | SetTolerance (double) |
Specify absolute tolerance (in world coordinates) for performing geometric operations. | |
virtual double | GetTolerance () |
Specify absolute tolerance (in world coordinates) for performing geometric operations. | |
virtual void | SetUseExistingSearchStructure (vtkTypeBool) |
Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. | |
virtual vtkTypeBool | GetUseExistingSearchStructure () |
Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. | |
virtual void | UseExistingSearchStructureOn () |
Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. | |
virtual void | UseExistingSearchStructureOff () |
Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. | |
virtual vtkMTimeType | GetBuildTime () |
Return the time of the last data structure build. | |
bool | UsesGarbageCollector () const override |
Handle the PointSet <-> Locator loop. | |
vtkLocator * | NewInstance () const |
Standard type and print methods. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Standard type and print methods. | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. | |
virtual void | DebugOff () |
Turn debugging output off. | |
bool | GetDebug () |
Get the value of the debug flag. | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. | |
virtual void | Modified () |
Update the modification time for this object. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
vtkTypeBool | InvokeEvent (unsigned long event) |
vtkTypeBool | InvokeEvent (const char *event) |
std::string | GetObjectDescription () const override |
The object description printed in messages and PrintSelf output. | |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. | |
vtkTypeBool | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
vtkTypeBool | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
virtual void | SetObjectName (const std::string &objectName) |
Set/get the name of this object for reporting purposes. | |
virtual std::string | GetObjectName () const |
Set/get the name of this object for reporting purposes. | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual std::string | GetObjectDescription () const |
The object description printed in messages and PrintSelf output. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
virtual void | Delete () |
Delete a VTK object. | |
virtual void | FastDelete () |
Delete a reference to this object. | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. | |
void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). | |
int | GetReferenceCount () |
Return the current reference count of this object. | |
void | SetReferenceCount (int) |
Sets the reference count. | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
Static Public Member Functions | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkKdTree * | SafeDownCast (vtkObjectBase *o) |
static vtkKdTree * | New () |
static vtkKdNode * | CopyTree (vtkKdNode *kd) |
Create a copy of the binary tree representation of the k-d tree spatial partitioning provided. | |
Static Public Member Functions inherited from vtkLocator | |
static vtkTypeBool | IsTypeOf (const char *type) |
Standard type and print methods. | |
static vtkLocator * | SafeDownCast (vtkObjectBase *o) |
Standard type and print methods. | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. | |
static void | SetGlobalWarningDisplay (vtkTypeBool val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static vtkTypeBool | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Protected Types | |
enum | { XDIM = 0 , YDIM = 1 , ZDIM = 2 } |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
Standard type and print methods. | |
vtkKdTree () | |
~vtkKdTree () override | |
void | BuildLocatorInternal () override |
This function is not pure virtual to maintain backwards compatibility. | |
void | SetCalculator (vtkKdNode *kd) |
int | ProcessUserDefinedCuts (double *bounds) |
void | SetCuts (vtkBSPCuts *cuts, int userDefined) |
void | UpdateBuildTime () |
Save enough state so NewGeometry() can work, and update the BuildTime time stamp. | |
int | DivideTest (int numberOfPoints, int level) |
Prior to dividing a region at level "level", of size "numberOfPoints", apply the tests implied by MinCells, NumberOfRegionsOrMore and NumberOfRegionsOrLess. | |
void | BuildRegionList () |
virtual int | SelectCutDirection (vtkKdNode *kd) |
void | SetActualLevel () |
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 structures. | |
int | GetNumberOfCells () |
Returns the total number of cells in all the data sets. | |
int | GetDataSetsNumberOfCells (int set1, int set2) |
Returns the total number of cells in data set 1 through data set 2. | |
void | ComputeCellCenter (vtkDataSet *set, int cellId, float *center) |
Get or compute the center of one cell. | |
void | ComputeCellCenter (vtkDataSet *set, int cellId, double *center) |
float * | ComputeCellCenters () |
Compute and return a pointer to a list of all cell centers, in order by data set by cell Id. | |
float * | ComputeCellCenters (int set) |
float * | ComputeCellCenters (vtkDataSet *set) |
void | UpdateProgress (double amount) |
Modelled on vtkAlgorithm::UpdateProgress(). | |
void | UpdateSubOperationProgress (double amount) |
void | FindPointsWithinRadius (vtkKdNode *node, double R2, const double x[3], vtkIdList *ids) |
void | AddAllPointsInRegion (vtkKdNode *node, vtkIdList *ids) |
void | FindPointsInArea (vtkKdNode *node, double *area, vtkIdTypeArray *ids) |
void | AddAllPointsInRegion (vtkKdNode *node, vtkIdTypeArray *ids) |
int | DivideRegion (vtkKdNode *kd, float *c1, int *ids, int nlevels) |
void | DoMedianFind (vtkKdNode *kd, float *c1, int *ids, int d1, int d2, int d3) |
void | SelfRegister (vtkKdNode *kd) |
void | InitializeCellLists () |
vtkIdList * | GetList (int regionId, vtkIdList **which) |
void | ComputeCellCenter (vtkCell *cell, double *center, double *weights) |
void | GenerateRepresentationDataBounds (int level, vtkPolyData *pd) |
void | _generateRepresentationDataBounds (vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys, int level) |
void | GenerateRepresentationWholeSpace (int level, vtkPolyData *pd) |
void | _generateRepresentationWholeSpace (vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys, int level) |
void | AddPolys (vtkKdNode *kd, vtkPoints *pts, vtkCellArray *polys) |
void | printTree_ (int verbose) |
int | SearchNeighborsForDuplicate (int regionId, float *point, int **pointsSoFar, int *len, float tolerance, float tolerance2) |
int | SearchRegionForDuplicate (float *point, int *pointsSoFar, int len, float tolerance2) |
int | FindClosestPointInRegion_ (int regionId, double x, double y, double z, double &dist2) |
int | FindClosestPointInSphere (double x, double y, double z, double radius, int skipRegion, double &dist2) |
int | ViewOrderRegionsInDirection_ (vtkIntArray *IdsOfInterest, const double dop[3], vtkIntArray *orderedList) |
int | ViewOrderRegionsFromPosition_ (vtkIntArray *IdsOfInterest, const double pos[3], vtkIntArray *orderedList) |
void | SetInputDataInfo (int i, int dims[3], double origin[3], double spacing[3]) |
int | CheckInputDataInfo (int i, int dims[3], double origin[3], double spacing[3]) |
void | ClearLastBuildCache () |
void | NewPartitioningRequest (int req) |
vtkKdTree (const vtkKdTree &)=delete | |
void | operator= (const vtkKdTree &)=delete |
virtual void | SetProgress (double) |
Set/Get the execution progress of a process object. | |
virtual double | GetProgress () |
Set/Get the execution progress of a process object. | |
Protected Member Functions inherited from vtkLocator | |
vtkLocator () | |
~vtkLocator () override | |
virtual void | BuildLocatorInternal () |
This function is not pure virtual to maintain backwards compatibility. | |
void | ReportReferences (vtkGarbageCollector *) override |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
virtual void | ObjectFinalize () |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Static Protected Member Functions | |
static void | DeleteAllDescendants (vtkKdNode *nd) |
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 void | SetNewBounds_ (vtkKdNode *kd, double *b, int *fixDim) |
static void | CopyChildNodes (vtkKdNode *to, vtkKdNode *from) |
static void | CopyKdNode (vtkKdNode *to, vtkKdNode *from) |
static void | SetDataBoundsToSpatialBounds (vtkKdNode *kd) |
static void | ZeroNumberOfPoints (vtkKdNode *kd) |
static int | ViewOrderRegionsInDirection_P (vtkKdNode *node, vtkIntArray *list, vtkIntArray *IdsOfInterest, const double dir[3], int nextId) |
static int | ViewOrderRegionsFromPosition_P (vtkKdNode *node, vtkIntArray *list, vtkIntArray *IdsOfInterest, const double pos[3], int nextId) |
static int | ConvexSubRegions_ (int *ids, int len, vtkKdNode *tree, vtkKdNode **nodes) |
static int | FoundId (vtkIntArray *idArray, int id) |
static void | printTree_P (vtkKdNode *kd, int depth, int verbose) |
static int | MidValue (int dim, float *c1, int nvals, double &coord) |
static int | Select (int dim, float *c1, int *ids, int nvals, double &coord) |
static float | FindMaxLeftHalf (int dim, float *c1, int K) |
static void | Select_ (int dim, float *X, int *ids, int L, int R, int K) |
static int | ComputeLevel (vtkKdNode *kd) |
static int | SelfOrder (int id, vtkKdNode *kd) |
static int | findRegion (vtkKdNode *node, float x, float y, float z) |
static int | findRegion (vtkKdNode *node, double x, double y, double z) |
static vtkKdNode ** | GetRegionsAtLevel_ (int level, vtkKdNode **nodes, vtkKdNode *kd) |
static void | AddNewRegions (vtkKdNode *kd, float *c1, int midpt, int dim, double coord) |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
a Kd-tree spatial decomposition of a set of points
Given one or more vtkDataSets, create a load balancing k-d tree decomposition of the points at the center of the cells. Or, create a k-d tree point locator from a list of points. This class can also generate a PolyData representation of the boundaries of the spatial regions in the decomposition. It can sort the regions with respect to a viewing direction, and it can decompose a list of regions into subsets, each of which represent a convex spatial region (since many algorithms require a convex region). If the points were derived from cells, vtkKdTree can create a list of cell Ids for each region for each data set. Two lists are available - all cells with centroid in the region, and all cells that intersect the region but whose centroid lies in another region. For the purpose of removing duplicate points quickly from large data sets, or for finding nearby points, we added another mode for building the locator. BuildLocatorFromPoints will build a k-d tree from one or more vtkPoints objects. This can be followed by BuildMapForDuplicatePoints which returns a mapping from the original ids to a subset of the ids that is unique within a supplied tolerance, or you can use FindPoint and FindClosestPoint to locate points in the original set that the tree was built from.
Definition at line 116 of file vtkKdTree.h.
typedef vtkLocator vtkKdTree::Superclass |
Definition at line 119 of file vtkKdTree.h.
|
protected |
Enumerator | |
---|---|
XDIM | |
YDIM | |
ZDIM |
Definition at line 708 of file vtkKdTree.h.
|
protected |
|
overrideprotected |
|
protecteddelete |
|
static |
|
virtual |
|
static |
|
protectedvirtual |
vtkKdTree * vtkKdTree::NewInstance | ( | ) | const |
|
overridevirtual |
Methods invoked by print to print information about the object including superclasses.
Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObjectBase.
Reimplemented in vtkPKdTree.
|
static |
|
virtual |
Turn on timing of the k-d tree build.
|
virtual |
Turn on timing of the k-d tree build.
|
virtual |
Turn on timing of the k-d tree build.
|
virtual |
Turn on timing of the k-d tree build.
|
virtual |
Minimum number of cells per spatial region.
Default is 100.
|
virtual |
Minimum number of cells per spatial region.
Default is 100.
|
virtual |
Set/Get the number of spatial regions you want to get close to without going over.
(The number of spatial regions is normally a power of two.) Call this before BuildLocator(). Default is unset (0).
|
virtual |
|
virtual |
Set/Get the number of spatial regions you want to get close to while having at least this many regions.
(The number of spatial regions is normally a power of two.) Default is unset (0).
|
virtual |
|
virtual |
Some algorithms on k-d trees require a value that is a very small distance relative to the diameter of the entire space divided by the k-d tree.
This factor is the maximum axis-aligned width of the space multiplied by 10e-6.
|
virtual |
|
virtual |
Get a vtkBSPCuts object, a general object representing an axis- aligned spatial partitioning.
Used by vtkBSPIntersections.
void vtkKdTree::SetCuts | ( | vtkBSPCuts * | cuts | ) |
Normally the k-d tree is computed from the dataset(s) provided in SetDataSet.
Alternatively, you can provide the cuts that will be applied by calling SetCuts.
void vtkKdTree::OmitXPartitioning | ( | ) |
Omit partitions along the X axis, yielding shafts in the X direction.
void vtkKdTree::OmitYPartitioning | ( | ) |
Omit partitions along the Y axis, yielding shafts in the Y direction.
void vtkKdTree::OmitZPartitioning | ( | ) |
Omit partitions along the Z axis, yielding shafts in the Z direction.
void vtkKdTree::OmitXYPartitioning | ( | ) |
Omit partitions along the X and Y axes, yielding slabs along Z.
void vtkKdTree::OmitYZPartitioning | ( | ) |
Omit partitions along the Y and Z axes, yielding slabs along X.
void vtkKdTree::OmitZXPartitioning | ( | ) |
Omit partitions along the Z and X axes, yielding slabs along Y.
void vtkKdTree::OmitNoPartitioning | ( | ) |
Partition along all three axes - this is the default.
|
overridevirtual |
This class can compute a spatial decomposition based on the cells in a list of one or more input data sets.
SetDataSet sets the first data set in the list to the named set. SetNthDataSet sets the data set at index N to the data set named. RemoveData set takes either the data set itself or an index and removes that data set from the list of data sets. AddDataSet adds a data set to the list of data sets. Clear out all data sets and replace with single data set. For backward compatibility with superclass.
Reimplemented from vtkLocator.
|
virtual |
This class can compute a spatial decomposition based on the cells in a list of one or more input data sets.
Add them one at a time with this method.
|
virtual |
Remove the given data set.
|
virtual |
Remove the given data set.
|
virtual |
Remove the given data set.
int vtkKdTree::GetNumberOfDataSets | ( | ) |
Get the number of data sets included in spatial partitioning.
vtkDataSet * vtkKdTree::GetDataSet | ( | int | n | ) |
Get the nth defined data set in the spatial partitioning.
(If you used SetNthDataSet to define 0,1 and 3 and ask for data set 2, you get 3.) Return the n'th data set.
|
inlineoverridevirtual |
Return the 0'th data set.
For compatibility with the superclass' interface.
Reimplemented from vtkLocator.
Definition at line 272 of file vtkKdTree.h.
|
virtual |
Return a collection of all the data sets.
int vtkKdTree::GetDataSetIndex | ( | vtkDataSet * | set | ) |
Return the index of the given data set.
Returns -1 if that data set does not exist.
void vtkKdTree::GetBounds | ( | double * | bounds | ) |
Get the spatial bounds of the entire k-d tree space.
Sets bounds array to xmin, xmax, ymin, ymax, zmin, zmax.
void vtkKdTree::SetNewBounds | ( | double * | bounds | ) |
There are certain applications where you want the bounds of the k-d tree space to be at least as large as a specified box.
If the k-d tree has been built, you can expand it's bounds with this method. If the bounds supplied are smaller than those computed, they will be ignored.
|
virtual |
The number of leaf nodes of the tree, the spatial regions.
void vtkKdTree::GetRegionBounds | ( | int | regionID, |
double | bounds[6] | ||
) |
Get the spatial bounds of k-d tree region.
void vtkKdTree::GetRegionDataBounds | ( | int | regionID, |
double | bounds[6] | ||
) |
Get the bounds of the data within the k-d tree region.
void vtkKdTree::PrintTree | ( | ) |
Print out nodes of kd tree.
void vtkKdTree::PrintVerboseTree | ( | ) |
Print out nodes of kd tree.
void vtkKdTree::PrintRegion | ( | int | id | ) |
Print out leaf node data for given id.
void vtkKdTree::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 the region.
These lists are obtained with GetCellList(). If no DataSet is specified, the cell list is created for DataSet 0. If no list of requested regions is provided, the cell lists for all regions are created.
When CreateCellLists is called again, the lists created on the previous call are deleted.
void vtkKdTree::CreateCellLists | ( | vtkDataSet * | set, |
int * | regionReqList, | ||
int | reqListSize | ||
) |
void vtkKdTree::CreateCellLists | ( | int * | regionReqList, |
int | listSize | ||
) |
void vtkKdTree::CreateCellLists | ( | ) |
|
virtual |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region.
These lists are obtained with GetBoundaryCellList(). Default is OFF.
|
virtual |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region.
These lists are obtained with GetBoundaryCellList(). Default is OFF.
|
virtual |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region.
These lists are obtained with GetBoundaryCellList(). Default is OFF.
|
virtual |
If IncludeRegionBoundaryCells is ON, CreateCellLists() will also create a list of cells which intersect a given region, but are not assigned to the region.
These lists are obtained with GetBoundaryCellList(). Default is OFF.
void vtkKdTree::DeleteCellLists | ( | ) |
Free the memory used by the cell lists.
vtkIdList * vtkKdTree::GetCellList | ( | int | regionID | ) |
Get the cell list for a region.
This returns a pointer to vtkKdTree's memory, so don't free it.
vtkIdList * vtkKdTree::GetBoundaryCellList | ( | int | regionID | ) |
The cell list obtained with GetCellList is the list of all cells such that their centroid is contained in the spatial region.
It may also be desirable to get a list of all cells intersecting a spatial region, but with centroid in some other region. This is that list. This list is computed in CreateCellLists() if and only if IncludeRegionBoundaryCells is ON. This returns a pointer to KdTree's memory, so don't free it.
vtkIdType vtkKdTree::GetCellLists | ( | vtkIntArray * | regions, |
int | set, | ||
vtkIdList * | inRegionCells, | ||
vtkIdList * | onBoundaryCells | ||
) |
For a list of regions, get two cell lists.
The first lists the IDs all cells whose centroids lie in one of the regions. The second lists the IDs of all cells that intersect the regions, but whose centroid lies in a region not on the list.
The total number of cell IDs written to both lists is returned. Either list pointer passed in can be nullptr, and it will be ignored. If there are multiple data sets, you must specify which data set you wish cell IDs for.
The caller should delete these two lists when done. This method uses the cell lists created in CreateCellLists(). If the cell list for any of the requested regions does not exist, then this method will call CreateCellLists() to create cell lists for every region of the k-d tree. You must remember to DeleteCellLists() when done with all calls to this method, as cell lists can require a great deal of memory.
vtkIdType vtkKdTree::GetCellLists | ( | vtkIntArray * | regions, |
vtkDataSet * | set, | ||
vtkIdList * | inRegionCells, | ||
vtkIdList * | onBoundaryCells | ||
) |
For a list of regions, get two cell lists.
The first lists the IDs all cells whose centroids lie in one of the regions. The second lists the IDs of all cells that intersect the regions, but whose centroid lies in a region not on the list.
The total number of cell IDs written to both lists is returned. Either list pointer passed in can be nullptr, and it will be ignored. If there are multiple data sets, you must specify which data set you wish cell IDs for.
The caller should delete these two lists when done. This method uses the cell lists created in CreateCellLists(). If the cell list for any of the requested regions does not exist, then this method will call CreateCellLists() to create cell lists for every region of the k-d tree. You must remember to DeleteCellLists() when done with all calls to this method, as cell lists can require a great deal of memory.
vtkIdType vtkKdTree::GetCellLists | ( | vtkIntArray * | regions, |
vtkIdList * | inRegionCells, | ||
vtkIdList * | onBoundaryCells | ||
) |
For a list of regions, get two cell lists.
The first lists the IDs all cells whose centroids lie in one of the regions. The second lists the IDs of all cells that intersect the regions, but whose centroid lies in a region not on the list.
The total number of cell IDs written to both lists is returned. Either list pointer passed in can be nullptr, and it will be ignored. If there are multiple data sets, you must specify which data set you wish cell IDs for.
The caller should delete these two lists when done. This method uses the cell lists created in CreateCellLists(). If the cell list for any of the requested regions does not exist, then this method will call CreateCellLists() to create cell lists for every region of the k-d tree. You must remember to DeleteCellLists() when done with all calls to this method, as cell lists can require a great deal of memory.
int vtkKdTree::GetRegionContainingCell | ( | vtkDataSet * | set, |
vtkIdType | cellID | ||
) |
Get the id of the region containing the cell centroid.
If no DataSet is specified, assume DataSet 0. If you need the region ID for every cell, use AllGetRegionContainingCell instead. It is more efficient.
int vtkKdTree::GetRegionContainingCell | ( | int | set, |
vtkIdType | cellID | ||
) |
Get the id of the region containing the cell centroid.
If no DataSet is specified, assume DataSet 0. If you need the region ID for every cell, use AllGetRegionContainingCell instead. It is more efficient.
int vtkKdTree::GetRegionContainingCell | ( | vtkIdType | cellID | ) |
Get the id of the region containing the cell centroid.
If no DataSet is specified, assume DataSet 0. If you need the region ID for every cell, use AllGetRegionContainingCell instead. It is more efficient.
int * vtkKdTree::AllGetRegionContainingCell | ( | ) |
Get a list (in order by data set by cell id) of the region IDs of the region containing the centroid for each cell.
This is faster than calling GetRegionContainingCell for each cell in the DataSet. vtkKdTree uses this list, so don't delete it.
int vtkKdTree::GetRegionContainingPoint | ( | double | x, |
double | y, | ||
double | z | ||
) |
Get the id of the region containing the specified location.
|
overridevirtual |
Create the k-d tree decomposition of the cells of the data set or data sets.
Cells are assigned to k-d tree spatial regions based on the location of their centroids.
Implements vtkLocator.
Reimplemented in vtkPKdTree.
|
overridevirtual |
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Reimplemented from vtkLocator.
int vtkKdTree::MinimalNumberOfConvexSubRegions | ( | vtkIntArray * | regionIdList, |
double ** | convexRegionBounds | ||
) |
Given a list of region IDs, determine the decomposition of these regions into the minimal number of convex subregions.
Due to the way the k-d tree is constructed, those convex subregions will be axis-aligned boxes. Return the minimal number of such convex regions that compose the original region list. This call will set convexRegionBounds to point to a list of the bounds of these regions. Caller should free this. There will be six values for each convex subregion (xmin, xmax, ymin, ymax, zmin, zmax). If the regions in the regionIdList form a box already, a "1" is returned and the second argument contains the bounds of the box.
int vtkKdTree::ViewOrderAllRegionsInDirection | ( | const double | directionOfProjection[3], |
vtkIntArray * | orderedList | ||
) |
Given a direction of projection (typically obtained with vtkCamera::GetDirectionOfProjection()), this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction.
The number of ordered regions is returned. Use this method to view order regions for cameras that use parallel projection.
int vtkKdTree::ViewOrderRegionsInDirection | ( | vtkIntArray * | regionIds, |
const double | directionOfProjection[3], | ||
vtkIntArray * | orderedList | ||
) |
Given a direction of projection and a list of k-d tree region IDs, this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction.
The number of ordered regions is returned. Use this method to view order regions for cameras that use parallel projection.
int vtkKdTree::ViewOrderAllRegionsFromPosition | ( | const double | directionOfProjection[3], |
vtkIntArray * | orderedList | ||
) |
Given a camera position (typically obtained with vtkCamera::GetPosition()), this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction.
The number of ordered regions is returned. Use this method to view order regions for cameras that use perspective projection.
int vtkKdTree::ViewOrderRegionsFromPosition | ( | vtkIntArray * | regionIds, |
const double | directionOfProjection[3], | ||
vtkIntArray * | orderedList | ||
) |
Given a camera position and a list of k-d tree region IDs, this method, creates a list of the k-d tree region IDs in order from front to back with respect to that direction.
The number of ordered regions is returned. Use this method to view order regions for cameras that use perspective projection.
void vtkKdTree::BuildLocatorFromPoints | ( | vtkPointSet * | pointset | ) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points.
It builds the tree from one or more vtkPoints objects instead of from the cells of a vtkDataSet. This build would normally be followed by BuildMapForDuplicatePoints, FindPoint, or FindClosestPoint. Since this will build a normal k-d tree, all the region intersection queries will still work, as will most other calls except those that have "Cell" in the name.
This method works most efficiently when the point arrays are float arrays.
void vtkKdTree::BuildLocatorFromPoints | ( | vtkPoints * | ptArray | ) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points.
It builds the tree from one or more vtkPoints objects instead of from the cells of a vtkDataSet. This build would normally be followed by BuildMapForDuplicatePoints, FindPoint, or FindClosestPoint. Since this will build a normal k-d tree, all the region intersection queries will still work, as will most other calls except those that have "Cell" in the name.
This method works most efficiently when the point arrays are float arrays.
void vtkKdTree::BuildLocatorFromPoints | ( | vtkPoints ** | ptArray, |
int | numPtArrays | ||
) |
This is a special purpose locator that builds a k-d tree to find duplicate and near-by points.
It builds the tree from one or more vtkPoints objects instead of from the cells of a vtkDataSet. This build would normally be followed by BuildMapForDuplicatePoints, FindPoint, or FindClosestPoint. Since this will build a normal k-d tree, all the region intersection queries will still work, as will most other calls except those that have "Cell" in the name.
This method works most efficiently when the point arrays are float arrays.
vtkIdTypeArray * vtkKdTree::BuildMapForDuplicatePoints | ( | float | tolerance | ) |
This call returns a mapping from the original point IDs supplied to BuildLocatorFromPoints to a subset of those IDs that is unique within the specified tolerance.
If points 2, 5, and 12 are the same, then IdMap[2] = IdMap[5] = IdMap[12] = 2 (or 5 or 12).
"original point IDs" - For point IDs we start at 0 for the first point in the first vtkPoints object, and increase by 1 for subsequent points and subsequent vtkPoints objects.
You must have called BuildLocatorFromPoints() before calling this. You are responsible for deleting the returned array.
vtkIdType vtkKdTree::FindPoint | ( | double * | x | ) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints().
Returns -1 if the point was not in the original array.
vtkIdType vtkKdTree::FindPoint | ( | double | x, |
double | y, | ||
double | z | ||
) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints().
Returns -1 if the point was not in the original array.
vtkIdType vtkKdTree::FindClosestPoint | ( | double * | x, |
double & | dist2 | ||
) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints() which is closest to the given point.
Set the square of the distance between the two points.
vtkIdType vtkKdTree::FindClosestPoint | ( | double | x, |
double | y, | ||
double | z, | ||
double & | dist2 | ||
) |
Find the Id of the point that was previously supplied to BuildLocatorFromPoints() which is closest to the given point.
Set the square of the distance between the two points.
vtkIdType vtkKdTree::FindClosestPointWithinRadius | ( | double | radius, |
const double | x[3], | ||
double & | dist2 | ||
) |
Given a position x and a radius r, return the id of the point closest to the point in that radius.
dist2 returns the squared distance to the point.
vtkIdType vtkKdTree::FindClosestPointInRegion | ( | int | regionId, |
double * | x, | ||
double & | dist2 | ||
) |
Find the Id of the point in the given region which is closest to the given point.
Return the ID of the point, and set the square of the distance of between the points.
vtkIdType vtkKdTree::FindClosestPointInRegion | ( | int | regionId, |
double | x, | ||
double | y, | ||
double | z, | ||
double & | dist2 | ||
) |
Find the Id of the point in the given region which is closest to the given point.
Return the ID of the point, and set the square of the distance of between the points.
void vtkKdTree::FindPointsWithinRadius | ( | double | R, |
const double | x[3], | ||
vtkIdList * | result | ||
) |
Find all points within a specified radius R of position x.
The result is not sorted in any specific manner. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first.
void vtkKdTree::FindClosestNPoints | ( | int | N, |
const double | x[3], | ||
vtkIdList * | result | ||
) |
Find the closest N points to a position.
This returns the closest N points to a position. A faster method could be created that returned N close points to a position, but necessarily the exact N closest. The returned points are sorted from closest to farthest. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first.
vtkIdTypeArray * vtkKdTree::GetPointsInRegion | ( | int | regionId | ) |
Get a list of the original IDs of all points in a region.
You must have called BuildLocatorFromPoints before calling this.
|
overridevirtual |
Delete the k-d tree data structure.
Also delete any cell lists that were computed with CreateCellLists().
Implements vtkLocator.
|
overridevirtual |
Create a polydata representation of the boundaries of the k-d tree regions.
If level equals GetLevel(), the leaf nodes are represented.
Implements vtkLocator.
void vtkKdTree::GenerateRepresentation | ( | int * | regionList, |
int | len, | ||
vtkPolyData * | pd | ||
) |
Generate a polygonal representation of a list of regions.
Only leaf nodes have region IDs, so these will be leaf nodes.
|
virtual |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions.
The data inside the regions may not occupy the entire space. To draw just the bounds of the data in the regions, set this variable ON.
|
virtual |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions.
The data inside the regions may not occupy the entire space. To draw just the bounds of the data in the regions, set this variable ON.
|
virtual |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions.
The data inside the regions may not occupy the entire space. To draw just the bounds of the data in the regions, set this variable ON.
|
virtual |
The polydata representation of the k-d tree shows the boundaries of the k-d tree decomposition spatial regions.
The data inside the regions may not occupy the entire space. To draw just the bounds of the data in the regions, set this variable ON.
|
virtual |
Print timing of k-d tree build.
Reimplemented in vtkPKdTree.
|
virtual |
Return 1 if the geometry of the input data sets has changed since the last time the k-d tree was built.
|
virtual |
Return 1 if the geometry of these data sets differs for the geometry of the last data sets used to build the k-d tree.
|
virtual |
Forget about the last geometry used.
The next call to NewGeometry will return 1. A new k-d tree will be built the next time BuildLocator is called.
Create a copy of the binary tree representation of the k-d tree spatial partitioning provided.
void vtkKdTree::FindPointsInArea | ( | double * | area, |
vtkIdTypeArray * | ids, | ||
bool | clearArray = true |
||
) |
Fill ids with points found in area.
The area is a 6-tuple containing (xmin, xmax, ymin, ymax, zmin, zmax). This method will clear the array by default. To append ids to an array, set clearArray to false.
|
overrideprotectedvirtual |
This function is not pure virtual to maintain backwards compatibility.
Reimplemented from vtkLocator.
|
protected |
|
protected |
|
protected |
|
protected |
Save enough state so NewGeometry() can work, and update the BuildTime time stamp.
|
protected |
Prior to dividing a region at level "level", of size "numberOfPoints", apply the tests implied by MinCells, NumberOfRegionsOrMore and NumberOfRegionsOrLess.
Return 1 if it's OK to divide the region, 0 if you should not.
|
staticprotected |
|
protected |
|
protectedvirtual |
|
inlineprotected |
Definition at line 726 of file vtkKdTree.h.
|
protected |
Get back a list of the nodes at a specified level, nodes must be preallocated to hold 2^^(level) node structures.
|
staticprotected |
Adds to the vtkIntArray the list of region IDs of all leaf nodes in the given node.
|
protected |
Returns the total number of cells in all the data sets.
|
protected |
Returns the total number of cells in data set 1 through data set 2.
|
protected |
Get or compute the center of one cell.
If the DataSet is nullptr, the first DataSet is used. This is the point used in determining to which spatial region the cell is assigned.
|
protected |
|
protected |
Compute and return a pointer to a list of all cell centers, in order by data set by cell Id.
If a DataSet is specified cell centers for cells of that data only are returned. If no DataSet is specified, the cell centers of cells in all DataSets are returned. The caller should free the list of cell centers when done.
|
protected |
|
protected |
|
protected |
Modelled on vtkAlgorithm::UpdateProgress().
Update the progress when building the locator. Fires vtkCommand::ProgressEvent.
|
protectedvirtual |
Set/Get the execution progress of a process object.
|
protectedvirtual |
Set/Get the execution progress of a process object.
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protecteddelete |
|
protected |
Definition at line 683 of file vtkKdTree.h.
|
protected |
Definition at line 684 of file vtkKdTree.h.
|
protected |
Definition at line 715 of file vtkKdTree.h.
|
protected |
Definition at line 717 of file vtkKdTree.h.
|
protected |
Definition at line 718 of file vtkKdTree.h.
|
protected |
Definition at line 720 of file vtkKdTree.h.
|
protected |
Definition at line 777 of file vtkKdTree.h.
|
protected |
Definition at line 798 of file vtkKdTree.h.
|
protected |
Definition at line 799 of file vtkKdTree.h.
|
protected |
Definition at line 905 of file vtkKdTree.h.
|
protected |
Definition at line 906 of file vtkKdTree.h.
|
protected |
Definition at line 908 of file vtkKdTree.h.
|
protected |
Definition at line 909 of file vtkKdTree.h.
|
protected |
Definition at line 911 of file vtkKdTree.h.
|
protected |
Definition at line 913 of file vtkKdTree.h.
|
protected |
Definition at line 918 of file vtkKdTree.h.
|
protected |
Definition at line 920 of file vtkKdTree.h.
|
protected |
Definition at line 921 of file vtkKdTree.h.
|
protected |
Definition at line 923 of file vtkKdTree.h.
|
protected |
Definition at line 924 of file vtkKdTree.h.
|
protected |
Definition at line 929 of file vtkKdTree.h.
|
protected |
Definition at line 930 of file vtkKdTree.h.
|
protected |
Definition at line 931 of file vtkKdTree.h.
|
protected |
Definition at line 932 of file vtkKdTree.h.
|
protected |
Definition at line 934 of file vtkKdTree.h.
|
protected |
Definition at line 939 of file vtkKdTree.h.
|
protected |
Definition at line 940 of file vtkKdTree.h.
|
protected |
Definition at line 941 of file vtkKdTree.h.
|
protected |
Definition at line 942 of file vtkKdTree.h.
|
protected |
Definition at line 943 of file vtkKdTree.h.
|
protected |
Definition at line 944 of file vtkKdTree.h.
|
protected |
Definition at line 945 of file vtkKdTree.h.
|
protected |
Definition at line 946 of file vtkKdTree.h.
|
protected |
Definition at line 947 of file vtkKdTree.h.
|
protected |
Definition at line 949 of file vtkKdTree.h.
|
protected |
Definition at line 950 of file vtkKdTree.h.