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

Incremental octree in support of both point location and point insertion. More...

#include <vtkIncrementalOctreePointLocator.h>

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

Public Types

typedef vtkIncrementalPointLocator Superclass
 
- Public Types inherited from vtkIncrementalPointLocator
typedef vtkAbstractPointLocator Superclass
 
- Public Types inherited from vtkAbstractPointLocator
typedef vtkLocator Superclass
 
- Public Types inherited from vtkLocator
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkIncrementalOctreePointLocatorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void Initialize ()
 
virtual void FreeSearchStructure ()
 
virtual void GetBounds (double *bounds)
 
int GetNumberOfPoints ()
 
virtual vtkIdType FindClosestInsertedPoint (const double x[3])
 
virtual void GenerateRepresentation (int nodeLevel, vtkPolyData *polysData)
 
virtual void BuildLocator ()
 
virtual vtkIdType FindClosestPoint (const double x[3])
 
virtual vtkIdType FindClosestPoint (double x, double y, double z)
 
virtual vtkIdType FindClosestPoint (const double x[3], double *miniDist2)
 
virtual vtkIdType FindClosestPoint (double x, double y, double z, double *miniDist2)
 
virtual int InitPointInsertion (vtkPoints *points, const double bounds[6])
 
virtual vtkIdType IsInsertedPoint (const double x[3])
 
virtual vtkIdType IsInsertedPoint (double x, double y, double z)
 
virtual int InsertUniquePoint (const double point[3], vtkIdType &pntId)
 
virtual void InsertPoint (vtkIdType ptId, const double x[3])
 
virtual vtkIdType InsertNextPoint (const double x[3])
 
virtual void SetMaxPointsPerLeaf (int)
 
virtual int GetMaxPointsPerLeaf ()
 
virtual void SetBuildCubicOctree (int)
 
virtual int GetBuildCubicOctree ()
 
virtual void BuildCubicOctreeOn ()
 
virtual void BuildCubicOctreeOff ()
 
virtual vtkPointsGetLocatorPoints ()
 
virtual doubleGetBounds ()
 
virtual vtkIdType FindClosestPointWithinRadius (double radius, const double x[3], double &dist2)
 
vtkIdType FindClosestPointWithinSquaredRadius (double radius2, const double x[3], double &dist2)
 
virtual void FindPointsWithinRadius (double R, const double x[3], vtkIdList *result)
 
void FindPointsWithinSquaredRadius (double R2, const double x[3], vtkIdList *result)
 
virtual void FindClosestNPoints (int N, const double x[3], vtkIdList *result)
 
virtual int InitPointInsertion (vtkPoints *points, const double bounds[6], vtkIdType estSize)
 
void InsertPointWithoutChecking (const double point[3], vtkIdType &pntId, int insert)
 
- Public Member Functions inherited from vtkIncrementalPointLocator
vtkIncrementalPointLocatorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
- Public Member Functions inherited from vtkAbstractPointLocator
vtkAbstractPointLocatorNewInstance () const
 
vtkIdType FindClosestPoint (double x, double y, double z)
 
void FindClosestNPoints (int N, double x, double y, double z, vtkIdList *result)
 
void FindPointsWithinRadius (double R, double x, double y, double z, vtkIdList *result)
 
- Public Member Functions inherited from vtkLocator
vtkLocatorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void Update ()
 
virtual void SetDataSet (vtkDataSet *)
 
virtual vtkDataSetGetDataSet ()
 
virtual void SetMaxLevel (int)
 
virtual int GetMaxLevel ()
 
virtual int GetLevel ()
 
virtual void SetAutomatic (int)
 
virtual int GetAutomatic ()
 
virtual void AutomaticOn ()
 
virtual void AutomaticOff ()
 
virtual void SetTolerance (double)
 
virtual double GetTolerance ()
 
virtual unsigned long GetBuildTime ()
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkIncrementalOctreePointLocatorSafeDownCast (vtkObjectBase *o)
 
static vtkIncrementalOctreePointLocatorNew ()
 
- Static Public Member Functions inherited from vtkIncrementalPointLocator
static int IsTypeOf (const char *type)
 
static vtkIncrementalPointLocatorSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkAbstractPointLocator
static int IsTypeOf (const char *type)
 
static vtkAbstractPointLocatorSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkLocator
static int IsTypeOf (const char *type)
 
static vtkLocatorSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkIncrementalOctreePointLocator ()
 
virtual ~vtkIncrementalOctreePointLocator ()
 
- Protected Member Functions inherited from vtkIncrementalPointLocator
 vtkIncrementalPointLocator ()
 
virtual ~vtkIncrementalPointLocator ()
 
- Protected Member Functions inherited from vtkAbstractPointLocator
 vtkAbstractPointLocator ()
 
virtual ~vtkAbstractPointLocator ()
 
- Protected Member Functions inherited from vtkLocator
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkLocator ()
 
 ~vtkLocator ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkAbstractPointLocator
double Bounds [6]
 
- Protected Attributes inherited from vtkLocator
vtkDataSetDataSet
 
int Automatic
 
double Tolerance
 
int MaxLevel
 
int Level
 
vtkTimeStamp BuildTime
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Incremental octree in support of both point location and point insertion.

As opposed to the uniform bin-based search structure (adopted in class vtkPointLocator) with a fixed spatial resolution, an octree mechanism employs a hierarchy of tree-like sub-division of the 3D data domain. Thus it enables data-aware multi-resolution and accordingly accelerated point location as well as insertion, particularly when handling a radically imbalanced layout of points as not uncommon in datasets defined on adaptive meshes. Compared to a static point locator supporting pure location functionalities through some search structure established from a fixed set of points, an incremental point locator allows for, in addition, point insertion capabilities, with the search structure maintaining a dynamically increasing number of points. Class vtkIncrementalOctreePointLocator is an octree-based accelerated implementation of the functionalities of the uniform bin-based incremental point locator vtkPointLocator. For point location, an octree is built by accessing a vtkDataSet, specifically a vtkPointSet. For point insertion, an empty octree is inited and then incrementally populated as points are inserted. Three increasingly complex point insertion modes, i.e., direct check-free insertion, zero tolerance insertion, and non-zero tolerance insertion, are supported. In fact, the octree used in the point location mode is actually constructed via direct check-free point insertion. This class also provides a polygonal representation of the octree boundary.

See also
vtkAbstractPointLocator, vtkIncrementalPointLocator, vtkPointLocator, vtkMergePoints
Tests:
vtkIncrementalOctreePointLocator (Tests)

Definition at line 62 of file vtkIncrementalOctreePointLocator.h.

Member Typedef Documentation

Definition at line 66 of file vtkIncrementalOctreePointLocator.h.

Constructor & Destructor Documentation

vtkIncrementalOctreePointLocator::vtkIncrementalOctreePointLocator ( )
protected
virtual vtkIncrementalOctreePointLocator::~vtkIncrementalOctreePointLocator ( )
protectedvirtual

Member Function Documentation

static int vtkIncrementalOctreePointLocator::IsTypeOf ( const char *  type)
static
virtual int vtkIncrementalOctreePointLocator::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 vtkIncrementalPointLocator.

static vtkIncrementalOctreePointLocator* vtkIncrementalOctreePointLocator::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkIncrementalOctreePointLocator::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkIncrementalPointLocator.

vtkIncrementalOctreePointLocator* vtkIncrementalOctreePointLocator::NewInstance ( ) const
void vtkIncrementalOctreePointLocator::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 vtkAbstractPointLocator.

static vtkIncrementalOctreePointLocator* vtkIncrementalOctreePointLocator::New ( )
static
virtual void vtkIncrementalOctreePointLocator::SetMaxPointsPerLeaf ( int  )
virtual

Set/Get the maximum number of points that a leaf node may maintain. Note that the actual number of points maintained by a leaf node might exceed this threshold if there is a large number (equal to or greater than the threshold) of exactly duplicate points (with zero distance) to be inserted (e.g., to construct an octree for subsequent point location) in extreme cases. Respecting this threshold in such scenarios would cause endless node sub-division. Thus this threshold is broken, but only in case of such situations.

virtual int vtkIncrementalOctreePointLocator::GetMaxPointsPerLeaf ( )
virtual

Set/Get the maximum number of points that a leaf node may maintain. Note that the actual number of points maintained by a leaf node might exceed this threshold if there is a large number (equal to or greater than the threshold) of exactly duplicate points (with zero distance) to be inserted (e.g., to construct an octree for subsequent point location) in extreme cases. Respecting this threshold in such scenarios would cause endless node sub-division. Thus this threshold is broken, but only in case of such situations.

virtual void vtkIncrementalOctreePointLocator::SetBuildCubicOctree ( int  )
virtual

Set/Get whether the search octree is built as a cubic shape or not.

virtual int vtkIncrementalOctreePointLocator::GetBuildCubicOctree ( )
virtual

Set/Get whether the search octree is built as a cubic shape or not.

virtual void vtkIncrementalOctreePointLocator::BuildCubicOctreeOn ( )
virtual

Set/Get whether the search octree is built as a cubic shape or not.

virtual void vtkIncrementalOctreePointLocator::BuildCubicOctreeOff ( )
virtual

Set/Get whether the search octree is built as a cubic shape or not.

virtual vtkPoints* vtkIncrementalOctreePointLocator::GetLocatorPoints ( )
virtual

Get access to the vtkPoints object in which point coordinates are stored for either point location or point insertion.

virtual void vtkIncrementalOctreePointLocator::Initialize ( )
inlinevirtual

Delete the octree search structure.

Implements vtkIncrementalPointLocator.

Definition at line 98 of file vtkIncrementalOctreePointLocator.h.

virtual void vtkIncrementalOctreePointLocator::FreeSearchStructure ( )
virtual

Delete the octree search structure.

Implements vtkAbstractPointLocator.

virtual void vtkIncrementalOctreePointLocator::GetBounds ( double bounds)
virtual

Get the spatial bounding box of the octree.

Reimplemented from vtkAbstractPointLocator.

virtual double* vtkIncrementalOctreePointLocator::GetBounds ( )
inlinevirtual

Get the spatial bounding box of the octree.

Reimplemented from vtkAbstractPointLocator.

Definition at line 108 of file vtkIncrementalOctreePointLocator.h.

int vtkIncrementalOctreePointLocator::GetNumberOfPoints ( )

Get the number of points maintained by the octree.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestInsertedPoint ( const double  x[3])
virtual

Given a point x assumed to be covered by the octree, return the index of the closest in-octree point regardless of the associated minimum squared distance relative to the squared insertion-tolerance distance. This method is used when performing incremental point insertion. Note -1 indicates that no point is found. InitPointInsertion() should have been called in advance.

Implements vtkIncrementalPointLocator.

virtual void vtkIncrementalOctreePointLocator::GenerateRepresentation ( int  nodeLevel,
vtkPolyData polysData 
)
virtual

Create a polygonal representation of the octree boundary (from the root node to a specified level).

Implements vtkAbstractPointLocator.

virtual void vtkIncrementalOctreePointLocator::BuildLocator ( )
virtual

Load points from a dataset to construct an octree for point location. This function resorts to InitPointInsertion() to fulfill some of the work.

Implements vtkAbstractPointLocator.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestPoint ( const double  x[3])
virtual

Given a point x, return the id of the closest point. BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

Implements vtkAbstractPointLocator.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestPoint ( double  x,
double  y,
double  z 
)
virtual

Given a point (x, y, z), return the id of the closest point. Note that BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestPoint ( const double  x[3],
double miniDist2 
)
virtual

Given a point x, return the id of the closest point and the associated minimum squared distance (via miniDist2). Note BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestPoint ( double  x,
double  y,
double  z,
double miniDist2 
)
virtual

Given a point (x, y, z), return the id of the closest point and the associated minimum squared distance (via miniDist2). BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

virtual vtkIdType vtkIncrementalOctreePointLocator::FindClosestPointWithinRadius ( double  radius,
const double  x[3],
double dist2 
)
virtual

Given a point x and a radius, return the id of the closest point within the radius and the associated minimum squared distance (via dist2, this returned distance is valid only if the point id is not -1). Note that BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

Implements vtkAbstractPointLocator.

vtkIdType vtkIncrementalOctreePointLocator::FindClosestPointWithinSquaredRadius ( double  radius2,
const double  x[3],
double dist2 
)

Given a point x and a squared radius radius2, return the id of the closest point within the radius and the associated minimum squared distance (via dist2, note this returned distance is valid only if the point id is not -1). BuildLocator() should have been called prior to this function.This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

virtual void vtkIncrementalOctreePointLocator::FindPointsWithinRadius ( double  R,
const double  x[3],
vtkIdList result 
)
virtual

Find all points within a radius R relative to a given point x. The returned point ids (stored in result) are not sorted in any way. BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

Implements vtkAbstractPointLocator.

void vtkIncrementalOctreePointLocator::FindPointsWithinSquaredRadius ( double  R2,
const double  x[3],
vtkIdList result 
)

Find all points within a squared radius R2 relative to a given point x. The returned point ids (stored in result) are not sorted in any way. BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

virtual void vtkIncrementalOctreePointLocator::FindClosestNPoints ( int  N,
const double  x[3],
vtkIdList result 
)
virtual

Find the closest N points to a given point. The returned point ids (via result) are sorted from closest to farthest. BuildLocator() should have been called prior to this function. This method is thread safe if BuildLocator() is directly or indirectly called from a single thread first.

Implements vtkAbstractPointLocator.

virtual int vtkIncrementalOctreePointLocator::InitPointInsertion ( vtkPoints points,
const double  bounds[6] 
)
virtual

Initialize the point insertion process. points is an object, storing 3D point coordinates, to which incremental point insertion put coordinates. It is created and provided by an external VTK class. Argument bounds represents the spatial bounding box, into which the points fall. In fact, an adjusted version of the bounding box is used to build the octree to make sure no any point (to be inserted) falls outside the octree. This function is not thread safe.

Implements vtkIncrementalPointLocator.

virtual int vtkIncrementalOctreePointLocator::InitPointInsertion ( vtkPoints points,
const double  bounds[6],
vtkIdType  estSize 
)
virtual

Initialize the point insertion process. points is an object, storing 3D point coordinates, to which incremental point insertion put coordinates. It is created and provided by an external VTK class. Argument bounds represents the spatial bounding box, into which the points fall. In fact, an adjusted version of the bounding box is used to build the octree to make sure no any point (to be inserted) falls outside the octree. Argument estSize specifies the initial estimated size of the vtkPoints object. This function is not thread safe.

Implements vtkIncrementalPointLocator.

virtual vtkIdType vtkIncrementalOctreePointLocator::IsInsertedPoint ( const double  x[3])
virtual

Determine whether or not a given point has been inserted into the octree. Return the id of the already inserted point if true, otherwise return -1. InitPointInsertion() should have been called in advance.

Implements vtkIncrementalPointLocator.

virtual vtkIdType vtkIncrementalOctreePointLocator::IsInsertedPoint ( double  x,
double  y,
double  z 
)
virtual

Determine whether or not a given point has been inserted into the octree. Return the id of the already inserted point if true, otherwise return -1. InitPointInsertion() should have been called in advance.

Implements vtkIncrementalPointLocator.

virtual int vtkIncrementalOctreePointLocator::InsertUniquePoint ( const double  point[3],
vtkIdType pntId 
)
virtual

Insert a point to the octree unless there has been a duplciate point. Whether the point is actually inserted (return 1) or not (return 0 upon a rejection by an existing duplicate), the index of the point (either new or the duplicate) is returned via pntId. Note that InitPointInsertion() should have been called prior to this function. vtkPoints::InsertNextPoint() is invoked. This method is not thread safe.

Implements vtkIncrementalPointLocator.

virtual void vtkIncrementalOctreePointLocator::InsertPoint ( vtkIdType  ptId,
const double  x[3] 
)
virtual

Insert a given point into the octree with a specified point index ptId. InitPointInsertion() should have been called prior to this function. In addition, IsInsertedPoint() should have been called in advance to ensure that the given point has not been inserted unless point duplication is allowed (Note that in this case, this function involves a repeated leaf container location). vtkPoints::InsertPoint() is invoked.

Implements vtkIncrementalPointLocator.

virtual vtkIdType vtkIncrementalOctreePointLocator::InsertNextPoint ( const double  x[3])
virtual

Insert a given point into the octree and return the point index. Note that InitPointInsertion() should have been called prior to this function. In addition, IsInsertedPoint() should have been called in advance to ensure that the given point has not been inserted unless point duplication is allowed (in this case, this function invovles a repeated leaf container location). vtkPoints::InsertNextPoint() is invoked.

Implements vtkIncrementalPointLocator.

void vtkIncrementalOctreePointLocator::InsertPointWithoutChecking ( const double  point[3],
vtkIdType pntId,
int  insert 
)

"Insert" a point to the octree without any checking. Argument insert means whether vtkPoints::InsertNextPoint() upon 1 is called or the point itself is not inserted to the vtkPoints at all but instead only the point index is inserted to a vtkIdList upon 0. For case 0, the point index needs to be specified via pntId. For case 1, the actual point index is returned via pntId. InitPointInsertion() should have been called.


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