diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index 0866e27ebc0..b6d92c56b3a 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -8,10 +8,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand +// Mostafa Ashraf #ifndef CGAL_DRAW_POLYHEDRON_H #define CGAL_DRAW_POLYHEDRON_H +#include +#include #include #include @@ -32,28 +35,29 @@ template class T_HDS, - class Alloc> + class Alloc, typename BufferType = float> void draw(const CGAL_POLY_TYPE& apoly, const char* title="Polyhedron Basic Viewer", bool nofill=false) { -#if defined(CGAL_TEST_SUITE) - bool cgal_test_suite=true; -#else - bool cgal_test_suite=qEnvironmentVariableIsSet("CGAL_TEST_SUITE"); -#endif + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(apoly, buffer); + draw_buffer(buffer); +} - if (!cgal_test_suite) - { - CGAL::Qt::init_ogl_context(4,3); - int argc=1; - const char* argv[2]={"polyhedron_viewer", nullptr}; - QApplication app(argc,const_cast(argv)); - SimpleFaceGraphViewerQt - mainwindow(app.activeWindow(), apoly, title, nofill); - mainwindow.show(); - app.exec(); - } +template + class T_HDS, + class Alloc, typename BufferType = float, class DrawingFunctor> +void draw(const CGAL_POLY_TYPE& apoly, + const DrawingFunctor &drawing_functor, + const char* title="Polyhedron Basic Viewer", + bool nofill=false) +{ + CGAL::Graphic_buffer buffer; + add_in_graphic_buffer(apoly, buffer, drawing_functor); + draw_buffer(buffer); } #undef CGAL_POLY_TYPE