VTK  9.5.20250901
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
31
32VTK_ABI_NAMESPACE_BEGIN
33class vtkGenericCell;
34class vtkPolyData;
35class vtkPlane;
36
38 : public vtkImplicitFunction
39{
40public:
41 enum class NormType
42 {
43 L0 = 0,
44 L2 = 2
45 };
46
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
55
61 double EvaluateFunction(double x[3]) override;
62
67 void EvaluateGradient(double x[3], double g[3]) override;
68
73 void SetInput(vtkPolyData* input);
74
76
80 vtkGetMacro(Tolerance, double);
81 vtkSetMacro(Tolerance, double);
83
85
90 NormType GetNorm() const { return Norm; }
92 {
93 Norm = n;
94 Modified();
95 }
96#ifndef __VTK_WRAP_JAVA__
97 // The Java wrappers cannot resolve this signature from the one above,
98 // see https://gitlab.kitware.com/vtk/vtk/-/issues/17744
99 void SetNorm(int n)
100 {
101 Norm = static_cast<NormType>(n);
102 Modified();
103 }
104#endif
106
108
113 vtkGetSmartPointerMacro(Locator, vtkAbstractCellLocator);
114 vtkSetSmartPointerMacro(Locator, vtkAbstractCellLocator);
116
117protected:
120
126
127 double Tolerance;
129
133
134 // Stored here to avoid multiple allocation / dealloction
136 double Bounds[6];
137
138private:
140 void operator=(const vtkImplicitProjectOnPlaneDistance&) = delete;
141};
142
143VTK_ABI_NAMESPACE_END
144#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).
~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:141
concrete dataset represents vertices, lines, polygons, and triangle strips
Hold a reference to a vtkObjectBase instance.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_MARSHALAUTO