VTK  9.0.1
vtkImplicitProjectOnPlaneDistance.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitProjectOnPlaneDistance.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 =========================================================================*/
31 #ifndef vtkImplicitProjectOnPlaneDistance_h
32 #define vtkImplicitProjectOnPlaneDistance_h
33 
34 #include "vtkImplicitFunction.h"
35 
36 #include "vtkAbstractCellLocator.h" // User defined cellLocator
37 #include "vtkFiltersCoreModule.h" // For export macro
38 #include "vtkSmartPointer.h" // It has vtkSmartPointer fields
39 
40 class vtkGenericCell;
41 class vtkPolyData;
42 class vtkPlane;
43 
44 class VTKFILTERSCORE_EXPORT vtkImplicitProjectOnPlaneDistance : public vtkImplicitFunction
45 {
46 public:
47  enum class NormType
48  {
49  L0 = 0,
50  L2 = 2
51  };
52 
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60  vtkMTimeType GetMTime() override;
61 
67  double EvaluateFunction(double x[3]) override;
68 
73  void EvaluateGradient(double x[3], double g[3]) override;
74 
79  void SetInput(vtkPolyData* input);
80 
82 
86  vtkGetMacro(Tolerance, double);
87  vtkSetMacro(Tolerance, double);
89 
91 
96  NormType GetNorm() const { return Norm; }
97  void SetNorm(NormType n)
98  {
99  Norm = n;
100  Modified();
101  }
102 #ifndef __VTK_WRAP_JAVA__
103  // The Java wrappers cannot resolve this signature from the one above,
104  // see https://gitlab.kitware.com/vtk/vtk/issues/17744
105  void SetNorm(int n)
106  {
107  Norm = static_cast<NormType>(n);
108  Modified();
109  }
110 #endif
112 
114 
122 
123 protected:
126 
132 
133  double Tolerance;
135 
139 
140  // Stored here to avoid multiple allocation / dealloction
142  double Bounds[6];
143 
144 private:
146  void operator=(const vtkImplicitProjectOnPlaneDistance&) = delete;
147 };
148 
149 #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 recieve 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(void)
Create a default locator (vtkStaticCellLocator).
vtkSetSmartPointerMacro(Locator, vtkAbstractCellLocator)
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].
NormType GetNorm() const
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:34
virtual void Modified()
Update the modification time for this object.
perform various plane computations
Definition: vtkPlane.h:32
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293