/usr/include/vtk-7.1/vtkGeneralizedKernel.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkGeneralizedKernel.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkGeneralizedKernel
* @brief flexible, general interpolation kernels
*
*
* vtkGeneralizedKernel is an abstract class that defines an API for concrete
* general-purpose, kernel subclasses. vtkGeneralizedKernels has important
* properties that make them useful in a variety of interpolation
* applications:
* <pre>
* 1. The weights are normalized.
* 2. The footprint of the basis is configurable.
* 3. Probablistic weighting functions can be used to favor certain weights.
* </pre>
* The following paragraphs describe each of these properties in more detail.
*
* Normalized weightings simple mean Sum(w_i) = 1. This ensures that the
* interpolation process is well behaved.
*
* The interpolation footprint is the set of points that are used to perform
* the interpolation process. For example, it is possible to choose between a
* radius-based kernel selection, and one based on the N nearest
* neighbors. Note that the performance and mathematical properties of
* kernels may vary greatly depending on which kernel style is selected. For
* example, if a radius-based kernel footprint is used, and the radius is too
* big, the algorithm can perform in n^3 fashion.
*
* Finally, in advanced usage, probability functions can be applied to the
* interpolation weights (prior to normalization). These probability
* functions are confidence estimates that the data at a particular point is
* accurate. A typical application is when laser scans are used to acquire
* point measurements, which return normals that indicate glancing returns
* versus direct, near orthogonal hits. Another use is when point clouds are
* combined, where some clouds are acquired with more accurate, detailed
* devices versus a broad, potentially coarser acquisition process.
*
* @warning
* Some kernels, like the Voronoi kernel, cannot be subclasses of this class
* because their definition inherently defines the basis style. For example,
* the Voronoi kernel is simply the single closest point. SPH kernals are
* similar, because they implicitly depend on a particle distribution
* consistent with simulation constraints such as conservation of mass, etc.
*
* @sa
* vtkPointInterpolator vtkPointInterpolator2D vtkGaussianKernel vtkSPHKernel
* vtkShepardKernel vtkLinearKernel vtkVoronoiKernel
*/
#ifndef vtkGeneralizedKernel_h
#define vtkGeneralizedKernel_h
#include "vtkFiltersPointsModule.h" // For export macro
#include "vtkInterpolationKernel.h"
class VTKFILTERSPOINTS_EXPORT vtkGeneralizedKernel : public vtkInterpolationKernel
{
public:
//@{
/**
* Standard methods for type and printing.
*/
vtkTypeMacro(vtkGeneralizedKernel, vtkInterpolationKernel)
void PrintSelf(ostream& os, vtkIndent indent);
//@}
/**
* Based on the kernel style, invoke the appropriate locator method to
* obtain the points making up the basis. Given a point x (and optional
* associated point id), determine the points around x which form an
* interpolation basis. The user must provide the vtkIdList pIds, which
* will be dynamically resized as necessary. The method returns the number
* of points in the basis. Typically this method is called before
* ComputeWeights(). Note that ptId is optional in most cases, although in
* some kernels it is used to facilitate basis computation.
*/
virtual vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0);
/**
* Given a point x, a list of basis points pIds, and a probability
* weighting function prob, compute interpolation weights associated with
* these basis points. Note that basis points list pIds, the probability
* weighting prob, and the weights array are provided by the caller of the
* method, and may be dynamically resized as necessary. The method returns
* the number of weights (pIds may be resized in some cases). Typically
* this method is called after ComputeBasis(), although advanced users can
* invoke ComputeWeights() and provide the interpolation basis points pIds
* directly. The probably weighting prob are numbers 0<=prob<=1 which are
* multiplied against the interpolation weights before normalization. They
* are estimates of local confidence of weights. The prob may be NULL in
* which all probabilities are considered =1.
*/
virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds,
vtkDoubleArray *prob, vtkDoubleArray *weights) = 0;
/**
* Given a point x, and a list of basis points pIds, compute interpolation
* weights associated with these basis points. Note that both the nearby
* basis points list pIds and the weights array are provided by the caller
* of the method, and may be dynamically resized as necessary. Typically
* this method is called after ComputeBasis(), although advanced users can
* invoke ComputeWeights() and provide the interpolation basis points pIds
* directly.
*/
virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights)
{
return this->ComputeWeights(x,pIds,NULL,weights);
}
/**
* Enum used to select the interpolation basis form. By default, a Radius
* form is used (i.e., the basis is defined from all points within a
* specified radius). However, it is also possible to select the N closest
* points (NClosest).
*/
enum KernelStyle
{
RADIUS=0,
N_CLOSEST=1
};
//@{
/**
* Specify the interpolation basis style. By default, a Radius style is
* used (i.e., the basis is defined from all points within a specified
* radius). However, it is also possible to select the N closest points
* (NClosest). Note that in most formulations the Radius style is assumed
* as it provides better mathematical properties. However, for convenience
* some bases are easier to use when the N closest points are taken.
*/
vtkSetMacro(KernelFootprint,int);
vtkGetMacro(KernelFootprint,int);
void SetKernelFootprintToRadius()
{ this->SetKernelFootprint(RADIUS); }
void SetKernelFootprintToNClosest()
{ this->SetKernelFootprint(N_CLOSEST); }
//@}
//@{
/**
* If the interpolation basis style is Radius, then this method specifies
* the radius within which the basis points must lie.
*/
vtkSetClampMacro(Radius,double,0.0,VTK_FLOAT_MAX);
vtkGetMacro(Radius,double);
//@}
//@{
/**
* If the interpolation basis style is NClosest, then this method specifies
* the number of the closest points used to form the interpolation basis.
*/
vtkSetClampMacro(NumberOfPoints,int,1,VTK_INT_MAX);
vtkGetMacro(NumberOfPoints,int);
//@}
//@{
/**
* Indicate whether the interpolation weights should be normalized after they
* are computed. Generally this is left on as it results in more reasonable
* behavior.
*/
vtkSetMacro(NormalizeWeights,bool);
vtkGetMacro(NormalizeWeights,bool);
vtkBooleanMacro(NormalizeWeights,bool);
//@}
protected:
vtkGeneralizedKernel();
~vtkGeneralizedKernel();
int KernelFootprint;
double Radius;
int NumberOfPoints;
bool NormalizeWeights;
private:
vtkGeneralizedKernel(const vtkGeneralizedKernel&) VTK_DELETE_FUNCTION;
void operator=(const vtkGeneralizedKernel&) VTK_DELETE_FUNCTION;
};
#endif
|