From 8b1ae9a71889c409af275439d242ccaf00110250 Mon Sep 17 00:00:00 2001 From: Kerautret Date: Thu, 3 Mar 2016 15:00:30 +0100 Subject: [PATCH 1/3] fix bug show() is called at the end of prg --- ChangeLog.md | 4 ++++ src/DGtal/io/viewers/Viewer3D.h | 9 +++++++++ src/DGtal/io/viewers/Viewer3D.ih | 8 +++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 159aa0ff5f..4e4d35efb8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -18,6 +18,10 @@ - *IO Package* + + - Viewer3D: Fix a problem when the show() method was called at the of the main + program (the list creation was not called). + (Bertrand Kerautret [##1138](https://github.com/DGtal-team/DGtal/pull/1138)) - Viewer3D: add three new modes for shape rendering (default, metallic and plastic). The rendering can be changed by using the key M. The user can also choose its own rendering with some setter/getter on the opengl diff --git a/src/DGtal/io/viewers/Viewer3D.h b/src/DGtal/io/viewers/Viewer3D.h index a3dc118c80..3b9ddbfe61 100644 --- a/src/DGtal/io/viewers/Viewer3D.h +++ b/src/DGtal/io/viewers/Viewer3D.h @@ -638,6 +638,15 @@ namespace DGtal virtual void paintGL(); + /** + * @brief Overload QWidget method in order to add a call to + * updateList() method (to ensure that the lists are well created + * in the particular case where show() is called at the end of the + * program). + **/ + virtual void show(); + + /** * Add a TextureImage in the list of image to be displayed. * @param image a TextureImage including image data buffer and position, orientation. diff --git a/src/DGtal/io/viewers/Viewer3D.ih b/src/DGtal/io/viewers/Viewer3D.ih index 0a87cdf1ca..60d699e028 100644 --- a/src/DGtal/io/viewers/Viewer3D.ih +++ b/src/DGtal/io/viewers/Viewer3D.ih @@ -1879,7 +1879,13 @@ DGtal::Viewer3D::setGLLightSpecularCoefficients(const GLfloat lig } - +template +inline +void +DGtal::Viewer3D::show(){ + QGLWidget::show(); + updateList(); +} template From 2c6a1008d0e69ac072aa9d2a8fbf5f00fa7595fa Mon Sep 17 00:00:00 2001 From: Kerautret Date: Fri, 4 Mar 2016 14:03:11 +0100 Subject: [PATCH 2/3] fix bounding box no comp in show() else we can have a bad display --- src/DGtal/io/viewers/Viewer3D.ih | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DGtal/io/viewers/Viewer3D.ih b/src/DGtal/io/viewers/Viewer3D.ih index 60d699e028..b9fb6dc0c1 100644 --- a/src/DGtal/io/viewers/Viewer3D.ih +++ b/src/DGtal/io/viewers/Viewer3D.ih @@ -1884,7 +1884,7 @@ inline void DGtal::Viewer3D::show(){ QGLWidget::show(); - updateList(); + updateList(false); } From 00ca7ef66c1e6d2bd8810501f144f91d2f1e9c8b Mon Sep 17 00:00:00 2001 From: Kerautret Date: Sun, 6 Mar 2016 12:29:29 +0100 Subject: [PATCH 3/3] typo change log --- ChangeLog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 4e4d35efb8..e46e8eea88 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,8 +19,8 @@ - *IO Package* - - Viewer3D: Fix a problem when the show() method was called at the of the main - program (the list creation was not called). + - Viewer3D: Fix a problem when the show() method was called at the end of the + main program (the list creation was not called). (Bertrand Kerautret [##1138](https://github.com/DGtal-team/DGtal/pull/1138)) - Viewer3D: add three new modes for shape rendering (default, metallic and plastic). The rendering can be changed by using the key M. The user can