VTK  9.2.20230320
vtkImplicitPolyDataDistance.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitPolyDataDistance.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 =========================================================================*/
82 #ifndef vtkImplicitPolyDataDistance_h
83 #define vtkImplicitPolyDataDistance_h
84 
85 #include "vtkFiltersCoreModule.h" // For export macro
86 #include "vtkImplicitFunction.h"
87 
88 VTK_ABI_NAMESPACE_BEGIN
89 class vtkCellLocator;
90 class vtkPolyData;
91 
92 class VTKFILTERSCORE_EXPORT vtkImplicitPolyDataDistance : public vtkImplicitFunction
93 {
94 public:
97  void PrintSelf(ostream& os, vtkIndent indent) override;
98 
102  vtkMTimeType GetMTime() override;
103 
108  double EvaluateFunction(double x[3]) override;
109 
113  void EvaluateGradient(double x[3], double g[3]) override;
114 
119  double EvaluateFunctionAndGetClosestPoint(double x[3], double closestPoint[3]);
120 
127  void SetInput(vtkPolyData* input);
128 
130 
134  vtkSetMacro(NoValue, double);
135  vtkGetMacro(NoValue, double);
137 
139 
143  vtkSetVector3Macro(NoGradient, double);
144  vtkGetVector3Macro(NoGradient, double);
146 
148 
152  vtkSetVector3Macro(NoClosestPoint, double);
153  vtkGetVector3Macro(NoClosestPoint, double);
155 
157 
160  vtkGetMacro(Tolerance, double);
161  vtkSetMacro(Tolerance, double);
163 
164 protected:
167 
172 
173  double SharedEvaluate(double x[3], double g[3], double closestPoint[3]);
174 
175  double NoGradient[3];
176  double NoClosestPoint[3];
177  double NoValue;
178  double Tolerance;
179 
182 
183 private:
185  void operator=(const vtkImplicitPolyDataDistance&) = delete;
186 };
187 
188 VTK_ABI_NAMESPACE_END
189 #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])
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
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:120
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:282