Commit 817177ec authored by Andrew Bauer's avatar Andrew Bauer Committed by Code Review
Browse files

Merge topic 'vtkPolyLine_clang_analyzer_warning' into master

f86c5f89 Cosmetic change to be consistent with file codeing convention.
cc551eba Skipping the wasteful and unnecessary inverse sin computation.
409086cf Getting rid of clang analyzer warnings.
parents a4f61d28 f86c5f89
......@@ -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,13 @@ 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)));
if (theta==0.0)
if (vtkMath::Normalize(q) == 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