Fix LCC example

This commit is contained in:
Maxime Gimeno 2018-05-29 11:38:48 +02:00
parent 979bde1025
commit 6e878c4f66
2 changed files with 5 additions and 8 deletions

View File

@ -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()

View File

@ -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<char**>(argv));
SimpleLCCViewerQt<LCC, ColorFunctor> mainwindow(alcc, title, nofill, fcolor);
SimpleLCCViewerQt<LCC, ColorFunctor> mainwindow(app.activeWindow(),alcc, title, nofill, fcolor);
#if !defined(CGAL_TEST_SUITE)
mainwindow.show();