VTK  9.6.20260527
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
66
67#ifndef vtkLocator_h
68#define vtkLocator_h
69
70#include "vtkCommonDataModelModule.h" // For export macro
71#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
72#include "vtkObject.h"
73
74VTK_ABI_NAMESPACE_BEGIN
75class vtkDataSet;
76class vtkPolyData;
77
78class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
79{
80public:
82
85 vtkTypeMacro(vtkLocator, vtkObject);
86 void PrintSelf(ostream& os, vtkIndent indent) override;
88
90
93 virtual void SetDataSet(vtkDataSet*);
94 vtkGetObjectMacro(DataSet, vtkDataSet);
96
98
103 vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
104 vtkGetMacro(MaxLevel, int);
106
108
113 vtkGetMacro(Level, int);
115
117
123 vtkSetMacro(Automatic, vtkTypeBool);
124 vtkGetMacro(Automatic, vtkTypeBool);
125 vtkBooleanMacro(Automatic, vtkTypeBool);
127
129
133 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
134 void SetTolerance(double vtkNotUsed(tol)) {}
135 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
136 double GetToleranceMinValue() VTK_FUTURE_CONST { return 0.0; }
137 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
138 double GetToleranceMaxValue() VTK_FUTURE_CONST { return VTK_DOUBLE_MAX; }
139 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
140 double GetToleranceDefaultValue() VTK_FUTURE_CONST { return 0.001; }
142
144
159
164 virtual void Update();
165
169 virtual void Initialize();
170
175 virtual void BuildLocator() = 0;
176
182 virtual void ForceBuildLocator() {}
183
187 virtual void FreeSearchStructure() = 0;
188
195 virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
196
198
201 vtkGetMacro(BuildTime, vtkMTimeType);
203
205
208 bool UsesGarbageCollector() const override { return true; }
210
211protected:
213 ~vtkLocator() override;
214
218 virtual void BuildLocatorInternal() {}
219
222 vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
224 int Level;
225
226 vtkTimeStamp BuildTime; // time at which locator was built
227
229
230private:
231 vtkLocator(const vtkLocator&) = delete;
232 void operator=(const vtkLocator&) = delete;
233};
234
235VTK_ABI_NAMESPACE_END
236#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
a simple class to control print indentation
Definition vtkIndent.h:108
vtkTypeBool Automatic
Definition vtkLocator.h:222
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition vtkLocator.h:208
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition vtkLocator.h:218
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition vtkLocator.h:182
vtkTimeStamp BuildTime
Definition vtkLocator.h:226
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
vtkTypeBool UseExistingSearchStructure
Definition vtkLocator.h:221
virtual void SetDataSet(vtkDataSet *)
Build the locator from the points/cells defining this dataset.
virtual void Initialize()
Initialize locator.
double GetToleranceDefaultValue() VTK_FUTURE_CONST
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:140
void SetTolerance(double tol)
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:134
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:220
double GetToleranceMinValue() VTK_FUTURE_CONST
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:136
double GetToleranceMaxValue() VTK_FUTURE_CONST
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:138
friend class vtkGarbageCollector
Some classes need to clear the reference counts manually due to the way they work.
concrete dataset represents vertices, lines, polygons, and triangle strips
record modification and/or execution time
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_7_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_DOUBLE_MAX
Definition vtkType.h:202
#define VTK_INT_MAX
Definition vtkType.h:192