Commit 3b5e34da authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'edl_prop_fix'

fbff2fe7 fix for props that have no bounds with EDL
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !1275
parents 161cdbfd fbff2fe7
......@@ -400,29 +400,33 @@ bool vtkEDLShading::EDLShadeHigh(
// compute the scene bounding box, and set the scene size to the diagonal of it.
double bb[6];
vtkMath::UninitializeBounds(bb);
bool boundsSet = false;
for(int i=0; i<s.GetPropArrayCount(); i++)
{
double* bounds = s.GetPropArray()[i]->GetBounds();
if(i==0)
if (bounds)
{
bb[0] = bounds[0];
bb[1] = bounds[1];
bb[2] = bounds[2];
bb[3] = bounds[3];
bb[4] = bounds[4];
bb[5] = bounds[5];
}
else
{
bb[0] = (bb[0] < bounds[0] ? bb[0] : bounds[0]);
bb[1] = (bb[1] > bounds[1] ? bb[1] : bounds[1]);
bb[2] = (bb[2] < bounds[2] ? bb[2] : bounds[2]);
bb[3] = (bb[3] > bounds[3] ? bb[3] : bounds[3]);
bb[4] = (bb[4] < bounds[4] ? bb[4] : bounds[4]);
bb[5] = (bb[5] > bounds[5] ? bb[5] : bounds[5]);
if(!boundsSet)
{
bb[0] = bounds[0];
bb[1] = bounds[1];
bb[2] = bounds[2];
bb[3] = bounds[3];
bb[4] = bounds[4];
bb[5] = bounds[5];
boundsSet = true;
}
else
{
bb[0] = (bb[0] < bounds[0] ? bb[0] : bounds[0]);
bb[1] = (bb[1] > bounds[1] ? bb[1] : bounds[1]);
bb[2] = (bb[2] < bounds[2] ? bb[2] : bounds[2]);
bb[3] = (bb[3] > bounds[3] ? bb[3] : bounds[3]);
bb[4] = (bb[4] < bounds[4] ? bb[4] : bounds[4]);
bb[5] = (bb[5] > bounds[5] ? bb[5] : bounds[5]);
}
}
}
float diag = (bb[1]-bb[0])*(bb[1]-bb[0]) + (bb[3]-bb[2])*(bb[3]-bb[2])
+ (bb[5]-bb[4])*(bb[5]-bb[4]);
diag = sqrt(diag);
......
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