vtkPKdTree Class Reference
#include <vtkPKdTree.h>
Inheritance diagram for vtkPKdTree:
[legend]Collaboration diagram for vtkPKdTree:
[legend]List of all members.
Detailed Description
Build a k-d tree decomposition of a list of points.
Build, in parallel, a k-d tree decomposition of one or more vtkDataSets distributed across processors. We assume each process has read in one portion of a large distributed data set. When done, each process has access to the k-d tree structure, can obtain information about which process contains data for each spatial region, and can depth sort the spatial regions.
This class can also assign spatial regions to processors, based on one of several region assignment schemes. By default a contiguous, convex region is assigned to each process. Several queries return information about how many and what cells I have that lie in a region assigned to another process.
- See also:
- vtkKdTree
- Created by:
-
- CVS contributions (if > 5%):
- Law, Charles (91%)
- Fisk, Lee Ann (7%)
- CVS logs (CVSweb):
.cxx (/Parallel/vtkPKdTree
.cxx)
.h (/Parallel/vtkPKdTree
.h)
Definition at line 63 of file vtkPKdTree.h.
|
Public Types |
typedef vtkKdTree | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | PrintTiming (ostream &os, vtkIndent indent) |
void | PrintTables (ostream &os, vtkIndent indent) |
void | BuildLocator () |
int | GetTotalNumberOfCells () |
int | CreateProcessCellCountData () |
int | CreateGlobalDataArrayBounds () |
virtual int | GetNumRegionsOrLess () |
virtual void | SetNumRegionsOrLess (int) |
virtual int | GetNumRegionsOrMore () |
virtual void | SetNumRegionsOrMore (int) |
void | SetController (vtkMultiProcessController *c) |
virtual vtkMultiProcessController * | GetController () |
virtual int | GetRegionAssignment () |
int | AssignRegions (int *map, int numRegions) |
int | AssignRegionsRoundRobin () |
int | AssignRegionsContiguous () |
int | GetRegionAssignmentList (int procId, vtkIntArray *list) |
void | GetAllProcessesBorderingOnPoint (float x, float y, float z, vtkIntArray *list) |
int | GetProcessAssignedToRegion (int regionId) |
int | HasData (int processId, int regionId) |
int | GetProcessCellCountForRegion (int processId, int regionId) |
int | GetTotalProcessesInRegion (int regionId) |
int | GetProcessListForRegion (int regionId, vtkIntArray *processes) |
int | GetProcessesCellCountForRegion (int regionId, int *count, int len) |
int | GetTotalRegionsForProcess (int processId) |
int | GetRegionListForProcess (int processId, vtkIntArray *regions) |
int | GetRegionsCellCountForProcess (int ProcessId, int *count, int len) |
vtkIdType | GetCellListsForProcessRegions (int ProcessId, int set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
vtkIdType | GetCellListsForProcessRegions (int ProcessId, vtkDataSet *set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
vtkIdType | GetCellListsForProcessRegions (int ProcessId, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells) |
int | DepthOrderAllProcesses (vtkCamera *camera, vtkIntArray *orderedList) |
int | GetCellArrayGlobalRange (int arrayIndex, float range[2]) |
int | GetPointArrayGlobalRange (int arrayIndex, float range[2]) |
int | GetCellArrayGlobalRange (int arrayIndex, double range[2]) |
int | GetPointArrayGlobalRange (int arrayIndex, double range[2]) |
int | GetCellArrayGlobalRange (const char *name, float range[2]) |
int | GetPointArrayGlobalRange (const char *name, float range[2]) |
int | GetCellArrayGlobalRange (const char *name, double range[2]) |
int | GetPointArrayGlobalRange (const char *name, double range[2]) |
Static Public Member Functions |
int | IsTypeOf (const char *type) |
vtkPKdTree * | SafeDownCast (vtkObject *o) |
vtkPKdTree * | New () |
Static Public Attributes |
const int | NoRegionAssignment |
const int | ContiguousAssignment |
const int | UserDefinedAssignment |
const int | RoundRobinAssignment |
Protected Member Functions |
| vtkPKdTree () |
| ~vtkPKdTree () |
void | SingleProcessBuildLocator () |
int | MultiProcessBuildLocator () |
Member Typedef Documentation
Constructor & Destructor Documentation
vtkPKdTree::vtkPKdTree |
( |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* vtkPKdTree::GetClassName |
( |
|
) |
[virtual] |
|
int vtkPKdTree::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkKdTree. |
virtual int vtkPKdTree::IsA |
( |
const char * |
type |
) |
[virtual] |
|
|
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkKdTree. |
void vtkPKdTree::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
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 vtkKdTree. |
void vtkPKdTree::PrintTiming |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
Print timing of k-d tree build
Reimplemented from vtkKdTree. |
void vtkPKdTree::PrintTables |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
|
|
|
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkKdTree. |
void vtkPKdTree::BuildLocator |
( |
|
) |
[virtual] |
|
|
Build the spatial decomposition. Call this explicitly after changing any parameters affecting the build of the tree. It must be called by all processes in the parallel application, or it will hang.
Reimplemented from vtkKdTree. |
int vtkPKdTree::GetTotalNumberOfCells |
( |
|
) |
[inline] |
|
|
Get the total number of cells distributed across the data files read by all processes. You must have called BuildLocator before calling this method.
Definition at line 85 of file vtkPKdTree.h. |
int vtkPKdTree::CreateProcessCellCountData |
( |
|
) |
|
|
|
Create tables of counts of cells per process per region. These tables can be accessed with queries like "HasData", "GetProcessCellCountForRegion", and so on. You must have called BuildLocator() beforehand. This method must be called by all processes or it will hang. Returns 1 on error, 0 when no error. |
int vtkPKdTree::CreateGlobalDataArrayBounds |
( |
|
) |
|
|
|
A convenience function which compiles the global bounds of the data arrays across processes. These bounds can be accessed with "GetCellArrayGlobalRange" and "GetPointArrayGlobalRange". This method must be called by all processes or it will hang. Returns 1 on error, 0 when no error. |
virtual int vtkPKdTree::GetNumRegionsOrLess |
( |
|
) |
[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(). |
virtual void vtkPKdTree::SetNumRegionsOrLess |
( |
int |
|
) |
[virtual] |
|
virtual int vtkPKdTree::GetNumRegionsOrMore |
( |
|
) |
[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.) Performance hint: Request just enough regions so you have at least one spatial region per processor. Further subdividing the space takes time. Call this before BuildLocator(). |
virtual void vtkPKdTree::SetNumRegionsOrMore |
( |
int |
|
) |
[virtual] |
|
|
Set/Get the communicator object |
virtual int vtkPKdTree::GetRegionAssignment |
( |
|
) |
[virtual] |
|
|
The PKdTree class can assign spatial regions to processors after building the k-d tree, using one of several partitioning criteria. These functions Set/Get whether this assignment is computed. The default is "Off", no assignment is computed. If "On", and no assignment scheme is specified, contiguous assignment will be computed. Specifying an assignment scheme (with AssignRegions*()) automatically turns on RegionAssignment. |
int vtkPKdTree::AssignRegions |
( |
int * |
map, |
|
|
int |
numRegions |
|
) |
|
|
|
Assign spatial regions to processes via a user defined map. The user-supplied map is indexed by region ID, and provides a process ID for each region. |
int vtkPKdTree::AssignRegionsRoundRobin |
( |
|
) |
|
|
|
Let the PKdTree class assign a process to each region in a round robin fashion. If the k-d tree has not yet been built, the regions will be assigned after BuildLocator executes. |
int vtkPKdTree::AssignRegionsContiguous |
( |
|
) |
|
|
|
Let the PKdTree class assign a process to each region by assigning contiguous sets of spatial regions to each process. The set of regions assigned to each process will always have a union that is a convex space (a box). If the k-d tree has not yet been built, the regions will be assigned after BuildLocator executes. |
int vtkPKdTree::GetRegionAssignmentList |
( |
int |
procId, |
|
|
vtkIntArray * |
list |
|
) |
|
|
|
Writes the list of region IDs assigned to the specified process. Regions IDs start at 0 and increase by 1 from there. Returns the number of regions in the list. |
void vtkPKdTree::GetAllProcessesBorderingOnPoint |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
vtkIntArray * |
list |
|
) |
|
|
|
The k-d tree spatial regions have been assigned to processes. Given a point on the boundary of one of the regions, this method creates a list of all processes whose region boundaries include that point. This may be required when looking for processes that have cells adjacent to the cells of a given process. |
int vtkPKdTree::GetProcessAssignedToRegion |
( |
int |
regionId |
) |
|
|
|
Returns the ID of the process assigned to the region. |
int vtkPKdTree::HasData |
( |
int |
processId, |
|
|
int |
regionId |
|
) |
|
|
|
Returns 1 if the process has data for the given region, 0 otherwise. |
int vtkPKdTree::GetProcessCellCountForRegion |
( |
int |
processId, |
|
|
int |
regionId |
|
) |
|
|
|
Returns the number of cells the specified process has in the specified region. |
int vtkPKdTree::GetTotalProcessesInRegion |
( |
int |
regionId |
) |
|
|
|
Returns the total number of processes that have data falling within this spatial region. |
int vtkPKdTree::GetProcessListForRegion |
( |
int |
regionId, |
|
|
vtkIntArray * |
processes |
|
) |
|
|
|
Adds the list of processes having data for the given region to the supplied list, returns the number of processes added. |
int vtkPKdTree::GetProcessesCellCountForRegion |
( |
int |
regionId, |
|
|
int * |
count, |
|
|
int |
len |
|
) |
|
|
|
Writes the number of cells each process has for the region to the supplied list of length len. Returns the number of cell counts written. The order of the cell counts corresponds to the order of process IDs in the process list returned by GetProcessListForRegion. |
int vtkPKdTree::GetTotalRegionsForProcess |
( |
int |
processId |
) |
|
|
|
Returns the total number of spatial regions that a given process has data for. |
int vtkPKdTree::GetRegionListForProcess |
( |
int |
processId, |
|
|
vtkIntArray * |
regions |
|
) |
|
|
|
Adds the region IDs for which this process has data to the supplied vtkIntArray. Retruns the number of regions. |
int vtkPKdTree::GetRegionsCellCountForProcess |
( |
int |
ProcessId, |
|
|
int * |
count, |
|
|
int |
len |
|
) |
|
|
|
Writes to the supplied integer array the number of cells this process has for each region. Returns the number of cell counts written. The order of the cell counts corresponds to the order of region IDs in the region list returned by GetRegionListForProcess. |
|
After regions have been assigned to processes, I may want to know which cells I have that are in the regions assigned to a particular process. This method takes a process ID and two vtkIdLists. It writes to the first list the IDs of the cells contained in the process' regions. (That is, their cell centroid is contained in the region.) To the second list it write the IDs of the cells which intersect the process' regions but whose cell centroid lies elsewhere. The total number of cell IDs written to both lists is returned. Either list pointer passed in can be NULL, 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 vtkKdTree::CreateCellLists(). If the cell lists for the process' regions do not exist, this method will first build the cell lists for all regions by calling CreateCellLists(). You must remember to DeleteCellLists() when done with all calls to this method, as cell lists can require a great deal of memory. |
|
Return a list of all processes in order from front to back, given a vtkCamera |
int vtkPKdTree::GetCellArrayGlobalRange |
( |
int |
arrayIndex, |
|
|
float |
range[2] |
|
) |
|
|
|
An added feature of vtkPKdTree is that it will calculate the the global range of field arrays across all processes. You call CreateGlobalDataArrayBounds() to do this calculation. Then the following methods return the ranges. Returns 1 on error, 0 otherwise. |
int vtkPKdTree::GetPointArrayGlobalRange |
( |
int |
arrayIndex, |
|
|
float |
range[2] |
|
) |
|
|
int vtkPKdTree::GetCellArrayGlobalRange |
( |
int |
arrayIndex, |
|
|
double |
range[2] |
|
) |
|
|
int vtkPKdTree::GetPointArrayGlobalRange |
( |
int |
arrayIndex, |
|
|
double |
range[2] |
|
) |
|
|
int vtkPKdTree::GetCellArrayGlobalRange |
( |
const char * |
name, |
|
|
float |
range[2] |
|
) |
|
|
int vtkPKdTree::GetPointArrayGlobalRange |
( |
const char * |
name, |
|
|
float |
range[2] |
|
) |
|
|
int vtkPKdTree::GetCellArrayGlobalRange |
( |
const char * |
name, |
|
|
double |
range[2] |
|
) |
|
|
int vtkPKdTree::GetPointArrayGlobalRange |
( |
const char * |
name, |
|
|
double |
range[2] |
|
) |
|
|
void vtkPKdTree::SingleProcessBuildLocator |
( |
|
) |
[protected] |
|
int vtkPKdTree::MultiProcessBuildLocator |
( |
|
) |
[protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file: