VTK  9.4.20241016
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
67#ifndef vtkLocator_h
68#define vtkLocator_h
69
70#include "vtkCommonDataModelModule.h" // For export macro
71#include "vtkObject.h"
72
73VTK_ABI_NAMESPACE_BEGIN
74class vtkDataSet;
75class vtkPolyData;
76
77class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
78{
79public:
81
84 vtkTypeMacro(vtkLocator, vtkObject);
85 void PrintSelf(ostream& os, vtkIndent indent) override;
87
89
92 virtual void SetDataSet(vtkDataSet*);
93 vtkGetObjectMacro(DataSet, vtkDataSet);
95
97
102 vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
103 vtkGetMacro(MaxLevel, int);
105
107
112 vtkGetMacro(Level, int);
114
116
122 vtkSetMacro(Automatic, vtkTypeBool);
123 vtkGetMacro(Automatic, vtkTypeBool);
124 vtkBooleanMacro(Automatic, vtkTypeBool);
126
128
132 vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
133 vtkGetMacro(Tolerance, double);
135
137
148 vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
149 vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
150 vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
152
157 virtual void Update();
158
162 virtual void Initialize();
163
168 virtual void BuildLocator() = 0;
169
175 virtual void ForceBuildLocator() {}
176
180 virtual void FreeSearchStructure() = 0;
181
188 virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
189
191
194 vtkGetMacro(BuildTime, vtkMTimeType);
196
198
201 bool UsesGarbageCollector() const override { return true; }
203
204protected:
206 ~vtkLocator() override;
207
211 virtual void BuildLocatorInternal() {}
212
215 vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
216 double Tolerance; // for performing merging
218 int Level;
219
220 vtkTimeStamp BuildTime; // time at which locator was built
221
223
224private:
225 vtkLocator(const vtkLocator&) = delete;
226 void operator=(const vtkLocator&) = delete;
227};
228
229VTK_ABI_NAMESPACE_END
230#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
Detect and break reference loops.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for objects that accelerate spatial searches
Definition vtkLocator.h:78
vtkTypeBool Automatic
Definition vtkLocator.h:215
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition vtkLocator.h:201
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition vtkLocator.h:211
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition vtkLocator.h:175
vtkTimeStamp BuildTime
Definition vtkLocator.h:220
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
double Tolerance
Definition vtkLocator.h:216
vtkTypeBool UseExistingSearchStructure
Definition vtkLocator.h:214
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:213
abstract base class for most VTK objects
Definition vtkObject.h:162
concrete dataset represents vertices, lines, polygons, and triangle strips
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