VTK  9.1.20211015
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkIncrementalOctreeNode Class Reference

Octree node constituting incremental octree (in support of both point location and point insertion) More...

#include <vtkIncrementalOctreeNode.h>

Inheritance diagram for vtkIncrementalOctreeNode:
[legend]
Collaboration diagram for vtkIncrementalOctreeNode:
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkIncrementalOctreeNodeNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void DeleteChildNodes ()
 Delete the eight child nodes. More...
 
void SetBounds (double x1, double x2, double y1, double y2, double z1, double z2)
 Set the spatial bounding box of the node. More...
 
void GetBounds (double bounds[6]) const
 Get the spatial bounding box of the node. More...
 
double * GetMinDataBounds ()
 Get access to MinDataBounds. More...
 
double * GetMaxDataBounds ()
 Get access to MaxDataBounds. More...
 
int IsLeaf ()
 Determine whether or not this node is a leaf. More...
 
int GetChildIndex (const double point[3])
 Determine which specific child / octant contains a given point. More...
 
vtkIncrementalOctreeNodeGetChild (int i)
 Get quick access to a child of this node. More...
 
vtkTypeBool ContainsPoint (const double pnt[3])
 A point is in a node if and only if MinBounds[i] < p[i] <= MaxBounds[i], which allows a node to be divided into eight non-overlapping children. More...
 
vtkTypeBool ContainsPointByData (const double pnt[3])
 A point is in a node, in terms of data, if and only if MinDataBounds[i] <= p[i] <= MaxDataBounds[i]. More...
 
int InsertPoint (vtkPoints *points, const double newPnt[3], int maxPts, vtkIdType *pntId, int ptMode)
 This function is called after a successful point-insertion check and only applies to a leaf node. More...
 
int InsertPoint (vtkPoints *points, const double newPnt[3], int maxPts, vtkIdType *pntId, int ptMode, int &numberOfNodes)
 
double GetDistance2ToInnerBoundary (const double point[3], vtkIncrementalOctreeNode *rootNode)
 Given a point inside this node, get the minimum squared distance to all inner boundaries. More...
 
double GetDistance2ToBoundary (const double point[3], vtkIncrementalOctreeNode *rootNode, int checkData)
 Compute the minimum squared distance from a point to this node, with all six boundaries considered. More...
 
double GetDistance2ToBoundary (const double point[3], double closest[3], vtkIncrementalOctreeNode *rootNode, int checkData)
 Compute the minimum squared distance from a point to this node, with all six boundaries considered. More...
 
void ExportAllPointIdsByInsertion (vtkIdList *idList)
 Export all the indices of the points (contained in or under this node) by inserting them to an allocated vtkIdList via vtkIdList::InsertNextId(). More...
 
void ExportAllPointIdsByDirectSet (vtkIdType *pntIdx, vtkIdList *idList)
 Export all the indices of the points (contained in or under this node) by directly setting them in an allocated vtkIdList object. More...
 
int GetNumberOfLevels () const
 Computes and returns the maximum level of the tree. More...
 
int GetID () const
 Returns the ID of this node which is the index of the node in the octree. More...
 
vtkIdListGetPointIds () const
 
virtual int GetNumberOfPoints ()
 Get the number of points inside or under this node. More...
 
virtual vtkIdListGetPointIdSet ()
 Get the list of point indices, nullptr for a non-leaf node. More...
 
virtual double * GetMinBounds ()
 Get access to MinBounds. More...
 
virtual void GetMinBounds (double &, double &, double &)
 Get access to MinBounds. More...
 
virtual void GetMinBounds (double[3])
 Get access to MinBounds. More...
 
virtual double * GetMaxBounds ()
 Get access to MaxBounds. More...
 
virtual void GetMaxBounds (double &, double &, double &)
 Get access to MaxBounds. More...
 
virtual void GetMaxBounds (double[3])
 Get access to MaxBounds. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
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)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
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. More...
 
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. More...
 
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. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
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). More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkIncrementalOctreeNodeSafeDownCast (vtkObjectBase *o)
 
static vtkIncrementalOctreeNodeNew ()
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- 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. More...
 
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). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
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. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkIncrementalOctreeNode ()
 
 ~vtkIncrementalOctreeNode () 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. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Octree node constituting incremental octree (in support of both point location and point insertion)

Octree nodes serve as spatial sub-division primitives to build the search structure of an incremental octree in a recursive top-down manner. The hierarchy takes the form of a tree-like representation by which a parent node contains eight mutually non-overlapping child nodes. Each child is assigned with an axis-aligned rectangular volume (Spatial Bounding Box) and the eight children together cover exactly the same region as governed by their parent. The eight child nodes / octants are ordered as

{ (xBBoxMin, xBBoxMid] & (yBBoxMin, yBBoxMid] & (zBBoxMin, zBBoxMid] }, { (xBBoxMid, xBBoxMax] & (yBBoxMin, yBBoxMid] & (zBBoxMin, zBBoxMid] }, { (xBBoxMin, xBBoxMid] & (yBBoxMid, yBBoxMax] & (zBBoxMin, zBBoxMid] }, { (xBBoxMid, xBBoxMax] & (yBBoxMid, yBBoxMax] & (zBBoxMin, zBBoxMid] }, { (xBBoxMin, xBBoxMid] & (yBBoxMin, yBBoxMid] & (zBBoxMid, zBBoxMax] }, { (xBBoxMid, xBBoxMax] & (yBBoxMin, yBBoxMid] & (zBBoxMid, zBBoxMax] }, { (xBBoxMin, xBBoxMid] & (yBBoxMid, yBBoxMax] & (zBBoxMid, zBBoxMax] }, { (xBBoxMid, xBBoxMax] & (yBBoxMid, yBBoxMax] & (zBBoxMid, zBBoxMax] },

where { xrange & yRange & zRange } defines the region of each 3D octant. In addition, the points falling within and registered, by means of point indices, in the parent node are distributed to the child nodes for delegated maintenance. In fact, only leaf nodes, i.e., those without any descendants, actually store point indices while each node, regardless of a leaf or non- leaf node, keeps a dynamically updated Data Bounding Box of the inhabitant points, if any. Given a maximum number of points per leaf node, an octree is initialized with an empty leaf node that is then recursively sub-divided, but only on demand as points are incrementally inserted, to construct a populated tree.

Please note that this octree node class is able to handle a large number of EXACTLY duplicate points that is greater than the specified maximum number of points per leaf node. In other words, as an exception, a leaf node may maintain an arbitrary number of exactly duplicate points to deal with possible extreme cases.

See also
vtkIncrementalOctreePointLocator

Definition at line 69 of file vtkIncrementalOctreeNode.h.

Member Typedef Documentation

◆ Superclass

Definition at line 72 of file vtkIncrementalOctreeNode.h.

Constructor & Destructor Documentation

◆ vtkIncrementalOctreeNode()

vtkIncrementalOctreeNode::vtkIncrementalOctreeNode ( )
protected

◆ ~vtkIncrementalOctreeNode()

vtkIncrementalOctreeNode::~vtkIncrementalOctreeNode ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkIncrementalOctreeNode::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkIncrementalOctreeNode::IsA ( const char *  name)
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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkIncrementalOctreeNode* vtkIncrementalOctreeNode::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkIncrementalOctreeNode::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkIncrementalOctreeNode* vtkIncrementalOctreeNode::NewInstance ( ) const

◆ PrintSelf()

void vtkIncrementalOctreeNode::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
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 vtkObject.

◆ New()

static vtkIncrementalOctreeNode* vtkIncrementalOctreeNode::New ( )
static

◆ GetNumberOfPoints()

virtual int vtkIncrementalOctreeNode::GetNumberOfPoints ( )
virtual

Get the number of points inside or under this node.

◆ GetPointIdSet()

virtual vtkIdList* vtkIncrementalOctreeNode::GetPointIdSet ( )
virtual

Get the list of point indices, nullptr for a non-leaf node.

◆ DeleteChildNodes()

void vtkIncrementalOctreeNode::DeleteChildNodes ( )

Delete the eight child nodes.

◆ SetBounds()

void vtkIncrementalOctreeNode::SetBounds ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2 
)

Set the spatial bounding box of the node.

This function sets a default data bounding box.

◆ GetBounds()

void vtkIncrementalOctreeNode::GetBounds ( double  bounds[6]) const

Get the spatial bounding box of the node.

The values are returned via an array in order of: x_min, x_max, y_min, y_max, z_min, z_max.

◆ GetMinBounds() [1/3]

virtual double* vtkIncrementalOctreeNode::GetMinBounds ( )
virtual

Get access to MinBounds.

Do not free this pointer.

◆ GetMinBounds() [2/3]

virtual void vtkIncrementalOctreeNode::GetMinBounds ( double &  ,
double &  ,
double &   
)
virtual

Get access to MinBounds.

Do not free this pointer.

◆ GetMinBounds() [3/3]

virtual void vtkIncrementalOctreeNode::GetMinBounds ( double  [3])
virtual

Get access to MinBounds.

Do not free this pointer.

◆ GetMaxBounds() [1/3]

virtual double* vtkIncrementalOctreeNode::GetMaxBounds ( )
virtual

Get access to MaxBounds.

Do not free this pointer.

◆ GetMaxBounds() [2/3]

virtual void vtkIncrementalOctreeNode::GetMaxBounds ( double &  ,
double &  ,
double &   
)
virtual

Get access to MaxBounds.

Do not free this pointer.

◆ GetMaxBounds() [3/3]

virtual void vtkIncrementalOctreeNode::GetMaxBounds ( double  [3])
virtual

Get access to MaxBounds.

Do not free this pointer.

◆ GetMinDataBounds()

double* vtkIncrementalOctreeNode::GetMinDataBounds ( )
inline

Get access to MinDataBounds.

Note that MinDataBounds is not valid until point insertion.

Definition at line 126 of file vtkIncrementalOctreeNode.h.

◆ GetMaxDataBounds()

double* vtkIncrementalOctreeNode::GetMaxDataBounds ( )
inline

Get access to MaxDataBounds.

Note that MaxDataBounds is not valid until point insertion.

Definition at line 135 of file vtkIncrementalOctreeNode.h.

◆ IsLeaf()

int vtkIncrementalOctreeNode::IsLeaf ( )
inline

Determine whether or not this node is a leaf.

Definition at line 143 of file vtkIncrementalOctreeNode.h.

◆ GetChildIndex()

int vtkIncrementalOctreeNode::GetChildIndex ( const double  point[3])
inline

Determine which specific child / octant contains a given point.

Note that the point is assumed to be inside this node and no checking is performed on the inside issue.

Definition at line 415 of file vtkIncrementalOctreeNode.h.

◆ GetChild()

vtkIncrementalOctreeNode* vtkIncrementalOctreeNode::GetChild ( int  i)
inline

Get quick access to a child of this node.

Note that this node is assumed to be a non-leaf one and no checking is performed on the node type.

Definition at line 156 of file vtkIncrementalOctreeNode.h.

◆ ContainsPoint()

vtkTypeBool vtkIncrementalOctreeNode::ContainsPoint ( const double  pnt[3])
inline

A point is in a node if and only if MinBounds[i] < p[i] <= MaxBounds[i], which allows a node to be divided into eight non-overlapping children.

Definition at line 424 of file vtkIncrementalOctreeNode.h.

◆ ContainsPointByData()

vtkTypeBool vtkIncrementalOctreeNode::ContainsPointByData ( const double  pnt[3])
inline

A point is in a node, in terms of data, if and only if MinDataBounds[i] <= p[i] <= MaxDataBounds[i].

Definition at line 434 of file vtkIncrementalOctreeNode.h.

◆ InsertPoint() [1/2]

int vtkIncrementalOctreeNode::InsertPoint ( vtkPoints points,
const double  newPnt[3],
int  maxPts,
vtkIdType pntId,
int  ptMode 
)

This function is called after a successful point-insertion check and only applies to a leaf node.

Prior to a call to this function, the octree should have been retrieved top-down to find the specific leaf node in which this new point (newPt) will be inserted. The actual index of the new point (to be inserted to points) is stored in pntId. Argument ptMode specifies whether the point is not inserted at all but instead only the point index is provided upon 0, the point is inserted via vtkPoints:: InsertPoint() upon 1, or it is inserted via vtkPoints::InsertNextPoint() upon 2. For case 0, pntId needs to be specified. For cases 1 and 2, the actual point index is returned via pntId. Note that this function always returns 1 to indicate the success of point insertion. numberOfNodes is the number of nodes present in the tree at this time. it is used to assign an ID to each node which can be used to associate application specifc information with each node. It is updated if new nodes are added to the tree.

◆ InsertPoint() [2/2]

int vtkIncrementalOctreeNode::InsertPoint ( vtkPoints points,
const double  newPnt[3],
int  maxPts,
vtkIdType pntId,
int  ptMode,
int &  numberOfNodes 
)

◆ GetDistance2ToInnerBoundary()

double vtkIncrementalOctreeNode::GetDistance2ToInnerBoundary ( const double  point[3],
vtkIncrementalOctreeNode rootNode 
)

Given a point inside this node, get the minimum squared distance to all inner boundaries.

An inner boundary is a node's face that is shared by another non-root node.

◆ GetDistance2ToBoundary() [1/2]

double vtkIncrementalOctreeNode::GetDistance2ToBoundary ( const double  point[3],
vtkIncrementalOctreeNode rootNode,
int  checkData 
)

Compute the minimum squared distance from a point to this node, with all six boundaries considered.

The data bounding box is checked if checkData is non-zero.

◆ GetDistance2ToBoundary() [2/2]

double vtkIncrementalOctreeNode::GetDistance2ToBoundary ( const double  point[3],
double  closest[3],
vtkIncrementalOctreeNode rootNode,
int  checkData 
)

Compute the minimum squared distance from a point to this node, with all six boundaries considered.

The data bounding box is checked if checkData is non-zero. The closest on-boundary point is returned via closest.

◆ ExportAllPointIdsByInsertion()

void vtkIncrementalOctreeNode::ExportAllPointIdsByInsertion ( vtkIdList idList)

Export all the indices of the points (contained in or under this node) by inserting them to an allocated vtkIdList via vtkIdList::InsertNextId().

◆ ExportAllPointIdsByDirectSet()

void vtkIncrementalOctreeNode::ExportAllPointIdsByDirectSet ( vtkIdType pntIdx,
vtkIdList idList 
)

Export all the indices of the points (contained in or under this node) by directly setting them in an allocated vtkIdList object.

pntIdx indicates the starting location (in terms of vtkIdList) from which new point indices are added to vtkIdList by vtkIdList::SetId().

◆ GetNumberOfLevels()

int vtkIncrementalOctreeNode::GetNumberOfLevels ( ) const

Computes and returns the maximum level of the tree.

If a tree has one node it returns 1 else it returns the maximum level of its children plus 1.

◆ GetID()

int vtkIncrementalOctreeNode::GetID ( ) const
inline

Returns the ID of this node which is the index of the node in the octree.

The index of the node enables users of this class to associate additional information with each node.

Definition at line 243 of file vtkIncrementalOctreeNode.h.

◆ GetPointIds()

vtkIdList* vtkIncrementalOctreeNode::GetPointIds ( ) const
inline

Definition at line 244 of file vtkIncrementalOctreeNode.h.


The documentation for this class was generated from the following file: