VTK  9.3.1
vtkImplicitPolyDataDistance.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
31 #ifndef vtkImplicitPolyDataDistance_h
32 #define vtkImplicitPolyDataDistance_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkGenericCell.h" // For thread local storage
36 #include "vtkImplicitFunction.h"
37 #include "vtkSMPThreadLocalObject.h" // For thread local storage
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCellLocator;
41 class vtkPolyData;
42 
43 class VTKFILTERSCORE_EXPORT vtkImplicitPolyDataDistance : public vtkImplicitFunction
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  vtkMTimeType GetMTime() override;
54 
59  double EvaluateFunction(double x[3]) override;
60 
64  void EvaluateGradient(double x[3], double g[3]) override;
65 
70  double EvaluateFunctionAndGetClosestPoint(double x[3], double closestPoint[3]);
71 
78  void SetInput(vtkPolyData* input);
79 
81 
85  vtkSetMacro(NoValue, double);
86  vtkGetMacro(NoValue, double);
88 
90 
94  vtkSetVector3Macro(NoGradient, double);
95  vtkGetVector3Macro(NoGradient, double);
97 
99 
103  vtkSetVector3Macro(NoClosestPoint, double);
104  vtkGetVector3Macro(NoClosestPoint, double);
106 
108 
111  vtkGetMacro(Tolerance, double);
112  vtkSetMacro(Tolerance, double);
114 
115 protected:
117  ~vtkImplicitPolyDataDistance() override;
118 
122  void CreateDefaultLocator();
123 
124  double SharedEvaluate(double x[3], double g[3], double closestPoint[3]);
125 
126  double NoGradient[3];
127  double NoClosestPoint[3];
128  double NoValue;
129  double Tolerance;
130 
135 
136 private:
138  void operator=(const vtkImplicitPolyDataDistance&) = delete;
139 };
140 
141 VTK_ABI_NAMESPACE_END
142 #endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
vtkSMPThreadLocalObject< vtkGenericCell > TLCell
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
octree-based spatial search object to quickly locate cells
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkMTimeType GetMTime() override
Overload standard modified time function.
Implicit function that computes the distance from a point x to the nearest point p on an input vtkPol...
vtkSMPThreadLocalObject< vtkIdList > TLCellIds
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.