mirror of https://github.com/CGAL/cgal
Fix LCC example
This commit is contained in:
parent
979bde1025
commit
6e878c4f66
|
|
@ -12,10 +12,7 @@ endif()
|
||||||
find_package(CGAL COMPONENTS Qt5)
|
find_package(CGAL COMPONENTS Qt5)
|
||||||
|
|
||||||
if(CGAL_Qt5_FOUND)
|
if(CGAL_Qt5_FOUND)
|
||||||
find_package(QGLViewer)
|
|
||||||
if (TARGET QGLViewer::QGLViewer)
|
|
||||||
add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
|
add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For Gprof.
|
# For Gprof.
|
||||||
|
|
@ -43,8 +40,8 @@ if (CGAL_FOUND)
|
||||||
create_single_source_cgal_program("voronoi_3.cpp")
|
create_single_source_cgal_program("voronoi_3.cpp")
|
||||||
|
|
||||||
create_single_source_cgal_program("draw_linear_cell_complex.cpp")
|
create_single_source_cgal_program("draw_linear_cell_complex.cpp")
|
||||||
if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer)
|
if(CGAL_Qt5_FOUND)
|
||||||
target_link_libraries(draw_linear_cell_complex CGAL::CGAL_Qt5 QGLViewer::QGLViewer)
|
target_link_libraries(draw_linear_cell_complex PUBLIC CGAL::CGAL_Qt5)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,10 @@ public:
|
||||||
/// @param title the title of the window
|
/// @param title the title of the window
|
||||||
/// @param anofaces if true, do not draw faces (faces are not computed; this can be
|
/// @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)
|
/// 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()) :
|
const ColorFunctor& fcolor=ColorFunctor()) :
|
||||||
// First draw: vertices; edges, faces; multi-color; inverse normal
|
// 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),
|
lcc(alcc),
|
||||||
m_nofaces(anofaces),
|
m_nofaces(anofaces),
|
||||||
m_fcolor(fcolor)
|
m_fcolor(fcolor)
|
||||||
|
|
@ -207,7 +207,7 @@ void draw(const LCC& alcc,
|
||||||
const char* argv[2]={"lccviewer","\0"};
|
const char* argv[2]={"lccviewer","\0"};
|
||||||
QApplication app(argc,const_cast<char**>(argv));
|
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)
|
#if !defined(CGAL_TEST_SUITE)
|
||||||
mainwindow.show();
|
mainwindow.show();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue