23#include "vtkPointData.h"
25#include "vtkObjectFactory.h"
26#include "vtkVersion.h"
58 double r2 = vtkMath::Distance2BetweenPoints(c,x);
63 return r2 * log(sqrt(r2));
67 return sqrt(vtkMath::Distance2BetweenPoints(c,x));
71 return pow(vtkMath::Distance2BetweenPoints(c,x),1.5);
75 vtkErrorMacro(<<
"Error: Unsupported RBFType!");
90 vtkErrorMacro(
"No Source specified!");
94 int numberOfPoints = this->
Source->GetNumberOfPoints();
97 vtkWarningMacro(
"Empty Source specified!");
105 x =
new double[numberOfPoints];
106 A =
new double* [numberOfPoints];
109 for (i=0; i<numberOfPoints; i++)
111 A[i] =
new double[numberOfPoints];
117 for (i=0; i<numberOfPoints; i++)
119 this->
Source->GetPoint(i,center);
120 for (j=0; j<numberOfPoints; j++)
126 int ret = vtkMath::SolveLinearSystem(A,x,numberOfPoints);
130 vtkErrorMacro(<<
"Cannot compute coefficients: error during linear system solve");
133 for (i=0; i<numberOfPoints; i++)
139 for (i=0; i<numberOfPoints; i++)
150 vtkErrorMacro(
"No Source specified!");
154 int numberOfPoints = this->
Source->GetNumberOfPoints();
158 vtkWarningMacro(
"Empty Source specified!");
167 double rbfValue = 0.0;
170 for (i=0; i<numberOfPoints; i++)
172 this->
Source->GetPoint(i,center);
183 vtkWarningMacro(
"RBF gradient computation not implemented.");
188 unsigned long mTime=this->Superclass::GetMTime();
189 unsigned long sourceMTime;
193 sourceMTime = this->
Source->GetMTime();
194 mTime = ( sourceMTime > mTime ? sourceMTime : mTime );
202 this->Superclass::PrintSelf(os,indent);
Implements an implicit function that interpolates a scalar value at a scattered set of points using r...
double EvaluateFunction(double x[3]) override
double EvaluateRBF(double c[3], double x[3])
void PrintSelf(std::ostream &os, vtkIndent indent) override
vtkDoubleArray * Coefficients
vtkvmtkRBFInterpolation()
double RBFInterpolationValue
void ComputeCoefficients()
vtkMTimeType GetMTime() override
void EvaluateGradient(double x[3], double n[3]) override
~vtkvmtkRBFInterpolation()
vtkStandardNewMacro(vtkvmtkRBFInterpolation)