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 =========================================================================*/
60 #ifndef vtkLocator_h
61 #define vtkLocator_h
62 
63 #include "vtkCommonDataModelModule.h" // For export macro
64 #include "vtkObject.h"
65 
66 class vtkDataSet;
67 class vtkPolyData;
68 
69 class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject
70 {
71 public:
73 
76  vtkTypeMacro(vtkLocator, vtkObject);
77  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
81 
84  virtual void SetDataSet(vtkDataSet*);
85  vtkGetObjectMacro(DataSet, vtkDataSet);
87 
89 
94  vtkSetClampMacro(MaxLevel, int, 0, VTK_INT_MAX);
95  vtkGetMacro(MaxLevel, int);
97 
99 
104  vtkGetMacro(Level, int);
106 
108 
114  vtkSetMacro(Automatic, vtkTypeBool);
115  vtkGetMacro(Automatic, vtkTypeBool);
116  vtkBooleanMacro(Automatic, vtkTypeBool);
118 
120 
124  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
125  vtkGetMacro(Tolerance, double);
127 
129 
140  vtkSetMacro(UseExistingSearchStructure, vtkTypeBool);
141  vtkGetMacro(UseExistingSearchStructure, vtkTypeBool);
142  vtkBooleanMacro(UseExistingSearchStructure, vtkTypeBool);
144 
149  virtual void Update();
150 
154  virtual void Initialize();
155 
160  virtual void BuildLocator() = 0;
161 
167  virtual void ForceBuildLocator() {}
168 
172  virtual void FreeSearchStructure() = 0;
173 
180  virtual void GenerateRepresentation(int level, vtkPolyData* pd) = 0;
181 
183 
186  vtkGetMacro(BuildTime, vtkMTimeType);
188 
190 
193  bool UsesGarbageCollector() const override { return true; }
195 
196 protected:
197  vtkLocator();
198  ~vtkLocator() override;
199 
203  virtual void BuildLocatorInternal(){};
204 
207  vtkTypeBool Automatic; // boolean controls automatic subdivision (or uses user spec.)
208  double Tolerance; // for performing merging
209  int MaxLevel;
210  int Level;
211 
212  vtkTimeStamp BuildTime; // time at which locator was built
213 
214  void ReportReferences(vtkGarbageCollector*) override;
215 
216 private:
217  vtkLocator(const vtkLocator&) = delete;
218  void operator=(const vtkLocator&) = delete;
219 };
220 
221 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
#define VTK_INT_MAX
Definition: vtkType.h:155
record modification and/or execution time
Definition: vtkTimeStamp.h:35
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:69
vtkTimeStamp BuildTime
Definition: vtkLocator.h:212
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
Detect and break reference loops.
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ReportReferences(vtkGarbageCollector *)
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray
Definition: VTXTypes.h:39
vtkTypeBool Automatic
Definition: vtkLocator.h:207
bool UsesGarbageCollector() const override
Handle the PointSet <-> Locator loop.
Definition: vtkLocator.h:193
int MaxLevel
Definition: vtkLocator.h:209
vtkTypeBool UseExistingSearchStructure
Definition: vtkLocator.h:206
double Tolerance
Definition: vtkLocator.h:208
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition: vtkLocator.h:167