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
vtkPlane
perform various plane computations
Definition: vtkPlane.h:31
vtkImplicitProjectOnPlaneDistance
Definition: vtkImplicitProjectOnPlaneDistance.h:44
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkImplicitFunction::EvaluateFunction
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkImplicitProjectOnPlaneDistance::SetNorm
void SetNorm(int n)
Definition: vtkImplicitProjectOnPlaneDistance.h:105
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkAbstractCellLocator.h
vtkSmartPointer< vtkPolyData >
vtkImplicitProjectOnPlaneDistance::UnusedCell
vtkSmartPointer< vtkGenericCell > UnusedCell
Definition: vtkImplicitProjectOnPlaneDistance.h:141
vtkImplicitProjectOnPlaneDistance::GetNorm
NormType GetNorm() const
Set the norm to use: L0: 0 when the projection is inside the input polygon, 1 otherwise L2: Euclidean...
Definition: vtkImplicitProjectOnPlaneDistance.h:96
vtkImplicitProjectOnPlaneDistance::NormType
NormType
Definition: vtkImplicitProjectOnPlaneDistance.h:47
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkImplicitFunction::GetMTime
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImplicitFunction::EvaluateGradient
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
vtkImplicitProjectOnPlaneDistance::Input
vtkSmartPointer< vtkPolyData > Input
Definition: vtkImplicitProjectOnPlaneDistance.h:136
vtkSmartPointer.h
vtkImplicitProjectOnPlaneDistance::Norm
NormType Norm
Definition: vtkImplicitProjectOnPlaneDistance.h:134
vtkImplicitProjectOnPlaneDistance::SetNorm
void SetNorm(NormType n)
Definition: vtkImplicitProjectOnPlaneDistance.h:97
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:48
vtkImplicitProjectOnPlaneDistance::Locator
vtkSmartPointer< vtkAbstractCellLocator > Locator
Definition: vtkImplicitProjectOnPlaneDistance.h:137
vtkImplicitProjectOnPlaneDistance::Tolerance
double Tolerance
Definition: vtkImplicitProjectOnPlaneDistance.h:133
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkImplicitFunction.h
vtkImplicitProjectOnPlaneDistance::ProjectionPlane
vtkSmartPointer< vtkPlane > ProjectionPlane
Definition: vtkImplicitProjectOnPlaneDistance.h:138
vtkImplicitFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293