diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index de94f6e40cf..f2943cc11dc 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -53,6 +53,7 @@ #include #include #include +#include namespace CGAL { @@ -1719,6 +1720,30 @@ protected: }; +template +void draw_buffer(GraphicBuffer &graphic_buffer) { + +#if defined(CGAL_TEST_SUITE) + bool cgal_test_suite = true; +#else + bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); +#endif + + if (!cgal_test_suite) { + CGAL::Qt::init_ogl_context(4, 3); + // Qt::init_ogl_context(4, 3); + + int argc = 1; + const char *argv[2] = {"lccviewer", nullptr}; + QApplication app(argc, const_cast(argv)); + + Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); + + basic_viewer.show(); + app.exec(); + } +} + } // End namespace CGAL #else // CGAL_USE_BASIC_VIEWER diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h index 50e23994a06..615eb3d6a4a 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex_function.h @@ -16,7 +16,6 @@ #include #ifdef CGAL_USE_BASIC_VIEWER -#include #include #include @@ -342,29 +341,6 @@ void add_in_graphic_buffer_lcc(GraphicBuffer &graphic_buffer, } } -// TODO: Move to Basic_viewer_qt.h -template -void draw_buffer(GraphicBuffer &graphic_buffer) { - -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite = true; -#else - bool cgal_test_suite = qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif - - if (!cgal_test_suite) { - CGAL::Qt::init_ogl_context(4, 3); - int argc = 1; - const char *argv[2] = {"lccviewer", nullptr}; - QApplication app(argc, const_cast(argv)); - - Basic_viewer_qt basic_viewer(app.activeWindow(), graphic_buffer); - - basic_viewer.show(); - app.exec(); - } -} - // Specialization of draw function. #define CGAL_LCC_TYPE \ CGAL::Linear_cell_complex_base