55 double sphereFunctionValue, minSphereFunctionValue;
56 vtkDataArray* polyballRadiusArray;
60 vtkErrorMacro(
"No Input specified!");
64 if (this->
Input->GetNumberOfPoints()==0)
66 vtkWarningMacro(
"Empty Input specified!");
71 vtkErrorMacro(
"No PolyBallRadiusArrayName specified!");
75 if (!this->
Input->GetPointData()->GetArray(this->PolyBallRadiusArrayName))
77 vtkErrorMacro(
"PolyBallRadiusArray with name specified does not exist!");
83 for (i=0; i<this->
Input->GetNumberOfPoints(); i++)
87 this->
Input->GetPoint(i,px);
88 pr = polyballRadiusArray->GetComponent(i,0);
92 sphereFunctionValue = ((x[0] - px[0]) * (x[0] - px[0]) + (x[1] - px[1]) * (x[1] - px[1]) + (x[2] - px[2]) * (x[2] - px[2])) - pr*pr;
95 minSphereFunctionValue = sphereFunctionValue;
100 return minSphereFunctionValue;