Commit 8456b5ee authored by Burlen Loring's avatar Burlen Loring
Browse files

Surface LIC: Check for invalid bounds

Change-Id: I80239c35fbdf161bd915569fe7948111fa70903e
parent 99101fdf
......@@ -1412,11 +1412,12 @@ public:
}
// dataset case
vtkDataSet* ds = dynamic_cast<vtkDataSet*>(dobj);
if (ds)
if (ds && ds->GetNumberOfCells())
{
double bounds[6];
ds->GetBounds(bounds);
if (this->ProjectBounds(PMV, viewsize, bounds, dataExt))
if ( vtkBoundingBox::IsValid(bounds)
&& this->ProjectBounds(PMV, viewsize, bounds, dataExt) )
{
// the dataset is visible
// add its extent
......@@ -1426,7 +1427,7 @@ public:
//cerr << "ds " << ds << " not visible " << endl;
return 0;
}
// composite dataset case
// composite dataset case
vtkCompositeDataSet* cd = dynamic_cast<vtkCompositeDataSet*>(dobj);
if (cd)
{
......@@ -1441,7 +1442,8 @@ public:
double bounds[6];
ds->GetBounds(bounds);
vtkPixelExtent screenExt;
if (this->ProjectBounds(PMV, viewsize, bounds, screenExt))
if ( vtkBoundingBox::IsValid(bounds)
&& this->ProjectBounds(PMV, viewsize, bounds, screenExt) )
{
// this block is visible
// save it's screen extent
......@@ -1456,14 +1458,14 @@ public:
// process accumulated dataset bounds
double bounds[6];
bbox.GetBounds(bounds);
if (this->ProjectBounds(PMV, viewsize, bounds, dataExt))
if ( vtkBoundingBox::IsValid(bounds)
&& this->ProjectBounds(PMV, viewsize, bounds, dataExt) )
{
return 1;
}
return 0;
}
// it's an error to be here
vtkGenericWarningMacro("Invalid data object");
//cerr << "ds " << ds << " no cells " << endl;
return 0;
}
......
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