VTK  9.2.6
vtkLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLocator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
79 #ifndef vtkLocator_h
80 #define vtkLocator_h
81 
82 #include "vtkCommonDataModelModule.h" // For export macro
83 #include "vtkObject.h"
84 
85 class vtkDataSet;
86 class vtkPolyData;
87 
88 class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
89 {
90 public:
92 
95  vtkTypeMacro(vtkLocator, vtkObject);
96  void PrintSelf(ostream& os, vtkIndent indent) override;
98 
100 
103  virtual void SetDataSet(vtkDataSet*);
104  vtkGetObjectMacro(DataSet, vtkDataSet);
106 
108 
113  vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
114  vtkGetMacro(MaxLevel, int);
116 
118 
123  vtkGetMacro(Level, int);
125 
127 
133  vtkSetMacro(Automatic, vtkTypeBool);
134  vtkGetMacro(Automatic, vtkTypeBool);
135  vtkBooleanMacro(Automatic, vtkTypeBool);
137 
139 
143  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
144  vtkGetMacro(Tolerance, double);
146 
148 
159  vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
160  vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
161  vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
163 
168  virtual void Update();
169 
173  virtual void Initialize();
174 
179  virtual void BuildLocator() = 0;
180 
186  virtual void ForceBuildLocator() {}
187 
191  virtual void FreeSearchStructure() = 0;
192 
199  virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
200 
202 
205  vtkGetMacro(BuildTime, vtkMTimeType);
207 
209 
212  bool UsesGarbageCollector() const override { return true; }
214 
215 protected:
217  ~vtkLocator() override;
218 
222  virtual void BuildLocatorInternal(){};
223 
226  vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
227  double Tolerance; // for performing merging
228  int MaxLevel;
229  int Level;
230 
231  vtkTimeStamp BuildTime; // time at which locator was built
232 
234 
235 private:
236  vtkLocator(const vtkLocator&) = delete;
237  void operator=(const vtkLocator&) = delete;
238 };
239 
240 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
Detect and break reference loops.
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:89
vtkTypeBool Automatic
Definition: vtkLocator.h:226
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition: vtkLocator.h:212
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition: vtkLocator.h:222
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition: vtkLocator.h:186
vtkTimeStamp BuildTime
Definition: vtkLocator.h:231
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
double Tolerance
Definition: vtkLocator.h:227
vtkTypeBool UseExistingSearchStructure
Definition: vtkLocator.h:225
virtual void SetDataSet(vtkDataSet *)
Build the locator from the points/cells defining this dataset.
virtual void Initialize()
Initialize locator.
int MaxLevel
Definition: vtkLocator.h:228
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:222
abstract base class for most VTK objects
Definition: vtkObject.h:82
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
record modification and/or execution time
Definition: vtkTimeStamp.h:55
@ level
Definition: vtkX3D.h:401
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray
Definition: VTXTypes.h:39
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155