VTK  9.2.6
vtkGeneralizedKernel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGeneralizedKernel.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 =========================================================================*/
63 #ifndef vtkGeneralizedKernel_h
64 #define vtkGeneralizedKernel_h
65 
66 #include "vtkFiltersPointsModule.h" // For export macro
67 #include "vtkInterpolationKernel.h"
68 
69 class VTKFILTERSPOINTS_EXPORT vtkGeneralizedKernel : public vtkInterpolationKernel
70 {
71 public:
73 
77  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
90  vtkIdType ComputeBasis(double x[3], vtkIdList* pIds, vtkIdType ptId = 0) override;
91 
106  virtual vtkIdType ComputeWeights(
107  double x[3], vtkIdList* pIds, vtkDoubleArray* prob, vtkDoubleArray* weights) = 0;
108 
118  vtkIdType ComputeWeights(double x[3], vtkIdList* pIds, vtkDoubleArray* weights) override
119  {
120  return this->ComputeWeights(x, pIds, nullptr, weights);
121  }
122 
130  {
131  RADIUS = 0,
132  N_CLOSEST = 1
133  };
134 
136 
144  vtkSetMacro(KernelFootprint, int);
145  vtkGetMacro(KernelFootprint, int);
146  void SetKernelFootprintToRadius() { this->SetKernelFootprint(RADIUS); }
147  void SetKernelFootprintToNClosest() { this->SetKernelFootprint(N_CLOSEST); }
149 
151 
155  vtkSetClampMacro(Radius, double, 0.0, VTK_FLOAT_MAX);
156  vtkGetMacro(Radius, double);
158 
160 
164  vtkSetClampMacro(NumberOfPoints, int, 1, VTK_INT_MAX);
165  vtkGetMacro(NumberOfPoints, int);
167 
169 
174  vtkSetMacro(NormalizeWeights, bool);
175  vtkGetMacro(NormalizeWeights, bool);
176  vtkBooleanMacro(NormalizeWeights, bool);
178 
179 protected:
181  ~vtkGeneralizedKernel() override;
182 
184  double Radius;
187 
188 private:
190  void operator=(const vtkGeneralizedKernel&) = delete;
191 };
192 
193 #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:155
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:332
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:163
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Standard method for type and printing.
KernelStyle
Enum used to select the interpolation basis form.