VTK  9.3.0
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 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkGenericCell;
33 class vtkPolyData;
34 class vtkPlane;
35 
36 class VTKFILTERSCORE_EXPORT vtkImplicitProjectOnPlaneDistance : public vtkImplicitFunction
37 {
38 public:
39  enum class NormType
40  {
41  L0 = 0,
42  L2 = 2
43  };
44 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  vtkMTimeType GetMTime() override;
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; }
89  void SetNorm(NormType n)
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 
115 protected:
118 
124 
125  double Tolerance;
127 
131 
132  // Stored here to avoid multiple allocation / dealloction
134  double Bounds[6];
135 
136 private:
138  void operator=(const vtkImplicitProjectOnPlaneDistance&) = delete;
139 };
140 
141 VTK_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.
vtkMTimeType GetMTime() override
Return the MTime also considering the Input dependency.
vtkSmartPointer< vtkGenericCell > UnusedCell
vtkSmartPointer< vtkAbstractCellLocator > Locator
static vtkImplicitProjectOnPlaneDistance * New()
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:29
virtual void Modified()
Update the modification time for this object.
perform various plane computations
Definition: vtkPlane.h:26
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270