diff --git a/Polyhedron/examples/Polyhedron/CMakeLists.txt b/Polyhedron/examples/Polyhedron/CMakeLists.txt index c3d550772a6..821eebaa7ab 100644 --- a/Polyhedron/examples/Polyhedron/CMakeLists.txt +++ b/Polyhedron/examples/Polyhedron/CMakeLists.txt @@ -9,10 +9,7 @@ cmake_minimum_required(VERSION 2.8.10) 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() + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() if ( CGAL_FOUND ) @@ -30,8 +27,8 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() - if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) - target_link_libraries(draw_polyhedron CGAL::CGAL_Qt5 QGLViewer::QGLViewer) + if(CGAL_Qt5_FOUND ) + target_link_libraries(draw_polyhedron CGAL::CGAL_Qt5) endif() else() diff --git a/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp b/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp index 76c17c2d3e9..669a65f3989 100644 --- a/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp +++ b/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp @@ -3,6 +3,9 @@ #include #include +#include +#include + typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Polyhedron_3 Polyhedron; @@ -10,7 +13,11 @@ int main() { std::cerr<<"Loading OFF file ... "<>P; + std::string filename; + std::cin>>filename; + std::cout<> P; CGAL::draw(P); diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index a7b4a961dff..7273c023c46 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -63,11 +63,11 @@ 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) - SimplePolyhedronViewerQt(const Polyhedron& apoly, const char* title="", + SimplePolyhedronViewerQt(QWidget* parent,const Polyhedron& apoly, const char* title="", bool anofaces=false, const ColorFunctor& fcolor=ColorFunctor()) : // First draw: no vertex; edges, faces; mono-color; inverse normal - Base(title, false, true, true, true, false), + Base(parent, title, false, true, true, true, false), poly(apoly), m_nofaces(anofaces), m_fcolor(fcolor) @@ -205,7 +205,7 @@ void draw(const Polyhedron& apoly, QApplication app(argc,const_cast(argv)); SimplePolyhedronViewerQt - mainwindow(apoly, title, nofill, fcolor); + mainwindow(app.activeWindow(), apoly, title, nofill, fcolor); #if !defined(CGAL_TEST_SUITE) mainwindow.show();