VTK  9.2.6
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 =========================================================================*/
34 #ifndef vtkImplicitProjectOnPlaneDistance_h
35 #define vtkImplicitProjectOnPlaneDistance_h
36 
37 #include "vtkImplicitFunction.h"
38 
39 #include "vtkAbstractCellLocator.h" // User defined cellLocator
40 #include "vtkFiltersCoreModule.h" // For export macro
41 #include "vtkSmartPointer.h" // It has vtkSmartPointer fields
42 
43 class vtkGenericCell;
44 class vtkPolyData;
45 class vtkPlane;
46 
47 class VTKFILTERSCORE_EXPORT vtkImplicitProjectOnPlaneDistance : public vtkImplicitFunction
48 {
49 public:
50  enum class NormType
51  {
52  L0 = 0,
53  L2 = 2
54  };
55 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  vtkMTimeType GetMTime() override;
64 
70  double EvaluateFunction(double x[3]) override;
71 
76  void EvaluateGradient(double x[3], double g[3]) override;
77 
82  void SetInput(vtkPolyData* input);
83 
85 
89  vtkGetMacro(Tolerance, double);
90  vtkSetMacro(Tolerance, double);
92 
94 
99  NormType GetNorm() const { return Norm; }
101  {
102  Norm = n;
103  Modified();
104  }
105 #ifndef __VTK_WRAP_JAVA__
106  // The Java wrappers cannot resolve this signature from the one above,
107  // see https://gitlab.kitware.com/vtk/vtk/-/issues/17744
108  void SetNorm(int n)
109  {
110  Norm = static_cast<NormType>(n);
111  Modified();
112  }
113 #endif
114 
117 
122  vtkGetSmartPointerMacro(Locator, vtkAbstractCellLocator);
123  vtkSetSmartPointerMacro(Locator, vtkAbstractCellLocator);
125 
126 protected:
128  ~vtkImplicitProjectOnPlaneDistance() override = default;
129 
134  void CreateDefaultLocator(void);
135 
136  double Tolerance;
138 
142 
143  // Stored here to avoid multiple allocation / dealloction
145  double Bounds[6];
146 
147 private:
149  void operator=(const vtkImplicitProjectOnPlaneDistance&) = delete;
150 };
151 
152 #endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
NormType GetNorm() const
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
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:90
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
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMTimeType GetMTime() override
Overload standard modified time function.
perform various plane computations
Definition: vtkPlane.h:36
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.