1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkPointInterpolator2D.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 =========================================================================*/
15 /**
16  * @class   vtkPointInterpolator2D
17  * @brief   interpolate point cloud attribute data
18  * onto x-y plane using various kernels
19  *
20  *
21  * vtkPointInterpolator2D probes a point cloud Pc (the filter Source) with a
22  * set of points P (the filter Input), interpolating the data values from Pc
23  * onto P. Note however that the descriptive phrase "point cloud" is a
24  * misnomer: Pc can be represented by any vtkDataSet type, with the points of
25  * the dataset forming Pc. Similarly, the output P can also be represented by
26  * any vtkDataSet type; and the topology/geometry structure of P is passed
27  * through to the output along with the newly interpolated arrays. However,
28  * this filter presumes that P lies on a plane z=0.0, thus z-coordinates
29  * are set accordingly during the interpolation process.
30  *
31  * The optional boolean flag InterpolateZ is provided for convenience. In
32  * effect it turns the source z coordinates into an additional array that is
33  * interpolated onto the output data. For example, if the source is a x-y-z
34  * LIDAR point cloud, then z can be interpolated onto the output dataset as a
35  * vertical elevation(z-coordinate).
36  *
37  * A key input to this filter is the specification of the interpolation
38  * kernel, and the parameters which control the associated interpolation
39  * process. Interpolation kernels include Voronoi, Gaussian, Shepard, and SPH
40  * (smoothed particle hydrodynamics), with additional kernels to be added in
41  * the future. See vtkPointInterpolator for more information.
42  *
43  * @warning
44  * This class has been threaded with vtkSMPTools. Using TBB or other
45  * non-sequential type (set in the CMake variable
46  * VTK_SMP_IMPLEMENTATION_TYPE) may improve performance significantly.
47  *
48  * @warning
49  * For widely spaced points in Pc, or when p is located outside the bounding
50  * region of Pc, the interpolation may behave badly and the interpolation
51  * process will adapt as necessary to produce output. For example, if the N
52  * closest points within R are requested to interpolate p, if N=0 then the
53  * interpolation will switch to a different strategy (which can be controlled
54  * as in the NullPointsStrategy).
55  *
56  * @sa
57  * vtkPointInterpolator
58 */
59 
60 #ifndef vtkPointInterpolator2D_h
61 #define vtkPointInterpolator2D_h
62 
63 #include "vtkFiltersPointsModule.h" // For export macro
64 #include "vtkPointInterpolator.h"
65 #include "vtkStdString.h"        // For vtkStdString ivars
66 
67 
68 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator2D : public vtkPointInterpolator
69 {
70 public:
71   //@{
72   /**
73    * Standard methods for instantiating, obtaining type information, and
74    * printing.
75    */
76   static vtkPointInterpolator2D *New();
77   vtkTypeMacro(vtkPointInterpolator2D,vtkPointInterpolator);
78   void PrintSelf(ostream& os, vtkIndent indent) override;
79   //@}
80 
81   //@{
82   /**
83    * Specify whether to take the z-coordinate values of the source points as
84    * attributes to be interpolated. This is in addition to any other point
85    * attribute data associated with the source. By default this is enabled.
86    */
87   vtkSetMacro(InterpolateZ,bool);
88   vtkGetMacro(InterpolateZ,bool);
89   vtkBooleanMacro(InterpolateZ,bool);
90   //@}
91 
92   //@{
93   /**
94    * Specify the name of the output array containing z values. This method is
95    * only applicable when InterpolateZ is enabled. By default the output
96    * array name is "Elevation".
97    */
98   vtkSetMacro(ZArrayName, vtkStdString);
99   vtkGetMacro(ZArrayName, vtkStdString);
100   //@}
101 
102 protected:
103   vtkPointInterpolator2D();
104   ~vtkPointInterpolator2D() override;
105 
106   // Interpolate z values?
107   bool InterpolateZ;
108 
109   // Name of output array
110   vtkStdString ZArrayName;
111 
112   // The driver of the algorithm
113   void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output) override;
114 
115 private:
116   vtkPointInterpolator2D(const vtkPointInterpolator2D&) = delete;
117   void operator=(const vtkPointInterpolator2D&) = delete;
118 
119 };
120 
121 #endif
122