VTK
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkStaticPointLocator Class Reference

quickly locate points in 3-space More...

#include <vtkStaticPointLocator.h>

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

Public Member Functions

virtual vtkIdType FindClosestPoint (const double x[3])
 
virtual void FindClosestNPoints (int N, const double x[3], vtkIdList *result)
 
virtual void SetNumberOfPointsPerBucket (int)
 
virtual int GetNumberOfPointsPerBucket ()
 
virtual void SetDivisions (int, int, int)
 
virtual void SetDivisions (int[3])
 
virtual intGetDivisions ()
 
virtual void GetDivisions (int data[3])
 
virtual vtkIdType FindClosestPointWithinRadius (double radius, const double x[3], double &dist2)
 
virtual vtkIdType FindClosestPointWithinRadius (double radius, const double x[3], double inputDataLength, double &dist2)
 
virtual void FindPointsWithinRadius (double R, const double x[3], vtkIdList *result)
 
virtual void Initialize ()
 
virtual void FreeSearchStructure ()
 
virtual void BuildLocator ()
 
virtual void GenerateRepresentation (int level, vtkPolyData *pd)
 
- Public Member Functions inherited from vtkAbstractPointLocator
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)
 
virtual doubleGetBounds ()
 
virtual void GetBounds (double *)
 
virtual vtkIdType GetNumberOfBuckets ()
 
vtkAbstractPointLocatorNewInstance () const
 
- Public Member Functions inherited from vtkLocator
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)
 
vtkLocatorNewInstance () const
 
- 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 vtkStaticPointLocatorNew ()
 
- 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

 vtkStaticPointLocator ()
 
virtual ~vtkStaticPointLocator ()
 
- Protected Member Functions inherited from vtkAbstractPointLocator
 vtkAbstractPointLocator ()
 
virtual ~vtkAbstractPointLocator ()
 
- Protected Member Functions inherited from vtkLocator
 vtkLocator ()
 
 ~vtkLocator ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
- 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 &)
 

Protected Attributes

int NumberOfPointsPerBucket
 
int Divisions [3]
 
double H [3]
 
vtkBucketListBuckets
 
int LargeIds
 
- Protected Attributes inherited from vtkAbstractPointLocator
double Bounds [6]
 
vtkIdType NumberOfBuckets
 
- 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
 

Friends

class vtkBucketList
 
typedef vtkAbstractPointLocator Superclass
 
static int IsTypeOf (const char *type)
 
static vtkStaticPointLocatorSafeDownCast (vtkObjectBase *o)
 
virtual int IsA (const char *type)
 
vtkStaticPointLocatorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkObjectBaseNewInstanceInternal () const
 

Additional Inherited Members

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

Detailed Description

quickly locate points in 3-space

vtkStaticPointLocator is a spatial search object to quickly locate points in 3D. vtkStaticPointLocator works by dividing a specified region of space into a regular array of cuboid buckets, and then keeping a list of points that lie in each bucket. Typical operation involves giving a position in 3D and finding the closest point; or finding the N closest points.

vtkStaticPointLocator is an accelerated version of vtkPointLocator. It is threaded (via vtkSMPTools), and supports one-time static construction (i.e., incremental point insertion is not supported). If you need to incrementally insert points, use the vtkPointLocator or its kin to do so.

Warning
This class is templated. It may run slower than serial execution if the code is not optimized during compilation. Build in Release or ReleaseWithDebugInfo.
Make sure that you review the documentation for the superclasses vtkAbstactPointLocator and vtkLocator. In particular the Automatic data member can be used to automatically determine divisions based on the average number of points per bucket.
Other types of spatial locators have been developed such as octrees and kd-trees. These are often more efficient for the operations described here.
See also
vtkPointLocator vtkCellLocator vtkLocator vtkAbstractPointLocator
Tests:
vtkStaticPointLocator (Tests)

Definition at line 62 of file vtkStaticPointLocator.h.

Member Typedef Documentation

Standard type and print methods.

Definition at line 72 of file vtkStaticPointLocator.h.

Constructor & Destructor Documentation

vtkStaticPointLocator::vtkStaticPointLocator ( )
protected
virtual vtkStaticPointLocator::~vtkStaticPointLocator ( )
protectedvirtual

Member Function Documentation

static vtkStaticPointLocator* vtkStaticPointLocator::New ( )
static

Construct with automatic computation of divisions, averaging 5 points per bucket.

static int vtkStaticPointLocator::IsTypeOf ( const char *  type)
static

Standard type and print methods.

virtual int vtkStaticPointLocator::IsA ( const char *  type)
virtual

Standard type and print methods.

Reimplemented from vtkAbstractPointLocator.

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

Standard type and print methods.

virtual vtkObjectBase* vtkStaticPointLocator::NewInstanceInternal ( ) const
protectedvirtual

Standard type and print methods.

Reimplemented from vtkAbstractPointLocator.

vtkStaticPointLocator* vtkStaticPointLocator::NewInstance ( ) const

Standard type and print methods.

void vtkStaticPointLocator::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Standard type and print methods.

Reimplemented from vtkAbstractPointLocator.

virtual void vtkStaticPointLocator::SetNumberOfPointsPerBucket ( int  )
virtual

Specify the average number of points in each bucket. This data member is used in conjunction with the Automatic data member (if enabled) to determine the number of locator x-y-z divisions.

virtual int vtkStaticPointLocator::GetNumberOfPointsPerBucket ( )
virtual

Specify the average number of points in each bucket. This data member is used in conjunction with the Automatic data member (if enabled) to determine the number of locator x-y-z divisions.

virtual void vtkStaticPointLocator::SetDivisions ( int  ,
int  ,
int   
)
virtual

Set the number of divisions in x-y-z directions. If the Automatic data member is enabled, the Divisions are set according to the NumberOfPointsPerBucket data member.

virtual void vtkStaticPointLocator::SetDivisions ( int  [3])
virtual

Set the number of divisions in x-y-z directions. If the Automatic data member is enabled, the Divisions are set according to the NumberOfPointsPerBucket data member.

virtual int* vtkStaticPointLocator::GetDivisions ( )
virtual

Set the number of divisions in x-y-z directions. If the Automatic data member is enabled, the Divisions are set according to the NumberOfPointsPerBucket data member.

virtual void vtkStaticPointLocator::GetDivisions ( int  data[3])
virtual

Set the number of divisions in x-y-z directions. If the Automatic data member is enabled, the Divisions are set according to the NumberOfPointsPerBucket data member.

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

Given a position x, return the id of the point closest to it. An alternative method (defined in the superclass) requires separate x-y-z values. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first.

Implements vtkAbstractPointLocator.

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

Given a position x and a radius r, return the id of the point closest to the point in that radius. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first. dist2 returns the squared distance to the point. Note that if multiple points are located the same distance away, the actual point returned is a function in which order the points are processed (i.e., indeterminate).

Implements vtkAbstractPointLocator.

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

Given a position x and a radius r, return the id of the point closest to the point in that radius. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first. dist2 returns the squared distance to the point. Note that if multiple points are located the same distance away, the actual point returned is a function in which order the points are processed (i.e., indeterminate).

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

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.

Implements vtkAbstractPointLocator.

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

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.

Implements vtkAbstractPointLocator.

virtual void vtkStaticPointLocator::Initialize ( )
virtual

See vtkLocator and vtkAbstractPointLocator interface documentation. These methods are not thread safe.

Reimplemented from vtkLocator.

virtual void vtkStaticPointLocator::FreeSearchStructure ( )
virtual

See vtkLocator and vtkAbstractPointLocator interface documentation. These methods are not thread safe.

Implements vtkAbstractPointLocator.

virtual void vtkStaticPointLocator::BuildLocator ( )
virtual

See vtkLocator and vtkAbstractPointLocator interface documentation. These methods are not thread safe.

Implements vtkAbstractPointLocator.

virtual void vtkStaticPointLocator::GenerateRepresentation ( int  level,
vtkPolyData pd 
)
virtual

See vtkLocator and vtkAbstractPointLocator interface documentation. These methods are not thread safe.

Implements vtkAbstractPointLocator.

Friends And Related Function Documentation

friend class vtkBucketList
friend

Definition at line 64 of file vtkStaticPointLocator.h.

Member Data Documentation

int vtkStaticPointLocator::NumberOfPointsPerBucket
protected

Definition at line 149 of file vtkStaticPointLocator.h.

int vtkStaticPointLocator::Divisions[3]
protected

Definition at line 150 of file vtkStaticPointLocator.h.

double vtkStaticPointLocator::H[3]
protected

Definition at line 151 of file vtkStaticPointLocator.h.

vtkBucketList* vtkStaticPointLocator::Buckets
protected

Definition at line 152 of file vtkStaticPointLocator.h.

int vtkStaticPointLocator::LargeIds
protected

Definition at line 153 of file vtkStaticPointLocator.h.


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