VTK  9.3.0
vtkLocator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
57#ifndef vtkLocator_h
58#define vtkLocator_h
59
60#include "vtkCommonDataModelModule.h" // For export macro
61#include "vtkObject.h"
62
63VTK_ABI_NAMESPACE_BEGIN
64class vtkDataSet;
65class vtkPolyData;
66
67class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
68{
69public:
71
74 vtkTypeMacro(vtkLocator, vtkObject);
75 void PrintSelf(ostream& os, vtkIndent indent) override;
77
79
82 virtual void SetDataSet(vtkDataSet*);
83 vtkGetObjectMacro(DataSet, vtkDataSet);
85
87
92 vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
93 vtkGetMacro(MaxLevel, int);
95
97
102 vtkGetMacro(Level, int);
104
106
112 vtkSetMacro(Automatic, vtkTypeBool);
113 vtkGetMacro(Automatic, vtkTypeBool);
114 vtkBooleanMacro(Automatic, vtkTypeBool);
116
118
122 vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
123 vtkGetMacro(Tolerance, double);
125
127
138 vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
139 vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
140 vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
142
147 virtual void Update();
148
152 virtual void Initialize();
153
158 virtual void BuildLocator() = 0;
159
165 virtual void ForceBuildLocator() {}
166
170 virtual void FreeSearchStructure() = 0;
171
178 virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
179
181
184 vtkGetMacro(BuildTime, vtkMTimeType);
186
188
191 bool UsesGarbageCollector() const override { return true; }
193
194protected:
196 ~vtkLocator() override;
197
201 virtual void BuildLocatorInternal(){};
202
205 vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
206 double Tolerance; // for performing merging
208 int Level;
209
210 vtkTimeStamp BuildTime; // time at which locator was built
211
213
214private:
215 vtkLocator(const vtkLocator&) = delete;
216 void operator=(const vtkLocator&) = delete;
217};
218
219VTK_ABI_NAMESPACE_END
220#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:62
Detect and break reference loops.
a simple class to control print indentation
Definition vtkIndent.h:38
abstract base class for objects that accelerate spatial searches
Definition vtkLocator.h:68
vtkTypeBool Automatic
Definition vtkLocator.h:205
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition vtkLocator.h:191
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition vtkLocator.h:201
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition vtkLocator.h:165
vtkTimeStamp BuildTime
Definition vtkLocator.h:210
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
double Tolerance
Definition vtkLocator.h:206
vtkTypeBool UseExistingSearchStructure
Definition vtkLocator.h:204
virtual void SetDataSet(vtkDataSet *)
Build the locator from the points/cells defining this dataset.
virtual void Initialize()
Initialize locator.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
void ReportReferences(vtkGarbageCollector *) override
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
virtual void BuildLocator()=0
Build the locator from the input dataset.
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
vtkDataSet * DataSet
Definition vtkLocator.h:203
abstract base class for most VTK objects
Definition vtkObject.h:58
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:89
record modification and/or execution time
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144