VTK  9.2.20220926
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkLocator Class Referenceabstract

abstract base class for objects that accelerate spatial searches More...

#include <vtkLocator.h>

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

Public Member Functions

virtual void Update ()
 Cause the locator to rebuild itself if it or its input dataset has changed. More...
 
virtual void Initialize ()
 Initialize locator. More...
 
virtual void BuildLocator ()=0
 Build the locator from the input dataset. More...
 
virtual void ForceBuildLocator ()
 Build the locator from the input dataset (even if UseExistingSearchStructure is on). More...
 
virtual void FreeSearchStructure ()=0
 Free the memory required for the spatial data structure. More...
 
virtual void GenerateRepresentation (int level, vtkPolyData *pd)=0
 Method to build a representation at a particular level. More...
 
virtual void SetDataSet (vtkDataSet *)
 Build the locator from the points/cells defining this dataset. More...
 
virtual vtkDataSetGetDataSet ()
 Build the locator from the points/cells defining this dataset. More...
 
virtual void SetMaxLevel (int)
 Set the maximum allowable level for the tree. More...
 
virtual int GetMaxLevel ()
 Set the maximum allowable level for the tree. More...
 
virtual int GetLevel ()
 Get the level of the locator (determined automatically if Automatic is true). More...
 
virtual void SetAutomatic (vtkTypeBool)
 Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. More...
 
virtual vtkTypeBool GetAutomatic ()
 Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. More...
 
virtual void AutomaticOn ()
 Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. More...
 
virtual void AutomaticOff ()
 Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket. More...
 
virtual void SetTolerance (double)
 Specify absolute tolerance (in world coordinates) for performing geometric operations. More...
 
virtual double GetTolerance ()
 Specify absolute tolerance (in world coordinates) for performing geometric operations. More...
 
virtual void SetUseExistingSearchStructure (vtkTypeBool)
 Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. More...
 
virtual vtkTypeBool GetUseExistingSearchStructure ()
 Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. More...
 
virtual void UseExistingSearchStructureOn ()
 Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. More...
 
virtual void UseExistingSearchStructureOff ()
 Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again. More...
 
virtual vtkMTimeType GetBuildTime ()
 Return the time of the last data structure build. More...
 
bool UsesGarbageCollector () const override
 Handle the PointSet <-> Locator loop. 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)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output. More...
 
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...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. 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...
 

Protected Member Functions

 vtkLocator ()
 
 ~vtkLocator () override
 
virtual void BuildLocatorInternal ()
 This function is not pure virtual to maintain backwards compatibility. More...
 
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. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkDataSetDataSet
 
vtkTypeBool UseExistingSearchStructure
 
vtkTypeBool Automatic
 
double Tolerance
 
int MaxLevel
 
int Level
 
vtkTimeStamp BuildTime
 
- 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 and print methods. More...
 
static vtkTypeBool IsTypeOf (const char *type)
 Standard type and print methods. More...
 
static vtkLocatorSafeDownCast (vtkObjectBase *o)
 Standard type and print methods. More...
 
virtual vtkTypeBool IsA (const char *type)
 Standard type and print methods. More...
 
vtkLocatorNewInstance () const
 Standard type and print methods. More...
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Standard type and print methods. More...
 
virtual vtkObjectBaseNewInstanceInternal () const
 Standard type and print methods. More...
 

Additional Inherited Members

- 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...
 
- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

abstract base class for objects that accelerate spatial searches

vtkLocator is an abstract base class for spatial search objects, or locators. The principle behind locators is that they divide 3-space into small regions (or "buckets") that can be quickly found in response to queries about point location, line intersection, or object-object intersection.

The purpose of this base class is to provide data members and methods shared by all locators. The GenerateRepresentation() is one such interesting method. This method works in conjunction with vtkLocatorFilter to create polygonal representations for the locator. For example, if the locator is an OBB tree (i.e., vtkOBBTree.h), then the representation is a set of one or more oriented bounding boxes, depending upon the specified level.

Locators typically work as follows. One or more "entities", such as points or cells, are inserted into the locator structure. These entities are associated with one or more buckets. Then, when performing geometric operations, the operations are performed first on the buckets, and then if the operation tests positive, then on the entities in the bucket. For example, during collision tests, the locators are collided first to identify intersecting buckets. If an intersection is found, more expensive operations are then carried out on the entities in the bucket.

To obtain good performance, locators are often organized in a tree structure. In such a structure, there are frequently multiple "levels" corresponding to different nodes in the tree. So the word level (in the context of the locator) can be used to specify a particular representation in the tree. For example, in an octree (which is a tree with 8 children), level 0 is the bounding box, or root octant, and level 1 consists of its eight children.

Warning
There is a concept of static and incremental locators. Static locators are constructed one time, and then support appropriate queries. Incremental locators may have data inserted into them over time (e.g., adding new points during the process of isocontouring).
See also
vtkPointLocator vtkCellLocator vtkOBBTree vtkMergePoints
Online Examples:

Definition at line 89 of file vtkLocator.h.

Member Typedef Documentation

◆ Superclass

Standard type and print methods.

Definition at line 96 of file vtkLocator.h.

Constructor & Destructor Documentation

◆ vtkLocator()

vtkLocator::vtkLocator ( )
protected

◆ ~vtkLocator()

vtkLocator::~vtkLocator ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

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

Standard type and print methods.

◆ IsA()

virtual vtkTypeBool vtkLocator::IsA ( const char *  type)
virtual

◆ SafeDownCast()

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

Standard type and print methods.

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkLocator::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkLocator* vtkLocator::NewInstance ( ) const

Standard type and print methods.

◆ PrintSelf()

void vtkLocator::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

◆ SetDataSet()

virtual void vtkLocator::SetDataSet ( vtkDataSet )
virtual

Build the locator from the points/cells defining this dataset.

Reimplemented in vtkKdTree.

◆ GetDataSet()

virtual vtkDataSet* vtkLocator::GetDataSet ( )
virtual

Build the locator from the points/cells defining this dataset.

Reimplemented in vtkKdTree.

◆ SetMaxLevel()

virtual void vtkLocator::SetMaxLevel ( int  )
virtual

Set the maximum allowable level for the tree.

If the Automatic ivar is off, this will be the target depth of the locator. Initial value is 8.

◆ GetMaxLevel()

virtual int vtkLocator::GetMaxLevel ( )
virtual

Set the maximum allowable level for the tree.

If the Automatic ivar is off, this will be the target depth of the locator. Initial value is 8.

◆ GetLevel()

virtual int vtkLocator::GetLevel ( )
virtual

Get the level of the locator (determined automatically if Automatic is true).

The value of this ivar may change each time the locator is built. Initial value is 8.

◆ SetAutomatic()

virtual void vtkLocator::SetAutomatic ( vtkTypeBool  )
virtual

Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket.

If not set, there will be an explicit method to control the construction of the locator (found in the subclass).

◆ GetAutomatic()

virtual vtkTypeBool vtkLocator::GetAutomatic ( )
virtual

Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket.

If not set, there will be an explicit method to control the construction of the locator (found in the subclass).

◆ AutomaticOn()

virtual void vtkLocator::AutomaticOn ( )
virtual

Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket.

If not set, there will be an explicit method to control the construction of the locator (found in the subclass).

◆ AutomaticOff()

virtual void vtkLocator::AutomaticOff ( )
virtual

Boolean controls whether locator depth/resolution of locator is computed automatically from average number of entities in bucket.

If not set, there will be an explicit method to control the construction of the locator (found in the subclass).

◆ SetTolerance()

virtual void vtkLocator::SetTolerance ( double  )
virtual

Specify absolute tolerance (in world coordinates) for performing geometric operations.

◆ GetTolerance()

virtual double vtkLocator::GetTolerance ( )
virtual

Specify absolute tolerance (in world coordinates) for performing geometric operations.

◆ SetUseExistingSearchStructure()

virtual void vtkLocator::SetUseExistingSearchStructure ( vtkTypeBool  )
virtual

Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again.

This is useful when you have a dataset that either changes because the FieldData (PointData/CellData) changed or the actual dataset object changed but it's actually the same geometry (useful when a dataset has timesteps).

When this flag is on you need to use ForceBuildLocator() to rebuild the locator, if your dataset changes.

Default is off.

◆ GetUseExistingSearchStructure()

virtual vtkTypeBool vtkLocator::GetUseExistingSearchStructure ( )
virtual

Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again.

This is useful when you have a dataset that either changes because the FieldData (PointData/CellData) changed or the actual dataset object changed but it's actually the same geometry (useful when a dataset has timesteps).

When this flag is on you need to use ForceBuildLocator() to rebuild the locator, if your dataset changes.

Default is off.

◆ UseExistingSearchStructureOn()

virtual void vtkLocator::UseExistingSearchStructureOn ( )
virtual

Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again.

This is useful when you have a dataset that either changes because the FieldData (PointData/CellData) changed or the actual dataset object changed but it's actually the same geometry (useful when a dataset has timesteps).

When this flag is on you need to use ForceBuildLocator() to rebuild the locator, if your dataset changes.

Default is off.

◆ UseExistingSearchStructureOff()

virtual void vtkLocator::UseExistingSearchStructureOff ( )
virtual

Get/Set UseExistingSearchStructure, which when enabled it allows the locator to NOT be built again.

This is useful when you have a dataset that either changes because the FieldData (PointData/CellData) changed or the actual dataset object changed but it's actually the same geometry (useful when a dataset has timesteps).

When this flag is on you need to use ForceBuildLocator() to rebuild the locator, if your dataset changes.

Default is off.

◆ Update()

virtual void vtkLocator::Update ( )
virtual

Cause the locator to rebuild itself if it or its input dataset has changed.

◆ Initialize()

virtual void vtkLocator::Initialize ( )
virtual

Initialize locator.

Frees memory and resets object as appropriate.

Reimplemented in vtkStaticPointLocator2D, vtkStaticPointLocator, vtkPointLocator, and vtkIncrementalOctreePointLocator.

◆ BuildLocator()

virtual void vtkLocator::BuildLocator ( )
pure virtual

◆ ForceBuildLocator()

virtual void vtkLocator::ForceBuildLocator ( )
inlinevirtual

Build the locator from the input dataset (even if UseExistingSearchStructure is on).

This function is not pure virtual to maintain backwards compatibility.

Reimplemented in vtkOBBTree, vtkModifiedBSPTree, vtkLinearTransformCellLocator, vtkStaticPointLocator2D, vtkStaticPointLocator, vtkStaticCellLocator, vtkPointLocator, vtkOctreePointLocator, vtkKdTreePointLocator, vtkKdTree, vtkIncrementalOctreePointLocator, vtkCellTreeLocator, and vtkCellLocator.

Definition at line 187 of file vtkLocator.h.

◆ FreeSearchStructure()

virtual void vtkLocator::FreeSearchStructure ( )
pure virtual

◆ GenerateRepresentation()

virtual void vtkLocator::GenerateRepresentation ( int  level,
vtkPolyData pd 
)
pure virtual

Method to build a representation at a particular level.

Note that the method GetLevel() returns the maximum number of levels available for the tree. You must provide a vtkPolyData object into which to place the data.

Implemented in vtkIncrementalOctreePointLocator, vtkOBBTree, vtkModifiedBSPTree, vtkLinearTransformCellLocator, vtkStaticPointLocator2D, vtkStaticPointLocator, vtkStaticCellLocator, vtkPointLocator, vtkOctreePointLocator, vtkKdTreePointLocator, vtkKdTree, vtkCellTreeLocator, and vtkCellLocator.

◆ GetBuildTime()

virtual vtkMTimeType vtkLocator::GetBuildTime ( )
virtual

Return the time of the last data structure build.

◆ UsesGarbageCollector()

bool vtkLocator::UsesGarbageCollector ( ) const
inlineoverridevirtual

Handle the PointSet <-> Locator loop.

Reimplemented from vtkObjectBase.

Definition at line 213 of file vtkLocator.h.

◆ BuildLocatorInternal()

virtual void vtkLocator::BuildLocatorInternal ( )
inlineprotectedvirtual

◆ ReportReferences()

void vtkLocator::ReportReferences ( vtkGarbageCollector )
overrideprotectedvirtual

Reimplemented from vtkObjectBase.

Member Data Documentation

◆ DataSet

vtkDataSet* vtkLocator::DataSet
protected

Definition at line 225 of file vtkLocator.h.

◆ UseExistingSearchStructure

vtkTypeBool vtkLocator::UseExistingSearchStructure
protected

Definition at line 226 of file vtkLocator.h.

◆ Automatic

vtkTypeBool vtkLocator::Automatic
protected

Definition at line 227 of file vtkLocator.h.

◆ Tolerance

double vtkLocator::Tolerance
protected

Definition at line 228 of file vtkLocator.h.

◆ MaxLevel

int vtkLocator::MaxLevel
protected

Definition at line 229 of file vtkLocator.h.

◆ Level

int vtkLocator::Level
protected

Definition at line 230 of file vtkLocator.h.

◆ BuildTime

vtkTimeStamp vtkLocator::BuildTime
protected

Definition at line 232 of file vtkLocator.h.


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