VTK  9.3.20240424
vtkImplicitProjectOnPlaneDistance.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
22#ifndef vtkImplicitProjectOnPlaneDistance_h
23#define vtkImplicitProjectOnPlaneDistance_h
24
25#include "vtkImplicitFunction.h"
26
27#include "vtkAbstractCellLocator.h" // User defined cellLocator
28#include "vtkFiltersCoreModule.h" // For export macro
29#include "vtkSmartPointer.h" // It has vtkSmartPointer fields
30
31VTK_ABI_NAMESPACE_BEGIN
32class vtkGenericCell;
33class vtkPolyData;
34class vtkPlane;
35
36class VTKFILTERSCORE_EXPORT vtkImplicitProjectOnPlaneDistance : public vtkImplicitFunction
37{
38public:
39 enum class NormType
40 {
41 L0 = 0,
42 L2 = 2
43 };
44
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
53
59 double EvaluateFunction(double x[3]) override;
60
65 void EvaluateGradient(double x[3], double g[3]) override;
66
71 void SetInput(vtkPolyData* input);
72
74
78 vtkGetMacro(Tolerance, double);
79 vtkSetMacro(Tolerance, double);
81
83
88 NormType GetNorm() const { return Norm; }
90 {
91 Norm = n;
92 Modified();
93 }
94#ifndef __VTK_WRAP_JAVA__
95 // The Java wrappers cannot resolve this signature from the one above,
96 // see https://gitlab.kitware.com/vtk/vtk/-/issues/17744
97 void SetNorm(int n)
98 {
99 Norm = static_cast<NormType>(n);
100 Modified();
101 }
102#endif
104
106
114
115protected:
118
124
125 double Tolerance;
127
131
132 // Stored here to avoid multiple allocation / dealloction
134 double Bounds[6];
135
136private:
138 void operator=(const vtkImplicitProjectOnPlaneDistance&) = delete;
139};
140
141VTK_ABI_NAMESPACE_END
142#endif
an abstract base class for locators which find cells
provides thread-safe access to cells
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
This class receive a plannar polygon as input.
void SetInput(vtkPolyData *input)
Set the input vtkPolyData used for the implicit function evaluation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImplicitProjectOnPlaneDistance * New()
vtkMTimeType GetMTime() override
Return the MTime also considering the Input dependency.
vtkSmartPointer< vtkAbstractCellLocator > Locator
void CreateDefaultLocator()
Create a default locator (vtkStaticCellLocator).
vtkSetSmartPointerMacro(Locator, vtkAbstractCellLocator)
Set/get the Locator used by to compute the distance.
vtkGetSmartPointerMacro(Locator, vtkAbstractCellLocator)
Set/get the Locator used by to compute the distance.
~vtkImplicitProjectOnPlaneDistance() override=default
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient of nearest triangle to point x[3].
void SetNorm(NormType n)
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
NormType GetNorm() const
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
void SetNorm(int n)
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
a simple class to control print indentation
Definition vtkIndent.h:108
virtual void Modified()
Update the modification time for this object.
perform various plane computations
Definition vtkPlane.h:135
concrete dataset represents vertices, lines, polygons, and triangle strips
Hold a reference to a vtkObjectBase instance.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270