VTK
9.4.20241221
|
class to build and traverse sphere trees More...
#include <vtkSphereTree.h>
Public Member Functions | |
virtual int | GetNumberOfLevels () |
Get the current depth of the sphere tree. | |
virtual void | SetDataSet (vtkDataSet *) |
Specify the dataset from which to build the sphere tree. | |
virtual vtkDataSet * | GetDataSet () |
Specify the dataset from which to build the sphere tree. | |
void | Build () |
Build the sphere tree (if necessary) from the data set specified. | |
void | Build (vtkDataSet *input) |
Build the sphere tree (if necessary) from the data set specified. | |
virtual void | SetBuildHierarchy (bool) |
Control whether the tree hierarchy is built. | |
virtual bool | GetBuildHierarchy () |
Control whether the tree hierarchy is built. | |
virtual void | BuildHierarchyOn () |
Control whether the tree hierarchy is built. | |
virtual void | BuildHierarchyOff () |
Control whether the tree hierarchy is built. | |
const unsigned char * | SelectPoint (double point[3], vtkIdType &numSelected) |
Methods for cell selection based on a geometric query. | |
const unsigned char * | SelectLine (double origin[3], double ray[3], vtkIdType &numSelected) |
Methods for cell selection based on a geometric query. | |
const unsigned char * | SelectPlane (double origin[3], double normal[3], vtkIdType &numSelected) |
Methods for cell selection based on a geometric query. | |
void | SelectPoint (double point[3], vtkIdList *cellIds) |
Methods for cell selection based on a geometric query. | |
void | SelectLine (double origin[3], double ray[3], vtkIdList *cellIds) |
Methods for cell selection based on a geometric query. | |
void | SelectPlane (double origin[3], double normal[3], vtkIdList *cellIds) |
Methods for cell selection based on a geometric query. | |
virtual void | SetResolution (int) |
Sphere tree creation requires gathering spheres into groups. | |
virtual int | GetResolution () |
Sphere tree creation requires gathering spheres into groups. | |
virtual void | SetMaxLevel (int) |
Specify the maximum number of levels for the tree. | |
virtual int | GetMaxLevel () |
Specify the maximum number of levels for the tree. | |
const double * | GetCellSpheres () |
Special methods to retrieve the sphere tree data. | |
const double * | GetTreeSpheres (int level, vtkIdType &numSpheres) |
Special methods to retrieve the sphere tree data. | |
bool | UsesGarbageCollector () const override |
Participate in garbage collection via ReportReferences. | |
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 vtkSphereTree * | New () |
Instantiate the sphere tree. | |
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 Member Functions | |
vtkSphereTree () | |
~vtkSphereTree () override | |
void | BuildTreeSpheres (vtkDataSet *input) |
void | ExtractCellIds (const unsigned char *selected, vtkIdList *cellIds, vtkIdType numSelected) |
void | BuildTreeHierarchy (vtkDataSet *input) |
void | BuildStructuredHierarchy (vtkStructuredGrid *input, double *tree) |
void | BuildUnstructuredHierarchy (vtkDataSet *input, double *tree) |
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 &) |
Protected Attributes | |
vtkDataSet * | DataSet |
unsigned char * | Selected |
int | Resolution |
int | MaxLevel |
int | NumberOfLevels |
bool | BuildHierarchy |
vtkDoubleArray * | Tree |
double * | TreePtr |
vtkSphereTreeHierarchy * | Hierarchy |
double | AverageRadius |
double | SphereBounds [6] |
vtkTimeStamp | BuildTime |
int | SphereTreeType |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
std::string | ObjectName |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
typedef vtkObject | Superclass |
Standard type related macros and PrintSelf() method. | |
static vtkTypeBool | IsTypeOf (const char *type) |
Standard type related macros and PrintSelf() method. | |
static vtkSphereTree * | SafeDownCast (vtkObjectBase *o) |
Standard type related macros and PrintSelf() method. | |
virtual vtkTypeBool | IsA (const char *type) |
Standard type related macros and PrintSelf() method. | |
vtkSphereTree * | NewInstance () const |
Standard type related macros and PrintSelf() method. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Standard type related macros and PrintSelf() method. | |
virtual vtkObjectBase * | NewInstanceInternal () const |
Standard type related macros and PrintSelf() method. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
class to build and traverse sphere trees
vtkSphereTree is a helper class used to build and traverse sphere trees. Various types of trees can be constructed for different VTK dataset types, as well well as different approaches to organize the tree into hierarchies.
Typically building a complete sphere tree consists of two parts: 1) creating spheres for each cell in the dataset, then 2) creating an organizing hierarchy. The structure of the hierarchy varies depending on the topological characteristics of the dataset.
Once the tree is constructed, various geometric operations are available for quickly selecting cells based on sphere tree operations; for example, process all cells intersecting a plane (i.e., use the sphere tree to identify candidate cells for plane intersection).
This class does not necessarily create optimal sphere trees because some of its requirements (fast build time, provide simple reference code, a single bounding sphere per cell, etc.) precludes optimal performance. It is also oriented to computing on cells versus the classic problem of collision detection for polygonal models. For more information you want to read Gareth Bradshaw's PhD thesis "Bounding Volume Hierarchies for Level-of-Detail Collision Handling" which does a nice job of laying out the challenges and important algorithms relative to sphere trees and BVH (bounding volume hierarchies).
Definition at line 61 of file vtkSphereTree.h.
typedef vtkObject vtkSphereTree::Superclass |
Standard type related macros and PrintSelf() method.
Definition at line 73 of file vtkSphereTree.h.
|
protected |
|
overrideprotected |
|
static |
Instantiate the sphere tree.
|
static |
Standard type related macros and PrintSelf() method.
|
virtual |
Standard type related macros and PrintSelf() method.
Reimplemented from vtkObjectBase.
|
static |
Standard type related macros and PrintSelf() method.
|
protectedvirtual |
Standard type related macros and PrintSelf() method.
vtkSphereTree * vtkSphereTree::NewInstance | ( | ) | const |
Standard type related macros and PrintSelf() method.
|
overridevirtual |
Standard type related macros and PrintSelf() method.
Reimplemented from vtkObject.
|
virtual |
Specify the dataset from which to build the sphere tree.
|
virtual |
Specify the dataset from which to build the sphere tree.
void vtkSphereTree::Build | ( | ) |
Build the sphere tree (if necessary) from the data set specified.
The build time is recorded so the sphere tree will only build if something has changed. An alternative method is available to both set the dataset and then build the sphere tree.
void vtkSphereTree::Build | ( | vtkDataSet * | input | ) |
Build the sphere tree (if necessary) from the data set specified.
The build time is recorded so the sphere tree will only build if something has changed. An alternative method is available to both set the dataset and then build the sphere tree.
|
virtual |
Control whether the tree hierarchy is built.
If not, then just cell spheres are created (one for each cell).
|
virtual |
Control whether the tree hierarchy is built.
If not, then just cell spheres are created (one for each cell).
|
virtual |
Control whether the tree hierarchy is built.
If not, then just cell spheres are created (one for each cell).
|
virtual |
Control whether the tree hierarchy is built.
If not, then just cell spheres are created (one for each cell).
const unsigned char * vtkSphereTree::SelectPoint | ( | double | point[3], |
vtkIdType & | numSelected | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The array returned is set to non-zero for each cell that intersects the geometric entity. SelectPoint marks all cells with a non-zero value that may contain a point. SelectLine marks all cells that may intersect an infinite line. SelectPlane marks all cells that may intersect with an infinite plane.
const unsigned char * vtkSphereTree::SelectLine | ( | double | origin[3], |
double | ray[3], | ||
vtkIdType & | numSelected | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The array returned is set to non-zero for each cell that intersects the geometric entity. SelectPoint marks all cells with a non-zero value that may contain a point. SelectLine marks all cells that may intersect an infinite line. SelectPlane marks all cells that may intersect with an infinite plane.
const unsigned char * vtkSphereTree::SelectPlane | ( | double | origin[3], |
double | normal[3], | ||
vtkIdType & | numSelected | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The array returned is set to non-zero for each cell that intersects the geometric entity. SelectPoint marks all cells with a non-zero value that may contain a point. SelectLine marks all cells that may intersect an infinite line. SelectPlane marks all cells that may intersect with an infinite plane.
void vtkSphereTree::SelectPoint | ( | double | point[3], |
vtkIdList * | cellIds | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The method pupulates an vtkIdList with cell ids that may satisfy the geometric query (the user must provide a vtkLdList which the methods fill in). SelectPoint lists all cells with a non-zero value that may contain a point. SelectLine lists all cells that may intersect an infinite line. SelectPlane lists all cells that may intersect with an infinite plane.
void vtkSphereTree::SelectLine | ( | double | origin[3], |
double | ray[3], | ||
vtkIdList * | cellIds | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The method pupulates an vtkIdList with cell ids that may satisfy the geometric query (the user must provide a vtkLdList which the methods fill in). SelectPoint lists all cells with a non-zero value that may contain a point. SelectLine lists all cells that may intersect an infinite line. SelectPlane lists all cells that may intersect with an infinite plane.
void vtkSphereTree::SelectPlane | ( | double | origin[3], |
double | normal[3], | ||
vtkIdList * | cellIds | ||
) |
Methods for cell selection based on a geometric query.
Internally different methods are used depending on the dataset type. The method pupulates an vtkIdList with cell ids that may satisfy the geometric query (the user must provide a vtkLdList which the methods fill in). SelectPoint lists all cells with a non-zero value that may contain a point. SelectLine lists all cells that may intersect an infinite line. SelectPlane lists all cells that may intersect with an infinite plane.
|
virtual |
Sphere tree creation requires gathering spheres into groups.
The Resolution variable is a rough guide to the size of each group (the size different meanings depending on the type of data (structured versus unstructured). For example, in 3D structured data, blocks of resolution Resolution^3 are created. By default the Resolution is three.
|
virtual |
Sphere tree creation requires gathering spheres into groups.
The Resolution variable is a rough guide to the size of each group (the size different meanings depending on the type of data (structured versus unstructured). For example, in 3D structured data, blocks of resolution Resolution^3 are created. By default the Resolution is three.
|
virtual |
Specify the maximum number of levels for the tree.
By default, the number of levels is set to ten. If the number of levels is set to one or less, then no hierarchy is built (i.e., just the spheres for each cell are created). Note that the actual level of the tree may be less than this value depending on the number of cells and Resolution factor.
|
virtual |
Specify the maximum number of levels for the tree.
By default, the number of levels is set to ten. If the number of levels is set to one or less, then no hierarchy is built (i.e., just the spheres for each cell are created). Note that the actual level of the tree may be less than this value depending on the number of cells and Resolution factor.
|
virtual |
Get the current depth of the sphere tree.
This value may change each time the sphere tree is built and the branching factor (i.e., resolution) changes. Note that after building the sphere tree there are [0,this->NumberOfLevels) defined levels.
const double * vtkSphereTree::GetCellSpheres | ( | ) |
Special methods to retrieve the sphere tree data.
This is generally used for debugging or with filters like vtkSphereTreeFilter. Both methods return an array of double* where four doubles represent a sphere (center + radius). In the first method a sphere per cell is returned. In the second method the user must also specify a level in the sphere tree (used to retrieve the hierarchy of the tree). Note that null pointers can be returned if the request is not consistent with the state of the sphere tree.
const double * vtkSphereTree::GetTreeSpheres | ( | int | level, |
vtkIdType & | numSpheres | ||
) |
Special methods to retrieve the sphere tree data.
This is generally used for debugging or with filters like vtkSphereTreeFilter. Both methods return an array of double* where four doubles represent a sphere (center + radius). In the first method a sphere per cell is returned. In the second method the user must also specify a level in the sphere tree (used to retrieve the hierarchy of the tree). Note that null pointers can be returned if the request is not consistent with the state of the sphere tree.
|
inlineoverridevirtual |
Participate in garbage collection via ReportReferences.
Reimplemented from vtkObjectBase.
Definition at line 189 of file vtkSphereTree.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
overrideprotectedvirtual |
Reimplemented from vtkObjectBase.
|
protected |
Definition at line 197 of file vtkSphereTree.h.
|
protected |
Definition at line 198 of file vtkSphereTree.h.
|
protected |
Definition at line 199 of file vtkSphereTree.h.
|
protected |
Definition at line 200 of file vtkSphereTree.h.
|
protected |
Definition at line 201 of file vtkSphereTree.h.
|
protected |
Definition at line 202 of file vtkSphereTree.h.
|
protected |
Definition at line 205 of file vtkSphereTree.h.
|
protected |
Definition at line 206 of file vtkSphereTree.h.
|
protected |
Definition at line 207 of file vtkSphereTree.h.
|
protected |
Definition at line 210 of file vtkSphereTree.h.
|
protected |
Definition at line 211 of file vtkSphereTree.h.
|
protected |
Definition at line 212 of file vtkSphereTree.h.
|
protected |
Definition at line 221 of file vtkSphereTree.h.