Commit 409086cf authored by Andrew Bauer's avatar Andrew Bauer
Browse files

Getting rid of clang analyzer warnings.

Thanks to Sean McBride for sharing the warnings.

Change-Id: Ia1526ba45f818fa537186fe4b4e0521f91acf602
parent 02bd3466
......@@ -56,10 +56,10 @@ int vtkPolyLine::GenerateSlidingNormals(vtkPoints *pts, vtkCellArray *lines,
{
vtkIdType npts=0;
vtkIdType *linePts=0;
double sPrev[3], sNext[3], q[3], w[3], normal[3], theta;
double sPrev[3], sNext[3], q[3], w[3], normal[3];
double p[3], pNext[3];
double c[3], f1, f2;
int i, j, largeRotation;
int i, j;
sNext[0]=0.0;
sNext[1]=0.0;
sNext[2]=0.0;
......@@ -206,35 +206,14 @@ int vtkPolyLine::GenerateSlidingNormals(vtkPoints *pts, vtkCellArray *lines,
return 0;
}
//see whether we rotate greater than 90 degrees.
if ( vtkMath::Dot(sPrev,sNext) < 0.0 )
{
largeRotation = 1;
}
else
{
largeRotation = 0;
}
//compute rotation of line segment
vtkMath::Cross (sNext, sPrev, q);
theta=asin(static_cast<double>(vtkMath::Normalize(q)));
double theta=asin(static_cast<double>(vtkMath::Normalize(q)));
if (theta==0.0)
{ //no rotation, use previous normal
normals->InsertTuple(linePts[j],normal);
continue;
}
if ( largeRotation )
{
if ( theta > 0.0 )
{
theta = vtkMath::Pi() - theta;
}
else
{
theta = -vtkMath::Pi() - theta;
}
}
// new method
for (i=0; i<3; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment