From f931cf643cd794ec6dc36e20b6e14e84b3a76ecc Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 14:00:53 +0200 Subject: [PATCH 1/7] Fix a compilation The removal of the Qt4 code had side-effects. In Qt5, the method is QInputDialog::getInt instead of QInputDialog::getInteger --- ...olyhedron_demo_point_set_smoothing_plugin.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp index f4f36786603..c259da70df1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp @@ -59,14 +59,14 @@ void Polyhedron_demo_point_set_smoothing_plugin::on_actionJetSmoothing_triggered bool ok; const unsigned int nb_neighbors = - QInputDialog::getInteger((QWidget*)mw, - tr("Jet Smoothing"), // dialog title - tr("Number of neighbors:"), // field label - 24, // default value = fast - 6, // min - 1000, // max - 1, // step - &ok); + QInputDialog::getInt((QWidget*)mw, + tr("Jet Smoothing"), // dialog title + tr("Number of neighbors:"), // field label + 24, // default value = fast + 6, // min + 1000, // max + 1, // step + &ok); if(!ok) return; From a642c37ba16b3eea692e0d2fd1721676ae628b28 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 14:43:21 +0200 Subject: [PATCH 2/7] Fix a warning that looks like a real error --- Triangulation_3/demo/Triangulation_3/Viewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.cpp b/Triangulation_3/demo/Triangulation_3/Viewer.cpp index 1fbb92b70dc..815e1e91680 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.cpp +++ b/Triangulation_3/demo/Triangulation_3/Viewer.cpp @@ -1559,7 +1559,7 @@ void Viewer::draw() drawText( width()-200, 40, tr("Shift+Wheel: Resize trackball"), fontPrompt ); } - if(m_curMode != NORMAL && m_showTrackball) + if(m_selMode != NORMAL && m_showTrackball) { rendering_program_spheres.bind(); vao[11].bind(); From f17d91f4e3e4c49c6be22d4fbb6e8d4d00cae823 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 14:51:48 +0200 Subject: [PATCH 3/7] Fix warnings about unused variables/local types/local functions --- Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp | 4 ++-- Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp | 12 ------------ .../demo/Periodic_3_triangulation_3/Scene.cpp | 6 +++--- Triangulation_3/demo/Triangulation_3/Viewer.cpp | 6 +++--- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp b/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp index f2fe7afacda..6881495f62c 100644 --- a/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp +++ b/Mesh_3/demo/Mesh_3/C3t3_rib_exporter_plugin.cpp @@ -716,8 +716,6 @@ void C3t3_rib_exporter_plugin:: write_surface_cells(const C3t3& c3t3, const Plane& plane, std::ofstream& out) { - typedef Kernel::Oriented_side Side; - for ( C3t3::Cells_in_complex_iterator it_cell = c3t3.cells_in_complex_begin(), end = c3t3.cells_in_complex_end() ; it_cell != end ; ++it_cell ) { @@ -788,6 +786,8 @@ write_surface_cells(const C3t3& c3t3, const Plane& plane, std::ofstream& out) QColor edgecolor = facecolor.darker(150); /* + typedef Kernel::Oriented_side Side; + // Transparency on the negative side of the plane const Side s0 = plane.oriented_side(c->vertex(0)->point()); const Side s1 = plane.oriented_side(c->vertex(1)->point()); diff --git a/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp b/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp index ef5596feb40..32249a091f8 100644 --- a/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp +++ b/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp @@ -19,18 +19,6 @@ #include #include -namespace { - void CGALglcolor(QColor c, int dv = 0) - { - if ( 0 != dv ) - { - c = c.darker(dv); -#undef darker - } - - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); - } -} struct Scene_c3t3_item_priv { Scene_c3t3_item_priv() : c3t3() {} Scene_c3t3_item_priv(const C3t3& c3t3_) : c3t3(c3t3_) {} diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp index d31def92de5..282228520be 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp @@ -1355,9 +1355,9 @@ void Scene::gl_draw_location() { Point cp = Point(c.x(),c.y(),c.z()); // project facet center double px,py,pz; - // gluProject(cp.x(),cp.y(),cp.z(), - // modelMatrix, projMatrix, viewport, - // &px,&py,&pz); + gluProject(cp.x(),cp.y(),cp.z(), + modelMatrix, projMatrix, viewport, + &px,&py,&pz); cf.push_back(Projected_triangle(pz,Triangle(p,q,r))); } } diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.cpp b/Triangulation_3/demo/Triangulation_3/Viewer.cpp index 815e1e91680..5905714d9e2 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.cpp +++ b/Triangulation_3/demo/Triangulation_3/Viewer.cpp @@ -2390,9 +2390,9 @@ void Viewer::draw_cylinder(float R, int prec, std::vector *vertices, std: { vertices->resize(0); normals->resize(0); - int rings=360/prec, sectors=360/prec; - float T, P; - float x[4],y[4],z[4]; + // int rings=360/prec, sectors=360/prec; + // float T, P; + // float x[4],y[4],z[4]; //Closing nicely the tubes will cause z-fighting and the spherical parts will get all messy /* //top of the cylinder From f377b424ecda93992fbcd7d1ab7797be0904ee13 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 15:46:54 +0200 Subject: [PATCH 4/7] Fix a runtime warning from Qt5 Andreas reported the following warning on console of the Polyhedron demo: > QIODevice::read (QFile, > "C:\cgal\git\Polyhedron\demo\Polyhedron\VC12QT5\autostart.js"): device > not open This should be fixed, now. --- Polyhedron/demo/Polyhedron/Polyhedron_3.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp index a9c7f21f307..01e69f2b6bb 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp @@ -60,7 +60,10 @@ int main(int argc, char **argv) mainWindow.enableScriptDebugger(); args.removeAt(0); } - mainWindow.load_script(QFileInfo("autostart.js")); + QFileInfo autostart_js("autostart.js"); + if(autostart_js.exists()) { + mainWindow.load_script(autostart_js); + } #endif Q_FOREACH(QString filename, args) { mainWindow.open(filename); From 38657c4591f7ad0218d57f942a7d54ef3c9692b0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 15:59:04 +0200 Subject: [PATCH 5/7] Fix a warning -Wsign-compare --- Mesh_3/demo/Mesh_3/Scene_polygon_soup.cpp | 4 ++-- Mesh_3/demo/Mesh_3/Scene_polyhedron_item.cpp | 2 +- Mesh_3/demo/Mesh_3/Scene_segmented_image_item.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Mesh_3/demo/Mesh_3/Scene_polygon_soup.cpp b/Mesh_3/demo/Mesh_3/Scene_polygon_soup.cpp index c7b1b207d60..aa774b7de1f 100644 --- a/Mesh_3/demo/Mesh_3/Scene_polygon_soup.cpp +++ b/Mesh_3/demo/Mesh_3/Scene_polygon_soup.cpp @@ -294,7 +294,7 @@ void Scene_polygon_soup::initialize_buffers() const buffers[2].release(); std::vector empty_array; empty_array.resize(0); - for(int i=0; i empty_array; empty_array.resize(0); - for(int i=0; i nul_vec(0); - for(int i=0; isize(); i++) + for(std::size_t i=0; isize(); i++) nul_vec.push_back(0.0); rendering_program.bind(); @@ -748,7 +748,7 @@ Scene_segmented_image_item::initialize_buffers() vao[0].release(); color.resize(0); - for(int i=0; i Date: Wed, 8 Jul 2015 16:00:01 +0200 Subject: [PATCH 6/7] Fix a warning -Wnarrowing --- .../demo/Periodic_3_triangulation_3/Scene.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp index 282228520be..ef053368ed0 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp @@ -935,7 +935,9 @@ void Scene::update_position() if(y>1.)y-=1.; if(z>1.)z-=1.; moving_point = Point(x,y,z); - float moving_ball[] = {moving_point.x(), moving_point.y(), moving_point.z()}; + float moving_ball[] = {float(moving_point.x()), + float(moving_point.y()), + float(moving_point.z())}; vao[4].bind(); buffers[5].bind(); buffers[5].allocate(moving_ball, 3*sizeof(float)); From 3a0ea1bea52b739368a98b07c338539f8374f504 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jul 2015 16:06:34 +0200 Subject: [PATCH 7/7] Fix a warning in CMake --- Surface_mesher/demo/Surface_mesher/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index a7b4cdfb8bf..da54c48c9fa 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -101,13 +101,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) target_link_libraries( ${prj} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) - else( QGLVIEWER_FOUND) + else( QGLVIEWER_FOUND AND Qt5_FOUND) message(STATUS "NOTICE: This demo needs libQGLViewer, and will not be compiled.") - endif( QGLVIEWER_FOUND) -else(CGAL_FOUND AND CGAL_Qt5_FOUND) + endif( QGLVIEWER_FOUND AND Qt5_FOUND) +else(CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) if(RUNNING_CGAL_AUTO_TEST) # Just to avoid a warning from CMake if that variable is set on the command line... endif() message(STATUS "NOTICE: This demo needs Qt5, and will not be compiled.") -endif(CGAL_FOUND AND CGAL_Qt5_FOUND) +endif(CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND)