VTK  9.5.20250927
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
70#ifndef vtkImplicitPolyDataDistance_h
71#define vtkImplicitPolyDataDistance_h
72
73#include "vtkFiltersCoreModule.h" // For export macro
74#include "vtkGenericCell.h" // For thread local storage
75#include "vtkImplicitFunction.h"
76#include "vtkSMPThreadLocalObject.h" // For thread local storage
77#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
78
79VTK_ABI_NAMESPACE_BEGIN
80class vtkCellLocator;
81class vtkPolyData;
82
84{
85public:
88 void PrintSelf(ostream& os, vtkIndent indent) override;
89
94
99 double EvaluateFunction(double x[3]) override;
100
104 void EvaluateGradient(double x[3], double g[3]) override;
105
110 double EvaluateFunctionAndGetClosestPoint(double x[3], double closestPoint[3]);
111
118 void SetInput(vtkPolyData* input);
119
121
125 vtkSetMacro(NoValue, double);
126 vtkGetMacro(NoValue, double);
128
130
134 vtkSetVector3Macro(NoGradient, double);
135 vtkGetVector3Macro(NoGradient, double);
137
139
143 vtkSetVector3Macro(NoClosestPoint, double);
144 vtkGetVector3Macro(NoClosestPoint, double);
146
148
151 vtkGetMacro(Tolerance, double);
152 vtkSetMacro(Tolerance, double);
154
155protected:
158
163
164 double SharedEvaluate(double x[3], double g[3], double closestPoint[3]);
165
166 double NoGradient[3];
167 double NoClosestPoint[3];
168 double NoValue;
169 double Tolerance;
170
175
176private:
178 void operator=(const vtkImplicitPolyDataDistance&) = delete;
179};
180
181VTK_ABI_NAMESPACE_END
182#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].
~vtkImplicitPolyDataDistance() override
static vtkImplicitPolyDataDistance * New()
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:108
concrete dataset represents vertices, lines, polygons, and triangle strips
Thread local storage for VTK objects.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:289
#define VTK_MARSHALAUTO