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
111 
112 
114 
119  vtkGetSmartPointerMacro(Locator, vtkAbstractCellLocator);
120  vtkSetSmartPointerMacro(Locator, vtkAbstractCellLocator);
122 
123 protected:
125  ~vtkImplicitProjectOnPlaneDistance() override = default;
126 
131  void CreateDefaultLocator(void);
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
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
an abstract base class for locators which find cells
vtkSmartPointer< vtkGenericCell > UnusedCell
void SetNorm(NormType n)
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
provides thread-safe access to cells
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:33
vtkMTimeType GetMTime() override
Overload standard modified time function.
perform various plane computations
Definition: vtkPlane.h:31
virtual void Modified()
Update the modification time for this object.
void SetNorm(int n)
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkAbstractCellLocator > Locator
This class recieve a plannar polygon as input.