[vtk-developers] [VTK 0011846]: The vtkLinearExtrusionFilter is not thread safe

Mantis Bug Tracker mantis at public.kitware.com
Fri Feb 11 13:19:39 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=11846 
====================================================================== 
Reported By:                David Gobbi
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   11846
Category:                   (No Category)
Reproducibility:            random
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2011-02-11 13:19 EST
Last Modified:              2011-02-11 13:19 EST
====================================================================== 
Summary:                    The vtkLinearExtrusionFilter is not thread safe
Description: 
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;
}

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-11 13:19 David Gobbi    New Issue                                    
======================================================================




More information about the vtk-developers mailing list