VTK
vtkImplicitPolyDataDistance.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitPolyDataDistance.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 =========================================================================*/
42 #ifndef vtkImplicitPolyDataDistance_h
43 #define vtkImplicitPolyDataDistance_h
44 
45 #include "vtkFiltersCoreModule.h" // For export macro
46 #include "vtkImplicitFunction.h"
47 
48 class vtkCellLocator;
49 class vtkPolyData;
50 
51 class VTKFILTERSCORE_EXPORT vtkImplicitPolyDataDistance : public vtkImplicitFunction
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  vtkMTimeType GetMTime() override;
62 
67  double EvaluateFunction(double x[3]) override;
68 
72  void EvaluateGradient(double x[3], double g[3]) override;
73 
77  double EvaluateFunctionAndGetClosestPoint (double x[3], double closestPoint[3]);
78 
85  void SetInput(vtkPolyData *input);
86 
88 
92  vtkSetMacro(NoValue, double);
93  vtkGetMacro(NoValue, double);
95 
97 
101  vtkSetVector3Macro(NoGradient, double);
102  vtkGetVector3Macro(NoGradient, double);
104 
106 
110  vtkSetVector3Macro(NoClosestPoint, double);
111  vtkGetVector3Macro(NoClosestPoint, double);
113 
115 
118  vtkGetMacro(Tolerance, double);
119  vtkSetMacro(Tolerance, double);
121 
122 protected:
124  ~vtkImplicitPolyDataDistance() override;
125 
129  void CreateDefaultLocator(void);
130 
131  double SharedEvaluate(double x[3], double g[3], double p[3]);
132 
133  double NoGradient[3];
134  double NoClosestPoint[3];
135  double NoValue;
136  double Tolerance;
137 
140 
141 private:
143  void operator=(const vtkImplicitPolyDataDistance&) = delete;
144 };
145 
146 #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:302
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
octree-based spatial search object to quickly locate cells
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMTimeType GetMTime() override
Overload standard modified time function.
Implicit function that computes the distance from a point x to the nearest point p on an input vtkPol...
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.