VTK  9.3.1
vtkGeneralizedKernel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
51 #ifndef vtkGeneralizedKernel_h
52 #define vtkGeneralizedKernel_h
53 
54 #include "vtkFiltersPointsModule.h" // For export macro
55 #include "vtkInterpolationKernel.h"
56 
57 VTK_ABI_NAMESPACE_BEGIN
58 class VTKFILTERSPOINTS_EXPORT vtkGeneralizedKernel : public vtkInterpolationKernel
59 {
60 public:
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
79  vtkIdType ComputeBasis(double x[3], vtkIdList* pIds, vtkIdType ptId = 0) override;
80 
95  virtual vtkIdType ComputeWeights(
96  double x[3], vtkIdList* pIds, vtkDoubleArray* prob, vtkDoubleArray* weights) = 0;
97 
107  vtkIdType ComputeWeights(double x[3], vtkIdList* pIds, vtkDoubleArray* weights) override
108  {
109  return this->ComputeWeights(x, pIds, nullptr, weights);
110  }
111 
119  {
120  RADIUS = 0,
121  N_CLOSEST = 1
122  };
123 
125 
133  vtkSetMacro(KernelFootprint, int);
134  vtkGetMacro(KernelFootprint, int);
135  void SetKernelFootprintToRadius() { this->SetKernelFootprint(RADIUS); }
136  void SetKernelFootprintToNClosest() { this->SetKernelFootprint(N_CLOSEST); }
138 
140 
144  vtkSetClampMacro(Radius, double, 0.0, VTK_FLOAT_MAX);
145  vtkGetMacro(Radius, double);
147 
149 
153  vtkSetClampMacro(NumberOfPoints, int, 1, VTK_INT_MAX);
154  vtkGetMacro(NumberOfPoints, int);
156 
158 
163  vtkSetMacro(NormalizeWeights, bool);
164  vtkGetMacro(NormalizeWeights, bool);
165  vtkBooleanMacro(NormalizeWeights, bool);
167 
168 protected:
170  ~vtkGeneralizedKernel() override;
171 
173  double Radius;
176 
177 private:
179  void operator=(const vtkGeneralizedKernel&) = delete;
180 };
181 
182 VTK_ABI_NAMESPACE_END
183 #endif
virtual vtkIdType ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId=0)=0
Given a point x (and optional associated point id), determine the points around x which form an inter...
void SetKernelFootprintToNClosest()
Specify the interpolation basis style.
base class for interpolation kernels
flexible, general interpolation kernels
#define VTK_INT_MAX
Definition: vtkType.h:144
virtual vtkIdType ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights)=0
Given a point x, and a list of basis points pIds, compute interpolation weights associated with these...
int vtkIdType
Definition: vtkType.h:315
void SetKernelFootprintToRadius()
Specify the interpolation basis style.
dynamic, self-adjusting array of double
vtkIdType ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights) override
Given a point x, and a list of basis points pIds, compute interpolation weights associated with these...
#define VTK_FLOAT_MAX
Definition: vtkType.h:152
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
void PrintSelf(ostream &os, vtkIndent indent) override
Standard method for type and printing.
KernelStyle
Enum used to select the interpolation basis form.