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
48#ifndef vtkLocator_h
49#define vtkLocator_h
50
51#include "vtkCommonDataModelModule.h" // For export macro
52#include "vtkObject.h"
53
54VTK_ABI_NAMESPACE_BEGIN
55class vtkDataSet;
56class vtkPolyData;
57
58class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
59{
60public:
62
65 vtkTypeMacro(vtkLocator, vtkObject);
66 void PrintSelf(ostream& os, vtkIndent indent) override;
68
70
73 virtual void SetDataSet(vtkDataSet*);
74 vtkGetObjectMacro(DataSet, vtkDataSet);
76
78
83 vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
84 vtkGetMacro(MaxLevel, int);
86
88
93 vtkGetMacro(Level, int);
95
97
103 vtkSetMacro(Automatic, vtkTypeBool);
104 vtkGetMacro(Automatic, vtkTypeBool);
105 vtkBooleanMacro(Automatic, vtkTypeBool);
107
109
113 vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
114 vtkGetMacro(Tolerance, double);
116
118
129 vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
130 vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
131 vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
133
138 virtual void Update();
139
143 virtual void Initialize();
144
149 virtual void BuildLocator() = 0;
150
156 virtual void ForceBuildLocator() {}
157
161 virtual void FreeSearchStructure() = 0;
162
169 virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
170
172
175 vtkGetMacro(BuildTime, vtkMTimeType);
177
179
182 bool UsesGarbageCollector() const override { return true; }
184
185protected:
187 ~vtkLocator() override;
188
192 virtual void BuildLocatorInternal(){};
193
196 vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
197 double Tolerance; // for performing merging
199 int Level;
200
201 vtkTimeStamp BuildTime; // time at which locator was built
202
204
205private:
206 vtkLocator(const vtkLocator&) = delete;
207 void operator=(const vtkLocator&) = delete;
208};
209
210VTK_ABI_NAMESPACE_END
211#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
Detect and break reference loops.
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for objects that accelerate spatial searches
Definition vtkLocator.h:59
vtkTypeBool Automatic
Definition vtkLocator.h:196
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition vtkLocator.h:182
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition vtkLocator.h:192
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition vtkLocator.h:156
vtkTimeStamp BuildTime
Definition vtkLocator.h:201
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
double Tolerance
Definition vtkLocator.h:197
vtkTypeBool UseExistingSearchStructure
Definition vtkLocator.h:195
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:194
abstract base class for most VTK objects
Definition vtkObject.h:49
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
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