From a994933ccbc957496522775a94aac3a83b19839f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Jun 2022 11:44:09 +0100 Subject: [PATCH 01/86] Nef_3: Fix conversion to a FaceGraph --- .../include/CGAL/Nef_3/SNC_const_decorator.h | 10 +++++ .../convert_nef_polyhedron_to_polygon_mesh.h | 20 +++++---- Nef_3/test/Nef_3/issue_6423.cpp | 44 +++++++++++++++++++ 3 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 Nef_3/test/Nef_3/issue_6423.cpp diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index a8b0123f3df..910ba280e2f 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -535,6 +535,16 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const } Halffacet_handle f = ec->twin()->facet(); if ( Done[f] ) continue; + Halffacet_handle tf = f->twin(); + if ((f->incident_volume() == tf->incident_volume()) && Done[tf]) { + continue; // for example when we have to do with the unbounded volume and a surface with boundaries + } + Volume_const_iterator unbounded = volumes_begin(); + Volume_const_iterator fit = f->incident_volume(); + Volume_const_iterator tfit = tf->incident_volume(); + if ((fit == unbounded) && (tfit != unbounded)) { + continue; // because we will later report it from the bounded side + } FacetCandidates.push_back(f); Done[f] = true; } } else if (fc.is_svertex() ) { diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index a5e5e619120..f2a880c8872 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -351,18 +351,22 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typedef Cartesian_converter Converter; typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), vol_end = nef.volumes_end(); - if ( Nef_polyhedron::Infi_box::extended_kernel() ) ++vol_it; // skip Infi_box + + if (Nef_polyhedron::Infi_box::extended_kernel()) { + ++vol_it; // skip Infi_box + } + CGAL_assertion ( vol_it != vol_end ); - ++vol_it; // skip unbounded volume Converter to_output; for (;vol_it!=vol_end;++vol_it) - nef_to_pm::collect_polygon_mesh_info(points, - polygons, - nef, - vol_it->shells_begin(), - to_output, - triangulate_all_faces); + for(auto sit = vol_it->shells_begin(); sit != vol_it->shells_end(); ++sit) + nef_to_pm::collect_polygon_mesh_info(points, + polygons, + nef, + sit, + to_output, + triangulate_all_faces); } template diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp new file mode 100644 index 00000000000..0ffad5bf0e1 --- /dev/null +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh SurfaceMesh; +typedef CGAL::Nef_polyhedron_3 NefPolyhedron; + + +int main(int argc, char* argv[]) +{ + SurfaceMesh surfaceMesh; + SurfaceMesh::Vertex_index v0 = surfaceMesh.add_vertex(Point_3(-1, 0, 0)); + SurfaceMesh::Vertex_index v1 = surfaceMesh.add_vertex(Point_3(1, 0, 0)); + SurfaceMesh::Vertex_index v2 = surfaceMesh.add_vertex(Point_3(0, 1, 0)); + + SurfaceMesh::Vertex_index v3 = surfaceMesh.add_vertex(Point_3(-1, 0, 1)); + SurfaceMesh::Vertex_index v4 = surfaceMesh.add_vertex(Point_3(1, 0, 1)); + SurfaceMesh::Vertex_index v5 = surfaceMesh.add_vertex(Point_3(0, 1, 1)); + + surfaceMesh.add_face(v0, v1, v2); + surfaceMesh.add_face(v3, v4, v5); + + make_tetrahedron(Point_3(-1, 0, 10), + Point_3(1, 0, 10), + Point_3(0, 1, 10), + Point_3(-1, 0, 11), + surfaceMesh); + + std::cout << "Before conversion, number_of_faces: " << surfaceMesh.number_of_faces() << std::endl; + + NefPolyhedron nefPoly(surfaceMesh); + std::cout << "NefPolyhedron, number_of_faces: " << nefPoly.number_of_facets() << std::endl; + std::cout << nefPoly << std::endl; + SurfaceMesh convertedSurfaceMesh; + CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); + std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; + std::cout << convertedSurfaceMesh << std::endl; + return EXIT_SUCCESS; +} From 07b04366a0e01015f0ccf2f9f49a43d4a7331dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Jul 2022 17:09:55 +0200 Subject: [PATCH 02/86] WIP --- Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h | 6 ------ .../graph/convert_nef_polyhedron_to_polygon_mesh.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 910ba280e2f..c2c622a181e 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -539,12 +539,6 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const if ((f->incident_volume() == tf->incident_volume()) && Done[tf]) { continue; // for example when we have to do with the unbounded volume and a surface with boundaries } - Volume_const_iterator unbounded = volumes_begin(); - Volume_const_iterator fit = f->incident_volume(); - Volume_const_iterator tfit = tf->incident_volume(); - if ((fit == unbounded) && (tfit != unbounded)) { - continue; // because we will later report it from the bounded side - } FacetCandidates.push_back(f); Done[f] = true; } } else if (fc.is_svertex() ) { diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index f2a880c8872..bb11c0daace 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -359,14 +359,28 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, CGAL_assertion ( vol_it != vol_end ); Converter to_output; + bool handling_unbounded_volume = true; + + auto shell_is_closed = [](typename Nef_polyhedron::SFace_const_handle sfh) + { + typename Nef_polyhedron::Halffacet_handle f = sfh; + return f->incident_volume()!=f->twin()->incident_volume(); + }; + for (;vol_it!=vol_end;++vol_it) + { for(auto sit = vol_it->shells_begin(); sit != vol_it->shells_end(); ++sit) + { + if ( (handling_unbounded_volume || sit!=vol_it->shells_begin()) && shell_is_closed(sit)) continue; nef_to_pm::collect_polygon_mesh_info(points, polygons, nef, sit, to_output, triangulate_all_faces); + } + handling_unbounded_volume = false; + } } template From 69c4af61a9a3aae06c00e79cada527659439f81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 09:21:10 +0200 Subject: [PATCH 03/86] fix types, still not valid --- .../CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index bb11c0daace..98fb89d7192 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -361,9 +361,9 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, Converter to_output; bool handling_unbounded_volume = true; - auto shell_is_closed = [](typename Nef_polyhedron::SFace_const_handle sfh) + auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_handle f = sfh; + typename Nef_polyhedron::Halffacet_const_handle f = sfh; return f->incident_volume()!=f->twin()->incident_volume(); }; From 744a9643722d2d8a17685b41b0bf6b29f1ca8e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 09:36:39 +0200 Subject: [PATCH 04/86] fix compilation errors --- .../boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 8 ++++++-- Nef_3/test/Nef_3/issue_6423.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index 98fb89d7192..c055798f877 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -363,8 +363,12 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_const_handle f = sfh; - return f->incident_volume()!=f->twin()->incident_volume(); + typename Nef_polyhedron::Halffacet_const_handle f; + + if (CGAL::assign(f,*sfh)) + return f->incident_volume()!=f->twin()->incident_volume(); + else + return false; }; for (;vol_it!=vol_end;++vol_it) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 0ffad5bf0e1..5eeb664f23b 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -11,7 +11,7 @@ typedef CGAL::Surface_mesh SurfaceMesh; typedef CGAL::Nef_polyhedron_3 NefPolyhedron; -int main(int argc, char* argv[]) +int main() { SurfaceMesh surfaceMesh; SurfaceMesh::Vertex_index v0 = surfaceMesh.add_vertex(Point_3(-1, 0, 0)); From 31868332680d0219bbe94500ea460f9bdbe1fef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 10:16:18 +0200 Subject: [PATCH 05/86] WIP working with simple soup example --- .../convert_nef_polyhedron_to_polygon_mesh.h | 80 +++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index c055798f877..218e7210866 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -363,12 +363,82 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_const_handle f; + typename Nef_polyhedron::SFace_const_handle sf = sfh; - if (CGAL::assign(f,*sfh)) - return f->incident_volume()!=f->twin()->incident_volume(); - else - return false; + typename Nef_polyhedron::SFace_cycle_const_iterator fc; + for(fc = sf->sface_cycles_begin(); fc != sf->sface_cycles_end(); ++fc) + { + if (fc.is_shalfedge() ) { + typename Nef_polyhedron::SHalfedge_const_handle e(fc); + typename Nef_polyhedron::SHalfedge_around_sface_const_circulator ec(e),ee(e); + CGAL_For_all(ec,ee) + { + typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); + //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { + //~ V.visit(vv); // report edge + //~ Done[vv] = Done[vv->twin()] = true; + //~ } + typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); + return f->incident_volume()!=f->twin()->incident_volume(); + //~ if ( Done[f] ) continue; + //~ Halffacet_handle tf = f->twin(); + //~ } + //~ FacetCandidates.push_back(f); Done[f] = true; + } + } + +#if 0 + else if (fc.is_svertex() ) { + SVertex_handle v(fc); + if ( Done[v] ) continue; + V.visit(v); // report edge + V.visit(v->twin()); + Done[v] = Done[v->twin()] = true; + CGAL_assertion(SD.is_isolated(v)); + SFaceCandidates.push_back(v->twin()->incident_sface()); + Done[v->twin()->incident_sface()]=true; + // note that v is isolated, thus twin(v) is isolated too + // SM_const_decorator SD; + // SFace_const_handle fo; + // fo = v->twin()->incident_sface(); + /* + if(SD.is_isolated(v)) + fo = v->source()->sfaces_begin(); + else + fo = v->twin()->incident_sface(); + */ + } else if (fc.is_shalfloop() ) { + SHalfloop_handle l(fc); + V.visit(l); + Halffacet_handle f = l->twin()->facet(); + if ( Done[f] ) continue; + FacetCandidates.push_back(f); Done[f] = true; + } else CGAL_error_msg("Damn wrong handle."); +#endif + } + + return false; + + //~ typename Nef_polyhedron::SHalfedge_const_handle e(sf); + //~ typename Nef_polyhedron::SHalffacet_const_handle f = e->facet(); + //~ e->facet() + //~ SHalfedge_around_sface_circulator ec(e),ee(e); + //~ CGAL_For_all(ec,ee) { + //~ SVertex_handle vv = ec->twin()->source(); + //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { + //~ V.visit(vv); // report edge + //~ Done[vv] = Done[vv->twin()] = true; + //~ } + //~ Halffacet_handle f = ec->twin()->facet(); + //~ if ( Done[f] ) continue; + + //~ if (CGAL::assign(f,*sfh)) + //~ { + //~ std::cout << "COUCOU\n"; + //~ return f->incident_volume()!=f->twin()->incident_volume(); + //~ } + //~ else + //~ return false; }; for (;vol_it!=vol_end;++vol_it) From 05c3fc9e94f8a57329b210c1c429602e0d1f1264 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 11 Jun 2024 10:00:36 +0200 Subject: [PATCH 06/86] update CMakeLists.txt for recent VTK --- Mesh_3/examples/Mesh_3/CMakeLists.txt | 28 ++++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 6daadba7591..380202d4dff 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -26,18 +26,14 @@ if(NOT TARGET CGAL::Eigen3_support) return() endif() -find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) +find_package(VTK + COMPONENTS ImagingGeneral IOImage + QUIET) if(VTK_FOUND) - if(VTK_USE_FILE) - include(${VTK_USE_FILE}) - endif() - if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) - message(STATUS "VTK found") - if(TARGET VTK::IOImage) - set(VTK_LIBRARIES VTK::ImagingGeneral VTK::IOImage) - endif() + if("${VTK_VERSION_MAJOR}" GREATER "8" OR VTK_VERSION VERSION_GREATER 8) + message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") else() - message(STATUS "VTK version 6.0 or greater is required") + message(STATUS "VTK version 9.0 or greater is required") endif() else() message(STATUS "VTK was not found") @@ -123,13 +119,13 @@ create_single_source_cgal_program("mesh_polyhedral_complex_sm.cpp") target_link_libraries(mesh_polyhedral_complex_sm PUBLIC CGAL::Eigen3_support) if(TARGET CGAL::CGAL_ImageIO) - if(VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION - VERSION_GREATER 5)) + if(VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "8" OR VTK_VERSION + VERSION_GREATER 8)) create_single_source_cgal_program("mesh_3D_gray_vtk_image.cpp") - target_link_libraries( - mesh_3D_gray_vtk_image - PUBLIC CGAL::Eigen3_support CGAL::CGAL CGAL::CGAL_ImageIO ${VTK_LIBRARIES}) - cgal_add_test(mesh_3D_gray_vtk_image) + target_link_libraries(mesh_3D_gray_vtk_image + PUBLIC CGAL::Eigen3_support + CGAL::CGAL_ImageIO + PRIVATE ${VTK_LIBRARIES}) add_to_cached_list(CGAL_EXECUTABLE_TARGETS mesh_3D_gray_vtk_image) endif() From f3b409a807e539155199b32eaefd488338e5457b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 11 Jun 2024 15:57:25 +0200 Subject: [PATCH 07/86] require VTK version 9.0 or later --- BGL/test/BGL/CMakeLists.txt | 29 ++++++------------- Installation/CMakeLists.txt | 2 +- Lab/demo/Lab/Plugins/IO/CMakeLists.txt | 33 ++++++---------------- Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt | 18 ++---------- Mesh_3/examples/Mesh_3/CMakeLists.txt | 11 ++------ 5 files changed, 25 insertions(+), 68 deletions(-) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 3b4304b5056..0d995ff281d 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -66,26 +66,15 @@ else() message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() -find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources) -if (VTK_FOUND) - if(VTK_USE_FILE) - include(${VTK_USE_FILE}) - endif() - - if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) - if(TARGET VTK::CommonCore) - set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::FiltersCore VTK::FiltersSources) - endif() - - if(VTK_LIBRARIES) - target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX) - target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX) - else() - message(STATUS "Tests that use VTK will not be compiled.") - endif() - endif() +find_package(VTK 9.0 QUIET COMPONENTS CommonCore IOCore IOLegacy IOXML FiltersCore FiltersSources) +if (VTK_FOUND AND VTK_LIBRARIES) + message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") + target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES}) + target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX) + target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES}) + target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX) +else() + message(STATUS "Tests that use VTK will not be compiled.") endif() #VTK_FOUND find_path(3MF_INCLUDE_DIR diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 98d27538371..a44e7fb4cb5 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -934,7 +934,7 @@ if(CGAL_BRANCH_BUILD) find_package(Doxygen REQUIRED) find_package(Eigen3 REQUIRED) find_package(Qt6 COMPONENTS Core Widgets OpenGL Gui REQUIRED) - find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) + find_package(VTK COMPONENTS ImagingGeneral IOImage NO_MODULE) if(VTK_FOUND) get_target_property(VTK_INCLUDE_DIRS VTK::IOImage INTERFACE_INCLUDE_DIRECTORIES) endif() diff --git a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt index c6247c39212..6ed225c0490 100644 --- a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt @@ -43,38 +43,23 @@ target_link_libraries(surf_io_plugin PUBLIC scene_surface_mesh_item) cgal_lab_plugin(lcc_io_plugin lcc_io_plugin KEYWORDS Viewer) target_link_libraries(lcc_io_plugin PUBLIC scene_lcc_item) -find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML - vtkFiltersCore vtkFiltersSources) +find_package(VTK 9.0 QUIET COMPONENTS CommonCore IOCore IOLegacy IOXML FiltersCore FiltersSources) set_package_properties( VTK PROPERTIES DESCRIPTION "A library for image processing." - PURPOSE "Can be used for I/O (DICOM, VTU, VTP.") + PURPOSE "Can be used for I/O (DICOM, VTU, VTP).") cgal_lab_plugin(triangulation_3_io_plugin triangulation_3_io_plugin KEYWORDS Viewer) target_link_libraries(triangulation_3_io_plugin PUBLIC scene_triangulation_3_item) -if(VTK_FOUND) - if(VTK_USE_FILE) - include(${VTK_USE_FILE}) - endif() - if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) - if(TARGET VTK::CommonCore) - set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML - VTK::FiltersCore VTK::FiltersSources) - endif() - if(VTK_LIBRARIES) - cgal_lab_plugin(vtk_plugin VTK_io_plugin KEYWORDS Viewer Mesh_3) - target_link_libraries(vtk_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item scene_points_with_normal_item - ${VTK_LIBRARIES}) - target_compile_definitions(vtk_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) - else() - message(STATUS "NOTICE: the vtk IO plugin needs VTK libraries and will not be compiled.") - endif() - else() - message(STATUS "NOTICE: the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found).") - endif() +if(VTK_FOUND AND VTK_LIBRARIES) + message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") + cgal_lab_plugin(vtk_plugin VTK_io_plugin KEYWORDS Viewer Mesh_3) + target_link_libraries(vtk_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item scene_points_with_normal_item + ${VTK_LIBRARIES}) + target_compile_definitions(vtk_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) else() - message(STATUS "NOTICE: the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.") + message(STATUS "NOTICE: the vtk IO plugin needs VTK 9.0 or greater and will not be compiled.") endif() cgal_lab_plugin(xyz_plugin XYZ_io_plugin KEYWORDS Viewer PointSetProcessing Classification) target_link_libraries(xyz_plugin PUBLIC scene_points_with_normal_item) diff --git a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt index 1f681a39e2c..2234d34db36 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt @@ -37,21 +37,9 @@ if(ITK_FOUND) target_link_libraries(mesh_3_plugin PUBLIC CGAL::ITK_support) endif(ITK_FOUND) -find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage vtkIOXML NO_MODULE) -if(VTK_FOUND) - if(VTK_USE_FILE) - include(${VTK_USE_FILE}) - endif() - if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) - if(TARGET VTK::IOImage) - set(VTK_LIBRARIES VTK::IOImage VTK::ImagingGeneral VTK::IOXML) - endif() - if(NOT VTK_LIBRARIES) - message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") - endif() - else() - message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") - endif() +find_package(VTK 9.0 QUIET COMPONENTS ImagingGeneral IOImage IOXML NO_MODULE) +if(VTK_FOUND AND VTK_LIBRARIES) + message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") else() message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") endif() diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 380202d4dff..88aceb7c068 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -26,15 +26,11 @@ if(NOT TARGET CGAL::Eigen3_support) return() endif() -find_package(VTK +find_package(VTK 9.0 COMPONENTS ImagingGeneral IOImage QUIET) if(VTK_FOUND) - if("${VTK_VERSION_MAJOR}" GREATER "8" OR VTK_VERSION VERSION_GREATER 8) - message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") - else() - message(STATUS "VTK version 9.0 or greater is required") - endif() + message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") else() message(STATUS "VTK was not found") endif() @@ -119,8 +115,7 @@ create_single_source_cgal_program("mesh_polyhedral_complex_sm.cpp") target_link_libraries(mesh_polyhedral_complex_sm PUBLIC CGAL::Eigen3_support) if(TARGET CGAL::CGAL_ImageIO) - if(VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "8" OR VTK_VERSION - VERSION_GREATER 8)) + if(VTK_FOUND) create_single_source_cgal_program("mesh_3D_gray_vtk_image.cpp") target_link_libraries(mesh_3D_gray_vtk_image PUBLIC CGAL::Eigen3_support From 22732a9ae3078b3c6c21353032010d90bf141910 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 27 Jun 2024 10:55:33 +0200 Subject: [PATCH 08/86] using proper triangulated polygonal faces for linear_least_squares --- .../Least_squares_plane_fit_region.h | 58 +++++++++------- .../Region_growing/internal/utils.h | 68 +++++++++++++++++-- 2 files changed, 94 insertions(+), 32 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index 74fa797fee4..4ad50866291 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -19,6 +19,7 @@ // Internal includes. #include #include +#include namespace CGAL { namespace Shape_detection { @@ -83,12 +84,16 @@ namespace Polygon_mesh { using Point_3 = typename GeomTraits::Point_3; using Vector_3 = typename GeomTraits::Vector_3; using Plane_3 = typename GeomTraits::Plane_3; + using Triangle_3 = typename GeomTraits::Triangle_3; using Squared_length_3 = typename GeomTraits::Compute_squared_length_3; using Squared_distance_3 = typename GeomTraits::Compute_squared_distance_3; using Scalar_product_3 = typename GeomTraits::Compute_scalar_product_3; using Cross_product_3 = typename GeomTraits::Construct_cross_product_vector_3; + std::unordered_map > m_face_normals; + std::unordered_map, internal::hash_item > m_face_triangulations; + public: /// \name Initialization /// @{ @@ -158,6 +163,28 @@ namespace Polygon_mesh { m_scalar_product_3(m_traits.compute_scalar_product_3_object()), m_cross_product_3(m_traits.construct_cross_product_vector_3_object()) { + for (const Item &i : faces(pmesh)) { + m_face_normals[i] = Polygon_mesh_processing::compute_face_normal(i, pmesh); + std::vector pts; + auto h = halfedge(i, pmesh); + auto s = h; + + do { + pts.push_back(get(m_vertex_to_point_map, target(h, pmesh))); + h = next(h, pmesh); + } while (h != s); + + std::vector> output; + + Polygon_mesh_processing::triangulate_hole_polyline(pts, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); + + std::vector& tris = m_face_triangulations[i]; + tris.reserve(output.size()); + assert(!output.empty()); + for (const auto& t : output) + tris.push_back(Triangle_3(pts[t.first], pts[t.second], pts[t.third])); + } + CGAL_precondition(faces(m_face_graph).size() > 0); const FT max_distance = parameters::choose_parameter( parameters::get_parameter(np, internal_np::maximum_distance), FT(1)); @@ -234,7 +261,7 @@ namespace Polygon_mesh { const FT squared_distance_threshold = m_distance_threshold * m_distance_threshold; - const Vector_3 face_normal = get_face_normal(query); + const Vector_3 face_normal = m_face_normals.at(query); const FT cos_value = m_scalar_product_3(face_normal, m_normal_of_best_fit); const FT squared_cos_value = cos_value * cos_value; @@ -284,7 +311,7 @@ namespace Polygon_mesh { // The best fit plane will be a plane through this face centroid with // its normal being the face's normal. const Point_3 face_centroid = get_face_centroid(face); - const Vector_3 face_normal = get_face_normal(face); + const Vector_3 face_normal = m_face_normals.at(face); if (face_normal == CGAL::NULL_VECTOR) return false; CGAL_precondition(face_normal != CGAL::NULL_VECTOR); @@ -308,15 +335,15 @@ namespace Polygon_mesh { // The best fit plane will be a plane fitted to all vertices of all // region faces with its normal being perpendicular to the plane. // Given that the points, and no normals, are used in estimating - // the plane, the estimated normal will point into an arbitray + // the plane, the estimated normal will point into an arbitrary // one of the two possible directions. // We flip it into the correct direction (the one that the majority // of faces agree with) below. // This fix is proposed by nh2: // https://github.com/CGAL/cgal/pull/4563 const Plane_3 unoriented_plane_of_best_fit = - internal::create_plane_from_faces( - m_face_graph, region, m_vertex_to_point_map, m_traits).first; + internal::create_plane_from_triangulated_faces( + m_face_graph, region, m_face_triangulations, m_traits).first; const Vector_3 unoriented_normal_of_best_fit = unoriented_plane_of_best_fit.orthogonal_vector(); @@ -325,7 +352,7 @@ namespace Polygon_mesh { // Approach: each face gets one vote to keep or flip the current plane normal. long votes_to_keep_normal = 0; for (const auto &face : region) { - const Vector_3 face_normal = get_face_normal(face); + const Vector_3 face_normal = m_face_normals.at(face); const bool agrees = m_scalar_product_3(face_normal, unoriented_normal_of_best_fit) > FT(0); votes_to_keep_normal += (agrees ? 1 : -1); @@ -383,25 +410,6 @@ namespace Polygon_mesh { return Point_3(x, y, z); } - // Compute normal of the face. - template - Vector_3 get_face_normal(const Face& face) const { - - const auto hedge = halfedge(face, m_face_graph); - const auto vertices = vertices_around_face(hedge, m_face_graph); - CGAL_precondition(vertices.size() >= 3); - - auto vertex = vertices.begin(); - const Point_3& point1 = get(m_vertex_to_point_map, *vertex); ++vertex; - const Point_3& point2 = get(m_vertex_to_point_map, *vertex); ++vertex; - const Point_3& point3 = get(m_vertex_to_point_map, *vertex); - - const Vector_3 u = point2 - point1; - const Vector_3 v = point3 - point1; - const Vector_3 face_normal = m_cross_product_3(u, v); - return face_normal; - } - // The maximum squared distance from the vertices of the face // to the best fit plane. template diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index b539bf56e5c..17d927e544f 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -46,6 +46,7 @@ #include #include #include +#include namespace CGAL { namespace Shape_detection { @@ -61,7 +62,7 @@ namespace internal { mutable T it; }; - // TODO: this should be customisable in named function parameters + // TODO: this should be customizable in named function parameters template::value> struct hash_item {}; @@ -370,12 +371,13 @@ namespace internal { triangles.push_back(ITriangle_3(points[0], points[1], points[2])); else { - //use a triangulation using the centroid - std::size_t nb_edges = points.size(); - IPoint_3 c = CGAL::centroid(points.begin(), points.end()); - points.push_back(points.front()); - for (std::size_t i=0; i> output; + + Polygon_mesh_processing::triangulate_hole_polyline(points, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); + + assert(!output.empty()); + for (const auto& t : output) + triangles.push_back(ITriangle_3(points[t.first], points[t.second], points[t.third])); } } CGAL_precondition(triangles.size() >= region.size()); @@ -395,6 +397,58 @@ namespace internal { return std::make_pair(plane, static_cast(score)); } + template< + typename Traits, + typename FaceGraph, + typename Region, + typename FaceToTrianglesMap> + std::pair + create_plane_from_triangulated_faces( + const FaceGraph& face_graph, + const Region& region, + const FaceToTrianglesMap &face_to_triangles_map, const Traits&) { + + using FT = typename Traits::FT; + using Plane_3 = typename Traits::Plane_3; + using Triangle_3 = typename Traits::Triangle_3; + + using ITraits = CGAL::Exact_predicates_inexact_constructions_kernel; + using IConverter = CGAL::Cartesian_converter; + + using IFT = typename ITraits::FT; + using IPoint_3 = typename ITraits::Point_3; + using ITriangle_3 = typename ITraits::Triangle_3; + using IPlane_3 = typename ITraits::Plane_3; + + std::vector triangles; + CGAL_precondition(region.size() > 0); + triangles.reserve(region.size()); + const IConverter iconverter = IConverter(); + + for (const typename Region::value_type face : region) { + const std::vector& tris = face_to_triangles_map.at(face); + CGAL_precondition(tris.size() > 0); + + for (const auto tri : tris) + triangles.push_back(iconverter(tri)); + } + CGAL_precondition(triangles.size() >= region.size()); + IPlane_3 fitted_plane; + IPoint_3 fitted_centroid; + const IFT score = CGAL::linear_least_squares_fitting_3( + triangles.begin(), triangles.end(), + fitted_plane, fitted_centroid, + CGAL::Dimension_tag<2>(), ITraits(), + CGAL::Eigen_diagonalize_traits()); + + const Plane_3 plane( + static_cast(fitted_plane.a()), + static_cast(fitted_plane.b()), + static_cast(fitted_plane.c()), + static_cast(fitted_plane.d())); + return std::make_pair(plane, static_cast(score)); + } + template< typename Traits, typename Region, From 05ba6a264449bfaf4348c8db114611dc996ae78b Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 3 Jul 2024 10:12:07 +0200 Subject: [PATCH 09/86] fixed warnings handling of degenerate faces --- .../Polygon_mesh/Least_squares_plane_fit_region.h | 9 +++++++-- .../Shape_detection/Region_growing/internal/utils.h | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index 4ad50866291..60144403114 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -178,9 +178,14 @@ namespace Polygon_mesh { Polygon_mesh_processing::triangulate_hole_polyline(pts, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); + // Create entry in map. In case of degenerate polygonal faces, the list stays empty. std::vector& tris = m_face_triangulations[i]; + + // If the output is empty, the polygon is degenerate. + if (output.empty()) + continue; + tris.reserve(output.size()); - assert(!output.empty()); for (const auto& t : output) tris.push_back(Triangle_3(pts[t.first], pts[t.second], pts[t.third])); } @@ -343,7 +348,7 @@ namespace Polygon_mesh { // https://github.com/CGAL/cgal/pull/4563 const Plane_3 unoriented_plane_of_best_fit = internal::create_plane_from_triangulated_faces( - m_face_graph, region, m_face_triangulations, m_traits).first; + region, m_face_triangulations, m_traits).first; const Vector_3 unoriented_normal_of_best_fit = unoriented_plane_of_best_fit.orthogonal_vector(); diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index 17d927e544f..328c49031b2 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -399,12 +399,10 @@ namespace internal { template< typename Traits, - typename FaceGraph, typename Region, typename FaceToTrianglesMap> std::pair create_plane_from_triangulated_faces( - const FaceGraph& face_graph, const Region& region, const FaceToTrianglesMap &face_to_triangles_map, const Traits&) { @@ -427,12 +425,15 @@ namespace internal { for (const typename Region::value_type face : region) { const std::vector& tris = face_to_triangles_map.at(face); - CGAL_precondition(tris.size() > 0); - for (const auto tri : tris) + // Degenerate polygons are omitted. + if (tris.empty()) + continue; + + for (const auto &tri : tris) triangles.push_back(iconverter(tri)); } - CGAL_precondition(triangles.size() >= region.size()); + CGAL_precondition(!triangles.empty()); IPlane_3 fitted_plane; IPoint_3 fitted_centroid; const IFT score = CGAL::linear_least_squares_fitting_3( From d45c4a2b2e95d8295f6284c71ff8560642854cd4 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 3 Jul 2024 14:00:50 +0200 Subject: [PATCH 10/86] update FindOpenMesh.cmake --- Installation/cmake/modules/FindOpenMesh.cmake | 89 +++++++++++-------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/Installation/cmake/modules/FindOpenMesh.cmake b/Installation/cmake/modules/FindOpenMesh.cmake index 86b6eaebc9e..df51ed716ce 100644 --- a/Installation/cmake/modules/FindOpenMesh.cmake +++ b/Installation/cmake/modules/FindOpenMesh.cmake @@ -17,63 +17,82 @@ if (NOT OpenMesh_FOUND) ENV OPENMESH_DIR /usr/include /usr/local/include - PATH_SUFFIXES src + PATH_SUFFIXES src include DOC "The directory containing the OpenMesh header files WITHOUT the OpenMesh prefix" ) - find_library(OPENMESH_LIBRARY_RELEASE NAMES "OpenMeshCore" + find_library(OPENMESH_CORE_LIBRARY_RELEASE NAMES "OpenMeshCore" HINTS ENV OPENMESH_LIB_DIR ENV OPENMESH_DIR PATH_SUFFIXES lib DOC "Path to the OpenMeshCore library" ) - find_library(OPENMESH_LIBRARY_DEBUG NAMES "OpenMeshCored" + find_library(OPENMESH_CORE_LIBRARY_DEBUG NAMES "OpenMeshCored" HINTS ENV OPENMESH_LIB_DIR ENV OPENMESH_DIR PATH_SUFFIXES lib DOC "Path to the OpenMeshCored library" ) - if(OPENMESH_LIBRARY_RELEASE) - if(OPENMESH_LIBRARY_DEBUG) - set(OPENMESH_LIBRARIES optimized ${OPENMESH_LIBRARY_RELEASE} debug ${OPENMESH_LIBRARY_DEBUG}) - else() - set(OPENMESH_LIBRARIES ${OPENMESH_LIBRARY_RELEASE}) - endif() - endif() -endif() + find_library(OPENMESH_TOOLS_LIBRARY_RELEASE NAMES "OpenMeshTools" + HINTS ENV OPENMESH_LIB_DIR + ENV OPENMESH_DIR + PATH_SUFFIXES lib + DOC "Path to the OpenMeshTools library" + ) -include( FindPackageHandleStandardArgs ) + find_library(OPENMESH_TOOLS_LIBRARY_DEBUG NAMES "OpenMeshToolsd" + HINTS ENV OPENMESH_LIB_DIR + ENV OPENMESH_DIR + PATH_SUFFIXES lib + DOC "Path to the OpenMeshToolsd library" + ) -find_package_handle_standard_args(OpenMesh - REQUIRED_VARS OPENMESH_INCLUDE_DIR OPENMESH_LIBRARIES - FOUND_VAR OpenMesh_FOUND + #select configuration depending on platform (optimized... on windows) + include(SelectLibraryConfigurations) + select_library_configurations( OPENMESH_TOOLS ) + select_library_configurations( OPENMESH_CORE ) + + set(OPENMESH_LIBRARIES ${OPENMESH_CORE_LIBRARY} ${OPENMESH_TOOLS_LIBRARY} ) + set(OPENMESH_INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR} ) + + include( FindPackageHandleStandardArgs ) + find_package_handle_standard_args(OpenMesh + REQUIRED_VARS OPENMESH_INCLUDE_DIRS OPENMESH_LIBRARIES + FOUND_VAR OpenMesh_FOUND ) -if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh) - add_library(OpenMesh::OpenMesh UNKNOWN IMPORTED) + #target OpenMesh::OpenMesh + if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh) + add_library(OpenMesh::OpenMesh UNKNOWN IMPORTED) - if(TARGET OpenMeshCore) - target_link_libraries(OpenMesh::OpenMesh INTERFACE OpenMeshCore) - return() - endif() + if(TARGET OpenMeshCore) + target_link_libraries(OpenMesh::OpenMesh INTERFACE OpenMeshCore) + return() + endif() - set_target_properties(OpenMesh::OpenMesh PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" - INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIR}") - - if(OPENMESH_LIBRARY_RELEASE) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenMesh::OpenMesh PROPERTIES - IMPORTED_LOCATION_RELEASE "${OPENMESH_LIBRARY_RELEASE}") + INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" + INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIRS}") + + if(OPENMESH_CORE_LIBRARY_RELEASE) + set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenMesh::OpenMesh PROPERTIES + IMPORTED_LOCATION_RELEASE "${OPENMESH_CORE_LIBRARY_RELEASE}") + endif() + + if(OPENMESH_CORE_LIBRARY_DEBUG) + set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(OpenMesh::OpenMesh PROPERTIES + IMPORTED_LOCATION_DEBUG "${OPENMESH_CORE_LIBRARY_DEBUG}") + endif() endif() - if(OPENMESH_LIBRARY_DEBUG) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(OpenMesh::OpenMesh PROPERTIES - IMPORTED_LOCATION_DEBUG "${OPENMESH_LIBRARY_DEBUG}") - endif() endif() + +if(OpenMesh_FOUND) + message(STATUS "OpenMesh found") +endif() \ No newline at end of file From fa1f230364766baf05982221f1dcef4acb9d42fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 05:43:55 +0000 Subject: [PATCH 11/86] Bump fsfe/reuse-action from 3 to 4 Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 3 to 4. - [Release notes](https://github.com/fsfe/reuse-action/releases) - [Commits](https://github.com/fsfe/reuse-action/compare/v3...v4) --- updated-dependencies: - dependency-name: fsfe/reuse-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reuse.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index f76a99b18dd..e312e8a88ad 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -12,15 +12,15 @@ jobs: steps: - uses: actions/checkout@v4 - name: REUSE version - uses: fsfe/reuse-action@v3 + uses: fsfe/reuse-action@v4 with: args: --version - name: REUSE lint - uses: fsfe/reuse-action@v3 + uses: fsfe/reuse-action@v4 with: args: --include-submodules lint - name: REUSE SPDX SBOM - uses: fsfe/reuse-action@v3 + uses: fsfe/reuse-action@v4 with: args: spdx - name: install dependencies @@ -30,6 +30,6 @@ jobs: mkdir -p ./release cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake - name: REUSE lint release tarball - uses: fsfe/reuse-action@v3 + uses: fsfe/reuse-action@v4 with: args: --root ./release/CGAL-9.9 --include-submodules lint From 0babd3148ae833c6aae07b33059329994c87cfb4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jul 2024 17:20:02 +0200 Subject: [PATCH 12/86] update to REUSE tools v4 --- .reuse/dep5 | 12 ------------ Installation/.reuse/dep5 | 12 ------------ Installation/REUSE.toml | 16 ++++++++++++++++ REUSE.toml | 16 ++++++++++++++++ 4 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 .reuse/dep5 delete mode 100644 Installation/.reuse/dep5 create mode 100644 Installation/REUSE.toml create mode 100644 REUSE.toml diff --git a/.reuse/dep5 b/.reuse/dep5 deleted file mode 100644 index 06784d71d6b..00000000000 --- a/.reuse/dep5 +++ /dev/null @@ -1,12 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: CGAL -Upstream-Contact: CGAL Editorial Board -Source: https://github.com/CGAL/cgal - -Files: .* *.cmake *.md .github/* Maintenance/* */TODO */doc/* */deb/* */applications/* */doc_html/* */scripts/* */developer_scripts/* */demo/* */examples/* */src/* */test/* */benchmarks/* */benchmark/* */package_info/* */data/* */cmake/* -Copyright: 1995-2023 The CGAL Project -License: CC0-1.0 - -Files: CMakeLists.txt GraphicsView/include/CGAL/Qt/ImageInterface.ui GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm Installation/AUTHORS Installation/CMakeLists.txt Installation/README Installation/auxiliary/cgal_create_cmake_script.1 Installation/auxiliary/gmp/README Installation/include/CGAL/license/gpl_package_list.txt MacOSX/auxiliary/cgal_app.icns copyright -Copyright: 1995-2023 The CGAL Project -License: CC0-1.0 diff --git a/Installation/.reuse/dep5 b/Installation/.reuse/dep5 deleted file mode 100644 index ef2e017a397..00000000000 --- a/Installation/.reuse/dep5 +++ /dev/null @@ -1,12 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: CGAL -Upstream-Contact: CGAL Editorial Board -Source: https://github.com/CGAL/cgal - -Files: *.cmake *.md doc/* doc_html/* scripts/* developer_scripts/* package_info/* demo/* examples/* src/* test/* benchmarks/* benchmark/* data/* cmake/* -Copyright: 1995-2023 The CGAL Project -License: CC0-1.0 - -Files: include/CGAL/Qt/ImageInterface.ui include/CGAL/Qt/resources/qglviewer-icon.xpm AUTHORS CMakeLists.txt README auxiliary/cgal_create_cmake_script.1 auxiliary/gmp/README include/CGAL/license/gpl_package_list.txt auxiliary/cgal_app.icns copyright VERSION -Copyright: 1995-2023 The CGAL Project -License: CC0-1.0 diff --git a/Installation/REUSE.toml b/Installation/REUSE.toml new file mode 100644 index 00000000000..f004d1d2054 --- /dev/null +++ b/Installation/REUSE.toml @@ -0,0 +1,16 @@ +version = 1 +SPDX-PackageName = "CGAL" +SPDX-PackageSupplier = "CGAL Editorial Board " +SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" + +[[annotations]] +path = ["**.cmake", "**.md", "doc/**", "doc_html/**", "scripts/**", "developer_scripts/**", "package_info/**", "demo/**", "examples/**", "src/**", "test/**", "benchmarks/**", "benchmark/**", "data/**", "cmake/**"] +precedence = "aggregate" +SPDX-FileCopyrightText = "1995-2024 The CGAL Project" +SPDX-License-Identifier = "CC0-1.0" + +[[annotations]] +path = ["REUSE.toml", "include/CGAL/Qt/ImageInterface.ui", "include/CGAL/Qt/resources/qglviewer-icon.xpm", "AUTHORS", "CMakeLists.txt", "README", "auxiliary/cgal_create_cmake_script.1", "auxiliary/gmp/README", "include/CGAL/license/gpl_package_list.txt", "auxiliary/cgal_app.icns", "copyright", "VERSION"] +precedence = "aggregate" +SPDX-FileCopyrightText = "1995-2024 The CGAL Project" +SPDX-License-Identifier = "CC0-1.0" diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 00000000000..a36f899b03c --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,16 @@ +version = 1 +SPDX-PackageName = "CGAL" +SPDX-PackageSupplier = "CGAL Editorial Board " +SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" + +[[annotations]] +path = [".**", "**.cmake", "**.md", ".github/**", "Maintenance/**", "**/TODO", "**/doc/**", "**/deb/**", "**/applications/**", "**/doc_html/**", "**/scripts/**", "**/developer_scripts/**", "**/demo/**", "**/examples/**", "**/src/**", "**/test/**", "**/benchmarks/**", "**/benchmark/**", "**/package_info/**", "**/data/**", "**/cmake/**"] +precedence = "aggregate" +SPDX-FileCopyrightText = "1995-2024 The CGAL Project" +SPDX-License-Identifier = "CC0-1.0" + +[[annotations]] +path = ["REUSE.toml", "CMakeLists.txt", "cmake_uninstall.cmake.in", "GraphicsView/include/CGAL/Qt/ImageInterface.ui", "GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm", "Installation/AUTHORS", "Installation/CMakeLists.txt", "Installation/README", "Installation/auxiliary/cgal_create_cmake_script.1", "Installation/auxiliary/gmp/README", "Installation/include/CGAL/license/gpl_package_list.txt", "MacOSX/auxiliary/cgal_app.icns", "copyright"] +precedence = "aggregate" +SPDX-FileCopyrightText = "1995-2024 The CGAL Project" +SPDX-License-Identifier = "CC0-1.0" From a965b13bfe4a4790b11e6bbbfa762a683924683d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jul 2024 17:26:57 +0200 Subject: [PATCH 13/86] fix CI --- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 1 + Installation/REUSE.toml | 2 +- Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h | 2 +- Scripts/developer_scripts/test_merge_of_branch | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 7387b1f4874..92dd476a5a2 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -84,6 +84,7 @@ See the project main page for details on the project and installation steps. */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::defaultConstructor() { + return; setFocusPolicy(::Qt::StrongFocus); CGAL::QGLViewer::QGLViewerPool().append(this); diff --git a/Installation/REUSE.toml b/Installation/REUSE.toml index f004d1d2054..4ceda7b2279 100644 --- a/Installation/REUSE.toml +++ b/Installation/REUSE.toml @@ -10,7 +10,7 @@ SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" [[annotations]] -path = ["REUSE.toml", "include/CGAL/Qt/ImageInterface.ui", "include/CGAL/Qt/resources/qglviewer-icon.xpm", "AUTHORS", "CMakeLists.txt", "README", "auxiliary/cgal_create_cmake_script.1", "auxiliary/gmp/README", "include/CGAL/license/gpl_package_list.txt", "auxiliary/cgal_app.icns", "copyright", "VERSION"] +path = ["REUSE.toml", "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in", "include/CGAL/Qt/ImageInterface.ui", "include/CGAL/Qt/resources/qglviewer-icon.xpm", "AUTHORS", "CMakeLists.txt", "README", "auxiliary/cgal_create_cmake_script.1", "auxiliary/gmp/README", "include/CGAL/license/gpl_package_list.txt", "auxiliary/cgal_app.icns", "copyright", "VERSION"] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" 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 9034d419963..a6951a9275a 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -313,7 +313,7 @@ template Date: Thu, 11 Jul 2024 18:07:00 +0200 Subject: [PATCH 14/86] oops! remove bad changes --- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 1 - Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h | 2 +- Scripts/developer_scripts/test_merge_of_branch | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 92dd476a5a2..7387b1f4874 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -84,7 +84,6 @@ See the project main page for details on the project and installation steps. */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::defaultConstructor() { - return; setFocusPolicy(::Qt::StrongFocus); CGAL::QGLViewer::QGLViewerPool().append(this); 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 a6951a9275a..9034d419963 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -313,7 +313,7 @@ template Date: Thu, 25 Jul 2024 12:18:39 +0200 Subject: [PATCH 15/86] this assertion is invalid it would break for example when the function takes a far vertex, inserted by parallel version of Mesh_3 --- .../include/CGAL/Adaptive_remeshing_sizing_field.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Adaptive_remeshing_sizing_field.h b/Tetrahedral_remeshing/include/CGAL/Adaptive_remeshing_sizing_field.h index c651f9b2619..62f97115f82 100644 --- a/Tetrahedral_remeshing/include/CGAL/Adaptive_remeshing_sizing_field.h +++ b/Tetrahedral_remeshing/include/CGAL/Adaptive_remeshing_sizing_field.h @@ -497,7 +497,6 @@ average_edge_length_around(const Vertex_handle v, const Tr& tr, break; } - CGAL_assertion(!edges.empty()); if (edges.empty()) return 0; From ff89ba08adfb37604df0f9cebbe52f9875d8c37b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 6 Aug 2024 08:06:41 +0100 Subject: [PATCH 16/86] Deal with duplicate lines --- .../include/CGAL/Periodic_3_regular_triangulation_3.h | 2 +- .../include/CGAL/Triangulation_2/insert_constraints.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index 63fb9404469..4dba83f3847 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -931,7 +931,7 @@ public: CGAL_assertion(this->int_to_off(offsets[i])[0] == 0 || this->int_to_off(offsets[i])[0] == 1); CGAL_assertion(this->int_to_off(offsets[i])[1] == 0 || this->int_to_off(offsets[i])[1] == 1); - CGAL_assertion(this->int_to_off(offsets[i])[1] == 0 || this->int_to_off(offsets[i])[1] == 1); + CGAL_assertion(this->int_to_off(offsets[i])[2] == 0 || this->int_to_off(offsets[i])[2] == 1); } c->set_offsets(offsets[0], offsets[1], offsets[2], offsets[3]); diff --git a/Triangulation_2/include/CGAL/Triangulation_2/insert_constraints.h b/Triangulation_2/include/CGAL/Triangulation_2/insert_constraints.h index dc08e642db7..9fbd223ac25 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/insert_constraints.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/insert_constraints.h @@ -84,7 +84,6 @@ namespace CGAL { ConstraintIterator first, ConstraintIterator beyond) { - typedef typename T::Point Point; typedef typename T::Point Point; std::vector points; for (ConstraintIterator s_it=first; s_it!=beyond; ++s_it) From 37eb0eaa173499227e109cb1cf46cdb08d0dd273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 6 Aug 2024 10:33:14 +0200 Subject: [PATCH 17/86] Tentative fix for L3R3 do_intersect --- .../Intersections_3/internal/Line_3_Ray_3_do_intersect.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h index e6e125107f0..4659dda8c45 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h @@ -38,11 +38,8 @@ do_intersect(const typename K::Line_3& l, if(p0p1s == COLLINEAR) return true; - CGAL::Orientation stp0 = pred(r.source(), r.second_point(), l.point(0)); - if(stp0 == COLLINEAR) - return Ray_3_has_on_collinear_Point_3(r,l.point(0),k); - - return (p0p1s != stp0); + typename K::Point_3 lst = l.point(0) + (r.point(1) - r.point(0)); + return (pred(l.point(0), l.point(1), r.point(0), lst) != CGAL::POSITIVE); } template From c1e5926e707bebe5e17da489ba2e9f757ddee57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 6 Aug 2024 10:26:10 +0200 Subject: [PATCH 18/86] Add new Intersection_3 test cases --- .../Intersections_3/test_intersections_Line_3.cpp | 4 ++++ .../Intersections_3/test_intersections_Ray_3.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp index 6fe55a40654..936e077e018 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp @@ -232,6 +232,10 @@ public: check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(3,0,1),p(6,0,1))); check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(0,2,0),p(0,4,0))); check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(6,2,0),p(5,4,0))); + check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(1,0,0))); + check_no_intersection(L(p(0,-10,0),p(0,-9,0)), R(p(1,-1,0),p(2,0,0))); + check_no_intersection(L(p(0,-10,0),p(0,0,0)), R(p(1,-1,0),p(2,0,0))); + check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(2,0,0))); // Point intersection check_intersection (L(p(0,0,0),p(1,0,0)), R(p(3,0,0),p(6,4,0)), diff --git a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp index e1d603d4a5e..777c514bd49 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp @@ -74,6 +74,14 @@ public: check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,1,0), p(0,2,0))); check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(-1,0,0), p(-1,-1,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,0,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-1,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-2,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(0,-1,0), p(1,-1,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-1,-3,0),p(2,0,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-2,-4,0),p(-1,-3,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(1,-1,0), p(2,0,0))); + // Point check_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,0,0), p(-1,0,0)), p(0,0,0)); @@ -88,6 +96,10 @@ public: check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)), p(1,0,0)); + check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)), + p(1,0,0)); + + // Segment check_intersection (R(p(0,0,0), p(1,0,0)), R(p(2,0,0), p(-3,0,0)), S(p(0,0,0), p(2,0,0)), false); From bf10f945a96208e487c438eb742bb476239d60fa Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Wed, 7 Aug 2024 10:00:59 +0200 Subject: [PATCH 19/86] Remove deprecated Qt version checks and unused code --- .../CurveInputMethods.cpp | 13 ---------- GraphicsView/include/CGAL/Qt/qglviewer.h | 9 ------- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 24 ------------------- Lab/demo/Lab/CGAL_Lab.cpp | 5 ---- Lab/demo/Lab/MainWindow.cpp | 9 ------- 5 files changed, 60 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp index 91a64dad22e..82e7958b2ab 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp @@ -109,15 +109,6 @@ void CurveInputMethod::beginInput_() for (auto& item : items) this->getScene()->addItem(item); } -static inline void clearPainterPath(QPainterPath& ppath) -{ -#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) - ppath.clear(); -#else - ppath = {}; -#endif -} - void CurveInputMethod::reset() { this->resetInput(); @@ -193,7 +184,6 @@ PolylineInputMethod::PolylineInputMethod() : void PolylineInputMethod::beginInput() { - clearPainterPath(this->painterPath); this->polylineGuide.setPath(this->painterPath); this->lastLine.setLine(0, 0, 0, 0); QPen pen = this->polylineGuide.pen(); @@ -356,8 +346,6 @@ BezierInputMethod::BezierInputMethod() : CurveInputMethod(CurveType::Bezier, -1) void BezierInputMethod::beginInput() { - clearPainterPath(this->painterOldPath); - clearPainterPath(this->painterPath); this->bezierGuide.setPath(this->painterPath); this->bezierOldGuide.setPath(this->painterOldPath); @@ -407,7 +395,6 @@ static void updateBezierPainterPath( const std::vector& controlPoints, std::vector& cache, const QTransform& worldTransform, QPainterPath& painterPath) { - clearPainterPath(painterPath); if (controlPoints.size() < 2) return; float pixel_len = approx_pixel_length(controlPoints, worldTransform); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 8ee3b4135f2..5c0726d5344 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -478,15 +478,6 @@ public: qreal bufferTextureMaxU() const { return bufferTextureMaxU_; } /*! Same as bufferTextureMaxU(), but for the v texture coordinate. */ qreal bufferTextureMaxV() const { return bufferTextureMaxV_; } -#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) - // These methods are part of the QGLWidget public API. - // As of version 2.7.0, the use of QOpenGLWidget instead means that they have - // to be provided for backward compatibility. - void renderText(int x, int y, const QString &str, - const QFont &font = QFont()); - void renderText(double x, double y, double z, const QString &str, - const QFont &font = QFont()); -#endif public Q_SLOTS: void copyBufferToTexture(GLint, GLenum = GL_NONE); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 7387b1f4874..dc25f1d8675 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -720,30 +720,6 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::drawLight(GLenum, qreal ) const { } -#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) -CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::renderText(int x, int y, const QString &str, - const QFont &font) { - QColor fontColor = QColor(0, 0, - 0, 255); - - // Render text - QPainter painter(this); - painter.setPen(fontColor); - painter.setFont(font); - painter.drawText(x, y, str); - painter.end(); -} - -CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &str, - const QFont &font) { - using CGAL::qglviewer::Vec; - const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z)); - renderText(int(proj.x), int(proj.y), str, font); -} -#endif - /*! Draws \p text at position \p x, \p y (expressed in screen coordinates pixels, origin in the upper left corner of the widget). diff --git a/Lab/demo/Lab/CGAL_Lab.cpp b/Lab/demo/Lab/CGAL_Lab.cpp index 6f1504ab668..d54813edda9 100644 --- a/Lab/demo/Lab/CGAL_Lab.cpp +++ b/Lab/demo/Lab/CGAL_Lab.cpp @@ -27,11 +27,6 @@ int& code_to_call_before_creation_of_QCoreApplication(int& i) { fmt.setOption(QSurfaceFormat::DebugContext); QSurfaceFormat::setDefaultFormat(fmt); - //for windows -#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)) - QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); -#endif - return i; } diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 2269b4a2839..7eff95e0b3d 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -663,15 +663,6 @@ void MainWindow::loadPlugins() } } QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH"); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - QChar separator = QDir::listSeparator(); -#else -#if defined(_WIN32) - QChar separator = ';'; -#else - QChar separator = ':'; -#endif -#endif if(!env_path.isEmpty()) { #if defined(_WIN32) QString path = qgetenv("PATH"); From f8de6e72b8a887aa4a429ab5d67441d90f60c8d1 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 8 Aug 2024 15:26:59 +0200 Subject: [PATCH 20/86] take min_size into account inside Mesh_edge_criteria_3 --- Mesh_3/include/CGAL/Mesh_edge_criteria_3.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index 8d6215cd512..f743eb3f0fa 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -177,7 +177,13 @@ public: /// Returns size of tuple (p,dim,index) FT sizing_field(const Point_3& p, const int dim, const Index& index) const - { return (*p_size_)(p,dim,index); } + { + const FT s = (*p_size_)(p, dim, index); + if (min_length_bound_ == FT(0)) + return s; + else + return (std::max)(s, min_length_bound_); + } FT distance_field(const Point_3& p, const int dim, const Index& index) const { From 0bc365889363ae47988a1b89113909b2fe34c34f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 8 Aug 2024 15:28:09 +0200 Subject: [PATCH 21/86] use the 5 parameters version to avoid re-calling locate(p) and locate(q) --- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index 61eb0682d83..ddb1ba1109f 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -252,8 +252,8 @@ public: : (- negative_distance); } else { return (pit <= qit) - ? curve_segment_length(p, q, CGAL::POSITIVE) - : ( - curve_segment_length(p, q, CGAL::NEGATIVE) ); + ? curve_segment_length(p, q, CGAL::POSITIVE, pit, qit) + : ( - curve_segment_length(p, q, CGAL::NEGATIVE, pit, qit) ); } } From 4d38aa566ecba7e5bb164e7c1af7b61a10649994 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 8 Aug 2024 17:30:22 +0200 Subject: [PATCH 22/86] improve Mesh_3 log in demo --- Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h index 68c8300f9ee..ec38a369ea0 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h +++ b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h @@ -171,8 +171,10 @@ log() const .arg(detect_connected_components); res << QString("use weights: %1").arg(weights_ptr != nullptr); } - res << QString("use aabb tree: %1").arg(use_sizing_field_with_aabb_tree); - res << QString("manifold: %1").arg(manifold); + if(use_sizing_field_with_aabb_tree) + res << QString("use sizing field with aabb tree: %1").arg(use_sizing_field_with_aabb_tree); + if(manifold) + res << QString("manifold: %1").arg(manifold); return res; } From fa97ae8612db76041bf88bf05e1fca7fccf0b757 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 8 Aug 2024 17:31:14 +0200 Subject: [PATCH 23/86] add missing not-nullptr check --- Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp index d84bd9fc6f6..2aadc761957 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -750,7 +750,9 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, } } - if(mesh_type != Mesh_type::SURFACE_ONLY && !material_ids_valid) + if(mesh_type != Mesh_type::SURFACE_ONLY + && !material_ids_valid + && bounding_sm_item != nullptr) { sm_items.removeAll(make_not_null(bounding_sm_item)); } From 0de76f0c82978d96dcc3aa478f161a94a409a1d5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 9 Aug 2024 12:18:09 +0200 Subject: [PATCH 24/86] updated crontab (automated commit) --- .../infrastructure/cgal.geometryfactory.com/crontab | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index 758fd180e8e..cfe168932f7 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -11,6 +11,8 @@ PATH=/home/lrineau/bin-cmake3:/bin:/usr/bin:/home/lrineau/bin LC_CTYPE=en_US.UTF-8 +DOCKER_HOST=unix:///run/podman/podman.sock +CONTAINER_HOST=unix:///run/podman/podman.sock # Update testsuite result pages 5,15,25,35,45,55 * * * * cd $HOME/CGAL/collect_and_public_testresults; ./treat_result_collection || echo ERROR @@ -71,10 +73,10 @@ LC_CTYPE=en_US.UTF-8 #0 * * * * docker inspect --format='{{json .State.Health.Status}}' cgal-mediawiki-docker_wiki_1 | grep -q '"healthy"' || docker logs cgal-mediawiki-docker_wiki_1 # cgal->cgal2 with git-multimail -*/5 * * * * cd $HOME/Git/cgal-dev-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-dev cgal-dev-receiver -*/5 * * * * cd $HOME/Git/cgal-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal cgal-receiver -*/5 * * * * cd $HOME/Git/cgal-students-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-public-dev cgal-students-receiver -*/5 * * * * cd $HOME/Git/cgal-web-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-web cgal-web-receiver +#*/5 * * * * cd $HOME/Git/cgal-dev-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-dev cgal-dev-receiver +#*/5 * * * * cd $HOME/Git/cgal-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal cgal-receiver +#*/5 * * * * cd $HOME/Git/cgal-students-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-public-dev cgal-students-receiver +#*/5 * * * * cd $HOME/Git/cgal-web-pusher.git && $HOME/bin/git-fetch-and-push-to-multimail cgal-web cgal-web-receiver #################################### # Old stuff From 12468ccf4a32eebf5488fd7ceb75a47ac224b1ad Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 9 Aug 2024 11:32:26 +0100 Subject: [PATCH 25/86] Address #8401 --- .../ArrangementDemoTab.h | 1 - .../Arr_geodesic_arc_on_sphere_traits_2.h | 8 ++-- BGL/test/BGL/test_Euler_operations.cpp | 1 - .../CGAL/Boolean_set_operations_2.h | 2 +- Circulator/test/Circulator/test_circ1.cpp | 12 ------ Circulator/test/Circulator/test_circ2.cpp | 10 ----- .../include/CGAL/Combinatorial_map.h | 1 - .../test/Distance_3/test_distance_3.cpp | 8 ++-- .../doc/Generator/CGAL/point_generators_2.h | 1 - .../Intrinsic_Delaunay_triangulation_3.h | 1 - Kernel_23/test/Kernel_23/Dimension.cpp | 1 - ..._corrected_principal_curvatures_plugin.cpp | 1 - .../Lab/Scene_textured_surface_mesh_item.cpp | 2 +- Mesh_2/test/Mesh_2/test_meshing.cpp | 1 - .../test/Number_types/Interval_nt_new.cpp | 2 +- Orthtree/include/CGAL/Orthtree/Traversals.h | 1 - .../demo/Periodic_Lloyd_3/MainWindow.cpp | 6 +-- .../include/CGAL/IO/write_off_points.h | 1 - .../doc/Polygon_mesh_processing/examples.txt | 2 +- Polyhedron/doc/Polyhedron/Polyhedron.txt | 42 +++++++++---------- .../shortest_paths_multiple_sources.cpp | 1 - .../internal/Common.h | 1 - .../Concepts/DelaunayTriangulationTraits_2.h | 1 - 23 files changed, 34 insertions(+), 73 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h index 54ece4964c2..febc992fd59 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h @@ -38,7 +38,6 @@ namespace Qt { class Callback; class ArrangementGraphicsItemBase; -class ArrangementGraphicsItemBase; class GraphicsViewCurveInputBase; class GraphicsViewNavigation; enum class CurveType; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index ed552b8c9fc..65ab748e0ee 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -641,8 +641,7 @@ public: * \param[in] plane the containing plane. * \param[in] source the source-point direction. * \param[in] target the target-point direction. - * \pre Both endpoint lie on the given plane. - * \pre Both endpoint lie on the given plane. + * \pre Both endpoints lie on the given plane. */ X_monotone_curve_2 operator()(const Point_2& source, const Point_2& target, const Direction_3& normal) const @@ -3113,7 +3112,7 @@ public: * \param is_directed_right is the arc directed from left to right? * \param is_full is the arc a full circle? * \param is_degenerate is the arc degenerate (single point)? - * \pre Both endpoint lie on the given plane. + * \pre Both endpoints lie on the given plane. */ Arr_x_monotone_geodesic_arc_on_sphere_3 (const Arr_extended_direction_3& src, @@ -3312,8 +3311,7 @@ public: * \param plane the containing plane. * \param source the source-point direction. * \param target the target-point direction. - * \pre Both endpoint lie on the given plane. - * \pre Both endpoint lie on the given plane. + * \pre Both endpoints lie on the given plane. */ Arr_x_monotone_geodesic_arc_on_sphere_3 (const Arr_extended_direction_3& source, diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 941758cb1c3..5cbb3697f3a 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -17,7 +17,6 @@ test_copy_face_graph_nm_umbrella() T g; Kernel::Point_3 p(0,0,0); - CGAL::make_tetrahedron(p, p, p, p, g); CGAL::make_tetrahedron(p, p, p, p, g); std::vector verts(vertices(g).begin(), vertices(g).end()); diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 32fbfe7a129..39faf23e21a 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -1104,7 +1104,7 @@ do_intersect(const General_polygon_with_holes_2>& p * \param traits a traits object. * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` * otherwise. - * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. + * * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template diff --git a/Circulator/test/Circulator/test_circ1.cpp b/Circulator/test/Circulator/test_circ1.cpp index a3ffa58158f..9fdf36155dc 100644 --- a/Circulator/test/Circulator/test_circ1.cpp +++ b/Circulator/test/Circulator/test_circ1.cpp @@ -2380,7 +2380,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -2493,7 +2492,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -2735,7 +2733,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -2897,7 +2894,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -3308,7 +3304,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -3533,7 +3528,6 @@ void test_circulator_from_iterator() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -3742,7 +3736,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -3855,7 +3848,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -4097,7 +4089,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -4260,7 +4251,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -4671,7 +4661,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; @@ -4897,7 +4886,6 @@ void test_circulator_from_container() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == c); - assert( i == c); // Do I reach myself. ++i; Circulator j = i; diff --git a/Circulator/test/Circulator/test_circ2.cpp b/Circulator/test/Circulator/test_circ2.cpp index 697363d1cb6..1dd55f406c3 100644 --- a/Circulator/test/Circulator/test_circ2.cpp +++ b/Circulator/test/Circulator/test_circ2.cpp @@ -304,7 +304,6 @@ void test_struct(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Struct_circulator j = i; @@ -413,7 +412,6 @@ void test_struct(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Struct_const_circulator j = i; @@ -651,7 +649,6 @@ void test_struct(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Struct_bi_circulator j = i; @@ -809,7 +806,6 @@ void test_struct(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Struct_bi_const_circulator j = i; @@ -969,7 +965,6 @@ void test_class(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Class_circulator j = i; @@ -1078,7 +1073,6 @@ void test_class(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Class_const_circulator j = i; @@ -1316,7 +1310,6 @@ void test_class(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Class_bi_circulator j = i; @@ -1474,7 +1467,6 @@ void test_class(){ assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Class_bi_const_circulator j = i; @@ -1891,7 +1883,6 @@ void test_array() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Circulator j = i; @@ -2119,7 +2110,6 @@ void test_array() { assert( ! (i == nullptr)); assert( i != nullptr); assert( i == start); - assert( i == start); // Do I reach myself. ++i; Circulator j = i; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index aaa360677b7..7bf8295c665 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -1780,7 +1780,6 @@ namespace CGAL { void basic_link_beta_for_involution(Dart_descriptor adart1, Dart_descriptor adart2, unsigned int i) { - CGAL_assertion( i>=2 && i<=dimension ); CGAL_assertion( i>=2 && i<=dimension ); dart_link_beta(adart1, adart2, i); dart_link_beta(adart2, adart1, i); diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp index ab67ad18d79..e977faabe0f 100644 --- a/Distance_3/test/Distance_3/test_distance_3.cpp +++ b/Distance_3/test/Distance_3/test_distance_3.cpp @@ -160,7 +160,7 @@ private: assert(are_equal(res_o2o1, expected_result)); do_intersect_check(o1, o2); - do_intersect_check(o1, o2); + do_intersect_check(o2, o1); } template @@ -170,7 +170,7 @@ private: const FT res_o2o1 = CGAL::squared_distance(o2, o1); do_intersect_check(o1, o2); - do_intersect_check(o1, o2); + do_intersect_check(o2, o1); assert(res_o1o2 <= ubound); assert(res_o2o1 <= ubound); @@ -324,7 +324,7 @@ private: check_squared_distance(S{p2, p3}, S{p4, p5}, 0); check_squared_distance(S{p2, p3}, S{p5, p4}, 0); check_squared_distance(S{p3, p2}, S{p4, p5}, 0); - check_squared_distance(S{p3, p2}, S{p4, p5}, 0); + check_squared_distance(S{p3, p2}, S{p5, p4}, 0); const double lambda_6 = r.get_double(0, 1); const P p6 = p3 + FT(lambda_6) * V{p3 - p2}; @@ -332,7 +332,7 @@ private: check_squared_distance(S{p2, p3}, S{p6, p5}, 0); check_squared_distance(S{p2, p3}, S{p5, p6}, 0); check_squared_distance(S{p3, p2}, S{p6, p5}, 0); - check_squared_distance(S{p3, p2}, S{p6, p5}, 0); + check_squared_distance(S{p3, p2}, S{p, p6}, 0); const double lambda_7 = r.get_double(1, 2); const P p7 = p3 + FT(lambda_7) * V{p3 - p2}; diff --git a/Generator/doc/Generator/CGAL/point_generators_2.h b/Generator/doc/Generator/CGAL/point_generators_2.h index 10319fca737..b273f932314 100644 --- a/Generator/doc/Generator/CGAL/point_generators_2.h +++ b/Generator/doc/Generator/CGAL/point_generators_2.h @@ -30,7 +30,6 @@ are needed from `rnd` for each point. \sa `CGAL::points_on_segment_2()` \sa `CGAL::points_on_square_grid_2()` \sa `CGAL::random_selection()` -\sa `CGAL::random_selection()` \sa `std::random_shuffle()` */ diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 65d78512514..77a399704ec 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/Kernel_23/test/Kernel_23/Dimension.cpp b/Kernel_23/test/Kernel_23/Dimension.cpp index ab9086f0e22..e5b7315d690 100644 --- a/Kernel_23/test/Kernel_23/Dimension.cpp +++ b/Kernel_23/test/Kernel_23/Dimension.cpp @@ -9,7 +9,6 @@ #include #include -#include #include template < typename K > diff --git a/Lab/demo/Lab/Plugins/PMP/Interpolated_corrected_principal_curvatures_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Interpolated_corrected_principal_curvatures_plugin.cpp index 4a75dfd7a3b..dbe630ad09f 100644 --- a/Lab/demo/Lab/Plugins/PMP/Interpolated_corrected_principal_curvatures_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Interpolated_corrected_principal_curvatures_plugin.cpp @@ -59,7 +59,6 @@ void compute(SMesh* sMesh, namespace PMP = CGAL::Polygon_mesh_processing; typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic_kernel; typedef Epic_kernel::Point_3 Point; - typedef Epic_kernel::Point_3 Point; typedef Epic_kernel::Vector_3 Vector; typedef boost::graph_traits::vertex_descriptor Vertex_descriptor; diff --git a/Lab/demo/Lab/Scene_textured_surface_mesh_item.cpp b/Lab/demo/Lab/Scene_textured_surface_mesh_item.cpp index d3fdcb2996d..5ebdf60c6df 100644 --- a/Lab/demo/Lab/Scene_textured_surface_mesh_item.cpp +++ b/Lab/demo/Lab/Scene_textured_surface_mesh_item.cpp @@ -74,7 +74,7 @@ Scene_textured_surface_mesh_item_priv::compute_normals_and_vertices(void) const faces_buffer.resize(0); typedef boost::graph_traits::face_iterator face_iterator; - typedef boost::graph_traits::face_iterator face_iterator; + const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); //Faces diff --git a/Mesh_2/test/Mesh_2/test_meshing.cpp b/Mesh_2/test/Mesh_2/test_meshing.cpp index 2654f78aca9..48d6ccffaf0 100644 --- a/Mesh_2/test/Mesh_2/test_meshing.cpp +++ b/Mesh_2/test/Mesh_2/test_meshing.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/Number_types/test/Number_types/Interval_nt_new.cpp b/Number_types/test/Number_types/Interval_nt_new.cpp index c2481700c7d..0b4e7b06495 100644 --- a/Number_types/test/Number_types/Interval_nt_new.cpp +++ b/Number_types/test/Number_types/Interval_nt_new.cpp @@ -122,7 +122,7 @@ int main() { CGAL_catch_error((bool)(I<=J),CGAL::Uncertain_conversion_exception&); CGAL_catch_error((bool)(I>=J),CGAL::Uncertain_conversion_exception&); CGAL_catch_error((bool)(J> I),CGAL::Uncertain_conversion_exception&); - CGAL_catch_error((bool)(J> I),CGAL::Uncertain_conversion_exception&); + CGAL_catch_error((bool)(J< I),CGAL::Uncertain_conversion_exception&); CGAL_catch_error((bool)(J>=I),CGAL::Uncertain_conversion_exception&); CGAL_catch_error((bool)(J<=I),CGAL::Uncertain_conversion_exception&); diff --git a/Orthtree/include/CGAL/Orthtree/Traversals.h b/Orthtree/include/CGAL/Orthtree/Traversals.h index acd1db941f6..7e06e798351 100644 --- a/Orthtree/include/CGAL/Orthtree/Traversals.h +++ b/Orthtree/include/CGAL/Orthtree/Traversals.h @@ -143,7 +143,6 @@ public: \tparam Tree an instance of `Orthtree` - All tree nodes at another depth are ignored. If the selected depth is All tree nodes at another depth are ignored. If the selected depth is higher than the maximum depth of the orthtree, no node will be traversed. diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp index f4eb7aeb793..fb49efad8c4 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.cpp @@ -119,7 +119,7 @@ MainWindow::loadPoints() for (int i=0 ; i<8 ; i++) { cx += dom[i].x(); cy += dom[i].y(); - cy += dom[i].y(); + cz += dom[i].z(); } CGAL::qglviewer::Vec center(cx/8.,cy/8.,cz/8.); viewer->setSceneCenter(center); @@ -188,7 +188,7 @@ MainWindow::newPoints(int n) for (int i=0 ; i<8 ; i++) { cx += dom[i].x(); cy += dom[i].y(); - cy += dom[i].y(); + cz += dom[i].z(); } CGAL::qglviewer::Vec center(cx/8.,cy/8.,cz/8.); viewer->setSceneCenter(center); @@ -223,5 +223,3 @@ void MainWindow::help() { tr("Could not start Qt Assistant from %1.").arg(app)); } } - - diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index 941bc16d518..e99a2c90bce 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt index 3aca69fb004..08109123fa5 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt @@ -48,5 +48,5 @@ \example Polygon_mesh_processing/remesh_almost_planar_patches.cpp \example Polygon_mesh_processing/sample_example.cpp \example Polygon_mesh_processing/soup_autorefinement.cpp -*/ + */ diff --git a/Polyhedron/doc/Polyhedron/Polyhedron.txt b/Polyhedron/doc/Polyhedron/Polyhedron.txt index e9d9cb1a5b3..9e7ac47116e 100644 --- a/Polyhedron/doc/Polyhedron/Polyhedron.txt +++ b/Polyhedron/doc/Polyhedron/Polyhedron.txt @@ -385,20 +385,20 @@ polyhedral surface gives alias names renaming face to facet. class Polyhedron_items_3 { public: -template < class Refs, class Traits> -struct Vertex_wrapper { -typedef typename Traits::Point_3 Point; -typedef CGAL::HalfedgeDS_vertex_base Vertex; -}; -template < class Refs, class Traits> -struct Halfedge_wrapper { -typedef CGAL::HalfedgeDS_halfedge_base Halfedge; -}; -template < class Refs, class Traits> -struct Face_wrapper { -typedef typename Traits::Plane_3 Plane; -typedef CGAL::HalfedgeDS_face_base Face; -}; + template < class Refs, class Traits> + struct Vertex_wrapper { + typedef typename Traits::Point_3 Point; + typedef CGAL::HalfedgeDS_vertex_base Vertex; + }; + template < class Refs, class Traits> + struct Halfedge_wrapper { + typedef CGAL::HalfedgeDS_halfedge_base Halfedge; + }; + template < class Refs, class Traits> + struct Face_wrapper { + typedef typename Traits::Plane_3 Plane; + typedef CGAL::HalfedgeDS_face_base Face; + }; }; \endcode @@ -426,7 +426,7 @@ faces but would be for vertices - and add the color attribute. template struct My_face : public CGAL::HalfedgeDS_face_base { -CGAL::IO::Color color; + CGAL::IO::Color color; }; \endcode @@ -440,10 +440,10 @@ used. \code{.cpp} struct My_items : public CGAL::Polyhedron_items_3 { -template -struct Face_wrapper { -typedef My_face Face; -}; + template + struct Face_wrapper { + typedef My_face Face; + }; }; \endcode @@ -479,8 +479,8 @@ works as illustrated above. template struct My_face : public CGAL::HalfedgeDS_face_base { -typedef typename Refs::Vertex_handle Vertex_handle; -Vertex_handle vertex_ref; + typedef typename Refs::Vertex_handle Vertex_handle; + Vertex_handle vertex_ref; }; \endcode diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp index 4b1a99fabbd..a0a05111c91 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp @@ -6,7 +6,6 @@ #include -#include #include #include #include diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h index 4ed45a02d1e..2d3158a7095 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h @@ -29,7 +29,6 @@ #include #include #include -#include #include namespace CGAL { diff --git a/Triangulation_2/doc/Triangulation_2/Concepts/DelaunayTriangulationTraits_2.h b/Triangulation_2/doc/Triangulation_2/Concepts/DelaunayTriangulationTraits_2.h index f76e24c327a..0ec0e42e70d 100644 --- a/Triangulation_2/doc/Triangulation_2/Concepts/DelaunayTriangulationTraits_2.h +++ b/Triangulation_2/doc/Triangulation_2/Concepts/DelaunayTriangulationTraits_2.h @@ -26,7 +26,6 @@ required if the method `nearest_vertex()` is used. \cgalHasModelsBare{All models of the \cgal concept `Kernel`} \cgalHasModelsBare{`CGAL::Projection_traits_3` (not for dual Voronoi functions)} \cgalHasModelsBare{`CGAL::Projection_traits_xy_3` (not for dual Voronoi functions)} -\cgalHasModelsBare{`CGAL::Projection_traits_xy_3` (not for dual Voronoi functions)} \cgalHasModelsBare{`CGAL::Projection_traits_yz_3` (not for dual Voronoi functions)} \cgalHasModelsBare{`CGAL::Projection_traits_xz_3` (not for dual Voronoi functions)} \cgalHasModelsEnd From 6c54f7731107d7115b2360bdb455e4fe7ec40e19 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Sat, 10 Aug 2024 17:28:48 +0200 Subject: [PATCH 26/86] updated crontab (automated commit) --- Maintenance/infrastructure/cgal.geometryfactory.com/crontab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index cfe168932f7..9cb5358db66 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -63,7 +63,7 @@ CONTAINER_HOST=unix:///run/podman/podman.sock # Launch our Docker testsuite , at 21:36, # after a pull of all new images at 20:23. 06 20 * * * for i in $(cat /home/lrineau/.config/CGAL/test_cgal_docker_images); do docker pull $i; done; docker rmi $(docker images | awk '// {print $3}') -36 21 * * * cd /home/lrineau/Git/cgal-testsuite-dockerfiles && /usr/bin/time ./test_cgal.py --use-fedora-selinux-policy --force-rm --max-cpus 12 --container-cpus 4 --jobs 5 --upload-results --images $($HOME/bin/docker_images_to_test_today) +36 21 * * * cd /home/lrineau/Git/cgal-testsuite-dockerfiles && /usr/bin/time ./test_cgal.py --use-fedora-selinux-policy --force-rm --max-cpus 20 --container-cpus 8 --jobs 10 --upload-results --images $($HOME/bin/docker_images_to_test_today) # Dump the crontab to SVN every hour at minute 18 From eeffa4b752baeb49d68244024cd80500695f897b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 26 Jul 2024 06:03:37 +0200 Subject: [PATCH 27/86] speed up copy_face_graph mostly when tm is not empty and almost make it less dependent on tm size --- BGL/include/CGAL/boost/graph/copy_face_graph.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 2a4850647ce..9d9e9359c4c 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -64,13 +64,15 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, const tm_face_descriptor tm_null_face = boost::graph_traits::null_face(); const tm_vertex_descriptor tm_null_vertex = boost::graph_traits::null_vertex(); - reserve(tm, static_cast::vertices_size_type>(vertices(tm).size()+vertices(sm).size()), - static_cast::edges_size_type>(edges(tm).size()+edges(sm).size()), - static_cast::faces_size_type>(faces(tm).size()+faces(sm).size()) ); + reserve(tm, static_cast::vertices_size_type>(internal::exact_num_vertices(tm)+internal::exact_num_vertices(sm)), + static_cast::edges_size_type>(internal::exact_num_edges(tm)+internal::exact_num_edges(sm)), + static_cast::faces_size_type>(internal::exact_num_faces(tm)+internal::exact_num_faces(sm)) ); //insert halfedges and create each vertex when encountering its halfedge std::vector new_edges; - new_edges.reserve(edges(sm).size()); + std::vector new_vertices; + new_edges.reserve(internal::exact_num_edges(sm)); + new_vertices.reserve(internal::exact_num_vertices(sm)); for(sm_edge_descriptor sm_e : edges(sm)) { tm_edge_descriptor tm_e = add_edge(tm); @@ -108,6 +110,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, tm_vertex_descriptor tm_h_tgt = add_vertex(tm); *v2v++=std::make_pair(sm_h_tgt, tm_h_tgt); set_halfedge(tm_h_tgt, tm_h, tm); + new_vertices.push_back(tm_h); set_target(tm_h, tm_h_tgt, tm); put(tm_vpm, tm_h_tgt, conv(get(sm_vpm, sm_h_tgt))); } @@ -118,6 +121,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, tm_vertex_descriptor tm_h_src = add_vertex(tm); *v2v++=std::make_pair(sm_h_src, tm_h_src); set_halfedge(tm_h_src, tm_h_opp, tm); + new_vertices.push_back(tm_h_opp); set_target(tm_h_opp, tm_h_src, tm); put(tm_vpm, tm_h_src, conv(get(sm_vpm, sm_h_src))); } @@ -165,11 +169,9 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, } } // update halfedge vertex of all but the vertex halfedge - for(tm_vertex_descriptor v : vertices(tm)) + for(tm_halfedge_descriptor h : new_vertices) { - tm_halfedge_descriptor h = halfedge(v, tm); - if (h==boost::graph_traits::null_halfedge()) - continue; + tm_vertex_descriptor v = target(h, tm); tm_halfedge_descriptor next_around_vertex=h; do{ next_around_vertex=opposite(next(next_around_vertex, tm), tm); From fd498e398aafd12a6661ac796b7b3ae4ae5d153d Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 9 Aug 2024 15:45:24 +0200 Subject: [PATCH 28/86] fix approx_is_too_large(edge) that needs the corresponding curve_index to be valid use minimal_size instead of 0 fix 5e64bced8e37ce076f26317e9ea7638a14c9696c fix approx_is_too_large(edge) that needs the corresponding curve_index to be valid and fix the default edge_min_size --- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 4a0e3f131de..366f1b3a91e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -152,7 +152,7 @@ public: Protect_edges_sizing_field(C3T3& c3t3, const MeshDomain& domain, SizingFunction size=SizingFunction(), - const FT minimal_size = FT(-1), + const FT minimal_size = FT(0), const Distance_Function edge_distance = Distance_Function(), const std::size_t maximal_number_of_vertices = 0, Mesh_error_code* error_code = 0 @@ -273,8 +273,7 @@ private: /// Returns `true` if the edge `(va,vb)` is a not good enough approximation /// of its feature. - bool approx_is_too_large(const Vertex_handle& va, - const Vertex_handle& vb, + bool approx_is_too_large(const Edge& e, const bool is_edge_in_complex) const; /// Returns `true` if the balls of `va` and `vb` intersect. @@ -458,10 +457,12 @@ private: dim = -1 - dim; const FT s = field(p, dim, index); - if(s <= FT(0)) { + if(s < minimal_size_) + { std::stringstream msg; msg.precision(17); - msg << "Error: the field is null at "; + msg << "Error: the field is smaller than minimal size (" + << minimal_size_ << ") at "; if(dim == 0) msg << "corner ("; else msg << "point ("; msg << p << ")"; @@ -493,7 +494,7 @@ private: bool use_minimal_size() const { - return minimal_size_ != FT(-1); + return minimal_size_ != FT(0); } Weight minimal_weight() const { @@ -645,7 +646,10 @@ insert_corners() #endif // Get weight (the ball radius is given by the 'query_size' function) - FT w = CGAL::square(query_size(p, 0, p_index)); + const FT query_weight = CGAL::square(query_size(p, 0, p_index)); + FT w = use_minimal_size() + ? (std::min)(minimal_weight_, query_weight) + : query_weight; #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "Weight from sizing field: " << w << std::endl; @@ -1178,12 +1182,12 @@ insert_balls(const Vertex_handle& vp, const Weighted_point& vp_wp = c3t3_.triangulation().point(vp); #if ! defined(CGAL_NO_PRECONDITIONS) - if(sp <= 0) { - std::stringstream msg;; + if(sp <= minimal_size_) { + std::stringstream msg; msg.precision(17); - msg << "Error: the mesh sizing field is null at point ("; - msg << cp(vp_wp) << ")!"; - CGAL_precondition_msg(sp > 0, msg.str().c_str()); + msg << "Error: the mesh sizing field is smaller than minimal size "; + msg << " at point (" << cp(vp_wp) << ")!"; + CGAL_precondition_msg(sp > minimal_size_, msg.str().c_str()); } #endif // ! CGAL_NO_PRECONDITIONS @@ -1428,7 +1432,7 @@ refine_balls() if( // topology condition non_adjacent_but_intersect(va, vb, is_edge_in_complex) // approximation condition - || (use_distance_field() && approx_is_too_large(va, vb, is_edge_in_complex))) + || (use_distance_field() && approx_is_too_large(*eit, is_edge_in_complex))) { using CGAL::Mesh_3::internal::distance_divisor; @@ -1557,34 +1561,29 @@ do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const template bool Protect_edges_sizing_field:: -approx_is_too_large(const Vertex_handle& va, const Vertex_handle& vb, const bool is_edge_in_complex) const +approx_is_too_large(const Edge& e, const bool is_edge_in_complex) const { if ( ! is_edge_in_complex ) - { return false; - } - typedef typename Kernel::Point_3 Point_3; - Curve_index curve_index = domain_.curve_index((va->in_dimension() < vb->in_dimension()) ? vb->index() : va->index()); + const auto& [va, vb] = c3t3_.triangulation().vertices(e); - const Point_3& pa = va->point().point(); - const Point_3& pb = vb->point().point(); - const Point_3& segment_middle = CGAL::midpoint(pa, pb); - // Obtain the geodesic middle point - FT signed_geodesic_distance = domain_.signed_geodesic_distance(pa, pb, curve_index); - Point_3 geodesic_middle; - if (signed_geodesic_distance >= FT(0)) - { - geodesic_middle = domain_.construct_point_on_curve(pa, curve_index, signed_geodesic_distance / 2); - } - else - { - geodesic_middle = domain_.construct_point_on_curve(pb, curve_index, -signed_geodesic_distance / 2); - } - // Compare distance to the parameter's distance - FT squared_evaluated_distance = CGAL::squared_distance(segment_middle, geodesic_middle); - FT segment_middle_edge_distance = query_distance(segment_middle, 1, curve_index); - return squared_evaluated_distance > CGAL::square(segment_middle_edge_distance); + const Bare_point& pa = va->point().point(); + const Bare_point& pb = vb->point().point(); + + // Construct the geodesic middle point + const Curve_index curve_index = c3t3_.curve_index(e); + const FT signed_geodesic_distance = domain_.signed_geodesic_distance(pa, pb, curve_index); + const Bare_point geodesic_middle = (signed_geodesic_distance >= FT(0)) + ? domain_.construct_point_on_curve(pa, curve_index, signed_geodesic_distance / 2) + : domain_.construct_point_on_curve(pb, curve_index, -signed_geodesic_distance / 2); + + const Bare_point edge_middle = CGAL::midpoint(pa, pb); + const FT squared_evaluated_distance = CGAL::squared_distance(edge_middle, geodesic_middle); + + // Compare distance to the distance field from criteria + const FT max_distance_to_curve = query_distance(edge_middle, 1, curve_index); + return squared_evaluated_distance > CGAL::square(max_distance_to_curve); } template From fb4416fff556e8e06ce37530dd07703b137b2808 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Mon, 12 Aug 2024 18:10:40 +0200 Subject: [PATCH 29/86] typo --- Distance_3/test/Distance_3/test_distance_3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp index e977faabe0f..4f68e2278da 100644 --- a/Distance_3/test/Distance_3/test_distance_3.cpp +++ b/Distance_3/test/Distance_3/test_distance_3.cpp @@ -332,7 +332,7 @@ private: check_squared_distance(S{p2, p3}, S{p6, p5}, 0); check_squared_distance(S{p2, p3}, S{p5, p6}, 0); check_squared_distance(S{p3, p2}, S{p6, p5}, 0); - check_squared_distance(S{p3, p2}, S{p, p6}, 0); + check_squared_distance(S{p3, p2}, S{p5, p6}, 0); const double lambda_7 = r.get_double(1, 2); const P p7 = p3 + FT(lambda_7) * V{p3 - p2}; From 35195e311a6ba0c3799c9311a88d87dd2c1b6993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 12 Aug 2024 18:11:39 +0200 Subject: [PATCH 30/86] undo incorrect simplification --- BGL/test/BGL/test_Euler_operations.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 5cbb3697f3a..941758cb1c3 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -17,6 +17,7 @@ test_copy_face_graph_nm_umbrella() T g; Kernel::Point_3 p(0,0,0); + CGAL::make_tetrahedron(p, p, p, p, g); CGAL::make_tetrahedron(p, p, p, p, g); std::vector verts(vertices(g).begin(), vertices(g).end()); From f63c99d34223a1767de13c8913840ba9bb0bbb0f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 13 Aug 2024 08:48:31 +0100 Subject: [PATCH 31/86] remove duplicates --- Distance_3/test/Distance_3/test_distance_3.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp index 4f68e2278da..f297e93016b 100644 --- a/Distance_3/test/Distance_3/test_distance_3.cpp +++ b/Distance_3/test/Distance_3/test_distance_3.cpp @@ -160,7 +160,6 @@ private: assert(are_equal(res_o2o1, expected_result)); do_intersect_check(o1, o2); - do_intersect_check(o2, o1); } template @@ -170,7 +169,6 @@ private: const FT res_o2o1 = CGAL::squared_distance(o2, o1); do_intersect_check(o1, o2); - do_intersect_check(o2, o1); assert(res_o1o2 <= ubound); assert(res_o2o1 <= ubound); From 99539be5c5b4bb59ade022933f731c0f10fd5261 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 13 Aug 2024 08:50:04 +0100 Subject: [PATCH 32/86] explain why duplicate --- BGL/test/BGL/test_Euler_operations.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 941758cb1c3..615a4fd756d 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -17,6 +17,7 @@ test_copy_face_graph_nm_umbrella() T g; Kernel::Point_3 p(0,0,0); + // make two connected components CGAL::make_tetrahedron(p, p, p, p, g); CGAL::make_tetrahedron(p, p, p, p, g); From a8d7bd1850fa8ce9d07c686351105d9f068a31b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 13 Aug 2024 13:57:44 +0200 Subject: [PATCH 33/86] move point cloud to the right directory --- .../examples/Classification/example_classification.cpp | 2 +- .../examples/Classification/example_cluster_classification.cpp | 2 +- Classification/examples/Classification/example_feature.cpp | 2 +- Data/data/{meshes => points_3}/b9.ply | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename Data/data/{meshes => points_3}/b9.ply (100%) diff --git a/Classification/examples/Classification/example_classification.cpp b/Classification/examples/Classification/example_classification.cpp index 1d94295a645..2926a11fb85 100644 --- a/Classification/examples/Classification/example_classification.cpp +++ b/Classification/examples/Classification/example_classification.cpp @@ -48,7 +48,7 @@ typedef Classification::Feature::Vertical_dispersion int main (int argc, char** argv) { - const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/b9.ply"); + const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/b9.ply"); std::cerr << "Reading input" << std::endl; std::vector pts; diff --git a/Classification/examples/Classification/example_cluster_classification.cpp b/Classification/examples/Classification/example_cluster_classification.cpp index 51c7e642b78..a036f878f0b 100644 --- a/Classification/examples/Classification/example_cluster_classification.cpp +++ b/Classification/examples/Classification/example_cluster_classification.cpp @@ -48,7 +48,7 @@ typedef Classification::Cluster Clu int main (int argc, char** argv) { - std::string filename = CGAL::data_file_path("meshes/b9.ply"); + std::string filename = CGAL::data_file_path("points_3/b9.ply"); std::string filename_config = "data/b9_clusters_config.bin"; if (argc > 1) diff --git a/Classification/examples/Classification/example_feature.cpp b/Classification/examples/Classification/example_feature.cpp index b0cdcd90054..d8bed02141b 100644 --- a/Classification/examples/Classification/example_feature.cpp +++ b/Classification/examples/Classification/example_feature.cpp @@ -66,7 +66,7 @@ public: int main (int argc, char** argv) { - std::string filename (argc > 1 ? argv[1] : CGAL::data_file_path("meshes/b9.ply")); + std::string filename (argc > 1 ? argv[1] : CGAL::data_file_path("points_3/b9.ply")); std::vector pts; std::cerr << "Reading input" << std::endl; diff --git a/Data/data/meshes/b9.ply b/Data/data/points_3/b9.ply similarity index 100% rename from Data/data/meshes/b9.ply rename to Data/data/points_3/b9.ply From 2c31defc6528bef74194e135fe3736b9f55d282b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 13 Aug 2024 16:14:23 +0200 Subject: [PATCH 34/86] backport f7a48360395d819bbd15b48071bd89fc0bdd9648 to the deprecated test --- Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp index b2ba365111f..b20e573cf67 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp @@ -68,7 +68,6 @@ public: Mesh_criteria criteria(facet_angle = 30, facet_size = 6, facet_distance = 2, - facet_topology = CGAL::MANIFOLD, cell_radius_edge_ratio = 3, cell_size = 8); From 5b731118f9c2f7ad6d5e756ef5a47ca8559c2adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 13 Aug 2024 16:22:36 +0200 Subject: [PATCH 35/86] add validation for the range case --- .../CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h index 81c6f421171..d1b75253aef 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h @@ -642,6 +642,7 @@ public: unsigned int i = 1; for (InputIterator itr = begin; itr != end; ++itr, ++i) { + ValidationPolicy::is_valid((*itr), *m_traits); arr_vec[i].first = new Aos_2(m_traits); _insert(*itr, *(arr_vec[i].first)); } @@ -666,6 +667,7 @@ public: unsigned int i = 1; for (InputIterator itr = begin; itr!=end; ++itr, ++i) { + ValidationPolicy::is_valid((*itr), *m_traits); arr_vec[i].first = new Aos_2(m_traits); _insert(*itr, *(arr_vec[i].first)); } From 8c70d6120f71282183037973d0607f98af652006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 14:37:24 +0200 Subject: [PATCH 36/86] hide PMP usage behind a macro --- .../Least_squares_plane_fit_region.h | 47 +++++++++++++------ .../Region_growing/internal/utils.h | 36 ++++++++++---- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index 60144403114..0ab7463a08e 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -19,7 +19,9 @@ // Internal includes. #include #include +#ifdef CGAL_SD_RG_USE_PMP #include +#endif namespace CGAL { namespace Shape_detection { @@ -163,8 +165,36 @@ namespace Polygon_mesh { m_scalar_product_3(m_traits.compute_scalar_product_3_object()), m_cross_product_3(m_traits.construct_cross_product_vector_3_object()) { +#ifdef CGAL_SD_RG_USE_PMP + auto get_face_normal = [this](Item face, const PolygonMesh& pmesh) + { + return Polygon_mesh_processing::compute_face_normal(face, pmesh, parameters::vertex_point_map(m_vertex_to_point_map)); + }; +#else + auto get_face_normal = [this](Item face, const PolygonMesh& pmesh) -> Vector_3 + { + const auto hedge = halfedge(face, pmesh); + const auto vertices = vertices_around_face(hedge, pmesh); + CGAL_precondition(vertices.size() >= 3); + + auto vertex = vertices.begin(); + const Point_3& p1 = get(m_vertex_to_point_map, *vertex); ++vertex; + const Point_3& p2 = get(m_vertex_to_point_map, *vertex); ++vertex; + Point_3 p3 = get(m_vertex_to_point_map, *vertex); + while(collinear(p1, p2, p3)) + { + if (++vertex == vertices.end()) return NULL_VECTOR; + p3 = get(m_vertex_to_point_map, *vertex); + } + + const Vector_3 u = p2 - p1; + const Vector_3 v = p3 - p1; + return m_cross_product_3(u, v); + }; +#endif + for (const Item &i : faces(pmesh)) { - m_face_normals[i] = Polygon_mesh_processing::compute_face_normal(i, pmesh); + m_face_normals[i] = get_face_normal(i, pmesh); std::vector pts; auto h = halfedge(i, pmesh); auto s = h; @@ -174,20 +204,7 @@ namespace Polygon_mesh { h = next(h, pmesh); } while (h != s); - std::vector> output; - - Polygon_mesh_processing::triangulate_hole_polyline(pts, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); - - // Create entry in map. In case of degenerate polygonal faces, the list stays empty. - std::vector& tris = m_face_triangulations[i]; - - // If the output is empty, the polygon is degenerate. - if (output.empty()) - continue; - - tris.reserve(output.size()); - for (const auto& t : output) - tris.push_back(Triangle_3(pts[t.first], pts[t.second], pts[t.third])); + internal::triangulate_face(pts, m_face_triangulations[i]); } CGAL_precondition(faces(m_face_graph).size() > 0); diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index 328c49031b2..8a0d8690893 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -46,7 +46,9 @@ #include #include #include +#ifdef CGAL_SD_RG_USE_PMP #include +#endif namespace CGAL { namespace Shape_detection { @@ -330,6 +332,30 @@ namespace internal { return create_plane(tmp, item_map, traits); } + template + void + triangulate_face(const std::vector& points, + std::vector& triangles) + { +#ifdef CGAL_SD_RG_USE_PMP + std::vector> output; + + Polygon_mesh_processing::triangulate_hole_polyline(points, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); + + triangles.reserve(output.size()); + for (const auto& t : output) + triangles.emplace_back(points[t.first], points[t.second], points[t.third]); +#else + //use a triangulation using the centroid + std::size_t nb_edges = points.size(); + Point_3 c = CGAL::centroid(points.begin(), points.end()); + triangles.reserve(nb_edges); + for (std::size_t i=0; i> output; - - Polygon_mesh_processing::triangulate_hole_polyline(points, std::back_inserter(output), parameters::use_2d_constrained_delaunay_triangulation(true)); - - assert(!output.empty()); - for (const auto& t : output) - triangles.push_back(ITriangle_3(points[t.first], points[t.second], points[t.third])); - } + triangulate_face(points, triangles); } CGAL_precondition(triangles.size() >= region.size()); IPlane_3 fitted_plane; From 7d0969d15f3b1547b6bb0dd96ccef23acfa5c76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 15:47:16 +0200 Subject: [PATCH 37/86] use dynamic property maps --- .../Least_squares_plane_fit_region.h | 23 +++++++++++-------- .../Region_growing/internal/utils.h | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index 0ab7463a08e..2c8801ea5e6 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -93,9 +93,6 @@ namespace Polygon_mesh { using Scalar_product_3 = typename GeomTraits::Compute_scalar_product_3; using Cross_product_3 = typename GeomTraits::Construct_cross_product_vector_3; - std::unordered_map > m_face_normals; - std::unordered_map, internal::hash_item > m_face_triangulations; - public: /// \name Initialization /// @{ @@ -163,7 +160,10 @@ namespace Polygon_mesh { m_squared_length_3(m_traits.compute_squared_length_3_object()), m_squared_distance_3(m_traits.compute_squared_distance_3_object()), m_scalar_product_3(m_traits.compute_scalar_product_3_object()), - m_cross_product_3(m_traits.construct_cross_product_vector_3_object()) { + m_cross_product_3(m_traits.construct_cross_product_vector_3_object()), + m_face_normals( get(CGAL::dynamic_face_property_t(), pmesh) ), + m_face_triangulations( get(CGAL::dynamic_face_property_t>(), pmesh) ) + { #ifdef CGAL_SD_RG_USE_PMP auto get_face_normal = [this](Item face, const PolygonMesh& pmesh) @@ -194,7 +194,7 @@ namespace Polygon_mesh { #endif for (const Item &i : faces(pmesh)) { - m_face_normals[i] = get_face_normal(i, pmesh); + put(m_face_normals, i, get_face_normal(i, pmesh)); std::vector pts; auto h = halfedge(i, pmesh); auto s = h; @@ -204,7 +204,9 @@ namespace Polygon_mesh { h = next(h, pmesh); } while (h != s); - internal::triangulate_face(pts, m_face_triangulations[i]); + std::vector face_triangulation; + internal::triangulate_face(pts, face_triangulation); + put(m_face_triangulations, i, face_triangulation); } CGAL_precondition(faces(m_face_graph).size() > 0); @@ -283,7 +285,7 @@ namespace Polygon_mesh { const FT squared_distance_threshold = m_distance_threshold * m_distance_threshold; - const Vector_3 face_normal = m_face_normals.at(query); + const Vector_3 face_normal = get(m_face_normals, query); const FT cos_value = m_scalar_product_3(face_normal, m_normal_of_best_fit); const FT squared_cos_value = cos_value * cos_value; @@ -333,7 +335,7 @@ namespace Polygon_mesh { // The best fit plane will be a plane through this face centroid with // its normal being the face's normal. const Point_3 face_centroid = get_face_centroid(face); - const Vector_3 face_normal = m_face_normals.at(face); + const Vector_3 face_normal = get(m_face_normals, face); if (face_normal == CGAL::NULL_VECTOR) return false; CGAL_precondition(face_normal != CGAL::NULL_VECTOR); @@ -374,7 +376,7 @@ namespace Polygon_mesh { // Approach: each face gets one vote to keep or flip the current plane normal. long votes_to_keep_normal = 0; for (const auto &face : region) { - const Vector_3 face_normal = m_face_normals.at(face); + const Vector_3 face_normal = get(m_face_normals, face); const bool agrees = m_scalar_product_3(face_normal, unoriented_normal_of_best_fit) > FT(0); votes_to_keep_normal += (agrees ? 1 : -1); @@ -406,6 +408,9 @@ namespace Polygon_mesh { const Scalar_product_3 m_scalar_product_3; const Cross_product_3 m_cross_product_3; + typename boost::property_map >::const_type m_face_normals; + typename boost::property_map> >::const_type m_face_triangulations; + Plane_3 m_plane_of_best_fit; Vector_3 m_normal_of_best_fit; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index 8a0d8690893..09f87c109a8 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -442,7 +442,7 @@ namespace internal { const IConverter iconverter = IConverter(); for (const typename Region::value_type face : region) { - const std::vector& tris = face_to_triangles_map.at(face); + const std::vector& tris = get(face_to_triangles_map, face); // Degenerate polygons are omitted. if (tris.empty()) From e931d1258b5647d84ca32401102c0cacce0f859a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 16:52:42 +0200 Subject: [PATCH 38/86] add missing include --- .../CGAL/Shape_detection/Region_growing/internal/utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index 09f87c109a8..3cd71111d2c 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -48,6 +48,8 @@ #include #ifdef CGAL_SD_RG_USE_PMP #include +#else +#include #endif namespace CGAL { From 6e5f37474fcd35c05c38c13f20673d97b2b2b4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 17:20:06 +0200 Subject: [PATCH 39/86] bad type --- .../CGAL/Shape_detection/Region_growing/internal/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h index 3cd71111d2c..de1827fa376 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/internal/utils.h @@ -350,7 +350,7 @@ namespace internal { #else //use a triangulation using the centroid std::size_t nb_edges = points.size(); - Point_3 c = CGAL::centroid(points.begin(), points.end()); + typename Traits::Point_3 c = CGAL::centroid(points.begin(), points.end()); triangles.reserve(nb_edges); for (std::size_t i=0; i Date: Wed, 14 Aug 2024 18:18:26 +0200 Subject: [PATCH 40/86] clean up and move skip test to export header --- .../include/CGAL/Nef_3/SNC_const_decorator.h | 4 - .../convert_nef_polyhedron_to_polygon_mesh.h | 81 ++++--------------- Nef_3/test/Nef_3/issue_6423.cpp | 1 + 3 files changed, 18 insertions(+), 68 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index c2c622a181e..a8b0123f3df 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -535,10 +535,6 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const } Halffacet_handle f = ec->twin()->facet(); if ( Done[f] ) continue; - Halffacet_handle tf = f->twin(); - if ((f->incident_volume() == tf->incident_volume()) && Done[tf]) { - continue; // for example when we have to do with the unbounded volume and a surface with boundaries - } FacetCandidates.push_back(f); Done[f] = true; } } else if (fc.is_svertex() ) { diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index 218e7210866..8b03c755507 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -81,6 +82,7 @@ struct Shell_polygons_visitor Vertex_index_map& vertex_indices; PolygonRange& polygons; bool triangulate_all_faces; + CGAL::Generic_handle_map Done; Shell_polygons_visitor(Vertex_index_map& vertex_indices, PolygonRange& polygons, @@ -88,6 +90,7 @@ struct Shell_polygons_visitor : vertex_indices( vertex_indices ) , polygons(polygons) , triangulate_all_faces(triangulate_all_faces) + , Done(false) {} std::size_t get_cycle_length( typename Nef_polyhedron::Halffacet_cycle_const_iterator hfc) const @@ -103,6 +106,14 @@ struct Shell_polygons_visitor void visit(typename Nef_polyhedron::Halffacet_const_handle opposite_facet) { + typename Nef_polyhedron::Halffacet_const_handle twin_facet = opposite_facet->twin(); + + // skip when we have to do with the unbounded volume and a surface with boundaries + if ((twin_facet->incident_volume() == opposite_facet->incident_volume()) && Done[twin_facet]) + return; + + Done[opposite_facet] = true; + bool is_marked=opposite_facet->incident_volume()->mark(); CGAL_assertion(Nef_polyhedron::Infi_box::is_standard(opposite_facet->plane())); @@ -352,11 +363,9 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), vol_end = nef.volumes_end(); - if (Nef_polyhedron::Infi_box::extended_kernel()) { - ++vol_it; // skip Infi_box - } + if (Nef_polyhedron::Infi_box::extended_kernel()) ++vol_it; // skip Infi_box - CGAL_assertion ( vol_it != vol_end ); + if ( vol_it == vol_end ) return; Converter to_output; bool handling_unbounded_volume = true; @@ -374,71 +383,15 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, CGAL_For_all(ec,ee) { typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); - //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { - //~ V.visit(vv); // report edge - //~ Done[vv] = Done[vv->twin()] = true; - //~ } + typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); - return f->incident_volume()!=f->twin()->incident_volume(); - //~ if ( Done[f] ) continue; - //~ Halffacet_handle tf = f->twin(); - //~ } - //~ FacetCandidates.push_back(f); Done[f] = true; + if (f->incident_volume()==f->twin()->incident_volume()) + return false; } } - -#if 0 - else if (fc.is_svertex() ) { - SVertex_handle v(fc); - if ( Done[v] ) continue; - V.visit(v); // report edge - V.visit(v->twin()); - Done[v] = Done[v->twin()] = true; - CGAL_assertion(SD.is_isolated(v)); - SFaceCandidates.push_back(v->twin()->incident_sface()); - Done[v->twin()->incident_sface()]=true; - // note that v is isolated, thus twin(v) is isolated too - // SM_const_decorator SD; - // SFace_const_handle fo; - // fo = v->twin()->incident_sface(); - /* - if(SD.is_isolated(v)) - fo = v->source()->sfaces_begin(); - else - fo = v->twin()->incident_sface(); - */ - } else if (fc.is_shalfloop() ) { - SHalfloop_handle l(fc); - V.visit(l); - Halffacet_handle f = l->twin()->facet(); - if ( Done[f] ) continue; - FacetCandidates.push_back(f); Done[f] = true; - } else CGAL_error_msg("Damn wrong handle."); -#endif } - return false; - - //~ typename Nef_polyhedron::SHalfedge_const_handle e(sf); - //~ typename Nef_polyhedron::SHalffacet_const_handle f = e->facet(); - //~ e->facet() - //~ SHalfedge_around_sface_circulator ec(e),ee(e); - //~ CGAL_For_all(ec,ee) { - //~ SVertex_handle vv = ec->twin()->source(); - //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { - //~ V.visit(vv); // report edge - //~ Done[vv] = Done[vv->twin()] = true; - //~ } - //~ Halffacet_handle f = ec->twin()->facet(); - //~ if ( Done[f] ) continue; - - //~ if (CGAL::assign(f,*sfh)) - //~ { - //~ std::cout << "COUCOU\n"; - //~ return f->incident_volume()!=f->twin()->incident_volume(); - //~ } - //~ else - //~ return false; + return true; }; for (;vol_it!=vol_end;++vol_it) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 5eeb664f23b..87e7f7dff61 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -40,5 +40,6 @@ int main() CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; std::cout << convertedSurfaceMesh << std::endl; + std::ofstream("out.off") << convertedSurfaceMesh; return EXIT_SUCCESS; } From 30fc15064bc66a8f6bcf4222878139b201272d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 18:22:04 +0200 Subject: [PATCH 41/86] add assertions --- Nef_3/test/Nef_3/issue_6423.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 87e7f7dff61..441dd0b7939 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -35,11 +35,11 @@ int main() NefPolyhedron nefPoly(surfaceMesh); std::cout << "NefPolyhedron, number_of_faces: " << nefPoly.number_of_facets() << std::endl; - std::cout << nefPoly << std::endl; SurfaceMesh convertedSurfaceMesh; CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; - std::cout << convertedSurfaceMesh << std::endl; std::ofstream("out.off") << convertedSurfaceMesh; + assert(vertices(convertedSurfaceMesh).size()==10); + assert(faces(convertedSurfaceMesh).size()==6); return EXIT_SUCCESS; } From d20cef2f911a2e9773e6394708a14e5d3544222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Aug 2024 09:02:24 +0200 Subject: [PATCH 42/86] remove unused variable --- .../CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index 8b03c755507..3ecd0e1b805 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -382,8 +382,6 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typename Nef_polyhedron::SHalfedge_around_sface_const_circulator ec(e),ee(e); CGAL_For_all(ec,ee) { - typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); - typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); if (f->incident_volume()==f->twin()->incident_volume()) return false; From 926dab060e12fe23da736c6c1ee822c7d68bd74c Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Mon, 19 Aug 2024 09:43:55 +0200 Subject: [PATCH 43/86] Reintroduce QPainterPath reset logic --- .../Arrangement_on_surface_2/CurveInputMethods.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp index 82e7958b2ab..87908978b60 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp @@ -109,6 +109,12 @@ void CurveInputMethod::beginInput_() for (auto& item : items) this->getScene()->addItem(item); } +static inline void clearPainterPath(QPainterPath& ppath) +{ + ppath = {}; +} + + void CurveInputMethod::reset() { this->resetInput(); @@ -184,6 +190,7 @@ PolylineInputMethod::PolylineInputMethod() : void PolylineInputMethod::beginInput() { + clearPainterPath(this->painterPath); this->polylineGuide.setPath(this->painterPath); this->lastLine.setLine(0, 0, 0, 0); QPen pen = this->polylineGuide.pen(); @@ -346,6 +353,8 @@ BezierInputMethod::BezierInputMethod() : CurveInputMethod(CurveType::Bezier, -1) void BezierInputMethod::beginInput() { + clearPainterPath(this->painterOldPath); + clearPainterPath(this->painterPath); this->bezierGuide.setPath(this->painterPath); this->bezierOldGuide.setPath(this->painterOldPath); @@ -395,6 +404,7 @@ static void updateBezierPainterPath( const std::vector& controlPoints, std::vector& cache, const QTransform& worldTransform, QPainterPath& painterPath) { + clearPainterPath(painterPath); if (controlPoints.size() < 2) return; float pixel_len = approx_pixel_length(controlPoints, worldTransform); From 1286d8b6366201a5df3f5c1bbc3a6310a0d4e1f8 Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Mon, 19 Aug 2024 12:02:19 +0200 Subject: [PATCH 44/86] Remove deprecated Qt version checks --- .../GridGraphicsItem.cpp | 4 ---- GraphicsView/include/CGAL/Qt/qglviewer.h | 7 ++++++ GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 22 +++++++++++++++++++ Lab/demo/Lab/CGAL_Lab.cpp | 3 +++ Lab/demo/Lab/MainWindow.cpp | 6 +++++ 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp index 535f4684975..01723db026e 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp @@ -67,11 +67,7 @@ void GridGraphicsItem::setSpacing(int spacing_) static inline qreal horizontalAdvance(const QFontMetrics& fm, const QString& text) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) return fm.horizontalAdvance(text); -#else - return fm.boundingRect(text).width(); -#endif } void GridGraphicsItem::paint( diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 5c0726d5344..e24a5fcd6d7 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -478,6 +478,13 @@ public: qreal bufferTextureMaxU() const { return bufferTextureMaxU_; } /*! Same as bufferTextureMaxU(), but for the v texture coordinate. */ qreal bufferTextureMaxV() const { return bufferTextureMaxV_; } + // These methods are part of the QGLWidget public API. + // As of version 2.7.0, the use of QOpenGLWidget instead means that they have + // to be provided for backward compatibility. + void renderText(int x, int y, const QString &str, + const QFont &font = QFont()); + void renderText(double x, double y, double z, const QString &str, + const QFont &font = QFont()); public Q_SLOTS: void copyBufferToTexture(GLint, GLenum = GL_NONE); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index dc25f1d8675..508444710ad 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -720,6 +720,28 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::drawLight(GLenum, qreal ) const { } +CGAL_INLINE_FUNCTION +void CGAL::QGLViewer::renderText(int x, int y, const QString &str, + const QFont &font) { + QColor fontColor = QColor(0, 0, + 0, 255); + + // Render text + QPainter painter(this); + painter.setPen(fontColor); + painter.setFont(font); + painter.drawText(x, y, str); + painter.end(); +} + +CGAL_INLINE_FUNCTION +void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &str, + const QFont &font) { + using CGAL::qglviewer::Vec; + const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z)); + renderText(int(proj.x), int(proj.y), str, font); +} + /*! Draws \p text at position \p x, \p y (expressed in screen coordinates pixels, origin in the upper left corner of the widget). diff --git a/Lab/demo/Lab/CGAL_Lab.cpp b/Lab/demo/Lab/CGAL_Lab.cpp index d54813edda9..85880fb8add 100644 --- a/Lab/demo/Lab/CGAL_Lab.cpp +++ b/Lab/demo/Lab/CGAL_Lab.cpp @@ -27,6 +27,9 @@ int& code_to_call_before_creation_of_QCoreApplication(int& i) { fmt.setOption(QSurfaceFormat::DebugContext); QSurfaceFormat::setDefaultFormat(fmt); + // for windows + QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); + return i; } diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 7eff95e0b3d..806f8b912cb 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -663,6 +663,12 @@ void MainWindow::loadPlugins() } } QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH"); + QChar separator = QDir::listSeparator(); + #if defined(_WIN32) + QChar separator = ';'; + #else + QChar separator = ':'; + #endif if(!env_path.isEmpty()) { #if defined(_WIN32) QString path = qgetenv("PATH"); From 14a9db6d00af5aae18c2266d7f4af571e42ba7b8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 19 Aug 2024 12:23:32 +0200 Subject: [PATCH 45/86] weight_modifier was likely to make the weight too small let's keep the minimal weight as given in meshing criteria --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 366f1b3a91e..7f9fface33e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -720,7 +720,10 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object(); - const Weighted_point wp = cwp(p,w*weight_modifier); + const FT wwm = use_minimal_size() + ? (std::max)(w * weight_modifier, minimal_weight()) + : w * weight_modifier; + const Weighted_point wp = cwp(p, wwm); typename Tr::Locate_type lt; int li, lj; @@ -1182,7 +1185,7 @@ insert_balls(const Vertex_handle& vp, const Weighted_point& vp_wp = c3t3_.triangulation().point(vp); #if ! defined(CGAL_NO_PRECONDITIONS) - if(sp <= minimal_size_) { + if(sp < minimal_size_) { std::stringstream msg; msg.precision(17); msg << "Error: the mesh sizing field is smaller than minimal size "; From 481de41e2f980dbf75cb2175e2133cc17647292f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 19 Aug 2024 12:24:32 +0200 Subject: [PATCH 46/86] use c++11 for loops --- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 7f9fface33e..a1cd7aca8bc 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -867,13 +867,11 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, std::back_inserter(cells_in_conflicts), CGAL::Emptyset_iterator()); - for(typename std::vector::const_iterator - it = cells_in_conflicts.begin(), - end = cells_in_conflicts.end(); it != end; ++it) + for(Cell_handle cit : cells_in_conflicts) { for(int i=0, d=tr.dimension(); i<=d; ++i) { - const Vertex_handle v = (*it)->vertex(i); + const Vertex_handle v = cit->vertex(i); if(c3t3_.triangulation().is_infinite(v)) continue; if(!vertices_in_conflict_zone_set.insert(v).second) @@ -1030,21 +1028,20 @@ insert_balls_on_edges() domain_.get_curves(std::back_inserter(input_features)); // Iterate on edges - for ( typename Input_features::iterator fit = input_features.begin(), - end = input_features.end() ; fit != end ; ++fit ) + for (const Feature_tuple& ft : input_features) { if(forced_stop()) break; - const Curve_index& curve_index = std::get<0>(*fit); + const Curve_index& curve_index = std::get<0>(ft); if ( ! is_treated(curve_index) ) { #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "\n** treat curve #" << curve_index << std::endl; #endif - const Bare_point& p = std::get<1>(*fit).first; - const Bare_point& q = std::get<2>(*fit).first; + const Bare_point& p = std::get<1>(ft).first; + const Bare_point& q = std::get<2>(ft).first; - const Index& p_index = std::get<1>(*fit).second; - const Index& q_index = std::get<2>(*fit).second; + const Index& p_index = std::get<1>(ft).second; + const Index& q_index = std::get<2>(ft).second; Vertex_handle vp,vq; if ( ! domain_.is_loop(curve_index) ) @@ -1487,14 +1484,11 @@ refine_balls() new_sizes.clear(); // Update size of balls - for ( typename std::vector >::iterator - it = new_sizes_copy.begin(), - end = new_sizes_copy.end(); - it != end ; ++it ) + for (const std::pair& it : new_sizes_copy) { if(forced_stop()) break; - const Vertex_handle v = it->first; - const FT new_size = it->second; + const Vertex_handle v = it.first; + const FT new_size = it.second; // Set size of the ball to new value if(use_minimal_size() && new_size < minimal_size_) { if(!is_special(v)) { From 4a35823f1f8bd9a7231e31a55fa5ea40951781e5 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 19 Aug 2024 12:24:59 +0200 Subject: [PATCH 47/86] ease dump code reading --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index a1cd7aca8bc..918d48f8324 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -741,7 +741,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, std::cerr << "SPECIAL "; std::cerr << "protecting ball "; if(v == Vertex_handle()) - std::cerr << cwp(p,w*weight_modifier); + std::cerr << cwp(p, wwm); else std::cerr << disp_vert(v); From ac9a7013420ba0eadaae15549d48e1d62eebd732 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Mon, 19 Aug 2024 12:53:37 +0200 Subject: [PATCH 48/86] remove leftover --- Lab/demo/Lab/MainWindow.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 806f8b912cb..909a130e46d 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -664,11 +664,6 @@ void MainWindow::loadPlugins() } QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH"); QChar separator = QDir::listSeparator(); - #if defined(_WIN32) - QChar separator = ';'; - #else - QChar separator = ':'; - #endif if(!env_path.isEmpty()) { #if defined(_WIN32) QString path = qgetenv("PATH"); From 2bc86f90ca6726a0ad89b3711c4d74ee8475ad36 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Mon, 19 Aug 2024 12:54:46 +0200 Subject: [PATCH 49/86] keep correct variant --- .../demo/Arrangement_on_surface_2/CurveInputMethods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp index 87908978b60..06ebae10a20 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp @@ -111,7 +111,7 @@ void CurveInputMethod::beginInput_() static inline void clearPainterPath(QPainterPath& ppath) { - ppath = {}; + ppath.clear(); } From a1a7b652752bf79e92b6f0167a2ea86e139f542d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Aug 2024 13:01:09 +0200 Subject: [PATCH 50/86] remove remaining QT_VERSION_CHECK --- Lab/demo/Lab/MainWindow.cpp | 7 ------- Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp | 12 ------------ Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp | 4 ---- .../Plugins/Surface_mesh/Parameterization_plugin.cpp | 4 ---- Lab/demo/Lab/Viewer.cpp | 8 +------- Three/include/CGAL/Three/TextRenderer.h | 5 ----- Three/include/CGAL/Three/Three.h | 4 ---- 7 files changed, 1 insertion(+), 43 deletions(-) diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 909a130e46d..dd133dbf44f 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -2644,17 +2644,10 @@ void MainWindow::resetHeader() sceneView->header()->setSectionResizeMode(Scene::RenderingModeColumn, QHeaderView::ResizeToContents); sceneView->header()->setSectionResizeMode(Scene::ABColumn, QHeaderView::Fixed); sceneView->header()->setSectionResizeMode(Scene::VisibleColumn, QHeaderView::Fixed); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); sceneView->resizeColumnToContents(Scene::RenderingModeColumn); sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); -#else - sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().width("_#_")); - sceneView->resizeColumnToContents(Scene::RenderingModeColumn); - sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().width(QString("_AB_"))); - sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().width(QString("_View_"))); -#endif } void MainWindow::reset_default_loaders() diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp index 4720d8aa35b..780511846aa 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp @@ -705,11 +705,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = x_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) x_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - x_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif x_cubeLabel->setText("0"); x_cubeLabel->setValidator(validator); @@ -735,11 +731,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = y_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) y_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - y_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif y_cubeLabel->setText("0"); y_cubeLabel->setValidator(validator); y_slider = new QSlider(mw); @@ -764,11 +756,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = z_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) z_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - z_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif z_cubeLabel->setText("0"); z_cubeLabel->setValidator(validator); z_slider = new QSlider(mw); diff --git a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp index 27a3ba46f0d..1adc2ae81ea 100644 --- a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp @@ -250,11 +250,7 @@ protected: } case QEvent::Wheel: { QWheelEvent* event = static_cast(ev); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QPoint pos = event->pos(); -#else QPointF pos = event->position(); -#endif QPointF old_pos = v->mapToScene(pos.x(), pos.y()); if(event->angleDelta().y() <0) v->scale(1.2, 1.2); diff --git a/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp index d9ec9149133..38d593c2b40 100644 --- a/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -142,11 +142,7 @@ protected: } case QEvent::Wheel: { QWheelEvent* event = static_cast(ev); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QPoint pos = event->pos(); -#else QPointF pos = event->position(); -#endif QPointF old_pos = v->mapToScene(pos.x(), pos.y()); if(event->angleDelta().y() <0) v->scale(1.2, 1.2); diff --git a/Lab/demo/Lab/Viewer.cpp b/Lab/demo/Lab/Viewer.cpp index 70c2b60e838..b93cb2cb7b1 100644 --- a/Lab/demo/Lab/Viewer.cpp +++ b/Lab/demo/Lab/Viewer.cpp @@ -1152,13 +1152,7 @@ void Viewer::drawVisualHints() //Prints the displayMessage QFont font = QFont(); QFontMetrics fm(font); - TextItem *message_text = new TextItem(float(10 + - #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) - fm.horizontalAdvance(d->message)/2) - #else - fm.width(d->message)/2) - #endif - , + TextItem *message_text = new TextItem(float(10 + fm.horizontalAdvance(d->message)/2), float(height()-20), 0, d->message, false, QFont(), Qt::gray ); diff --git a/Three/include/CGAL/Three/TextRenderer.h b/Three/include/CGAL/Three/TextRenderer.h index c5c729ec032..f04535841f7 100644 --- a/Three/include/CGAL/Three/TextRenderer.h +++ b/Three/include/CGAL/Three/TextRenderer.h @@ -52,12 +52,7 @@ public : :x(p_x), y(p_y), z(p_z),_3D(p_3D), _is_always_visible(always_visible), m_text(p_text), m_font(font), m_color(p_color) { QFontMetrics fm(m_font); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) _width = float(fm.horizontalAdvance(m_text)+2); -#else - _width = float(fm.width(m_text)+2); -#endif - _height = float(fm.height()); } //!\brief Accessor for the string diff --git a/Three/include/CGAL/Three/Three.h b/Three/include/CGAL/Three/Three.h index 3dac95792a3..e3e6366d5b6 100644 --- a/Three/include/CGAL/Three/Three.h +++ b/Three/include/CGAL/Three/Three.h @@ -31,11 +31,7 @@ # define THREE_EXPORT Q_DECL_IMPORT #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) -#define CGAL_QT_SKIP_EMPTY_PARTS QString::SkipEmptyParts -#else #define CGAL_QT_SKIP_EMPTY_PARTS ::Qt::SkipEmptyParts -#endif namespace CGAL{ namespace Three{ From ca2907fbfc0cbfcdf093d73774826a0e858a15ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Aug 2024 10:09:23 +0200 Subject: [PATCH 51/86] avoid creating degenerate planes --- .../test/Intersections_3/test_intersections_Ray_3.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp index e1d603d4a5e..6a3dd24bcea 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp @@ -161,6 +161,8 @@ public: for(int i=0; i Date: Tue, 20 Aug 2024 10:58:38 +0200 Subject: [PATCH 52/86] vertices(edge) is not available in P3T3 --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 918d48f8324..e84e7dd933f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -1563,10 +1563,8 @@ approx_is_too_large(const Edge& e, const bool is_edge_in_complex) const if ( ! is_edge_in_complex ) return false; - const auto& [va, vb] = c3t3_.triangulation().vertices(e); - - const Bare_point& pa = va->point().point(); - const Bare_point& pb = vb->point().point(); + const Bare_point& pa = e.first->vertex(e.second)->point().point(); + const Bare_point& pb = e.first->vertex(e.third)->point().point(); // Construct the geodesic middle point const Curve_index curve_index = c3t3_.curve_index(e); From d5e411648547e7f5ec6d005737d29b6ad2e6425e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 20 Aug 2024 15:46:21 +0200 Subject: [PATCH 53/86] bug fixes to adapt to the new cgal.geometryfactory.com machine --- .../cgal.geometryfactory.com/bin/cgal_release.py | 2 +- Maintenance/test_handling/create_testresult_page | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py index a835da2c812..daa87aa614a 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py @@ -19,7 +19,7 @@ class Release: """return the command to create and publish the release""" return ( f"PATH=/home/lrineau/bin-cmake3:/bin:/usr/bin:/home/lrineau/bin; cd {self.cwd} &&" - + " /usr/bin/time scl enable rh-git29 -- " + + " /usr/bin/time -v bash -x " + f"$HOME/bin/create_release {self.repo}{self.extra_options} --do-it" ) diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index ca62a592828..a2825253e70 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -103,13 +103,13 @@ sub write_select() print OUTPUTV '\n"; my %results; foreach $_ (glob("results-*.shtml")) { - my $ctime = (stat($_))[10]; - $results{$_} = $ctime; + my $mtime = (stat($_))[9]; + $results{$_} = $mtime; } foreach $_ (sort { $results{$b} <=> $results{$a} } keys %results) { $_ =~ /results-${pattern}(\.\d+)?(-.*|)\.shtml/ || next; - my $ctime = (stat($_))[10]; - my $date = time2str('%a %Y/%m/%d', $ctime); + my $mtime = (stat($_))[9]; + my $date = time2str('%a %Y/%m/%d', $mtime); print OUTPUTV '\n", $filename, $date; From 286be1cfd05d0fe5ce742c44013f1b0ad333792b Mon Sep 17 00:00:00 2001 From: Donghao Chu <799017701@qq.com> Date: Wed, 21 Aug 2024 14:38:16 +0800 Subject: [PATCH 54/86] Pass random instance to GeneratorOnObject in Generic_random_point_generator for consistency --- .../CGAL/Generator/internal/Generic_random_point_generator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h b/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h index 958915aa635..2c6bfaf40e6 100644 --- a/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h +++ b/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h @@ -105,7 +105,7 @@ void Generic_random_point_generator: ); // generate the points - GeneratorOnObject pointCreator(object_from_id_map(ids[target])); + GeneratorOnObject pointCreator(object_from_id_map(ids[target]), random); this->d_item = *pointCreator; } From 35b5c086afbc8132c22cdadfda9d824e65d204f0 Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Wed, 21 Aug 2024 16:13:38 +0200 Subject: [PATCH 55/86] Add condition to check if CXXFLAGS variable is empty --- Maintenance/test_handling/to_zipped_format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintenance/test_handling/to_zipped_format b/Maintenance/test_handling/to_zipped_format index fdf62712b02..9131d100065 100755 --- a/Maintenance/test_handling/to_zipped_format +++ b/Maintenance/test_handling/to_zipped_format @@ -117,7 +117,7 @@ sub reformat_results($) # if (/BOOST_BIMAP_VERSION = '([^']+)'/) { # $BOOST="$BOOST+bimap"; # } - if (/USING +CXXFLAGS = '([^']*)'/) { + if (/USING +CXXFLAGS = '([^']*)'/ && !$CXXFLAGS) { $CXXFLAGS="$CXXFLAGS $1"; } if (/USING +LDFLAGS = '([^']*)'/) { From 13b5f3676a2a7d5ce8df2ce4cac18535e983bc05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Aug 2024 10:09:10 +0200 Subject: [PATCH 56/86] remove extra wording --- .../doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt b/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt index e8d94344cfc..49823e27292 100644 --- a/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt +++ b/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt @@ -156,7 +156,7 @@ setting the named parameter `remesh_boundaries` to `false`. It is also possible to define the polyline features as the ones stored as complex edges in a `Mesh_complex_3_in_triangulation_3` -(e.g., generated by the \ref PkgMesh3 package mesh generation algorithms). +(e.g., generated by the \ref PkgMesh3 package). \cgalExample{Tetrahedral_remeshing/mesh_and_remesh_c3t3.cpp } From 483d43cdf2c0ab390f5b862860d38bc2e41dbff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Aug 2024 11:12:01 +0200 Subject: [PATCH 57/86] use default that is fine for most of the packages --- Scripts/developer_scripts/cgal_create_package_dir.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/developer_scripts/cgal_create_package_dir.py b/Scripts/developer_scripts/cgal_create_package_dir.py index 90900b1304d..e2445915d5b 100755 --- a/Scripts/developer_scripts/cgal_create_package_dir.py +++ b/Scripts/developer_scripts/cgal_create_package_dir.py @@ -26,9 +26,8 @@ creationpath = args.creationpath doxystring = \ r"""@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} + PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Put title of project here" -INPUT = ${CMAKE_SOURCE_DIR}/PACKAGENAME/doc/PACKAGENAME/ \ - ${CMAKE_SOURCE_DIR}/PACKAGENAME/include """ descrstring = \ From 02a38472a14dd731ae399276bed877d446a87d55 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 23 Aug 2024 15:43:53 +0200 Subject: [PATCH 58/86] reformat the REUSE.toml file (readability), add natvis files --- Installation/REUSE.toml | 35 +++++++++++++++++++++++++++++++++-- REUSE.toml | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Installation/REUSE.toml b/Installation/REUSE.toml index 4ceda7b2279..34a4baee435 100644 --- a/Installation/REUSE.toml +++ b/Installation/REUSE.toml @@ -4,13 +4,44 @@ SPDX-PackageSupplier = "CGAL Editorial Board " SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" [[annotations]] -path = ["**.cmake", "**.md", "doc/**", "doc_html/**", "scripts/**", "developer_scripts/**", "package_info/**", "demo/**", "examples/**", "src/**", "test/**", "benchmarks/**", "benchmark/**", "data/**", "cmake/**"] +path = [ + "**.cmake", + "**.md", + "doc/**", + "doc_html/**", + "scripts/**", + "developer_scripts/**", + "package_info/**", + "demo/**", + "examples/**", + "src/**", + "test/**", + "benchmarks/**", + "benchmark/**", + "data/**", + "cmake/**", + "**/*.natvis", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" [[annotations]] -path = ["REUSE.toml", "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in", "include/CGAL/Qt/ImageInterface.ui", "include/CGAL/Qt/resources/qglviewer-icon.xpm", "AUTHORS", "CMakeLists.txt", "README", "auxiliary/cgal_create_cmake_script.1", "auxiliary/gmp/README", "include/CGAL/license/gpl_package_list.txt", "auxiliary/cgal_app.icns", "copyright", "VERSION"] +path = [ + "REUSE.toml", + "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in", + "include/CGAL/Qt/ImageInterface.ui", + "include/CGAL/Qt/resources/qglviewer-icon.xpm", + "AUTHORS", + "CMakeLists.txt", + "README", + "auxiliary/cgal_create_cmake_script.1", + "auxiliary/gmp/README", + "include/CGAL/license/gpl_package_list.txt", + "auxiliary/cgal_app.icns", + "copyright", + "VERSION", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" diff --git a/REUSE.toml b/REUSE.toml index a36f899b03c..5cca2b91384 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -4,13 +4,50 @@ SPDX-PackageSupplier = "CGAL Editorial Board " SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" [[annotations]] -path = [".**", "**.cmake", "**.md", ".github/**", "Maintenance/**", "**/TODO", "**/doc/**", "**/deb/**", "**/applications/**", "**/doc_html/**", "**/scripts/**", "**/developer_scripts/**", "**/demo/**", "**/examples/**", "**/src/**", "**/test/**", "**/benchmarks/**", "**/benchmark/**", "**/package_info/**", "**/data/**", "**/cmake/**"] +path = [ + ".**", + "**.cmake", + "**.md", + ".github/**", + "Maintenance/**", + "**/TODO", + "**/doc/**", + "**/deb/**", + "**/applications/**", + "**/doc_html/**", + "**/scripts/**", + "**/developer_scripts/**", + "**/demo/**", + "**/examples/**", + "**/src/**", + "**/test/**", + "**/benchmarks/**", + "**/benchmark/**", + "**/package_info/**", + "**/data/**", + "**/cmake/**", + "**/*.natvis", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" [[annotations]] -path = ["REUSE.toml", "CMakeLists.txt", "cmake_uninstall.cmake.in", "GraphicsView/include/CGAL/Qt/ImageInterface.ui", "GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm", "Installation/AUTHORS", "Installation/CMakeLists.txt", "Installation/README", "Installation/auxiliary/cgal_create_cmake_script.1", "Installation/auxiliary/gmp/README", "Installation/include/CGAL/license/gpl_package_list.txt", "MacOSX/auxiliary/cgal_app.icns", "copyright"] +path = [ + "REUSE.toml", + "CMakeLists.txt", + "cmake_uninstall.cmake.in", + "GraphicsView/include/CGAL/Qt/ImageInterface.ui", + "GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm", + "Installation/AUTHORS", + "Installation/CMakeLists.txt", + "Installation/README", + "Installation/auxiliary/cgal_create_cmake_script.1", + "Installation/auxiliary/gmp/README", + "Installation/include/CGAL/license/gpl_package_list.txt", + "MacOSX/auxiliary/cgal_app.icns", + "copyright", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" From ac46e562361650d6613549deecb0f5c9afd0cd66 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 23 Aug 2024 15:49:20 +0200 Subject: [PATCH 59/86] fix SELinux contexts so that the web server can offer the files --- Scripts/developer_scripts/run_doxygen_testsuite | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/developer_scripts/run_doxygen_testsuite b/Scripts/developer_scripts/run_doxygen_testsuite index ec3a5855620..271fb9699aa 100755 --- a/Scripts/developer_scripts/run_doxygen_testsuite +++ b/Scripts/developer_scripts/run_doxygen_testsuite @@ -65,6 +65,7 @@ bash -$- ./process_doc.sh /home/cgal-testsuite/bin/doxygen_1_8_13 /home/cgal-tes if head -2 ../../.scm-branch | grep -q cgal/master; then rsync -a --delete "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}/output2/" /srv/CGAL/www/doc/master/ fi +restorecon -R /srv/CGAL/www/doc/master/ /srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID} rm -rf "${CGAL_DOC_BUILD}" # Then gzip the log file, to save space exec From 7838b95b948fadfb25b4d49ad1ae46b1d04e2362 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 23 Aug 2024 15:55:55 +0200 Subject: [PATCH 60/86] generate review of the code --- .../developer_scripts/run_doxygen_testsuite | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Scripts/developer_scripts/run_doxygen_testsuite b/Scripts/developer_scripts/run_doxygen_testsuite index 271fb9699aa..22d9aab978f 100755 --- a/Scripts/developer_scripts/run_doxygen_testsuite +++ b/Scripts/developer_scripts/run_doxygen_testsuite @@ -6,7 +6,7 @@ cd /home/cgal-testsuite # Rotate log files on one month: the logfile name contains the number of # the day -LOGFILE=$PWD/doxygen_testsuite-`date '+%d'`.log +LOGFILE=$PWD/doxygen_testsuite-$(date '+%d').log exec > "$LOGFILE" @@ -31,8 +31,8 @@ if [ -r "${CGAL_DOC_BUILD}" ]; then rm -rf "${CGAL_DOC_BUILD}" fi -mkdir ${CGAL_DOC_BUILD} -cd ${CGAL_DOC_BUILD} +mkdir "${CGAL_DOC_BUILD}" +cd "${CGAL_DOC_BUILD}" if [ -r "LATEST" ]; then rm -rf LATEST @@ -44,12 +44,12 @@ if [ ! -f "LATEST" ]; then error "COULD NOT DOWNLOAD LATEST!" fi -for i in `cat LATEST` +for i in $(cat LATEST) do CGAL_LOCATION="${CGAL_URL}/${i}"; CGAL_ZIPFILE="${i}"; done -CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.gz//"` +CGAL_RELEASE_ID=$(echo "$CGAL_ZIPFILE" | sed "s/.tar.gz//") curl ${CURL_OPTS} "${CGAL_LOCATION}" tar xvzf "${CGAL_ZIPFILE}" && rm "${CGAL_ZIPFILE}" @@ -60,12 +60,16 @@ cd "${CGAL_RELEASE_ID}" PATH=/home/cgal-testsuite/local/bin:$PATH export PATH -cd "$PWD/doc/scripts" +cd "${PWD}/doc/scripts" bash -$- ./process_doc.sh /home/cgal-testsuite/bin/doxygen_1_8_13 /home/cgal-testsuite/bin/doxygen_1_9_6 /srv/CGAL/www/Members/Manual_doxygen_test if head -2 ../../.scm-branch | grep -q cgal/master; then rsync -a --delete "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}/output2/" /srv/CGAL/www/doc/master/ fi -restorecon -R /srv/CGAL/www/doc/master/ /srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID} +if sestatus &>/dev/null && [ -d "/srv/CGAL/www/doc/master/" ] && [ -d "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}" ]; then + restorecon -R /srv/CGAL/www/doc/master/ /srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID} || error "restorecon command failed" +else + error "SELinux is not enabled or the paths do not exist" +fi rm -rf "${CGAL_DOC_BUILD}" # Then gzip the log file, to save space exec From 9d2670f017601dacf08181c165ee9cf919c27d4e Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Sun, 25 Aug 2024 18:58:24 +0100 Subject: [PATCH 61/86] Remove commented out code --- .../External_structure_builder.h | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h index 8c4c546590d..7bbf805248b 100644 --- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h +++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h @@ -77,51 +77,7 @@ class External_structure_builder : public Modifier_base sedge2sface; - /* - SFace_iterator sfi; - CGAL_forall_sfaces(sfi, *sncp) { - SFace_cycle_iterator sfc; - for(sfc = sfi->sface_cycles_begin(); sfc != sfi->sface_cycles_end(); ++sfc) { - if(sfc.is_shalfedge()){ - SHalfedge_around_sface_circulator eaf(sfc), end(eaf); - CGAL_For_all(eaf,end) { - SHalfedge_handle se(eaf); - sedge2sface[eaf] = sfi; - } - } - } - } - - // CGAL::SNC_io_parser O0(std::cerr, *sncp, false); - // O0.print(); - - SHalfedge_iterator sei; - CGAL_forall_shalfedges(sei, *sncp) { - SHalfedge_handle se(sei); - if(sedge2sface[se] == SFace_handle()) { - SM_decorator SD(&*sei->source()->source()); - SFace_handle sf_new = SD.new_sface(); - sf_new->mark() = sei->incident_sface()->mark(); - - CGAL_NEF_TRACEN("new entry sedge " << sei->source()->point() - << "->" << sei->twin()->source()->point() - << " at " << sei->source()->source()->point()); - - SD.link_as_face_cycle(sei, sf_new); - - SHalfedge_around_sface_circulator eaf(se), end(eaf); - CGAL_For_all(eaf,end) { - SHalfedge_handle se(eaf); - sedge2sface[eaf] = sf_new; - } - - // TODO: relink inner sface cycles - } - } - */ SNC_point_locator* old_pl = pl; pl = pl->clone(); sncpl.pl = pl; @@ -129,9 +85,6 @@ class External_structure_builder : public Modifier_base Ox(std::cerr, *sncp, false); - // Ox.print(); } }; From 44b92c11dbe57e5cc12b1ede80e295d8c248caee Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Sun, 25 Aug 2024 18:58:55 +0100 Subject: [PATCH 62/86] Move the delete to the end of the function --- .../CGAL/Convex_decomposition_3/External_structure_builder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h index 7bbf805248b..f43609baafd 100644 --- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h +++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h @@ -81,10 +81,10 @@ class External_structure_builder : public Modifier_baseclone(); sncpl.pl = pl; - delete old_pl; SNC_external_structure C(*sncp,pl); C.clear_external_structure(); C.build_external_structure(); + delete old_pl; } }; From cf30f4dfab94a732c93f1cff3a5a9d5584343132 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Mon, 26 Aug 2024 09:29:21 +0100 Subject: [PATCH 63/86] Remove unused hashmap --- .../CGAL/Convex_decomposition_3/External_structure_builder.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h index f43609baafd..c6ecee86c0b 100644 --- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h +++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h @@ -76,8 +76,6 @@ class External_structure_builder : public Modifier_base sedge2sface; SNC_point_locator* old_pl = pl; pl = pl->clone(); sncpl.pl = pl; From 62cb850d5bcd70ac7871deed9f7c1bad92870fb6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 26 Aug 2024 15:38:45 +0200 Subject: [PATCH 64/86] create_new_release with SELinux: call restorecon --- Scripts/developer_scripts/create_new_release | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 692ed94e7fa..2b0e0f2ff2b 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -323,6 +323,9 @@ if [ -n "$DO_PUBLIC" ]; then zip -q -r ${public_release_name}-library.zip ${public_release_name} mv ${public_release_name}*.tar.xz "${HTML_DIR}/${release_name}-public/" mv ${public_release_name}*.zip "${HTML_DIR}/${release_name}-public/" + if command -v sestatus >/dev/null 2>&1; then + sestatus && restorecon -R "${HTML_DIR}/${release_name}-public" + fi rm -f "$HTML_DIR/CGAL-last-public" ln -s "${release_name}-public" "$HTML_DIR/CGAL-last-public" fi From 328c919d673723ef3f6f9965cdc686f15e43eadc Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 25 Jul 2024 10:54:30 +0200 Subject: [PATCH 65/86] wip CGAL_OpenMesh_support --- .../cmake/modules/CGAL_OpenMesh_support.cmake | 23 +++++++++++++++++++ Installation/cmake/modules/FindOpenMesh.cmake | 14 +++++------ Installation/cmake/modules/UseOpenMesh.cmake | 2 ++ 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 Installation/cmake/modules/CGAL_OpenMesh_support.cmake diff --git a/Installation/cmake/modules/CGAL_OpenMesh_support.cmake b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake new file mode 100644 index 00000000000..1154b2f2cff --- /dev/null +++ b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake @@ -0,0 +1,23 @@ + +if(OpenMesh_FOUND AND NOT TARGET CGAL::OpenMesh_support) + + add_library(CGAL::OpenMesh_support UNKNOWN IMPORTED) + + set_target_properties(OpenMesh::OpenMesh PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" + INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIRS}") + + if(OPENMESH_CORE_LIBRARY_RELEASE) + set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenMesh::OpenMesh PROPERTIES + IMPORTED_LOCATION_RELEASE "${OPENMESH_CORE_LIBRARY_RELEASE}") + endif() + + if(OPENMESH_CORE_LIBRARY_DEBUG) + set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(OpenMesh::OpenMesh PROPERTIES + IMPORTED_LOCATION_DEBUG "${OPENMESH_CORE_LIBRARY_DEBUG}") + endif() +endif() diff --git a/Installation/cmake/modules/FindOpenMesh.cmake b/Installation/cmake/modules/FindOpenMesh.cmake index df51ed716ce..1c9d2198ed9 100644 --- a/Installation/cmake/modules/FindOpenMesh.cmake +++ b/Installation/cmake/modules/FindOpenMesh.cmake @@ -65,28 +65,28 @@ if (NOT OpenMesh_FOUND) #target OpenMesh::OpenMesh if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh) - add_library(OpenMesh::OpenMesh UNKNOWN IMPORTED) + add_library(CGAL_OpenMesh::CGAL_OpenMesh UNKNOWN IMPORTED) if(TARGET OpenMeshCore) - target_link_libraries(OpenMesh::OpenMesh INTERFACE OpenMeshCore) + target_link_libraries(CGAL_OpenMesh::CGAL_OpenMesh INTERFACE OpenMeshCore) return() endif() - set_target_properties(OpenMesh::OpenMesh PROPERTIES + set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIRS}") if(OPENMESH_CORE_LIBRARY_RELEASE) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + set_property(TARGET CGAL_OpenMesh::CGAL_OpenMesh APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(OpenMesh::OpenMesh PROPERTIES + set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES IMPORTED_LOCATION_RELEASE "${OPENMESH_CORE_LIBRARY_RELEASE}") endif() if(OPENMESH_CORE_LIBRARY_DEBUG) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY + set_property(TARGET CGAL_OpenMesh::CGAL_OpenMesh APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(OpenMesh::OpenMesh PROPERTIES + set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES IMPORTED_LOCATION_DEBUG "${OPENMESH_CORE_LIBRARY_DEBUG}") endif() endif() diff --git a/Installation/cmake/modules/UseOpenMesh.cmake b/Installation/cmake/modules/UseOpenMesh.cmake index 23449d7cdf9..2d08d3f98fe 100644 --- a/Installation/cmake/modules/UseOpenMesh.cmake +++ b/Installation/cmake/modules/UseOpenMesh.cmake @@ -3,3 +3,5 @@ include_directories ( ${OPENMESH_INCLUDE_DIR} ) add_definitions( -DNOMINMAX -D_USE_MATH_DEFINES ) + +message(DEPRECATION "This file UseOpenMesh.cmake is deprecated, and the imported target `CGAL::Eigen3_support` from CGAL_OpenMesh_support.cmake should be used instead.") From 603f6a5a032ab9b61537d18a0f532b593a7b108f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 27 Aug 2024 14:00:46 +0200 Subject: [PATCH 66/86] OpenMesh >= 10.0 have a OpenMeshConfig.cmake file so we do not need FindOpenMesh.cmake anymore We add the target CGAL::OpenMesh_support to make it uniform with other dependencies --- .../cmake/modules/CGAL_OpenMesh_support.cmake | 24 ++--- Installation/cmake/modules/FindOpenMesh.cmake | 98 ------------------- Installation/cmake/modules/UseOpenMesh.cmake | 7 -- 3 files changed, 9 insertions(+), 120 deletions(-) delete mode 100644 Installation/cmake/modules/FindOpenMesh.cmake delete mode 100644 Installation/cmake/modules/UseOpenMesh.cmake diff --git a/Installation/cmake/modules/CGAL_OpenMesh_support.cmake b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake index 1154b2f2cff..97df95c8115 100644 --- a/Installation/cmake/modules/CGAL_OpenMesh_support.cmake +++ b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake @@ -1,23 +1,17 @@ if(OpenMesh_FOUND AND NOT TARGET CGAL::OpenMesh_support) - add_library(CGAL::OpenMesh_support UNKNOWN IMPORTED) + add_library(CGAL::OpenMesh_support INTERFACE IMPORTED) - set_target_properties(OpenMesh::OpenMesh PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" - INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIRS}") - - if(OPENMESH_CORE_LIBRARY_RELEASE) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(OpenMesh::OpenMesh PROPERTIES - IMPORTED_LOCATION_RELEASE "${OPENMESH_CORE_LIBRARY_RELEASE}") + if(TARGET OpenMeshCore) + target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshCore) endif() - if(OPENMESH_CORE_LIBRARY_DEBUG) - set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(OpenMesh::OpenMesh PROPERTIES - IMPORTED_LOCATION_DEBUG "${OPENMESH_CORE_LIBRARY_DEBUG}") + if(TARGET OpenMeshTools) + target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshTools) endif() + + target_compile_definitions(CGAL::OpenMesh_support + INTERFACE "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES") + endif() diff --git a/Installation/cmake/modules/FindOpenMesh.cmake b/Installation/cmake/modules/FindOpenMesh.cmake deleted file mode 100644 index 1c9d2198ed9..00000000000 --- a/Installation/cmake/modules/FindOpenMesh.cmake +++ /dev/null @@ -1,98 +0,0 @@ -#This modules tries to find OpenMesh -# Once done this will define -# -# OpenMesh_FOUND - system has OpenMesh -# OPENMESH_INCLUDE_DIR - OpenMesh include directory -# OPENMESH_LIBRARIES - OpenMesh libraries -# - -find_package(OpenMesh NO_MODULE QUIET) - -# Is it already configured? -if (NOT OpenMesh_FOUND) - - find_path(OPENMESH_INCLUDE_DIR - NAMES OpenMesh/Core/Mesh/ArrayKernel.hh - HINTS ENV OPENMESH_INC_DIR - ENV OPENMESH_DIR - /usr/include - /usr/local/include - PATH_SUFFIXES src include - DOC "The directory containing the OpenMesh header files WITHOUT the OpenMesh prefix" - ) - - find_library(OPENMESH_CORE_LIBRARY_RELEASE NAMES "OpenMeshCore" - HINTS ENV OPENMESH_LIB_DIR - ENV OPENMESH_DIR - PATH_SUFFIXES lib - DOC "Path to the OpenMeshCore library" - ) - - find_library(OPENMESH_CORE_LIBRARY_DEBUG NAMES "OpenMeshCored" - HINTS ENV OPENMESH_LIB_DIR - ENV OPENMESH_DIR - PATH_SUFFIXES lib - DOC "Path to the OpenMeshCored library" - ) - - find_library(OPENMESH_TOOLS_LIBRARY_RELEASE NAMES "OpenMeshTools" - HINTS ENV OPENMESH_LIB_DIR - ENV OPENMESH_DIR - PATH_SUFFIXES lib - DOC "Path to the OpenMeshTools library" - ) - - find_library(OPENMESH_TOOLS_LIBRARY_DEBUG NAMES "OpenMeshToolsd" - HINTS ENV OPENMESH_LIB_DIR - ENV OPENMESH_DIR - PATH_SUFFIXES lib - DOC "Path to the OpenMeshToolsd library" - ) - - #select configuration depending on platform (optimized... on windows) - include(SelectLibraryConfigurations) - select_library_configurations( OPENMESH_TOOLS ) - select_library_configurations( OPENMESH_CORE ) - - set(OPENMESH_LIBRARIES ${OPENMESH_CORE_LIBRARY} ${OPENMESH_TOOLS_LIBRARY} ) - set(OPENMESH_INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR} ) - - include( FindPackageHandleStandardArgs ) - find_package_handle_standard_args(OpenMesh - REQUIRED_VARS OPENMESH_INCLUDE_DIRS OPENMESH_LIBRARIES - FOUND_VAR OpenMesh_FOUND - ) - - #target OpenMesh::OpenMesh - if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh) - add_library(CGAL_OpenMesh::CGAL_OpenMesh UNKNOWN IMPORTED) - - if(TARGET OpenMeshCore) - target_link_libraries(CGAL_OpenMesh::CGAL_OpenMesh INTERFACE OpenMeshCore) - return() - endif() - - set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES" - INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIRS}") - - if(OPENMESH_CORE_LIBRARY_RELEASE) - set_property(TARGET CGAL_OpenMesh::CGAL_OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES - IMPORTED_LOCATION_RELEASE "${OPENMESH_CORE_LIBRARY_RELEASE}") - endif() - - if(OPENMESH_CORE_LIBRARY_DEBUG) - set_property(TARGET CGAL_OpenMesh::CGAL_OpenMesh APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(CGAL_OpenMesh::CGAL_OpenMesh PROPERTIES - IMPORTED_LOCATION_DEBUG "${OPENMESH_CORE_LIBRARY_DEBUG}") - endif() - endif() - -endif() - -if(OpenMesh_FOUND) - message(STATUS "OpenMesh found") -endif() \ No newline at end of file diff --git a/Installation/cmake/modules/UseOpenMesh.cmake b/Installation/cmake/modules/UseOpenMesh.cmake deleted file mode 100644 index 2d08d3f98fe..00000000000 --- a/Installation/cmake/modules/UseOpenMesh.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# This module setups the compiler for using the OpenMesh library. -# It assumes that find_package(OpenMesh) was already called. - -include_directories ( ${OPENMESH_INCLUDE_DIR} ) -add_definitions( -DNOMINMAX -D_USE_MATH_DEFINES ) - -message(DEPRECATION "This file UseOpenMesh.cmake is deprecated, and the imported target `CGAL::Eigen3_support` from CGAL_OpenMesh_support.cmake should be used instead.") From 3f6083e6ffbcc52807c2ac2d69163de7e2d5d9a4 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 27 Aug 2024 14:02:37 +0200 Subject: [PATCH 67/86] use CGAL::OpenMesh_support in examples and tests --- BGL/examples/BGL_OpenMesh/CMakeLists.txt | 6 ++-- BGL/examples/BGL_polyhedron_3/CMakeLists.txt | 6 ++-- BGL/test/BGL/CMakeLists.txt | 28 +++++++------------ .../test/Combinatorial_map/CMakeLists.txt | 11 ++++---- .../examples/Convex_hull_3/CMakeLists.txt | 8 +++--- .../Polygon_mesh_processing/CMakeLists.txt | 19 ++++++------- .../Polygon_mesh_processing/CMakeLists.txt | 6 ++-- Property_map/test/Property_map/CMakeLists.txt | 8 ++---- .../test/STL_Extension/CMakeLists.txt | 6 ++-- .../Surface_mesh_deformation/CMakeLists.txt | 6 ++-- .../Surface_mesh_deformation/CMakeLists.txt | 6 ++-- .../Surface_mesh_segmentation/CMakeLists.txt | 6 ++-- .../Surface_mesh_shortest_path/CMakeLists.txt | 6 ++-- .../CMakeLists.txt | 6 ++-- .../CMakeLists.txt | 6 ++-- 15 files changed, 61 insertions(+), 73 deletions(-) diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index d11ac1444c9..36a1968b752 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -7,11 +7,11 @@ project(BGL_OpenMesh_Examples) # CGAL and its components find_package(CGAL REQUIRED) -find_package(OpenMesh) +find_package(OpenMesh CONFIG) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) create_single_source_cgal_program("TriMesh.cpp") - target_link_libraries(TriMesh PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(TriMesh PRIVATE CGAL::OpenMesh_support) else() message("NOTICE: This project requires OpenMesh and will not be compiled.") endif() diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 7c901c71d8e..cd6f6827467 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -16,10 +16,10 @@ create_single_source_cgal_program("range.cpp") create_single_source_cgal_program("transform_iterator.cpp") create_single_source_cgal_program("copy_polyhedron.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH) + include(CGAL_OpenMesh_support) + target_link_libraries(copy_polyhedron PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: The example 'copy_polyhedron' will not use OpenMesh.") endif() diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index fd43a685fe5..1f5bbb9ecd9 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -40,28 +40,20 @@ create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_fa create_single_source_cgal_program("graph_traits_inheritance.cpp" ) create_single_source_cgal_program("test_deprecated_io.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) + include(CGAL_OpenMesh_support) - target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_Euler_operations PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_Collapse_edge PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_Face_filtered_graph PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} ) - target_compile_definitions(test_graph_traits PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_Properties PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH) + target_link_libraries(test_clear PRIVATE CGAL::OpenMesh_support) + target_link_libraries(test_Euler_operations PRIVATE CGAL::OpenMesh_support) + target_link_libraries(test_Collapse_edge PRIVATE CGAL::OpenMesh_support) + target_link_libraries(test_Face_filtered_graph PRIVATE CGAL::OpenMesh_support) + target_link_libraries(test_graph_traits PRIVATE CGAL::OpenMesh_support ) + target_link_libraries(test_Properties PRIVATE CGAL::OpenMesh_support) + target_link_libraries(test_bgl_read_write PRIVATE CGAL::OpenMesh_support) create_single_source_cgal_program("graph_concept_OpenMesh.cpp") - target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(graph_concept_OpenMesh PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index d0c26ec31c5..17d31b5fbcf 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -27,14 +27,13 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index) create_single_source_cgal_program(cmap_test_split_attribute.cpp) # Link with OpenMesh if possible -find_package(OpenMesh QUIET) -if(TARGET OpenMesh::OpenMesh) +find_package(OpenMesh CONFIG QUIET) +if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") + include(CGAL_OpenMesh_support) - target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) - target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH) - target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh) - target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH) + target_link_libraries(Combinatorial_map_copy_test PRIVATE CGAL::OpenMesh_support) + target_link_libraries(Combinatorial_map_copy_test_index PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 4b6f08ba252..7a72a7c4caf 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -19,15 +19,15 @@ create_single_source_cgal_program("quickhull_any_dim_3.cpp") create_single_source_cgal_program("extreme_points_3_sm.cpp") create_single_source_cgal_program("extreme_indices_3.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("quickhull_OM_3.cpp") - target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(quickhull_OM_3 PRIVATE CGAL::OpenMesh_support) create_single_source_cgal_program("dynamic_hull_OM_3.cpp") - target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(dynamic_hull_OM_3 PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 718ab1096a9..911ea62ce07 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -93,32 +93,31 @@ else() message(STATUS "NOTICE: Examples that use Eigen will not be compiled.") endif() -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) create_single_source_cgal_program("compute_normals_example_OM.cpp") - target_link_libraries(compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(compute_normals_example_OM PRIVATE CGAL::OpenMesh_support) create_single_source_cgal_program("corefinement_OM_union.cpp") - target_link_libraries(corefinement_OM_union PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(corefinement_OM_union PRIVATE CGAL::OpenMesh_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("hole_filling_example_OM.cpp") - target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support ${OPENMESH_LIBRARIES}) + target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support CGAL::OpenMesh_support) endif() create_single_source_cgal_program("point_inside_example_OM.cpp") - target_link_libraries(point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(point_inside_example_OM PRIVATE CGAL::OpenMesh_support) create_single_source_cgal_program("stitch_borders_example_OM.cpp") - target_link_libraries(stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(stitch_borders_example_OM PRIVATE CGAL::OpenMesh_support) #create_single_source_cgal_program("remove_degeneracies_example.cpp") - #target_link_libraries(remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES}) - #target_compile_definitions(remove_degeneracies_example PRIVATE -DCGAL_USE_OPENMESH) + #target_link_libraries(remove_degeneracies_example PRIVATE CGAL::OpenMesh_support) create_single_source_cgal_program("triangulate_faces_example_OM.cpp") - target_link_libraries(triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(triangulate_faces_example_OM PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index f814501997c..3d78756fba8 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -112,11 +112,11 @@ else() message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.") endif() -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp") - target_link_libraries(remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(remeshing_test_P_SM_OM PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index 92a3eb097d5..78f43581afc 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -10,13 +10,11 @@ create_single_source_cgal_program("dynamic_properties_test.cpp") create_single_source_cgal_program("kernel_converter_properties_test.cpp") create_single_source_cgal_program("test_Property_container.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") - include(UseOpenMesh) - - target_link_libraries(dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES}) - target_compile_definitions(dynamic_properties_test PRIVATE -DCGAL_USE_OPENMESH) + include(CGAL_OpenMesh_support) + target_link_libraries(dynamic_properties_test PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index ee978530077..902664e75c8 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -61,13 +61,13 @@ if(TARGET CGAL::TBB_support) target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) endif() -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") - include(UseOpenMesh) + include(CGAL_OpenMesh_support) create_single_source_cgal_program("test_hash_OpenMesh.cpp") - target_link_libraries(test_hash_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_hash_OpenMesh PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index ab336b9fb26..0d93d45eda9 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -31,14 +31,14 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() - find_package(OpenMesh QUIET) + find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("all_roi_assign_example_with_OpenMesh.cpp") target_link_libraries(all_roi_assign_example_with_OpenMesh - PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support) + PRIVATE CGAL::OpenMesh_support CGAL::Eigen3_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index 398dd703748..b34653b68ec 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -16,14 +16,14 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("Symmetry_test.cpp") target_link_libraries(Symmetry_test PUBLIC CGAL::Eigen3_support) - find_package(OpenMesh QUIET) + find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("Cactus_deformation_session_OpenMesh.cpp") target_link_libraries(Cactus_deformation_session_OpenMesh - PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support) + PRIVATE CGAL::OpenMesh_support CGAL::Eigen3_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index 5ef633bb539..f944ad20b2f 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -15,13 +15,13 @@ create_single_source_cgal_program("segmentation_from_sdf_values_SM_example.cpp") create_single_source_cgal_program("segmentation_from_sdf_values_LCC_example.cpp") create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("segmentation_from_sdf_values_OpenMesh_example.cpp") - target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt index 5238bd06c18..e605b7cbaf4 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt @@ -13,13 +13,13 @@ create_single_source_cgal_program("shortest_paths_with_id.cpp") create_single_source_cgal_program("shortest_paths.cpp") create_single_source_cgal_program("shortest_path_with_locate.cpp") -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("shortest_paths_OpenMesh.cpp") - target_link_libraries(shortest_paths_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(shortest_paths_OpenMesh PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index 60135e84d4d..fbf0c06996a 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -28,13 +28,13 @@ else() message(STATUS "NOTICE: Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.") endif() -find_package(OpenMesh QUIET) +find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("edge_collapse_OpenMesh.cpp") - target_link_libraries(edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(edge_collapse_OpenMesh PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index 674ac89feff..6c50f2d1b8d 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -29,13 +29,13 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() - find_package(OpenMesh QUIET) + find_package(OpenMesh CONFIG QUIET) if(OpenMesh_FOUND) - include(UseOpenMesh) + include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") create_single_source_cgal_program("MCF_Skeleton_om_example.cpp") - target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE CGAL::OpenMesh_support) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() From b5fc288336301f7b930ae892c6caf270a8236d12 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 27 Aug 2024 14:06:46 +0200 Subject: [PATCH 68/86] update Linear_cell_complex benchmark wrt OpenMesh --- .../Linear_cell_complex_2/CMakeLists.txt | 10 ++--- .../cmake/FindOpenMesh.cmake | 40 ------------------- 2 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt index ce0dd87df2f..9c2ae7efb0c 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -18,10 +18,8 @@ include_directories(BEFORE "/usr/include/libxml2/") # add_definitions("-g") # OpenMesh -set(OPENMESH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/openmesh") -find_package(OpenMesh REQUIRED) -include_directories(${OPENMESH_INCLUDE_DIR}) -link_directories(${OPENMESH_LIBRARY_DIR}) +find_package(OpenMesh CONFIG REQUIRED) +include(CGAL_OpenMesh_support) # Polyhedron add_executable(polyhedron_performance performance_2.h polyhedron_performance.h @@ -42,7 +40,7 @@ target_link_libraries(surface_mesh_performance surface_mesh) # Open_mesh add_executable(openmesh_performance performance_2.h openmesh_performance.h openmesh_performance.cpp) -target_link_libraries(openmesh_performance ${OPENMESH_LIBRARIES}) +target_link_libraries(openmesh_performance CGAL::OpenMesh_support) # CGoGN find_package(Qt REQUIRED) @@ -91,4 +89,4 @@ target_link_libraries( Zinri z ${QT_LIBRARIES} - ${OPENMESH_LIBRARIES}) + CGAL::OpenMesh_support) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake b/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake deleted file mode 100644 index 98aefc13d23..00000000000 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# Find OpenMesh. If found, this will define -# -# OPENMESH_FOUND - Successfully found OpenMesh -# OPENMESH_INCLUDE_DIR - OpenMesh include directory -# OPENMESH_LIBRARIES - OpenMesh libraries -# OPENMESH_LIBRARY_DIR - OpenMesh library directory -# - -if(DEFINED OPENMESH_INCLUDE_DIR) - set(OPENMESH_FIND_QUIETLY TRUE) -else() - - find_path(OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh - PATHS - /usr/local/include - /usr/include - $ENV{OPENMESH_DIR}/include - ${OPENMESH_DIR}/include - ) - - if(DEFINED OPENMESH_INCLUDE_DIR) - - message(STATUS "Found OpenMesh: " ${OPENMESH_INCLUDE_DIR}) - set(OPENMESH_FOUND true) - - if(WIN32) - set(OPENMESH_LIBRARY_DIR "${OPENMESH_INCLUDE_DIR}/../lib" - CACHE PATH "OpenMesh library directory") - else() - set(OPENMESH_LIBRARY_DIR "${OPENMESH_INCLUDE_DIR}/../lib/OpenMesh" - CACHE PATH "OpenMesh library directory") - endif() - - set(OPENMESH_LIBRARIES "OpenMeshCore;OpenMeshTools" - CACHE STRING "OpenMesh libraries") - - else() - set(OPENMESH_FOUND FALSE) - endif() -endif() From 261bf3aa81b003fdbe31ac1bae3aacc4740f3fe9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 27 Aug 2024 17:53:22 +0200 Subject: [PATCH 69/86] try to create bug-fixes releases --- .../bin/create_internal_release_of_the_day.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py index f2a97610321..ab1b640f42a 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py @@ -13,8 +13,8 @@ from cgal_release import release, integration, master, beta_release, master, bet # Define a dictionary that maps day of the week to an action actions = { "Monday": integration, - "Tuesday": integration, - "Wednesday": integration, + "Tuesday": release("5.5"), #integration, + "Wednesday": release("5.6"), #integration, "Thursday": integration, "Friday": release("5.5"), "Saturday": release("5.6"), From 4eb51f79d0c7dad473dfe77f7b6ca3f765529e11 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 28 Aug 2024 10:46:59 +0200 Subject: [PATCH 70/86] fixed saving paths --- .../polyfit_example_model_complexty_control.cpp | 6 +++--- .../polyfit_example_user_provided_planes.cpp | 2 +- .../polyfit_example_with_region_growing.cpp | 2 +- .../polyfit_example_without_input_planes.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp index 64fd9a9784a..e132d62975d 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp @@ -90,7 +90,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.05.off"; + const std::string& output_file = "building_result-0.05.off"; if (CGAL::IO::write_OFF(output_file, model)) { std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } @@ -108,7 +108,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.5.off"; + const std::string& output_file = "building_result-0.5.off"; if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { @@ -125,7 +125,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.7.off"; + const std::string& output_file = "building_result-0.7.off"; if (CGAL::IO::write_OFF(output_file, model)){ std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp index 733f0113749..2f2ed2df2c9 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp @@ -89,7 +89,7 @@ int main() } // Saves the mesh model - const std::string& output_file("data/ball_result.off"); + const std::string& output_file("user_provided_planes_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index 8dc81bd3c1e..493c8c138aa 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -172,7 +172,7 @@ int main() std::cout << "Saving..."; t.reset(); - const std::string& output_file("data/cube_result.off"); + const std::string& output_file("with_region_growing_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index 85e474d99d7..b04ba46dd0b 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -138,7 +138,7 @@ int main() // Also stores the candidate faces as a surface mesh to a file Surface_mesh candidate_faces; algo.output_candidate_faces(candidate_faces); - const std::string& candidate_faces_file("data/cube_candidate_faces.off"); + const std::string& candidate_faces_file("without_input_planes_result.off"); std::ofstream candidate_stream(candidate_faces_file.c_str()); if (CGAL::IO::write_OFF(candidate_stream, candidate_faces)) std::cout << "Candidate faces saved to " << candidate_faces_file << "." << std::endl; From 860f60b090c05b83378885d81cc81598e14fa996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 28 Aug 2024 11:23:06 +0200 Subject: [PATCH 71/86] need c++17 --- Triangulation_3/test/Triangulation_3/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index d5156f0d1e6..2da2b2aeecc 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -23,10 +23,11 @@ create_single_source_cgal_program( "test_RT_cell_base_with_weighted_circumcenter_3.cpp") create_single_source_cgal_program("test_robust_weighted_circumcenter.cpp") create_single_source_cgal_program("test_simplex_3.cpp") -create_single_source_cgal_program( "test_simplex_iterator_3.cpp" ) -create_single_source_cgal_program( "test_segment_cell_traverser_3.cpp" ) create_single_source_cgal_program( "test_segment_simplex_traverser_3.cpp" ) if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + create_single_source_cgal_program( "test_simplex_iterator_3.cpp" ) + create_single_source_cgal_program( "test_segment_cell_traverser_3.cpp" ) + target_compile_features(test_simplex_iterator_3 PRIVATE cxx_std_17) target_compile_features(test_segment_simplex_traverser_3 PRIVATE cxx_std_17) else() message( From 377e2f11bcdf71ec0126ef244c4f160bda27bc28 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 26 Aug 2024 15:38:45 +0200 Subject: [PATCH 72/86] create_new_release with SELinux: call restorecon --- Scripts/developer_scripts/create_new_release | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 692ed94e7fa..2b0e0f2ff2b 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -323,6 +323,9 @@ if [ -n "$DO_PUBLIC" ]; then zip -q -r ${public_release_name}-library.zip ${public_release_name} mv ${public_release_name}*.tar.xz "${HTML_DIR}/${release_name}-public/" mv ${public_release_name}*.zip "${HTML_DIR}/${release_name}-public/" + if command -v sestatus >/dev/null 2>&1; then + sestatus && restorecon -R "${HTML_DIR}/${release_name}-public" + fi rm -f "$HTML_DIR/CGAL-last-public" ln -s "${release_name}-public" "$HTML_DIR/CGAL-last-public" fi From 706c5f12ae1b12d5ed952733a5e43e4224da891e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 28 Aug 2024 11:49:05 +0200 Subject: [PATCH 73/86] backport of https://github.com/CGAL/cgal/pull/7499 --- .../CGAL/OSQP_quadratic_program_traits.h | 126 ++++++++---------- .../CGAL/SCIP_mixed_integer_program_traits.h | 5 + 2 files changed, 60 insertions(+), 71 deletions(-) diff --git a/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h b/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h index 002b6acba83..261c4c514b0 100644 --- a/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h +++ b/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h @@ -44,9 +44,9 @@ namespace CGAL { number type that `FieldNumberType` \note The `FT` type is provided for convenience. Internally, this FT type is converted - to `c_float` type that can be set either to `float` or `double`. By default, the `double` - type is used. After the optimization is complete, the `c_float` type is converted back to `FT`. - See more about `c_float` here. + to `OSQPFloat` type that can be set either to `float` or `double`. By default, the `double` + type is used. After the optimization is complete, the `OSQPFloat` type is converted back to `FT`. + See more about `OSQPFloat` here. \cgalModels `QuadraticProgramTraits` */ @@ -192,27 +192,27 @@ public: CGAL_precondition(q_vec.size() == n); CGAL_precondition(l_vec.size() == m && l_vec.size() == m); - const c_int P_nnz = static_cast(P_vec.size()); - auto P_x = std::make_unique(P_nnz); - auto P_i = std::make_unique(P_nnz); - auto P_p = std::make_unique(n + 1); + const OSQPInt P_nnz = static_cast(P_vec.size()); + auto P_x = std::make_unique(P_nnz); + auto P_i = std::make_unique(P_nnz); + auto P_p = std::make_unique(n + 1); set_matrix_from_triplets("P", P_vec, P_x.get(), P_i.get(), P_p.get()); if(verbose) std::cout << "P_nnz: " << P_nnz << std::endl; - const c_int A_nnz = static_cast(A_vec.size()); - auto A_x = std::make_unique(A_nnz); - auto A_i = std::make_unique(A_nnz); - auto A_p = std::make_unique(n + 1); + const OSQPInt A_nnz = static_cast(A_vec.size()); + auto A_x = std::make_unique(A_nnz); + auto A_i = std::make_unique(A_nnz); + auto A_p = std::make_unique(n + 1); set_matrix_from_triplets("A", A_vec, A_x.get(), A_i.get(), A_p.get()); if(verbose) std::cout << "A_nnz: " << A_nnz << std::endl; - const c_int q_size = static_cast(q_vec.size()); - const c_int l_size = static_cast(l_vec.size()); - const c_int u_size = static_cast(u_vec.size()); + const OSQPInt q_size = static_cast(q_vec.size()); + const OSQPInt l_size = static_cast(l_vec.size()); + const OSQPInt u_size = static_cast(u_vec.size()); - auto q_x = std::make_unique(q_size); - auto l_x = std::make_unique(l_size); - auto u_x = std::make_unique(u_size); + auto q_x = std::make_unique(q_size); + auto l_x = std::make_unique(l_size); + auto u_x = std::make_unique(u_size); set_qlu_data(q_x.get(), l_x.get(), u_x.get()); // Problem settings. @@ -220,22 +220,11 @@ public: CGAL_assertion(settings); // Structures. - OSQPWorkspace *work; - OSQPData *data = (OSQPData *) malloc(sizeof(OSQPData)); - CGAL_assertion(data); + OSQPCscMatrix* P = static_cast(malloc(sizeof(OSQPCscMatrix))); + OSQPCscMatrix* A = static_cast(malloc(sizeof(OSQPCscMatrix))); - // Populate data. - data->n = static_cast(n); - data->m = static_cast(m); - data->P = csc_matrix(data->n, data->n, P_nnz, P_x.get(), P_i.get(), P_p.get()); - CGAL_assertion(data->P); - - data->q = q_x.get(); - data->A = csc_matrix(data->m, data->n, A_nnz, A_x.get(), A_i.get(), A_p.get()); - CGAL_assertion(data->A); - - data->l = l_x.get(); - data->u = u_x.get(); + csc_set_data(A, m, n, A_nnz, A_x.get(), A_i.get(), A_p.get()); + csc_set_data(P, n, n, P_nnz, P_x.get(), P_i.get(), P_p.get()); // Set solver settings. osqp_set_default_settings(settings); @@ -243,38 +232,33 @@ public: settings->eps_rel = eps_rel; settings->verbose = verbose; - // Set workspace. - osqp_setup(&work, data, settings); + OSQPSolver* solver = NULL; + OSQPInt exitflag = osqp_setup(&solver, P, q_x.get(), A, l_x.get(), u_x.get(), m, n, settings); - // Solve problem. - c_int exitflag = -1; try { - exitflag = osqp_solve(work); + if (!exitflag) + exitflag = osqp_solve(solver); + + const OSQPFloat* x = solver->solution->x; + for (std::size_t i = 0; i < n; ++i) + { + const FT value{ x[i] }; + *(++solution) = value; + } } - catch(std::exception& e) + catch (std::exception& e) { std::cerr << "ERROR: OSQP solver has thrown an exception!" << std::endl; std::cerr << e.what() << std::endl; } - const bool success = (exitflag == 0); - // Create solution. - const c_float *x = work->solution->x; - for(std::size_t i=0; iA); - c_free(data->P); - c_free(data); - c_free(settings); - - return success; + return (exitflag == 0); } /// \endcond @@ -282,9 +266,9 @@ private: // Based on the code in scipy, function coo_tocsr() void set_matrix_from_triplets(const std::string /* name */, const std::vector& triplets, - c_float *M_x, - c_int *M_i, - c_int *M_p) const + OSQPFloat *M_x, + OSQPInt *M_i, + OSQPInt *M_p) const { const std::size_t nnz = triplets.size(); @@ -296,10 +280,10 @@ private: } // Fill M_p - c_int cumsum = 0; + OSQPInt cumsum = 0; for(std::size_t j=0; j(std::get<1>(triplets[k])); - const c_int dest = M_p[col]; + const OSQPInt col = static_cast(std::get<1>(triplets[k])); + const OSQPInt dest = M_p[col]; - M_i[dest] = static_cast(std::get<0>(triplets[k])); - M_x[dest] = c_float(CGAL::to_double(std::get<2>(triplets[k]))); + M_i[dest] = static_cast(std::get<0>(triplets[k])); + M_x[dest] = OSQPFloat(CGAL::to_double(std::get<2>(triplets[k]))); M_p[col]++; } - c_int last = 0; + OSQPInt last = 0; for(std::size_t j=0; j<=n; ++j) { - const c_int tmp = M_p[j]; + const OSQPInt tmp = M_p[j]; M_p[j] = last; last = tmp; } @@ -341,19 +325,19 @@ private: // std::cout << std::endl; } - void set_qlu_data(c_float *q_x, - c_float *l_x, - c_float *u_x) const + void set_qlu_data(OSQPFloat *q_x, + OSQPFloat *l_x, + OSQPFloat *u_x) const { for(std::size_t i=0; i Date: Wed, 28 Aug 2024 11:58:03 +0200 Subject: [PATCH 74/86] backport of https://github.com/CGAL/cgal/pull/7382 --- BGL/test/BGL/CMakeLists.txt | 4 ++-- Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt | 2 +- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index da8baf25ccb..4f76ac1664e 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -130,9 +130,9 @@ if (VTK_FOUND) if(VTK_LIBRARIES) target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK) + target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX) target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK) + target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX) else() message(STATUS "Tests that use VTK will not be compiled.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index d7ed3ec6bb8..bfe4bee7b74 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -66,7 +66,7 @@ if(VTK_FOUND) polyhedron_demo_plugin(vtk_plugin VTK_io_plugin KEYWORDS Viewer Mesh_3) target_link_libraries(vtk_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item scene_points_with_normal_item ${VTK_LIBRARIES}) - target_compile_definitions(vtk_plugin PRIVATE -DCGAL_USE_VTK) + target_compile_definitions(vtk_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) else() message( STATUS diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index 89d05476c46..d60aeb2f6d0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -73,7 +73,7 @@ if(Boost_FILESYSTEM_FOUND) KEYWORDS Viewer Mesh_3) target_link_libraries(io_image_plugin PUBLIC scene_image_item ${VTK_LIBRARIES} CGAL::CGAL_ImageIO) if(VTK_LIBRARIES) - target_compile_definitions(io_image_plugin PRIVATE CGAL_USE_VTK) + target_compile_definitions(io_image_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) endif() if(TARGET Boost::filesystem) target_link_libraries(io_image_plugin PUBLIC Boost::filesystem From af8e134aa6d26da08eab18e1436ac693066c33ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 28 Aug 2024 14:04:57 +0200 Subject: [PATCH 75/86] doc boost mp as gmp replacement --- .../doc/Documentation/Third_party.txt | 31 +++++++++++++------ Documentation/doc/Documentation/Usage.txt | 2 +- Documentation/doc/Documentation/windows.txt | 2 +- Installation/CHANGES.md | 2 ++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index d2eeb5d9b7e..eaafe426bdd 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -72,23 +72,34 @@ As there is no canonical directory for where to find \boost on Windows, we recommend that you define the environment variable `BOOST_ROOT` and set it to where you have installed \boost, e.g., `C:\boost\boost_1_70_0`. -\subsection thirdpartyMPFR GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries -GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later +\subsection thirdpartyMP Multi Precision Number Type Library -The components \cgal, `CGAL_Core`, and `CGAL_Qt6` require -\gmp and \mpfr which are libraries for multi precision integers and rational numbers, -and for multi precision floating point numbers. - -\cgal combines floating point arithmetic with exact arithmetic -in order to be efficient and reliable. \cgal has a built-in -number type for that, but \gmp and \mpfr provide a faster -solution, and we recommend using them. +GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries +are libraries for multi precision integers and rational numbers, and for multi precision floating point numbers. These libraries can be obtained from `https://gmplib.org/` and `https://www.mpfr.org/`. Since Visual \cpp is not properly supported by the \gmp and \mpfr projects, we provide precompiled versions of \gmp and \mpfr, which can be downloaded from the assets of a release. +Version supported are GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later. + +The \boost library also provides a module for multi precision integers and rational numbers: +\boost multiprecision. +Versions supported are \boost Version 1.72 or later. + +The components \cgal, and `CGAL_Qt6` require either \gmp and \mpfr, or \boost multiprecision +for multi precision numbers. `CGAL_Core` requires \boost multiprecision. + +\cgal combines floating point arithmetic with exact arithmetic +in order to be efficient and reliable. \cgal has a built-in +number type for that, but previous alternatives are faster +solutions, and we recommend using one of them. + +The CMake variable `CGAL_CMAKE_EXACT_NT_BACKEND` can be used to select +the library that will be used internally for multi precision number types. +The variable `CGAL_CMAKE_EXACT_NT_BACKEND-STRINGS` contains all the possible +values. \section secoptional3rdpartysoftware Optional Third Party Libraries diff --git a/Documentation/doc/Documentation/Usage.txt b/Documentation/doc/Documentation/Usage.txt index 68a3ae85001..8547affb691 100644 --- a/Documentation/doc/Documentation/Usage.txt +++ b/Documentation/doc/Documentation/Usage.txt @@ -36,7 +36,7 @@ Using \cgal requires a few core components to be previously installed:
  • a supported compiler (see Section \ref seccompilers),
  • \ref seccmake,
  • \ref thirdpartyBoost,
  • -
  • \ref thirdpartyMPFR.
  • +
  • a \ref thirdpartyMP.
  • Optional third-party software might be required to build examples and demos shipped with \cgal, diff --git a/Documentation/doc/Documentation/windows.txt b/Documentation/doc/Documentation/windows.txt index c7d613e5c3a..b0b8875c2ee 100644 --- a/Documentation/doc/Documentation/windows.txt +++ b/Documentation/doc/Documentation/windows.txt @@ -6,7 +6,7 @@ 15.9, 16.0, 17.0 (\visualstudio 2017, 2019, and 2022). \cgal is a library that has mandatory dependencies that must be first installed: -\ref thirdpartyBoost and \ref thirdpartyMPFR. +\ref thirdpartyBoost and a \ref thirdpartyMP. You have two options to install \cgal and its dependencies: you can either use the *Vcpkg library manager*, which will automatically install an appropriate version of diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index a8ddd38c1a1..6526c913414 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -13,6 +13,8 @@ Release date: June 2024 - LLVM Clang version 15.0.7 or later (on Linux) - Apple Clang compiler versions 10.0.1, 12.0.5, and 15.0.0 (on macOS) - The minimal supported version of Boost is now 1.72.0. +- GMP/MPFR are no longer mandatory to use CGAL, [Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html). + can be used instead. - The CGAL `Core` library is no longer based on GMP, but on [Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html). Either GMP backend or Boost backend can be used. From 6917edd6973b181a892b11caea9622c0ab55334d Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 28 Aug 2024 16:16:25 +0200 Subject: [PATCH 76/86] added test for formerly unused OutputIteratorValueType --- .../test/Stream_support/data/simple_ascii.ply | 16 ++++++ .../test/Stream_support/issue8155.cpp | 50 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Stream_support/test/Stream_support/data/simple_ascii.ply create mode 100644 Stream_support/test/Stream_support/issue8155.cpp diff --git a/Stream_support/test/Stream_support/data/simple_ascii.ply b/Stream_support/test/Stream_support/data/simple_ascii.ply new file mode 100644 index 00000000000..5bc4a19d34f --- /dev/null +++ b/Stream_support/test/Stream_support/data/simple_ascii.ply @@ -0,0 +1,16 @@ +ply +format ascii 1.0 +comment VCGLIB generated +element vertex 3 +property float x +property float y +property float z +property float nx +property float ny +property float nz +element face 0 +property list uchar int vertex_indices +end_header +1 1 1 2 2 2 +3 3 3 4 4 4 +5 5 5 6 6 6 diff --git a/Stream_support/test/Stream_support/issue8155.cpp b/Stream_support/test/Stream_support/issue8155.cpp new file mode 100644 index 00000000000..f92bf9cca84 --- /dev/null +++ b/Stream_support/test/Stream_support/issue8155.cpp @@ -0,0 +1,50 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_3 Point_3; +typedef Kernel::Vector_3 Vector_3; +typedef std::pair PointVectorPair; +typedef CGAL::First_of_pair_property_map Point_map; +typedef CGAL::Second_of_pair_property_map Normal_map; + +int main() +{ + std::vector pv_pairs; + const std::function lambda = + [&](const PointVectorPair& p) { + FT len = p.second.squared_length(); + if (len > 0 || len != 1.0) { + Vector_3 n = p.second * (1.0 / CGAL::sqrt(len)); + pv_pairs.push_back(std::make_pair(p.first, n)); + } + else pv_pairs.push_back(p); + }; + + pv_pairs.clear(); + std::ifstream file("data/simple_ascii.ply"); + CGAL::IO::read_PLY_with_properties(file, boost::function_output_iterator(lambda), + CGAL::make_ply_point_reader(Point_map()), + CGAL::make_ply_normal_reader(Normal_map())); + + assert(pv_pairs[0].first == Point_3(1, 1, 1)); + assert(pv_pairs[1].first == Point_3(3, 3, 3)); + assert(pv_pairs[2].first == Point_3(5, 5, 5)); + + for (std::size_t i = 0; i < pv_pairs.size(); i++) { + FT dev = CGAL::abs(1.0 - pv_pairs[i].second.squared_length()); + assert(dev < 0.01); + } + + return 0; +} From fdd8f7f3749493daafd94bc8bb9e67aa5f7f7497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Aug 2024 09:08:14 +0200 Subject: [PATCH 77/86] data dir does not exist --- .../polyfit_example_without_input_planes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index b04ba46dd0b..c676fd83bbf 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -125,7 +125,7 @@ int main() return EXIT_FAILURE; } - const std::string& output_file("data/cube_result.off"); + const std::string& output_file("cube_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { From abd99b68eb30fd4c7d13362091680e7720d19700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Aug 2024 10:10:20 +0200 Subject: [PATCH 78/86] handle nested holes in convex decomposition --- .../cd_nested_holes_test.cpp | 53 ++++++ .../test/Convex_decomposition_3/data/in1.off | 117 ++++++++++++ .../test/Convex_decomposition_3/data/in2.off | 144 ++++++++++++++ .../test/Convex_decomposition_3/data/in3.off | 180 ++++++++++++++++++ .../test/Convex_decomposition_3/data/in4.off | 180 ++++++++++++++++++ Nef_3/include/CGAL/Nef_polyhedron_3.h | 98 +++++++++- 6 files changed, 764 insertions(+), 8 deletions(-) create mode 100644 Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp create mode 100644 Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off create mode 100644 Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off create mode 100644 Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off create mode 100644 Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp new file mode 100644 index 00000000000..3c69b2a5339 --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron_3; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; +typedef Nef_polyhedron_3::Volume_const_iterator Volume_const_iterator; + +std::size_t run(std::string path) +{ + Polyhedron_3 input; + std::ifstream(path) >> input; + + Nef_polyhedron_3 N(input); + + CGAL::convex_decomposition_3(N); + std::list convex_parts; + + Volume_const_iterator ci = ++N.volumes_begin(); + for( ; ci != N.volumes_end(); ++ci) { + if(ci->mark()) { + Polyhedron_3 P; + N.convert_inner_shell_to_polyhedron(ci->shells_begin(), P); + convex_parts.push_back(P); + } + } + +// int i=0; + for (const Polyhedron_3& P : convex_parts) + { +// std::ofstream("out_"+std::to_string(i++)+".off") << std::setprecision(17) << P; + CGAL_assertion(P.size_of_vertices()!=0); + } + + return convex_parts.size(); +} + +int main() +{ + std::size_t val = run("data/in1.off"); + assert(val==9); + val = run("data/in2.off"); + assert(val==10); + val = run("data/in3.off"); + assert(val==13); + val = run("data/in4.off"); + assert(val==17); +} diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off new file mode 100644 index 00000000000..dabda4d9d3e --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off @@ -0,0 +1,117 @@ +OFF 40 76 0 +5 -5 4 +5 -5 2 +5 5 2 +5 5 4 +5 -5 -2 +5 -5 -4 +5 5 -4 +5 5 -2 +-5 5 4 +-5 -5 4 +-4 -4 4 +-4 4 4 +4 4 4 +4 -4 4 +-5 -5 -4 +-5 5 -4 +-4 4 -4 +-4 -4 -4 +4 -4 -4 +4 4 -4 +-5 5 2 +-5 -5 2 +-5 -5 -2 +-5 5 -2 +4 4 2 +4 -4 2 +4 -4 -2 +4 4 -2 +-4 4 2 +-4 -4 2 +-4 4 -2 +-4 -4 -2 +6 -6 2 +6 -6 -2 +6 6 -2 +6 6 2 +-6 6 2 +-6 -6 2 +-6 -6 -2 +-6 6 -2 +3 0 2 3 +3 2 0 1 +3 4 6 7 +3 6 4 5 +3 3 12 0 +3 3 11 12 +3 11 8 10 +3 8 11 3 +3 13 0 12 +3 10 0 13 +3 10 9 0 +3 9 10 8 +3 5 18 6 +3 5 17 18 +3 17 14 16 +3 14 17 5 +3 19 6 18 +3 16 6 19 +3 16 15 6 +3 15 16 14 +3 21 8 20 +3 8 21 9 +3 14 23 15 +3 23 14 22 +3 2 8 3 +3 8 2 20 +3 6 23 7 +3 23 6 15 +3 21 0 9 +3 0 21 1 +3 14 4 22 +3 4 14 5 +3 25 12 24 +3 12 25 13 +3 18 27 19 +3 27 18 26 +3 10 28 11 +3 28 10 29 +3 31 16 30 +3 16 31 17 +3 28 12 11 +3 12 28 24 +3 16 27 30 +3 27 16 19 +3 25 10 13 +3 10 25 29 +3 18 31 26 +3 31 18 17 +3 32 34 35 +3 34 32 33 +3 35 2 32 +3 35 20 2 +3 20 36 21 +3 36 20 35 +3 1 32 2 +3 21 32 1 +3 21 37 32 +3 37 21 36 +3 28 25 24 +3 25 28 29 +3 33 4 34 +3 33 22 4 +3 22 38 23 +3 38 22 33 +3 7 34 4 +3 23 34 7 +3 23 39 34 +3 39 23 38 +3 31 27 26 +3 27 31 30 +3 38 36 39 +3 36 38 37 +3 34 36 35 +3 36 34 39 +3 38 32 37 +3 32 38 33 diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off new file mode 100644 index 00000000000..d09ff781d58 --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off @@ -0,0 +1,144 @@ +OFF +48 92 0 + +2 2 2 +2 -2 2 +-2 2 2 +-2 -2 2 +-2 2 4 +2 2 4 +-2 -2 4 +2 -2 4 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +3 2 4 5 +3 7 6 3 +3 5 7 1 +3 6 7 5 +3 3 6 4 +3 5 0 2 +3 3 1 7 +3 1 0 5 +3 5 4 6 +3 4 2 3 +3 8 28 10 +3 28 8 31 +3 34 18 37 +3 18 34 14 +3 10 20 8 +3 10 9 20 +3 9 17 22 +3 17 9 10 +3 11 8 20 +3 22 8 11 +3 22 12 8 +3 12 22 17 +3 14 26 18 +3 14 13 26 +3 13 19 24 +3 19 13 14 +3 15 18 26 +3 24 18 15 +3 24 16 18 +3 16 24 19 +3 32 17 29 +3 17 32 12 +3 19 38 16 +3 38 19 35 +3 28 17 10 +3 17 28 29 +3 18 38 37 +3 38 18 16 +3 32 8 12 +3 8 32 31 +3 19 34 35 +3 34 19 14 +3 47 20 46 +3 20 47 11 +3 26 25 15 +3 25 26 21 +3 22 45 9 +3 45 22 44 +3 40 24 23 +3 24 40 13 +3 45 20 9 +3 20 45 46 +3 24 25 23 +3 25 24 15 +3 47 22 11 +3 22 47 44 +3 26 40 21 +3 40 26 13 +3 27 42 30 +3 42 27 36 +3 30 28 27 +3 30 29 28 +3 29 41 32 +3 41 29 30 +3 31 27 28 +3 32 27 31 +3 32 33 27 +3 33 32 41 +3 2 0 45 +3 1 44 47 +3 36 34 42 +3 36 35 34 +3 35 43 38 +3 43 35 36 +3 37 42 34 +3 38 42 37 +3 38 39 42 +3 39 38 43 +3 40 25 21 +3 25 40 23 +3 43 41 39 +3 41 43 33 +3 42 41 30 +3 41 42 39 +3 43 27 33 +3 27 43 36 +3 44 1 3 +3 44 3 45 +3 45 3 2 +3 46 45 0 +3 46 0 47 +3 47 0 1 + diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off new file mode 100644 index 00000000000..7685150981d --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off @@ -0,0 +1,180 @@ +OFF +60 116 0 + +1 1 4 +1 0.33333333333333337 4 +1 -1 4 +0.33333333333333337 -1 4 +-1 -1 4 +-1 0.33333333333333337 4 +-1 1 4 +0.33333333333333337 1 4 +-2 2 2 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-2 -2 2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +2 -2 2 +2 2 2 +-2 2 4 +2 2 4 +2 -2 4 +-2 -2 4 +1 1 2 +1 -1 2 +-1 -1 2 +-1 1 2 +3 8 52 53 +3 54 55 45 +3 53 54 50 +3 0 1 53 +3 45 55 52 +3 53 51 8 +3 45 50 54 +3 50 51 53 +3 4 5 55 +3 52 8 45 +3 9 29 11 +3 29 9 32 +3 35 19 38 +3 19 35 15 +3 11 21 9 +3 11 10 21 +3 10 18 23 +3 18 10 11 +3 12 9 21 +3 23 9 12 +3 23 13 9 +3 13 23 18 +3 15 27 19 +3 15 14 27 +3 14 20 25 +3 20 14 15 +3 16 19 27 +3 25 19 16 +3 25 17 19 +3 17 25 20 +3 33 18 30 +3 18 33 13 +3 20 39 17 +3 39 20 36 +3 29 18 11 +3 18 29 30 +3 19 39 38 +3 39 19 17 +3 33 9 13 +3 9 33 32 +3 20 35 36 +3 35 20 15 +3 49 21 48 +3 21 49 12 +3 27 26 16 +3 26 27 22 +3 23 47 10 +3 47 23 46 +3 41 25 24 +3 25 41 14 +3 47 21 10 +3 21 47 48 +3 25 26 24 +3 26 25 16 +3 49 23 12 +3 23 49 46 +3 27 41 22 +3 41 27 14 +3 28 43 31 +3 43 28 37 +3 31 29 28 +3 31 30 29 +3 30 42 33 +3 42 30 31 +3 32 28 29 +3 33 28 32 +3 33 34 28 +3 34 33 42 +3 8 51 47 +3 50 46 49 +3 37 35 43 +3 37 36 35 +3 36 44 39 +3 44 36 37 +3 38 43 35 +3 39 43 38 +3 39 40 43 +3 40 39 44 +3 41 26 22 +3 26 41 24 +3 44 42 40 +3 42 44 34 +3 43 42 31 +3 42 43 40 +3 44 28 34 +3 28 44 37 +3 46 50 45 +3 46 45 47 +3 47 45 8 +3 48 47 51 +3 48 51 49 +3 49 51 50 +3 52 55 5 +3 52 7 53 +3 52 5 6 +3 53 7 0 +3 52 6 7 +3 54 53 1 +3 54 2 3 +3 54 1 2 +3 55 54 3 +3 55 3 4 +3 58 57 56 +3 59 56 7 +3 2 57 3 +3 0 56 1 +3 5 59 6 +3 56 59 58 +3 57 1 56 +3 57 2 1 +3 58 5 4 +3 7 56 0 +3 58 3 57 +3 4 3 58 +3 59 5 58 +3 7 6 59 + diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off new file mode 100644 index 00000000000..1a7bbd1ba82 --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off @@ -0,0 +1,180 @@ +OFF +60 116 0 + +1 1 4 +1 0.5 4 +1 -1 4 +0.5 -1 4 +-1 -1 4 +-1 0.5 4 +-1 1 4 +0.5 1 4 +-2 2 2 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-2 -2 2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +2 -2 2 +2 2 2 +-2 2 4 +2 2 4 +2 -2 4 +-2 -2 4 +1 1 1 +1 -1 1 +-1 -1 1 +-1 1 1 +3 8 52 53 +3 54 55 45 +3 53 54 50 +3 0 1 53 +3 45 55 52 +3 53 51 8 +3 45 50 54 +3 50 51 53 +3 4 5 55 +3 52 8 45 +3 9 29 11 +3 29 9 32 +3 35 19 38 +3 19 35 15 +3 11 21 9 +3 11 10 21 +3 10 18 23 +3 18 10 11 +3 12 9 21 +3 23 9 12 +3 23 13 9 +3 13 23 18 +3 15 27 19 +3 15 14 27 +3 14 20 25 +3 20 14 15 +3 16 19 27 +3 25 19 16 +3 25 17 19 +3 17 25 20 +3 33 18 30 +3 18 33 13 +3 20 39 17 +3 39 20 36 +3 29 18 11 +3 18 29 30 +3 19 39 38 +3 39 19 17 +3 33 9 13 +3 9 33 32 +3 20 35 36 +3 35 20 15 +3 49 21 48 +3 21 49 12 +3 27 26 16 +3 26 27 22 +3 23 47 10 +3 47 23 46 +3 41 25 24 +3 25 41 14 +3 47 21 10 +3 21 47 48 +3 25 26 24 +3 26 25 16 +3 49 23 12 +3 23 49 46 +3 27 41 22 +3 41 27 14 +3 28 43 31 +3 43 28 37 +3 31 29 28 +3 31 30 29 +3 30 42 33 +3 42 30 31 +3 32 28 29 +3 33 28 32 +3 33 34 28 +3 34 33 42 +3 8 51 47 +3 50 46 49 +3 37 35 43 +3 37 36 35 +3 36 44 39 +3 44 36 37 +3 38 43 35 +3 39 43 38 +3 39 40 43 +3 40 39 44 +3 41 26 22 +3 26 41 24 +3 44 42 40 +3 42 44 34 +3 43 42 31 +3 42 43 40 +3 44 28 34 +3 28 44 37 +3 46 50 45 +3 46 45 47 +3 47 45 8 +3 48 47 51 +3 48 51 49 +3 49 51 50 +3 52 55 5 +3 52 7 53 +3 52 5 6 +3 53 7 0 +3 52 6 7 +3 54 53 1 +3 54 2 3 +3 54 1 2 +3 55 54 3 +3 55 3 4 +3 58 57 56 +3 59 56 7 +3 2 57 3 +3 0 56 1 +3 5 59 6 +3 56 59 58 +3 57 1 56 +3 57 2 1 +3 58 5 4 +3 7 56 0 +3 58 3 57 +3 4 3 58 +3 59 5 58 +3 7 6 59 + diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 05ef4dea923..7b129f9dda2 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -904,10 +904,11 @@ protected: Unique_hash_map& omit_vertex; int nov, nof; + bool hh; public: Find_holes(Unique_hash_map& omit_vertex_) - : omit_vertex(omit_vertex_), nov(0), nof(0) {} + : omit_vertex(omit_vertex_), nov(0), nof(0), hh(false) {} void visit(Halffacet_const_handle f) { ++nof; @@ -920,10 +921,11 @@ protected: CGAL_For_all(sfc, send) { omit_vertex[sfc->source()->source()] = true; --nov; + hh=true; } } else if(fc.is_shalfloop()) { SHalfloop_const_handle sl(fc); - omit_vertex[sl->incident_sface()->center_vertex()]; + omit_vertex[sl->incident_sface()->center_vertex()] = true; --nov; } else CGAL_error_msg( "wrong handle type"); @@ -943,6 +945,63 @@ protected: int number_of_facets() const { return nof; } + + bool holes_detected() const { + return hh; + } + }; + + class Nested_holes { + + Unique_hash_map& omit_vertex; + int norv, nof; + + public: + Nested_holes(Unique_hash_map& omit_vertex_) + : omit_vertex(omit_vertex_), norv(0), nof(0) {} + + void visit(Halffacet_const_handle f) { + Halffacet_cycle_const_iterator fc = f->facet_cycles_begin(); + CGAL_assertion(fc.is_shalfedge()); + + SHalfedge_around_facet_const_circulator sfc(fc), send(sfc); + bool all_in=true; + bool all_out=true; + CGAL_For_all(sfc, send) { + if (omit_vertex[sfc->source()->source()]) + all_in=false; + else + all_out=false; + } + if (!all_in && !all_out) + { + SHalfedge_around_facet_const_circulator sfc(fc), send(sfc); + ++nof; + CGAL_For_all(sfc, send) { + if (!omit_vertex[sfc->source()->source()]) + { + omit_vertex[sfc->source()->source()]=true; + ++norv; + } + } + } + if (all_in) + ++nof; + } + + void visit(Vertex_const_handle) {} + void visit(SFace_const_handle) {} + void visit(Halfedge_const_handle) {} + void visit(SHalfedge_const_handle) {} + void visit(SHalfloop_const_handle) {} + + int number_of_removed_vertices() const { + return norv; + } + + int number_of_facets() const { + return nof; + } }; class Add_vertices { @@ -1001,14 +1060,19 @@ protected: se = SHalfedge_const_handle(fc); CGAL_assertion(se!=0); if(omit_vertex[se->source()->source()]) return; - B.begin_facet(); + SHalfedge_around_facet_const_circulator hc_start(se); SHalfedge_around_facet_const_circulator hc_end(hc_start); + std::vector vids; CGAL_For_all(hc_start,hc_end) { - CGAL_NEF_TRACEN(" add vertex " << hc_start->source()->center_vertex()->point()); - B.add_vertex_to_facet(VI[hc_start->source()->center_vertex()]); + if (omit_vertex[hc_start->source()->center_vertex()]) + { + std::cout << "issue with " << se->source()->source()->point() << "\n"; + return; + } + vids.push_back(VI[hc_start->source()->center_vertex()]); } - B.end_facet(); + B.add_facet (vids.begin(), vids.end()); } void visit(SFace_const_handle) {} @@ -1033,11 +1097,29 @@ protected: Polyhedron_incremental_builder_3 B(hds, true); + // first mark vertices of holes of each halffacet as omitted. Find_holes F(omit_vertex); scd.visit_shell_objects(sf, F); + std::size_t nb_v = F.number_of_vertices(); + std::size_t nb_f = F.number_of_facets(); - B.begin_surface(F.number_of_vertices(), - F.number_of_facets(), + // then if a halffacet contains a vertex marked as omitted, all its vertices + // must be marked as such + if (F.holes_detected()) + { + while(true) + { + Nested_holes F2(omit_vertex); + scd.visit_shell_objects(sf, F2); + if (F2.number_of_removed_vertices()==0) break; + nb_v-=F2.number_of_removed_vertices(); + nb_f=F2.number_of_facets(); + } + } + + + B.begin_surface(nb_v, + nb_f, F.number_of_vertices()+F.number_of_facets()-2); Add_vertices A(B,omit_vertex, VI); From ee4dbad0b3102d71db165b13712ac07a461c2508 Mon Sep 17 00:00:00 2001 From: POUGET Marc Date: Wed, 28 Aug 2024 17:06:05 +0200 Subject: [PATCH 79/86] doc fix --- Ridges_3/doc/Ridges_3/Ridges_3.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ridges_3/doc/Ridges_3/Ridges_3.txt b/Ridges_3/doc/Ridges_3/Ridges_3.txt index e6ef0d7877d..3eacadc8a7a 100644 --- a/Ridges_3/doc/Ridges_3/Ridges_3.txt +++ b/Ridges_3/doc/Ridges_3/Ridges_3.txt @@ -44,8 +44,8 @@ functions of the package are provided in Section \ref Ridges_3Examples. For a detailed introduction to ridges and related topics, the reader may consult -\cgalCite{cgal:hgygm-ttdpf-99},cgal:p-gd-01, as well as -the following survey article \cgalCite{cgal:cp-ssulc-05}. +\cgalCite{cgal:hgygm-ttdpf-99}, as well as +the survey article \cgalCite{cgal:cp-ssulc-05}. In the sequel, we just introduce the basic notions so as to explain our algorithms. Consider a smooth embedded surface, and denote \f$ k_1\f$ and \f$ k_2\f$ the principal curvatures, with \f$ k_1\geq k_2\f$. Umbilics are @@ -399,7 +399,7 @@ neighborhood. \subsection Ridges_3Exampleprogram Example Program The following program computes ridges and umbilics from an off -file.\cgalFootnote{Model data may be downloaded via ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/Ridges_3_datafiles.tgz . The mechanical part model has been provided courtesy of Dassault System to produce \cgalFigureRef{figmechanical_crest_filteredintro}, due to copyright issues the available model is not the same, it is provided by the AIM\@SHAPE Shape Repository.} It uses the package \ref PkgJetFitting3 to estimate the differential +file. It uses the package \ref PkgJetFitting3 to estimate the differential quantities. The default output file gives rough data for visualization purpose, a verbose output file may also be asked for. Parameters are @@ -536,7 +536,7 @@ Ridges on the ellipsoid, normals pointing outward. Color coding : of crest ridges on a mechanical model, and has been computed as follows: \code{.cpp} -./Compute_Ridges_Umbilics -f data/mecanic.off -d 4 -m 4 -a 4 -t 4 +./Compute_Ridges_Umbilics -f data/rocker-arm.off -d 4 -m 4 -a 4 -t 4 \endcode \cgalFigureBegin{figmechanical_crest_filteredintro,mecanic-sub1_crest-jpg.png} From 24ca2df2b38dc88e7c832a93b011ca02b728a64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Aug 2024 15:35:47 +0200 Subject: [PATCH 80/86] do not mention data that does not exist --- Ridges_3/doc/Ridges_3/Ridges_3.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Ridges_3/doc/Ridges_3/Ridges_3.txt b/Ridges_3/doc/Ridges_3/Ridges_3.txt index 3eacadc8a7a..90854893a01 100644 --- a/Ridges_3/doc/Ridges_3/Ridges_3.txt +++ b/Ridges_3/doc/Ridges_3/Ridges_3.txt @@ -533,11 +533,7 @@ Ridges on the ellipsoid, normals pointing outward. Color coding : \subsection Ridges_3ExampleFilteringofCrestRidgesona Example: Filtering of Crest Ridges on a Mechanical Part \cgalFigureRef{figmechanical_crest_filteredintro} illustrates the filtering -of crest ridges on a mechanical model, and has been computed as follows: - -\code{.cpp} -./Compute_Ridges_Umbilics -f data/rocker-arm.off -d 4 -m 4 -a 4 -t 4 -\endcode +of crest ridges on a mechanical model. \cgalFigureBegin{figmechanical_crest_filteredintro,mecanic-sub1_crest-jpg.png} Mechanical part (37k pts). Left: All crest lines. Middle: crests filtered From b67bb2529dd093e714abc4a400bd0746c1e90473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 2 Sep 2024 09:03:30 +0200 Subject: [PATCH 81/86] use assert in test --- .../test/Convex_decomposition_3/cd_nested_holes_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp index 3c69b2a5339..37a3c68264f 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp +++ b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp @@ -34,7 +34,7 @@ std::size_t run(std::string path) for (const Polyhedron_3& P : convex_parts) { // std::ofstream("out_"+std::to_string(i++)+".off") << std::setprecision(17) << P; - CGAL_assertion(P.size_of_vertices()!=0); + assert(P.size_of_vertices()!=0); } return convex_parts.size(); From 37218301bbfd6d9179a9eccf7a34a22a7331f2bf Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 2 Sep 2024 12:32:30 +0200 Subject: [PATCH 82/86] Spelling corrections Spelling corrections --- .../include/CGAL/Test/_test_algebraic_structure.h | 2 +- .../Arrangement_on_surface_2/data/circle_segments/intersect | 2 +- Documentation/doc/biblio/geom.bib | 2 +- .../Square_border_parameterizer_3.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h index 56c421eee1f..08412f96ea4 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h @@ -426,7 +426,7 @@ void test_algebraic_structure_intern( //commutative assert(a+b+c==c+b+a); assert(a*b*c==c*b*a); - //distributiv + //distributive assert((a-b)*c==a*c-b*c); assert((a+b)*c==a*c+b*c); //binom diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect index b0e0bbe6a46..6a3783c9cfc 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect @@ -1,6 +1,6 @@ # Input is based on the curves and points indexes from intersect.pt # intersect.xcv. The first two numbers are the numbers of the input curves -# to be intersected. After that there is the number of intesections and +# to be intersected. After that there is the number of intersections and # 2-3 numbers representing each intersection. Meaning, the input is of the form: # intersect \ # [ \ diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index d6b9488ec1f..ab364082bf8 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -92400,7 +92400,7 @@ some 2 curves cross exponentially many times." @inproceedings{kn-afrmt-97 , author = "Yoshiyuki Kusakari and Takao Nishizeki" -, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescibed Terminals" +, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescribed Terminals" , booktitle = "Proc. 8th Annu. Internat. Sympos. Algorithms Comput." , nickname = "ISAAC '97" , site = "Singapore" diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index cb97d65430a..35c16dae10a 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -234,7 +234,7 @@ private: // If the target is a corner vertex, we have the complete length of a side in 'len' // and we must "normalize" the previous entries if(get(vpmap, vt)) { - // If both extremeties of a segment are corners, offsets are already correct + // If both extremities of a segment are corners, offsets are already correct if(!get(vpmap, vs)) { CGAL_assertion(len != 0.0); double ld = 1.0 / len; From 93dd87c3ccb293235635ff043d0cf9b8fbbdfbfe Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 2 Sep 2024 17:51:06 +0200 Subject: [PATCH 83/86] simple fix to remove the segfault with Qt>=6.7 --- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 508444710ad..01e8a68433d 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -354,7 +354,6 @@ camera is manipulated) : main drawing method. Should be overloaded. \arg postDraw() : display of visual hints (world axis, FPS...) */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::paintGL() { - makeCurrent(); // Clears screen, set model view matrix... preDraw(); // Used defined method. Default calls draw() @@ -364,7 +363,6 @@ void CGAL::QGLViewer::paintGL() { draw(); // Add visual hints: axis, camera, grid... postDraw(); - doneCurrent(); Q_EMIT drawFinished(true); } From a0276c9d74c033c970fb968c1db2c50536460246 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 4 Sep 2024 08:15:02 +0200 Subject: [PATCH 84/86] Update CHANGES.md Some changes for Mesh 3 are in the wrong place. --- Installation/CHANGES.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index a8ddd38c1a1..04de99365db 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -144,10 +144,6 @@ Release date: June 2024 to the [`GenericMap`](https://doc.cgal.org/6.0/Combinatorial_map/classGenericMap.html) concept, which enables users to insert an edge between two different faces in order to create faces with holes. -- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature. -- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`. - - ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree) - **Breaking change**: @@ -225,6 +221,9 @@ Release date: June 2024 as well as the class `Triangle_accessor`. These were no longer used for several releases. - **Breaking change**: Removed the class templates `CGAL::Gray_image_mesh_domain_3`, `CGAL::Implicit_mesh_domain_3`, and `CGAL::Labeled_image_mesh_domain_3`, which were deprecated since CGAL-4.13. +- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature. +- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`. + ### [3D Surface Mesh Generation](https://doc.cgal.org/6.0/Manual/packages.html#PkgSurfaceMesher3) From 4cf1f4b214be5a790f6719b2d2682e23de7aa92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Sep 2024 14:48:07 +0200 Subject: [PATCH 85/86] CONFIG options is only needed if a FindXXX.cmake exists --- BGL/examples/BGL_OpenMesh/CMakeLists.txt | 2 +- BGL/examples/BGL_polyhedron_3/CMakeLists.txt | 2 +- BGL/test/BGL/CMakeLists.txt | 2 +- Combinatorial_map/test/Combinatorial_map/CMakeLists.txt | 2 +- Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt | 2 +- .../benchmark/Linear_cell_complex_2/CMakeLists.txt | 2 +- .../examples/Polygon_mesh_processing/CMakeLists.txt | 2 +- .../test/Polygon_mesh_processing/CMakeLists.txt | 2 +- Property_map/test/Property_map/CMakeLists.txt | 2 +- STL_Extension/test/STL_Extension/CMakeLists.txt | 2 +- .../examples/Surface_mesh_deformation/CMakeLists.txt | 2 +- .../test/Surface_mesh_deformation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_segmentation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_shortest_path/CMakeLists.txt | 2 +- .../examples/Surface_mesh_simplification/CMakeLists.txt | 2 +- .../examples/Surface_mesh_skeletonization/CMakeLists.txt | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index 36a1968b752..f461d55efb1 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -7,7 +7,7 @@ project(BGL_OpenMesh_Examples) # CGAL and its components find_package(CGAL REQUIRED) -find_package(OpenMesh CONFIG) +find_package(OpenMesh) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) create_single_source_cgal_program("TriMesh.cpp") diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index cd6f6827467..eabe0b1bd40 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -16,7 +16,7 @@ create_single_source_cgal_program("range.cpp") create_single_source_cgal_program("transform_iterator.cpp") create_single_source_cgal_program("copy_polyhedron.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) target_link_libraries(copy_polyhedron PRIVATE CGAL::OpenMesh_support) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 1f5bbb9ecd9..9594accd1fd 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -40,7 +40,7 @@ create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_fa create_single_source_cgal_program("graph_traits_inheritance.cpp" ) create_single_source_cgal_program("test_deprecated_io.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 17d31b5fbcf..8df873f5de3 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -27,7 +27,7 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index) create_single_source_cgal_program(cmap_test_split_attribute.cpp) # Link with OpenMesh if possible -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") include(CGAL_OpenMesh_support) diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 7a72a7c4caf..add02f31d30 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -19,7 +19,7 @@ create_single_source_cgal_program("quickhull_any_dim_3.cpp") create_single_source_cgal_program("extreme_points_3_sm.cpp") create_single_source_cgal_program("extreme_indices_3.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt index 9c2ae7efb0c..986cd4f2fdb 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -18,7 +18,7 @@ include_directories(BEFORE "/usr/include/libxml2/") # add_definitions("-g") # OpenMesh -find_package(OpenMesh CONFIG REQUIRED) +find_package(OpenMesh REQUIRED) include(CGAL_OpenMesh_support) # Polyhedron diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 911ea62ce07..69c6d25a52f 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -93,7 +93,7 @@ else() message(STATUS "NOTICE: Examples that use Eigen will not be compiled.") endif() -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 3d78756fba8..0ac926c0f30 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -112,7 +112,7 @@ else() message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.") endif() -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp") diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index 78f43581afc..a51a39b66d0 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -10,7 +10,7 @@ create_single_source_cgal_program("dynamic_properties_test.cpp") create_single_source_cgal_program("kernel_converter_properties_test.cpp") create_single_source_cgal_program("test_Property_container.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") include(CGAL_OpenMesh_support) diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index 902664e75c8..781a6285d45 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -61,7 +61,7 @@ if(TARGET CGAL::TBB_support) target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) endif() -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) message(STATUS "Found OpenMesh") include(CGAL_OpenMesh_support) diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index 0d93d45eda9..b6013ffce75 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -31,7 +31,7 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() - find_package(OpenMesh CONFIG QUIET) + find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index b34653b68ec..e8819b7a22b 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -16,7 +16,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("Symmetry_test.cpp") target_link_libraries(Symmetry_test PUBLIC CGAL::Eigen3_support) - find_package(OpenMesh CONFIG QUIET) + find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index f944ad20b2f..e3f63874b1f 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -15,7 +15,7 @@ create_single_source_cgal_program("segmentation_from_sdf_values_SM_example.cpp") create_single_source_cgal_program("segmentation_from_sdf_values_LCC_example.cpp") create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt index e605b7cbaf4..ba5a6455d26 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt @@ -13,7 +13,7 @@ create_single_source_cgal_program("shortest_paths_with_id.cpp") create_single_source_cgal_program("shortest_paths.cpp") create_single_source_cgal_program("shortest_path_with_locate.cpp") -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index fbf0c06996a..0f63efb7b06 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -28,7 +28,7 @@ else() message(STATUS "NOTICE: Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.") endif() -find_package(OpenMesh CONFIG QUIET) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index 6c50f2d1b8d..9b86386660b 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -29,7 +29,7 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() - find_package(OpenMesh CONFIG QUIET) + find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(CGAL_OpenMesh_support) message(STATUS "Found OpenMesh") From 248f648118ef437623da014571784d9b45b8c7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Sep 2024 15:11:37 +0200 Subject: [PATCH 86/86] do not doc internal variable --- Documentation/doc/Documentation/Third_party.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index eaafe426bdd..e012763b266 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -98,8 +98,6 @@ solutions, and we recommend using one of them. The CMake variable `CGAL_CMAKE_EXACT_NT_BACKEND` can be used to select the library that will be used internally for multi precision number types. -The variable `CGAL_CMAKE_EXACT_NT_BACKEND-STRINGS` contains all the possible -values. \section secoptional3rdpartysoftware Optional Third Party Libraries