From e75b70064a2509713f23e71ba0edf0e92465418c Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 1 Oct 2020 10:05:18 +0200 Subject: [PATCH] Recenter the scene resets the FOV --- GraphicsView/include/CGAL/Qt/camera_impl.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/camera_impl.h b/GraphicsView/include/CGAL/Qt/camera_impl.h index c5c1d1c4d0f..d79ce8af56d 100644 --- a/GraphicsView/include/CGAL/Qt/camera_impl.h +++ b/GraphicsView/include/CGAL/Qt/camera_impl.h @@ -895,13 +895,17 @@ Vec Camera::pointUnderPixel(const QPoint &pixel, bool &found) const { /*! Moves the Camera so that the entire scene is visible. - Simply calls fitSphere() on a sphere defined by sceneCenter() and - sceneRadius(). + Calls fitSphere() on a sphere defined by sceneCenter() and + sceneRadius(), and resets the default FOV. You will typically use this method in CGAL::QGLViewer::init() after you defined a new sceneRadius(). */ CGAL_INLINE_FUNCTION -void Camera::showEntireScene() { fitSphere(sceneCenter(), sceneRadius()); } +void Camera::showEntireScene() +{ + setFieldOfView(CGAL_PI/4.0); + fitSphere(sceneCenter(), sceneRadius()); +} /*! Moves the Camera so that its sceneCenter() is projected on the center of the window. The orientation() and fieldOfView() are unchanged.