VTK  9.7.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
47
48#ifndef vtkLocator_h
49#define vtkLocator_h
50
51#include "vtkCommonDataModelModule.h" // For export macro
52#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
53#include "vtkObject.h"
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkDataSet;
57class vtkPolyData;
58
59class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
60{
61public:
63
66 vtkTypeMacro(vtkLocator, vtkObject);
67 void PrintSelf(ostream& os, vtkIndent indent) override;
69
71
74 virtual void SetDataSet(vtkDataSet*);
75 vtkGetObjectMacro(DataSet, vtkDataSet);
77
79
84 vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
85 vtkGetMacro(MaxLevel, int);
87
89
94 vtkGetMacro(Level, int);
96
98
104 vtkSetMacro(Automatic, vtkTypeBool);
105 vtkGetMacro(Automatic, vtkTypeBool);
106 vtkBooleanMacro(Automatic, vtkTypeBool);
108
110
114 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
115 void SetTolerance(double vtkNotUsed(tol)) {}
116 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
117 double GetToleranceMinValue() VTK_FUTURE_CONST { return 0.0; }
118 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
119 double GetToleranceMaxValue() VTK_FUTURE_CONST { return VTK_DOUBLE_MAX; }
120 VTK_DEPRECATED_IN_9_7_0("Tolerance is only used by vtkAbstractPointLocator subclasses")
121 double GetToleranceDefaultValue() VTK_FUTURE_CONST { return 0.001; }
123
125
140
145 virtual void Update();
146
150 virtual void Initialize();
151
156 virtual void BuildLocator() = 0;
157
163 virtual void ForceBuildLocator() {}
164
168 virtual void FreeSearchStructure() = 0;
169
176 virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
177
179
182 vtkGetMacro(BuildTime, vtkMTimeType);
184
186
189 bool UsesGarbageCollector() const override { return true; }
191
192protected:
194 ~vtkLocator() override;
195
199 virtual void BuildLocatorInternal() {}
200
203 vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
205 int Level;
206
207 vtkTimeStamp BuildTime; // time at which locator was built
208
210
211private:
212 vtkLocator(const vtkLocator&) = delete;
213 void operator=(const vtkLocator&) = delete;
214};
215
216VTK_ABI_NAMESPACE_END
217#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:29
vtkTypeBool Automatic
Definition vtkLocator.h:203
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition vtkLocator.h:189
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition vtkLocator.h:199
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition vtkLocator.h:163
vtkTimeStamp BuildTime
Definition vtkLocator.h:207
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
vtkTypeBool UseExistingSearchStructure
Definition vtkLocator.h:202
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:121
void SetTolerance(double tol)
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:115
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:201
double GetToleranceMinValue() VTK_FUTURE_CONST
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:117
double GetToleranceMaxValue() VTK_FUTURE_CONST
Specify absolute tolerance (in world coordinates) for performing geometric operations.
Definition vtkLocator.h:119
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
Definition vtkPolyData.h:72
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