VTK  9.3.0
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
40 #ifndef vtkImplicitPolyDataDistance_h
41 #define vtkImplicitPolyDataDistance_h
42 
43 #include "vtkFiltersCoreModule.h" // For export macro
44 #include "vtkGenericCell.h" // For thread local storage
45 #include "vtkImplicitFunction.h"
46 #include "vtkSMPThreadLocalObject.h" // For thread local storage
47 
48 VTK_ABI_NAMESPACE_BEGIN
49 class vtkCellLocator;
50 class vtkPolyData;
51 
52 class VTKFILTERSCORE_EXPORT vtkImplicitPolyDataDistance : public vtkImplicitFunction
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
62  vtkMTimeType GetMTime() override;
63 
68  double EvaluateFunction(double x[3]) override;
69 
73  void EvaluateGradient(double x[3], double g[3]) override;
74 
79  double EvaluateFunctionAndGetClosestPoint(double x[3], double closestPoint[3]);
80 
87  void SetInput(vtkPolyData* input);
88 
90 
94  vtkSetMacro(NoValue, double);
95  vtkGetMacro(NoValue, double);
97 
99 
103  vtkSetVector3Macro(NoGradient, double);
104  vtkGetVector3Macro(NoGradient, double);
106 
108 
112  vtkSetVector3Macro(NoClosestPoint, double);
113  vtkGetVector3Macro(NoClosestPoint, double);
115 
117 
120  vtkGetMacro(Tolerance, double);
121  vtkSetMacro(Tolerance, double);
123 
124 protected:
127 
132 
133  double SharedEvaluate(double x[3], double g[3], double closestPoint[3]);
134 
135  double NoGradient[3];
136  double NoClosestPoint[3];
137  double NoValue;
138  double Tolerance;
139 
144 
145 private:
147  void operator=(const vtkImplicitPolyDataDistance&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
octree-based spatial search object to quickly locate cells
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
Implicit function that computes the distance from a point x to the nearest point p on an input vtkPol...
vtkMTimeType GetMTime() override
Return the MTime also considering the Input dependency.
void SetInput(vtkPolyData *input)
Set the input vtkPolyData used for the implicit function evaluation.
double EvaluateFunctionAndGetClosestPoint(double x[3], double closestPoint[3])
Evaluate plane equation of nearest triangle to point x[3] and provides closest point on an input vtkP...
double SharedEvaluate(double x[3], double g[3], double closestPoint[3])
vtkSMPThreadLocalObject< vtkGenericCell > TLCell
void CreateDefaultLocator()
Create default locator.
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient of nearest triangle to point x[3].
static vtkImplicitPolyDataDistance * New()
~vtkImplicitPolyDataDistance() override
vtkSMPThreadLocalObject< vtkIdList > TLCellIds
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition: vtkIndent.h:38
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270