Allow for empty Z bounds in ResetToBounds

If the camera is not a 3D camera, then it might be the case that the
calling code has not set the bounds in the Z direction. Allow this to
happen as long as you are not using a 3D camera.
This commit is contained in:
Kenneth Moreland 2021-07-12 10:57:19 -06:00
parent 4c1514bb3a
commit ede7756929

@ -268,9 +268,17 @@ void Camera::ResetToBounds(const vtkm::Bounds& dataBounds,
viewPadAmount = YDataViewPadding * (db.Y.Max - db.Y.Min);
db.Y.Max += viewPadAmount;
db.Y.Min -= viewPadAmount;
viewPadAmount = ZDataViewPadding * (db.Z.Max - db.Z.Min);
db.Z.Max += viewPadAmount;
db.Z.Min -= viewPadAmount;
if (db.Z.IsNonEmpty())
{
viewPadAmount = ZDataViewPadding * (db.Z.Max - db.Z.Min);
db.Z.Max += viewPadAmount;
db.Z.Min -= viewPadAmount;
}
else
{
VTKM_ASSERT(saveMode != MODE_3D);
db.Z.Include(0);
}
// Reset for 3D camera
vtkm::Vec3f_32 directionOfProjection = this->GetPosition() - this->GetLookAt();