From 6e878c4f66daf30f41f76c96575d024636cb2d4b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 29 May 2018 11:38:48 +0200 Subject: [PATCH] Fix LCC example --- .../examples/Linear_cell_complex/CMakeLists.txt | 7 ++----- .../include/CGAL/draw_linear_cell_complex.h | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 1a74373d02c..9c0372c277d 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -12,10 +12,7 @@ endif() find_package(CGAL COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - find_package(QGLViewer) - if (TARGET QGLViewer::QGLViewer) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) - endif() endif() # For Gprof. @@ -43,8 +40,8 @@ if (CGAL_FOUND) create_single_source_cgal_program("voronoi_3.cpp") create_single_source_cgal_program("draw_linear_cell_complex.cpp") - if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) - target_link_libraries(draw_linear_cell_complex CGAL::CGAL_Qt5 QGLViewer::QGLViewer) + if(CGAL_Qt5_FOUND) + target_link_libraries(draw_linear_cell_complex PUBLIC CGAL::CGAL_Qt5) endif() else() diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h index 2ab0bf2a2f3..f1c893b1c97 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -88,10 +88,10 @@ public: /// @param title the title of the window /// @param anofaces if true, do not draw faces (faces are not computed; this can be /// usefull for very big object where this time could be long) - SimpleLCCViewerQt(const LCC& alcc, const char* title="", bool anofaces=false, + SimpleLCCViewerQt(QWidget* parent, const LCC& alcc, const char* title="", bool anofaces=false, const ColorFunctor& fcolor=ColorFunctor()) : // First draw: vertices; edges, faces; multi-color; inverse normal - Base(title, true, true, true, false, true), + Base(parent, title, true, true, true, false, true), lcc(alcc), m_nofaces(anofaces), m_fcolor(fcolor) @@ -207,7 +207,7 @@ void draw(const LCC& alcc, const char* argv[2]={"lccviewer","\0"}; QApplication app(argc,const_cast(argv)); - SimpleLCCViewerQt mainwindow(alcc, title, nofill, fcolor); + SimpleLCCViewerQt mainwindow(app.activeWindow(),alcc, title, nofill, fcolor); #if !defined(CGAL_TEST_SUITE) mainwindow.show();