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 =========================================================================*/
69 #ifndef vtkLocator_h
70 #define vtkLocator_h
71 
72 #include "vtkCommonDataModelModule.h" // For export macro
73 #include "vtkObject.h"
74 
75 class vtkDataSet;
76 class vtkPolyData;
77 
78 class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
79 {
80 public:
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  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
134  vtkGetMacro(Tolerance, double);
136 
138 
149  vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
150  vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
151  vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
153 
158  virtual void Update();
159 
163  virtual void Initialize();
164 
169  virtual void BuildLocator() = 0;
170 
176  virtual void ForceBuildLocator() {}
177 
181  virtual void FreeSearchStructure() = 0;
182 
189  virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
190 
192 
195  vtkGetMacro(BuildTime, vtkMTimeType);
197 
199 
202  bool UsesGarbageCollector() const override { return true; }
204 
205 protected:
207  ~vtkLocator() override;
208 
212  virtual void BuildLocatorInternal(){};
213 
216  vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
217  double Tolerance; // for performing merging
218  int MaxLevel;
219  int Level;
220 
221  vtkTimeStamp BuildTime; // time at which locator was built
222 
224 
225 private:
226  vtkLocator(const vtkLocator&) = delete;
227  void operator=(const vtkLocator&) = delete;
228 };
229 
230 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:72
Detect and break reference loops.
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:79
vtkTypeBool Automatic
Definition: vtkLocator.h:216
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition: vtkLocator.h:202
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition: vtkLocator.h:212
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition: vtkLocator.h:176
vtkTimeStamp BuildTime
Definition: vtkLocator.h:221
~vtkLocator() override
virtual void Update()
Cause the locator to rebuild itself if it or its input dataset has changed.
double Tolerance
Definition: vtkLocator.h:217
vtkTypeBool UseExistingSearchStructure
Definition: vtkLocator.h:215
virtual void SetDataSet(vtkDataSet *)
Build the locator from the points/cells defining this dataset.
virtual void Initialize()
Initialize locator.
int MaxLevel
Definition: vtkLocator.h:218
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:212
abstract base class for most VTK objects
Definition: vtkObject.h:72
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
record modification and/or execution time
Definition: vtkTimeStamp.h:45
@ 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