130 vtkErrorMacro(<<
"No Input specified!");
134 if (this->
Input->GetNumberOfPoints()==0)
136 vtkWarningMacro(<<
"Empty Input specified!");
144 vtkErrorMacro(<<
"No PolyBallRadiusArrayName specified!");
160 vtkIdType closCellId;
162 this->
Locator->FindClosestPoint(x,closPt,closCellId,subId,dist2);
170 if (polyballRadiusArray==NULL)
172 vtkErrorMacro(<<
"PolyBallRadiusArray with name specified does not exist!");
178 if (cellType != VTK_LINE)
180 vtkErrorMacro(<<
"Error wrong cell type in polyline!");
184 vtkIdList *linePointsIds = vtkIdList::New();
188 double vector0[3], vector1[3];
189 double radius0, radius1;
193 for (
int i=0;i<3;i++)
195 vector0[i] = point1[i] - point0[i];
196 vector1[i] = closPt[i] - point0[i];
199 double num = vtkMath::Dot(vector0,vector1);
200 double den = vtkMath::Dot(vector0,vector0);
210 radius0 = polyballRadiusArray->GetComponent(linePointsIds->GetId(0),0);
211 radius1 = polyballRadiusArray->GetComponent(linePointsIds->GetId(1),0);
213 double radius = radius0 + t*(radius1 - radius0);
215 value = sqrt(dist2) - radius;
217 linePointsIds->Delete();