MantisBT - VTK
View Issue Details
0011846VTK(No Category)public2011-02-11 13:192012-12-12 12:02
David Gobbi 
David Gobbi 
highmajorrandom
closedfixed 
 
 
0011846: The vtkLinearExtrusionFilter is not thread safe
Multiple instances of vtkLinearExtrusionFilter cannot run in multiple threads, because this filter uses static variables to store its internal method return values. The bad code, which dates back to 1995, is as follows:

double *vtkLinearExtrusionFilter::ViaNormal(double x[3], vtkIdType id,
                                           vtkDataArray *n)
{
  static double xNew[3], normal[3];
  int i;

  n->GetTuple(id, normal);
  for (i=0; i<3; i++)
    {
    xNew[i] = x[i] + this->ScaleFactor*normal[i];
    }

  return xNew;
}

double *vtkLinearExtrusionFilter::ViaVector(double x[3],
                                           vtkIdType vtkNotUsed(id),
                                           vtkDataArray *vtkNotUsed(n))
{
  static double xNew[3];
  int i;

  for (i=0; i<3; i++)
    {
    xNew[i] = x[i] + this->ScaleFactor*this->Vector[i];
    }

  return xNew;
}

double *vtkLinearExtrusionFilter::ViaPoint(double x[3], vtkIdType vtkNotUsed(id),
                                          vtkDataArray *vtkNotUsed(n))
{
  static double xNew[3];
  int i;

  for (i=0; i<3; i++)
    {
    xNew[i] = x[i] + this->ScaleFactor*(x[i] - this->ExtrusionPoint[i]);
    }

  return xNew;
}
No tags attached.
Issue History
2011-02-11 13:19David GobbiNew Issue
2011-02-11 16:02David GobbiNote Added: 0025399
2011-02-11 16:02David GobbiStatusbacklog => @80@
2011-02-11 16:02David GobbiResolutionopen => fixed
2011-02-11 16:02David GobbiAssigned To => David Gobbi
2012-12-12 12:02David GobbiStatuscustomer review => closed

Notes
(0025399)
David Gobbi   
2011-02-11 16:02   
9e49da9b34d77e047306437d6e4394e3d8eaf272