diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 5504103efeb..65de07fe345 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -196,6 +196,8 @@ public: CGAL::qglviewer::Vec maxv(bbox.xmax(), bbox.ymax(), 0); auto diameter = (maxv - minv).norm(); m_pixel_ratio = diameter / gso.height(); + + add_elements(); } /*! Intercept the resizing of the window. @@ -281,13 +283,15 @@ void add_to_graphics_scene(const CGAL_PS2_TYPE& ap2, draw_function_for_boolean_set_2::compute_elements(ap2, graphics_scene, gso); } -#ifdef CGAL_USE_BASIC_VIEWER_QT - // Specialization of draw function. template void draw(const CGAL_PS2_TYPE& ps, GSOptions& gso, const char* title = "Polygon_set_2 Basic Viewer") { + CGAL_USE(ps); + CGAL_USE(gso); + CGAL_USE(title); + #if defined(CGAL_TEST_SUITE) bool cgal_test_suite = true; #else @@ -298,6 +302,7 @@ void draw(const CGAL_PS2_TYPE& ps, GSOptions& gso, { using Ps = CGAL::Polygon_set_2; using Viewer = Polygon_set_2_basic_viewer_qt; +#ifdef CGAL_USE_BASIC_VIEWER_QT CGAL::Qt::init_ogl_context(4,3); int argc = 1; const char* argv[2] = {"t2_viewer", nullptr}; @@ -305,6 +310,7 @@ void draw(const CGAL_PS2_TYPE& ps, GSOptions& gso, Viewer basic_viewer(app.activeWindow(), ps, gso, title); basic_viewer.show(); app.exec(); +#endif // CGAL_USE_BASIC_VIEWER_QT } } @@ -319,7 +325,6 @@ void draw(const CGAL_PS2_TYPE& ps, draw(ps, gso, title); } -#endif // CGAL_USE_BASIC_VIEWER_QT #undef CGAL_PS2_TYPE