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) VTK_OVERRIDE;
57 
61  vtkMTimeType GetMTime() VTK_OVERRIDE;
62 
66  double EvaluateFunction(double x[3]) VTK_OVERRIDE;
67 
71  void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
72 
76  double EvaluateFunctionAndGetClosestPoint (double x[3], double closestPoint[3]);
77 
84  void SetInput(vtkPolyData *input);
85 
87 
91  vtkSetMacro(NoValue, double);
92  vtkGetMacro(NoValue, double);
94 
96 
100  vtkSetVector3Macro(NoGradient, double);
101  vtkGetVector3Macro(NoGradient, double);
103 
105 
109  vtkSetVector3Macro(NoClosestPoint, double);
110  vtkGetVector3Macro(NoClosestPoint, double);
112 
114 
117  vtkGetMacro(Tolerance, double);
118  vtkSetMacro(Tolerance, double);
120 
121 protected:
123  ~vtkImplicitPolyDataDistance() VTK_OVERRIDE;
124 
128  void CreateDefaultLocator(void);
129 
130  double SharedEvaluate(double x[3], double g[3], double p[3]);
131 
132  double NoGradient[3];
133  double NoClosestPoint[3];
134  double NoValue;
135  double Tolerance;
136 
137  vtkPolyData *Input;
138  vtkCellLocator *Locator;
139 
140 private:
141  vtkImplicitPolyDataDistance(const vtkImplicitPolyDataDistance&) VTK_DELETE_FUNCTION;
142  void operator=(const vtkImplicitPolyDataDistance&) VTK_DELETE_FUNCTION;
143 };
144 
145 #endif
abstract interface for implicit functions
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
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...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.