Fix BoundsCompute for missing coordinate system.

DataSet::GetCoordinateSystem(Id) doesn't throw `ErrorBadValue`. Fixed
BoundsCompute to check for number of coordinate systems instead.
This commit is contained in:
Utkarsh Ayachit 2018-04-16 16:56:23 -04:00
parent 94db252c62
commit e62ff8096a

@ -34,15 +34,9 @@ namespace cont
VTKM_CONT
vtkm::Bounds BoundsCompute(const vtkm::cont::DataSet& dataset, vtkm::Id coordinate_system_index)
{
try
{
return dataset.GetCoordinateSystem(coordinate_system_index).GetBounds();
}
catch (vtkm::cont::ErrorBadValue&)
{
// missing coordinate_system_index, return empty bounds.
return vtkm::Bounds();
}
return dataset.GetNumberOfCoordinateSystems() > coordinate_system_index
? dataset.GetCoordinateSystem(coordinate_system_index).GetBounds()
: vtkm::Bounds();
}
//-----------------------------------------------------------------------------