[vtk-developers] Tests failing on Borland builds

dean.inglis at camris.ca dean.inglis at camris.ca
Mon Dec 8 15:10:15 EST 2003


Hi,

I have noticed that the tests failing on the Borland 
dashboards are all due to numerical exceptions.  This is
because in some classes, like vtkCell and its subclasses
and vtkDataSet the double ivar Bounds, is initialized
to something like

  this->Bounds[0] = VTK_DOUBLE_MAX;
  this->Bounds[1] = -VTK_DOUBLE_MAX;
  this->Bounds[2] = VTK_DOUBLE_MAX;
  this->Bounds[3] = -VTK_DOUBLE_MAX;
  this->Bounds[4] = VTK_DOUBLE_MAX;
  this->Bounds[5] = -VTK_DOUBLE_MAX;

and then a method is called, for example as in vtkDataSet:

// Return the length of the diagonal of the bounding box.
double vtkDataSet::GetLength()
{
  double diff, l=0.0;
  int i;

  this->ComputeBounds();
  for (i=0; i<3; i++)
    {
    diff = static_cast<double>(this->Bounds[2*i+1]) - 
      static_cast<double>(this->Bounds[2*i]);
    l += diff * diff;  //<----------------exception
    }
  diff = sqrt(l);
  if(diff > VTK_DOUBLE_MAX)
    {
    return VTK_DOUBLE_MAX;
    }
  return static_cast<double>(diff);
}


Should Bounds be default initialized using 
VTK_FLOAT_MAX, -VTK_FLOAT_MAX instead???

Dean




More information about the vtk-developers mailing list