forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkProbabilisticVoronoiKernel.h
87 lines (73 loc) · 3.25 KB
/
vtkProbabilisticVoronoiKernel.h
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
/*=========================================================================
Program: Visualization Toolkit
Module: vtkProbabilisticVoronoiKernel.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 vtkProbabilisticVoronoiKernel
* @brief interpolate from the weighted closest point
*
*
* vtkProbabilisticVoronoiKernel is an interpolation kernel that interpolates
* from the closest weighted point from a neighborhood of points. The weights
* refer to the probabilistic weighting that can be provided to the
* ComputeWeights() method.
*
* Note that the local neighborhood is taken from the kernel footprint
* specified in the superclass vtkGeneralizedKernel.
*
* @warning
* If probability weightings are not defined, then the kernel provides the
* same results as vtkVoronoiKernel, except a less efficiently.
*
* @sa
* vtkInterpolationKernel vtkGeneralizedKernel vtkVoronoiKernel
*/
#ifndef vtkProbabilisticVoronoiKernel_h
#define vtkProbabilisticVoronoiKernel_h
#include "vtkFiltersPointsModule.h" // For export macro
#include "vtkGeneralizedKernel.h"
class vtkIdList;
class vtkDoubleArray;
class VTKFILTERSPOINTS_EXPORT vtkProbabilisticVoronoiKernel : public vtkGeneralizedKernel
{
public:
//@{
/**
* Standard methods for instantiation, obtaining type information, and printing.
*/
static vtkProbabilisticVoronoiKernel *New();
vtkTypeMacro(vtkProbabilisticVoronoiKernel,vtkGeneralizedKernel);
void PrintSelf(ostream& os, vtkIndent indent) override;
//@}
// Re-use any superclass signatures that we don't override.
using vtkGeneralizedKernel::ComputeWeights;
/**
* 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 nullptr in
* which all probabilities are considered =1.
*/
vtkIdType ComputeWeights(double x[3], vtkIdList *pIds,
vtkDoubleArray *prob, vtkDoubleArray *weights) override;
protected:
vtkProbabilisticVoronoiKernel();
~vtkProbabilisticVoronoiKernel() override;
private:
vtkProbabilisticVoronoiKernel(const vtkProbabilisticVoronoiKernel&) = delete;
void operator=(const vtkProbabilisticVoronoiKernel&) = delete;
};
#endif