mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
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:
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();
|
||||
|
Loading…
Reference in New Issue
Block a user