From ef8cd2930d28644f1f2e599e1dd544ccda9325fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Oct 2021 14:18:27 +0200 Subject: [PATCH 001/332] add functions to compute discrete curvature --- .../internal/curvature.h | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h new file mode 100644 index 00000000000..aace605e6ca --- /dev/null +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -0,0 +1,184 @@ +// Copyright (c) 2021 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Mael Rouxel-Labbé + +#ifndef CGAL_PMP_INTERNAL_CURVATURE_H +#define CGAL_PMP_INTERNAL_CURVATURE_H + +#include + +#include +#include +#include + +namespace CGAL { +namespace Polygon_mesh_processing { + +template +typename GetGeomTraits::type::FT +vertex_discrete_gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, + const TriangleMesh& tm, + const NamedParameters& np) +{ + typedef typename GetGeomTraits::type GeomTraits; + typedef typename GetVertexPointMap::const_type VertexPointMap; + typedef typename GeomTraits::FT FT; + typedef typename GeomTraits::Vector_3 Vector_3; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + using parameters::choose_parameter; + using parameters::get_parameter; + + GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + get_const_property_map(vertex_point, tm)); + + typename GeomTraits::Construct_vector_3 vector = gt.construct_vector_3_object(); + typename GeomTraits::Compute_scalar_product_3 scalar_product = gt.compute_scalar_product_3_object(); + typename GeomTraits::Compute_squared_length_3 squared_length = gt.compute_squared_length_3_object(); + typename GeomTraits::Construct_cross_product_vector_3 cross_product = gt.construct_cross_product_vector_3_object(); + typename GeomTraits::Compute_approximate_angle_3 approximate_angle = gt.compute_approximate_angle_3_object(); + + const FT two_pi = 2 * CGAL_PI; + + FT ki = 0; + for(halfedge_descriptor h : CGAL::halfedges_around_target(vd, tm)) + { + if(is_border(h, tm)) + continue; + + const Vector_3 v0 = vector(get(vpm, vd), get(vpm, target(next(h, tm), tm))); // p1p2 + const Vector_3 v1 = vector(get(vpm, vd), get(vpm, source(h, tm))); // p1p0 + + const FT dot = scalar_product(v0, v1); + const Vector_3 cross = cross_product(v0, v1); + const FT sqcn = squared_length(cross); + + if(dot != FT(0) && sqcn != FT(0)) + { + const FT loc_ki = std::atan2(CGAL::approximate_sqrt(sqcn), dot); + + FT ia = approximate_angle(get(vpm, source(h, tm)), + get(vpm, target(h, tm)), + get(vpm, target(next(h, tm), tm))); + ia *= CGAL_PI / FT(180.); + + ki += loc_ki; + } + } + + return two_pi - ki; +} + +template +void discrete_gaussian_curvature(const TriangleMesh& tm, + VertexCurvatureMap vcm, + const NamedParameters& np) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + for(vertex_descriptor v : vertices(tm)) + put(vcm, v, vertex_discrete_gaussian_curvature(v, tm, np)); +} + + +template +typename GetGeomTraits::type::FT +vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, + const TriangleMesh& tm, + const NamedParameters& np) +{ + typedef typename GetGeomTraits::type GeomTraits; + typedef typename GetVertexPointMap::const_type VertexPointMap; + typedef typename GeomTraits::FT FT; + typedef typename GeomTraits::Point_3 Point_3; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + using parameters::choose_parameter; + using parameters::get_parameter; + + GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + get_const_property_map(vertex_point, tm)); + + typename GeomTraits::Compute_squared_distance_3 squared_distance = gt.compute_squared_distance_3_object(); + typename GeomTraits::Compute_approximate_dihedral_angle_3 approximate_dihedral_angle= gt.compute_approximate_dihedral_angle_3_object(); + + const FT two_pi = 2 * CGAL_PI; + + FT hi = 0; + for(halfedge_descriptor h : CGAL::halfedges_around_target(vd, tm)) + { + const Point_3& p = get(vpm, source(h, tm)); + const Point_3& q = get(vpm, target(h, tm)); + const Point_3& r = get(vpm, target(next(h, tm), tm)); + const Point_3& s = get(vpm, target(next(opposite(h, tm), tm), tm)); + const FT l = squared_distance(p,q); + + FT phi = CGAL_PI * approximate_dihedral_angle(p, q, r, s) / FT(180); + + if(phi < 0) + phi += two_pi; + if(phi > two_pi) + phi = two_pi; + + hi += FT(0.5) * l * (CGAL_PI - phi); + } + + return FT(0.5) * hi; +} + +template +void discrete_mean_curvature(const TriangleMesh& tm, + VertexCurvatureMap vcm, + const NamedParameters& np) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + for(vertex_descriptor v : vertices(tm)) + put(vcm, v, vertex_discrete_mean_curvature(v, tm, np)); +} + +/// convenience overloads + +template +auto +vertex_discrete_gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, + const TriangleMesh& tm) +{ + return vertex_discrete_gaussian_curvature(vd, tm, parameters::all_default()); +} + +template +void discrete_gaussian_curvature(const TriangleMesh& tm, + VertexCurvatureMap vcm) +{ + discrete_gaussian_curvature(tm, vcm, parameters::all_default()); +} + +template +auto +vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, + const TriangleMesh& tm) +{ + return vertex_discrete_mean_curvature(vd, tm, parameters::all_default()); +} + +template +void discrete_mean_curvature(const TriangleMesh& tm, + VertexCurvatureMap vcm) +{ + discrete_mean_curvature(tm, vcm, parameters::all_default()); +} + +} } // CGAL::Polygon_mesh_processing::experimental + +#endif //CGAL_PMP_INTERNAL_CURVATURE_H From da3179abe0b94160d7a4478ba4365c8f4e5d4b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Oct 2021 15:56:52 +0200 Subject: [PATCH 002/332] remove debug variable --- .../CGAL/Polygon_mesh_processing/internal/curvature.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index aace605e6ca..6b2ffbb01cc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -45,7 +45,6 @@ vertex_discrete_gaussian_curvature(typename boost::graph_traits::v typename GeomTraits::Compute_scalar_product_3 scalar_product = gt.compute_scalar_product_3_object(); typename GeomTraits::Compute_squared_length_3 squared_length = gt.compute_squared_length_3_object(); typename GeomTraits::Construct_cross_product_vector_3 cross_product = gt.construct_cross_product_vector_3_object(); - typename GeomTraits::Compute_approximate_angle_3 approximate_angle = gt.compute_approximate_angle_3_object(); const FT two_pi = 2 * CGAL_PI; @@ -65,12 +64,6 @@ vertex_discrete_gaussian_curvature(typename boost::graph_traits::v if(dot != FT(0) && sqcn != FT(0)) { const FT loc_ki = std::atan2(CGAL::approximate_sqrt(sqcn), dot); - - FT ia = approximate_angle(get(vpm, source(h, tm)), - get(vpm, target(h, tm)), - get(vpm, target(next(h, tm), tm))); - ia *= CGAL_PI / FT(180.); - ki += loc_ki; } } From 2b7246a14d02a67177c3b43a6557b6fc3104b2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Oct 2021 16:58:19 +0200 Subject: [PATCH 003/332] handle border cases --- .../Polygon_mesh_processing/internal/curvature.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 6b2ffbb01cc..7b976fee3a6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -60,11 +60,18 @@ vertex_discrete_gaussian_curvature(typename boost::graph_traits::v const FT dot = scalar_product(v0, v1); const Vector_3 cross = cross_product(v0, v1); const FT sqcn = squared_length(cross); - - if(dot != FT(0) && sqcn != FT(0)) + if(dot == FT(0)) + ki += CGAL_PI/FT(2); + else { - const FT loc_ki = std::atan2(CGAL::approximate_sqrt(sqcn), dot); - ki += loc_ki; + if (sqcn == FT(0)) + { + if (dot < 0) + ki += CGAL_PI; + } + else{ + ki += std::atan2(CGAL::approximate_sqrt(sqcn), dot); + } } } From 8a52d7c65cba07edad57c616ecc87e5b34ca8a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Oct 2021 11:44:18 +0200 Subject: [PATCH 004/332] remove unused function --- .../Plugins/Display/Display_property_plugin.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index c787c901e5b..a767ebf31c3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -859,18 +859,6 @@ private Q_SLOTS: treat_sm_property("f:angle", item->face_graph()); } - bool resetAngles(Scene_surface_mesh_item* item) - { - SMesh& smesh = *item->face_graph(); - if(!smesh.property_map("f:angle").second) - { - return false; - } - dock_widget->minBox->setValue(angles_min[item].first); - dock_widget->maxBox->setValue(angles_max[item].first); - return true; - } - // AF: This function gets called when we click on the button "Colorize" bool displayHeatIntensity(Scene_surface_mesh_item* item, bool iDT = false) { From 80ff6bfb67bf73fe3f85f6291a2099826f47613c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Oct 2021 11:52:25 +0200 Subject: [PATCH 005/332] add display for discrete mean and gaussian curvature --- .../Display/Display_property_plugin.cpp | 190 ++++++++++++++++-- 1 file changed, 177 insertions(+), 13 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index a767ebf31c3..1b00f6c074a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "Scene_points_with_normal_item.h" @@ -526,10 +527,12 @@ private Q_SLOTS: if(sm_item) { - dock_widget->propertyBox->addItem("Smallest Angle Per Face"); - dock_widget->propertyBox->addItem("Scaled Jacobian"); - dock_widget->propertyBox->addItem("Heat Intensity"); - dock_widget->propertyBox->addItem("Heat Intensity (Intrinsic Delaunay)"); + dock_widget->propertyBox->addItem("Smallest Angle Per Face"); + dock_widget->propertyBox->addItem("Scaled Jacobian"); + dock_widget->propertyBox->addItem("Heat Intensity"); + dock_widget->propertyBox->addItem("Heat Intensity (Intrinsic Delaunay)"); + dock_widget->propertyBox->addItem("Discrete Mean Curvature"); + dock_widget->propertyBox->addItem("Discrete Gaussian Curvature"); detectSMScalarProperties(sm_item->face_graph()); } @@ -604,6 +607,14 @@ private Q_SLOTS: return; sm_item->setRenderingMode(Gouraud); break; + case 4: // Discrete Mean Curvature + displayDiscreteMeanCurvature(sm_item); + sm_item->setRenderingMode(Gouraud); + break; + case 5: // Discrete Gaussian Curvature + displayDiscreteGaussianCurvature(sm_item); + sm_item->setRenderingMode(Gouraud); + break; default: if(dock_widget->propertyBox->currentText().contains("v:")) { @@ -638,6 +649,14 @@ private Q_SLOTS: sm_item->face_graph()->property_map("f:angle"); if(does_exist) sm_item->face_graph()->remove_property_map(pmap); + std::tie(pmap, does_exist) = + sm_item->face_graph()->property_map("v:discrete_mean_curvature"); + if(does_exist) + sm_item->face_graph()->remove_property_map(pmap); + std::tie(pmap, does_exist) = + sm_item->face_graph()->property_map("v:discrete_gaussian_curvature"); + if(does_exist) + sm_item->face_graph()->remove_property_map(pmap); }); QApplication::restoreOverrideCursor(); sm_item->invalidateOpenGLBuffers(); @@ -669,13 +688,21 @@ private Q_SLOTS: switch(dock_widget->propertyBox->currentIndex()) { case 0: - dock_widget->zoomToMinButton->setEnabled(angles_max.count(sm_item)>0 ); + dock_widget->zoomToMinButton->setEnabled(angles_min.count(sm_item)>0 ); dock_widget->zoomToMaxButton->setEnabled(angles_max.count(sm_item)>0 ); break; case 1: - dock_widget->zoomToMinButton->setEnabled(jacobian_max.count(sm_item)>0); + dock_widget->zoomToMinButton->setEnabled(jacobian_min.count(sm_item)>0); dock_widget->zoomToMaxButton->setEnabled(jacobian_max.count(sm_item)>0); break; + case 4: + dock_widget->zoomToMinButton->setEnabled(dmc_min.count(sm_item)>0); + dock_widget->zoomToMaxButton->setEnabled(dmc_max.count(sm_item)>0); + break; + case 5: + dock_widget->zoomToMinButton->setEnabled(dgc_min.count(sm_item)>0); + dock_widget->zoomToMaxButton->setEnabled(dgc_max.count(sm_item)>0); + break; default: break; } @@ -702,11 +729,22 @@ private Q_SLOTS: { smesh.remove_property_map(angles); } + SMesh::Property_map dmc; + std::tie(dmc, found) = smesh.property_map("v:discrete_mean_curvature"); + if(found) + { + smesh.remove_property_map(dmc); + } + SMesh::Property_map dgc; + std::tie(dgc, found) = smesh.property_map("v:discrete_gaussian_curvature"); + if(found) + { + smesh.remove_property_map(dgc); + } } void displayScaledJacobian(Scene_surface_mesh_item* item) { - SMesh& smesh = *item->face_graph(); //compute and store the jacobian per face bool non_init; @@ -743,18 +781,77 @@ private Q_SLOTS: treat_sm_property("f:jacobian", item->face_graph()); } - bool resetScaledJacobian(Scene_surface_mesh_item* item) + void displayDiscreteMeanCurvature(Scene_surface_mesh_item* item) { SMesh& smesh = *item->face_graph(); - if(!smesh.property_map("f:jacobian").second) + //compute once and store the value per vertex + bool non_init; + SMesh::Property_map mcurvature; + std::tie(mcurvature, non_init) = smesh.add_property_map("v:discrete_mean_curvature", 0); + if(non_init) { - return false; + CGAL::Polygon_mesh_processing::discrete_mean_curvature(smesh, mcurvature); + + double res_min = ARBITRARY_DBL_MAX, + res_max = -ARBITRARY_DBL_MAX; + SMesh::Vertex_index min_index, max_index; + for (SMesh::Vertex_index v : vertices(smesh)) + { + if (mcurvature[v] > res_max) + { + res_max = mcurvature[v]; + max_index = v; + } + if (mcurvature[v] < res_min) + { + res_min = mcurvature[v]; + min_index = v; + } + } + dmc_max[item]=std::make_pair(res_max, max_index); + dmc_min[item]=std::make_pair(res_min, min_index); + + connect(item, &Scene_surface_mesh_item::itemChanged, + this, &DisplayPropertyPlugin::resetProperty); } - dock_widget->minBox->setValue(jacobian_min[item].first-0.01); - dock_widget->maxBox->setValue(jacobian_max[item].first); - return true; + treat_sm_property("v:discrete_mean_curvature", item->face_graph()); } + void displayDiscreteGaussianCurvature(Scene_surface_mesh_item* item) + { + SMesh& smesh = *item->face_graph(); + //compute once and store the value per vertex + bool non_init; + SMesh::Property_map mcurvature; + std::tie(mcurvature, non_init) = smesh.add_property_map("v:discrete_gaussian_curvature", 0); + if(non_init) + { + CGAL::Polygon_mesh_processing::discrete_gaussian_curvature(smesh, mcurvature); + + double res_min = ARBITRARY_DBL_MAX, + res_max = -ARBITRARY_DBL_MAX; + SMesh::Vertex_index min_index, max_index; + for (SMesh::Vertex_index v : vertices(smesh)) + { + if (mcurvature[v] > res_max) + { + res_max = mcurvature[v]; + max_index = v; + } + if (mcurvature[v] < res_min) + { + res_min = mcurvature[v]; + min_index = v; + } + } + dgc_max[item]=std::make_pair(res_max, max_index); + dgc_min[item]=std::make_pair(res_min, min_index); + + connect(item, &Scene_surface_mesh_item::itemChanged, + this, &DisplayPropertyPlugin::resetProperty); + } + treat_sm_property("v:discrete_gaussian_curvature", item->face_graph()); + } void displayAngles(Scene_surface_mesh_item* item) { @@ -1058,6 +1155,30 @@ private Q_SLOTS: case 3: dock_widget->sourcePointsButton->setEnabled(true); CGAL_FALLTHROUGH; + case 4: + dock_widget->groupBox-> setEnabled(true); + dock_widget->groupBox_3->setEnabled(true); + + dock_widget->minBox->setMinimum(-1000); + dock_widget->minBox->setMaximum(1000); + dock_widget->minBox->setValue(0); + + dock_widget->maxBox->setMinimum(-1000); + dock_widget->maxBox->setMaximum(1000); + dock_widget->maxBox->setValue(2); + break; + case 5: + dock_widget->groupBox-> setEnabled(true); + dock_widget->groupBox_3->setEnabled(true); + + dock_widget->minBox->setMinimum(-1000); + dock_widget->minBox->setMaximum(1000); + dock_widget->minBox->setValue(0); + + dock_widget->maxBox->setMinimum(-1000); + dock_widget->maxBox->setMaximum(1000); + dock_widget->maxBox->setValue(2); + break; default: dock_widget->maxBox->setMinimum(-99999999); dock_widget->maxBox->setMaximum(99999999); @@ -1103,6 +1224,24 @@ private Q_SLOTS: dummy_p); } break; + case 4: + { + ::zoomToId(*item->face_graph(), + QString("v%1").arg(dmc_min[item].second), + getActiveViewer(), + dummy_fd, + dummy_p); + } + break; + case 5: + { + ::zoomToId(*item->face_graph(), + QString("v%1").arg(dgc_min[item].second), + getActiveViewer(), + dummy_fd, + dummy_p); + } + break; default: break; } @@ -1136,6 +1275,24 @@ private Q_SLOTS: dummy_p); } break; + case 4: + { + ::zoomToId(*item->face_graph(), + QString("v%1").arg(dmc_max[item].second), + getActiveViewer(), + dummy_fd, + dummy_p); + } + break; + case 5: + { + ::zoomToId(*item->face_graph(), + QString("v%1").arg(dgc_max[item].second), + getActiveViewer(), + dummy_fd, + dummy_p); + } + break; default: break; } @@ -1425,6 +1582,13 @@ private: boost::unordered_map > angles_min; boost::unordered_map > angles_max; + + boost::unordered_map > dmc_min; + boost::unordered_map > dmc_max; + + boost::unordered_map > dgc_min; + boost::unordered_map > dgc_max; + boost::unordered_map is_source; From 3937c5df346053de8d0f42ceeb8fdac44d0e8b35 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 13 Oct 2023 14:51:43 +0200 Subject: [PATCH 006/332] Implemented make_mesh_3 param : initial_points_generator --- Mesh_3/examples/Mesh_3/CMakeLists.txt | 6 + .../mesh_3D_image_with_initial_points.cpp | 58 +++++ ...struct_initial_points_from_labeled_image.h | 238 ++++++++++++++++++ ...tialize_triangulation_from_labeled_image.h | 231 +++-------------- Mesh_3/include/CGAL/make_mesh_3.h | 100 ++++++-- .../internal/mesh_option_classes.h | 58 +++++ .../internal/parameters_interface.h | 1 + 7 files changed, 462 insertions(+), 230 deletions(-) create mode 100644 Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp create mode 100644 Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 0b59088e04a..90857127a80 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -167,6 +167,11 @@ if(TARGET CGAL::CGAL_ImageIO) target_link_libraries(mesh_3D_gray_image_with_custom_initialization PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program( + "mesh_3D_image_with_initial_points.cpp") + target_link_libraries(mesh_3D_image_with_initial_points + PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("mesh_3D_image_variable_size.cpp") target_link_libraries(mesh_3D_image_variable_size PUBLIC CGAL::Eigen3_support) @@ -201,6 +206,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) mesh_3D_image_variable_size mesh_3D_image_with_custom_initialization mesh_3D_gray_image_with_custom_initialization + mesh_3D_image_with_initial_points mesh_3D_image_with_features mesh_3D_image_with_detection_of_features mesh_3D_image_with_input_features diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp new file mode 100644 index 00000000000..e065062697d --- /dev/null +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -0,0 +1,58 @@ +#include "random_labeled_image.h" +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include + +// Domain +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; + +#ifdef CGAL_CONCURRENT_MESH_3 +typedef CGAL::Parallel_tag Concurrency_tag; +#else +typedef CGAL::Sequential_tag Concurrency_tag; +#endif + +// Triangulation +typedef CGAL::Mesh_triangulation_3::type Tr; + +typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; + +// Criteria +typedef CGAL::Mesh_criteria_3 Mesh_criteria; + +namespace params = CGAL::parameters; + +int main() +{ + /// [Create the image] + CGAL::Image_3 image = random_labeled_image(); + /// [Create the image] + + // Domain + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); + + // Mesh criteria + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). + cell_radius_edge_ratio(3).cell_size(3)); + + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + params::initial_points_generator(Construct_initial_points_labeled_image(image)) + ); + /// [Meshing] + + // Output + CGAL::dump_c3t3(c3t3, "out"); + + return 0; +} diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h new file mode 100644 index 00000000000..878af535821 --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h @@ -0,0 +1,238 @@ +// Copyright (c) 20XX,20XX GeometryFactory +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Ange Clement + +#ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H +#define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H + +#include + +#include + +#include +#include + +#include + +template +struct Get_point +{ + const double vx, vy, vz; + const double tx, ty, tz; + const std::size_t xdim, ydim, zdim; + Get_point(const CGAL::Image_3* image) + : vx(image->vx()) + , vy(image->vy()) + , vz(image->vz()) + , tx(image->tx()) + , ty(image->ty()) + , tz(image->tz()) + , xdim(image->xdim()) + , ydim(image->ydim()) + , zdim(image->zdim()) + {} + + Point operator()(const std::size_t i, + const std::size_t j, + const std::size_t k) const + { + double x = double(i) * vx + tx; + double y = double(j) * vy + ty; + double z = double(k) * vz + tz; + + if (i == 0) x += 1. / 6. * vx; + else if (i == xdim - 1) x -= 1. / 6. * vx; + if (j == 0) y += 1. / 6. * vy; + else if (j == ydim - 1) y -= 1. / 6. * vy; + if (k == 0) z += 1. / 6. * vz; + else if (k == zdim - 1) z -= 1. / 6. * vz; + + return Point(x, y, z); + } +}; + +struct Construct_initial_points_labeled_image +{ + const CGAL::Image_3 & image; + + Construct_initial_points_labeled_image(const CGAL::Image_3 & image_) + : image(image_) + { } + + template + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const + { + typedef typename MeshDomain::Subdomain Subdomain; + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; + + typedef typename C3t3::Triangulation Tr; + typedef typename Tr::Geom_traits GT; + typedef typename GT::FT FT; + typedef typename Tr::Weighted_point Weighted_point; + typedef typename Tr::Segment Segment_3; + typedef typename Tr::Vertex_handle Vertex_handle; + typedef typename Tr::Cell_handle Cell_handle; + typedef typename GT::Vector_3 Vector_3; + + const Tr& tr = c3t3.triangulation(); + + typename GT::Compare_weighted_squared_radius_3 cwsr = + tr.geom_traits().compare_weighted_squared_radius_3_object(); + typename GT::Construct_point_3 cp = + tr.geom_traits().construct_point_3_object(); + typename GT::Construct_weighted_point_3 cwp = + tr.geom_traits().construct_weighted_point_3_object(); + + const double max_v = (std::max)((std::max)(image.vx(), + image.vy()), + image.vz()); + + struct Seed { + std::size_t i, j, k; + std::size_t radius; + }; + using Seeds = std::vector; + + Seeds seeds; + Get_point get_point(&image); + std::cout << "Searching for connected components..." << std::endl; + CGAL_IMAGE_IO_CASE(image.image(), search_for_connected_components_in_labeled_image(image, + std::back_inserter(seeds), + CGAL::Emptyset_iterator(), + CGAL::Identity(), + Word())); + std::cout << " " << seeds.size() << " components were found." << std::endl; + std::cout << "Construct initial points..." << std::endl; + for(const Seed seed : seeds) + { + const Point_3 seed_point = get_point(seed.i, seed.j, seed.k); + Cell_handle seed_cell = tr.locate(cwp(seed_point)); + + const Subdomain seed_label + = domain.is_in_domain_object()(seed_point); + const Subdomain seed_cell_label + = ( tr.dimension() < 3 + || seed_cell == Cell_handle() + || tr.is_infinite(seed_cell)) + ? Subdomain() //seed_point is OUTSIDE_AFFINE_HULL + : domain.is_in_domain_object()( + seed_cell->weighted_circumcenter(tr.geom_traits())); + + if ( seed_label != std::nullopt + && seed_cell_label != std::nullopt + && *seed_label == *seed_cell_label) + continue; //this means the connected component has already been initialized + + const double radius = double(seed.radius + 1)* max_v; + CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); + typename MeshDomain::Construct_intersection construct_intersection = + domain.construct_intersection_object(); + + std::vector directions; + if(seed.radius < 2) { + // shoot in six directions + directions.push_back(Vector_3(-radius, 0, 0)); + directions.push_back(Vector_3(+radius, 0, 0)); + directions.push_back(Vector_3(0, -radius, 0)); + directions.push_back(Vector_3(0, +radius, 0)); + directions.push_back(Vector_3(0, 0, -radius)); + directions.push_back(Vector_3(0, 0, +radius)); + } else { + for(int i = 0; i < n; ++i) + { + // shoot n random directions + directions.push_back(*points_on_sphere_3++ - CGAL::ORIGIN); + } + } + + for(const Vector_3& v : directions) + { + const Point_3 test = seed_point + v; + const Segment_3 test_segment = Segment_3(seed_point, test); + + const typename MeshDomain::Intersection intersect = + construct_intersection(test_segment); + if (std::get<2>(intersect) != 0) + { + const Point_3& bpi = std::get<0>(intersect); + const Index index = std::get<1>(intersect); + Weighted_point pi = Weighted_point(bpi); + + // This would cause trouble to optimizers + // check pi will not be hidden + typename Tr::Locate_type lt; + int li, lj; + Cell_handle pi_cell = tr.locate(pi, lt, li, lj); + if(lt != Tr::OUTSIDE_AFFINE_HULL) { + switch (tr.dimension()) + { //skip dimension 0 + case 1: + if (tr.side_of_power_segment(pi_cell, pi, true) != CGAL::ON_BOUNDED_SIDE) + continue; + break; + case 2: + if (tr.side_of_power_circle(pi_cell, 3, pi, true) != CGAL::ON_BOUNDED_SIDE) + continue; + break; + case 3: + if (tr.side_of_power_sphere(pi_cell, pi, true) != CGAL::ON_BOUNDED_SIDE) + continue; + } + } + + //check pi is not inside a protecting ball + std::vector conflict_vertices; + if (tr.dimension() == 3) + { + tr.vertices_on_conflict_zone_boundary(pi, pi_cell + , std::back_inserter(conflict_vertices)); + } + else + { + for (typename Tr::Finite_vertices_iterator vit = tr.finite_vertices_begin(); + vit != tr.finite_vertices_end(); ++vit) + { + const Weighted_point& wp = tr.point(vit); + if (cwsr(wp, FT(0)) == CGAL::SMALLER) // 0 < wp's weight + conflict_vertices.push_back(vit); + } + } + + bool pi_inside_protecting_sphere = false; + for(Vertex_handle cv : conflict_vertices) + { + if(tr.is_infinite(cv)) + continue; + + const Weighted_point& cv_wp = tr.point(cv); + if (cwsr(cv_wp, FT(0)) == CGAL::EQUAL) // 0 == wp's weight + continue; + + // if the (squared) distance between bpi and cv is smaller or equal than cv's weight + if (cwsr(cv_wp, - tr.min_squared_distance(bpi, cp(cv_wp))) != CGAL::LARGER) + { + pi_inside_protecting_sphere = true; + break; + } + } + if (pi_inside_protecting_sphere) + continue; + + *pts++ = std::make_pair(bpi, index); + } + } + } + return pts; + } +}; + +#endif // CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index ec3e5761a9a..5035fcfd26f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -14,56 +14,10 @@ #define CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_LABELED_IMAGE_H #include - -#include -#include -#include #include -#include -#include -#include -#include +#include -#include -#include - -template -struct Get_point -{ - const double vx, vy, vz; - const double tx, ty, tz; - const std::size_t xdim, ydim, zdim; - Get_point(const CGAL::Image_3* image) - : vx(image->vx()) - , vy(image->vy()) - , vz(image->vz()) - , tx(image->tx()) - , ty(image->ty()) - , tz(image->tz()) - , xdim(image->xdim()) - , ydim(image->ydim()) - , zdim(image->zdim()) - {} - - Point operator()(const std::size_t i, - const std::size_t j, - const std::size_t k) const - { - double x = double(i) * vx + tx; - double y = double(j) * vy + ty; - double z = double(k) * vz + tz; - - if (i == 0) x += 1. / 6. * vx; - else if (i == xdim - 1) x -= 1. / 6. * vx; - if (j == 0) y += 1. / 6. * vy; - else if (j == ydim - 1) y -= 1. / 6. * vy; - if (k == 0) z += 1. / 6. * vz; - else if (k == zdim - 1) z -= 1. / 6. * vz; - - return Point(x, y, z); - } -}; template void init_tr_from_labeled_image_call_init_features(C3T3&, const MeshDomain&, @@ -97,23 +51,17 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, { typedef typename C3T3::Triangulation Tr; typedef typename Tr::Geom_traits GT; - typedef typename GT::FT FT; typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Bare_point Bare_point; - typedef typename Tr::Segment Segment_3; typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Cell_handle Cell_handle; + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; - typedef typename GT::Vector_3 Vector_3; + typedef typename std::pair ConstructedPoint; typedef MeshDomain Mesh_domain; Tr& tr = c3t3.triangulation(); - typename GT::Compare_weighted_squared_radius_3 cwsr = - tr.geom_traits().compare_weighted_squared_radius_3_object(); - typename GT::Construct_point_3 cp = - tr.geom_traits().construct_point_3_object(); typename GT::Construct_weighted_point_3 cwp = tr.geom_traits().construct_weighted_point_3_object(); @@ -123,159 +71,36 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, CGAL::internal::Has_features()); } - const double max_v = (std::max)((std::max)(image.vx(), - image.vy()), - image.vz()); + std::vector constructedPoints; - struct Seed { - std::size_t i, j, k; - std::size_t radius; - }; - using Seeds = std::vector; - using Subdomain = typename Mesh_domain::Subdomain; + Construct_initial_points_labeled_image construct(image); + construct(std::back_inserter(constructedPoints), domain, c3t3); - Seeds seeds; - Get_point get_point(&image); - std::cout << "Searching for connected components..." << std::endl; - search_for_connected_components_in_labeled_image(image, - std::back_inserter(seeds), - CGAL::Emptyset_iterator(), - transform, - Image_word_type()); - std::cout << " " << seeds.size() << " components were found." << std::endl; - std::cout << "Construct initial points..." << std::endl; - for(const Seed seed : seeds) + std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; + + for (const ConstructedPoint & constructedPoint : constructedPoints) { - const Bare_point seed_point = get_point(seed.i, seed.j, seed.k); - Cell_handle seed_cell = tr.locate(cwp(seed_point)); + const Point_3& point = constructedPoint.first; + const Index& index = constructedPoint.second; - const Subdomain seed_label - = domain.is_in_domain_object()(seed_point); - const Subdomain seed_cell_label - = ( tr.dimension() < 3 - || seed_cell == Cell_handle() - || tr.is_infinite(seed_cell)) - ? Subdomain() //seed_point is OUTSIDE_AFFINE_HULL - : domain.is_in_domain_object()( - seed_cell->weighted_circumcenter(tr.geom_traits())); + Weighted_point pi = cwp(point); - if ( seed_label != std::nullopt - && seed_cell_label != std::nullopt - && *seed_label == *seed_cell_label) - continue; //this means the connected component has already been initialized + /// The following lines show how to insert initial points in the + /// `c3t3` object. [insert initial points] + Vertex_handle v = tr.insert(pi); + // `v` could be null if `pi` is hidden by other vertices of `tr`. + CGAL_assertion(v != Vertex_handle()); + c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_index(v, index); + /// [insert initial points] + } - const double radius = double(seed.radius + 1)* max_v; - CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); - typename Mesh_domain::Construct_intersection construct_intersection = - domain.construct_intersection_object(); - - std::vector directions; - if(seed.radius < 2) { - // shoot in six directions - directions.push_back(Vector_3(-radius, 0, 0)); - directions.push_back(Vector_3(+radius, 0, 0)); - directions.push_back(Vector_3(0, -radius, 0)); - directions.push_back(Vector_3(0, +radius, 0)); - directions.push_back(Vector_3(0, 0, -radius)); - directions.push_back(Vector_3(0, 0, +radius)); - } else { - for(int i = 0; i < 20; ++i) - { - // shoot 20 random directions - directions.push_back(*points_on_sphere_3++ - CGAL::ORIGIN); - } - } - - for(const Vector_3& v : directions) - { - const Bare_point test = seed_point + v; - - const typename Mesh_domain::Intersection intersect = - construct_intersection(Segment_3(seed_point, test)); - if (std::get<2>(intersect) != 0) - { - const Bare_point& bpi = std::get<0>(intersect); - Weighted_point pi = cwp(bpi); - - // This would cause trouble to optimizers - // check pi will not be hidden - typename Tr::Locate_type lt; - int li, lj; - Cell_handle pi_cell = tr.locate(pi, lt, li, lj); - if(lt != Tr::OUTSIDE_AFFINE_HULL) { - switch (tr.dimension()) - { //skip dimension 0 - case 1: - if (tr.side_of_power_segment(pi_cell, pi, true) != CGAL::ON_BOUNDED_SIDE) - continue; - break; - case 2: - if (tr.side_of_power_circle(pi_cell, 3, pi, true) != CGAL::ON_BOUNDED_SIDE) - continue; - break; - case 3: - if (tr.side_of_power_sphere(pi_cell, pi, true) != CGAL::ON_BOUNDED_SIDE) - continue; - } - } - - //check pi is not inside a protecting ball - std::vector conflict_vertices; - if (tr.dimension() == 3) - { - tr.vertices_on_conflict_zone_boundary(pi, pi_cell - , std::back_inserter(conflict_vertices)); - } - else - { - for (typename Tr::Finite_vertices_iterator vit = tr.finite_vertices_begin(); - vit != tr.finite_vertices_end(); ++vit) - { - const Weighted_point& wp = tr.point(vit); - if (cwsr(wp, FT(0)) == CGAL::SMALLER) // 0 < wp's weight - conflict_vertices.push_back(vit); - } - } - - bool pi_inside_protecting_sphere = false; - for(Vertex_handle cv : conflict_vertices) - { - if(tr.is_infinite(cv)) - continue; - - const Weighted_point& cv_wp = tr.point(cv); - if (cwsr(cv_wp, FT(0)) == CGAL::EQUAL) // 0 == wp's weight - continue; - - // if the (squared) distance between bpi and cv is smaller or equal than cv's weight - if (cwsr(cv_wp, - tr.min_squared_distance(bpi, cp(cv_wp))) != CGAL::LARGER) - { - pi_inside_protecting_sphere = true; - break; - } - } - if (pi_inside_protecting_sphere) - continue; - const typename Mesh_domain::Index index = std::get<1>(intersect); - - /// The following lines show how to insert initial points in the - /// `c3t3` object. [insert initial points] - Vertex_handle v = tr.insert(pi); - - // `v` could be null if `pi` is hidden by other vertices of `tr`. - CGAL_assertion(v != Vertex_handle()); - - c3t3.set_dimension(v, 2); // by construction, points are on surface - c3t3.set_index(v, index); - /// [insert initial points] - } - // else - // { - // std::cerr << - // boost::format("Error. Segment (%1%, %2%) does not intersect the surface!\n") - // % it->first % test; - // } - } + if ( tr.dimension() != 3 ) + { + std::cout << " not enough points: triangulation.dimension() == " + << tr.dimension() << std::endl; + CGAL::Mesh_3::internal::init_c3t3(c3t3, domain, criteria, 20); + std::cout << " -> " << tr.number_of_vertices() << " initial points." << std::endl; } std::cout << " " << tr.number_of_vertices() << " initial points." << std::endl; if ( c3t3.triangulation().dimension() != 3 ) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 79277f1643f..c77efc45446 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -38,10 +38,10 @@ namespace CGAL { namespace Mesh_3 { namespace internal { -template < typename C3T3, typename MeshDomain, typename MeshCriteria > +template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitialPointsGenerator = Null_functor > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points) + const int nb_initial_points, InitialPointsGenerator& generator = Null_functor()) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -49,13 +49,23 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, typedef typename Initial_points_vector::iterator Ipv_iterator; typedef typename C3T3::Vertex_handle Vertex_handle; + typedef typename + CGAL::parameters::internal::Initial_points_generator_generator< + std::back_insert_iterator, + MeshDomain, + C3T3, + InitialPointsGenerator> + Initial_points_generator_generator; + // Mesh initialization : get some points and add them to the mesh Initial_points_vector initial_points; + auto& generator_wrapped = + Initial_points_generator_generator()(generator); if (nb_initial_points > -1) - domain.construct_initial_points_object()(std::back_inserter(initial_points), + generator_wrapped(std::back_inserter(initial_points), domain, c3t3, nb_initial_points); else //use default number of points - domain.construct_initial_points_object()(std::back_inserter(initial_points)); + generator_wrapped(std::back_inserter(initial_points), domain, c3t3); typename C3T3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); @@ -159,20 +169,22 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria, bool MeshDomainHasHasFeatures, - typename HasFeatures = int> + typename HasFeatures = int, + typename InitialPointsGenerator = Null_functor> struct C3t3_initializer { }; // Partial specialization of C3t3_initializer // Handle cases where MeshDomain::Has_features is not a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures > -struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures > +template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitialPointsGenerator > +struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerator > { typedef parameters::internal::Mesh_3_options Mesh_3_options; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, - Mesh_3_options mesh_options = Mesh_3_options()) + Mesh_3_options mesh_options = Mesh_3_options(), + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { @@ -181,23 +193,24 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures > } init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points); + mesh_options.number_of_initial_points, generator); } }; // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures > -struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures > +template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitialPointsGenerator > +struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerator > { typedef parameters::internal::Mesh_3_options Mesh_3_options; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, - Mesh_3_options mesh_options = Mesh_3_options()) + Mesh_3_options mesh_options = Mesh_3_options(), + InitialPointsGenerator& generator = Null_functor()) { - C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features >() + C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() (c3t3,domain,criteria,with_features,mesh_options); } }; @@ -205,8 +218,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures > // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_true -template < typename C3T3, typename MD, typename MC > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > +template < typename C3T3, typename MD, typename MC, typename InitialPointsGenerator > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGenerator > : public C3t3_initializer_base < C3T3, MD, MC > { virtual ~C3t3_initializer() { } @@ -216,7 +229,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > const MD& domain, const MC& criteria, bool with_features, - Mesh_3_options mesh_options = Mesh_3_options()) + Mesh_3_options mesh_options = Mesh_3_options(), + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -242,26 +256,27 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > } if(need_more_init) { init_c3t3(c3t3, domain, criteria, - mesh_options.number_of_initial_points); + mesh_options.number_of_initial_points, generator); } } else { init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points); } + mesh_options.number_of_initial_points, generator); } } }; // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_false -template < typename C3T3, typename MD, typename MC > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > +template < typename C3T3, typename MD, typename MC, typename InitialPointsGenerator > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitialPointsGenerator > { typedef parameters::internal::Mesh_3_options Mesh_3_options; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, - Mesh_3_options mesh_options = Mesh_3_options()) + Mesh_3_options mesh_options = Mesh_3_options(), + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { @@ -270,7 +285,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > } init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points); + mesh_options.number_of_initial_points, generator); } }; @@ -401,6 +416,31 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * } * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh initialisation} + * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. + * It must folow the `InitialPointsGenerator` concept and is specified with the param: + *
    + *
  • `parameters::initial_points_generator(generator)` + *
+ * + * The `InitialPointsGenerator` concept is a function object to construct + * a set of initial points on the surface of the domain. Provides the + * following operators: + * + * `template ` + *
+ * `OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3)` + * + * `template ` + *
+ * `OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n)` + * + * Those two operators output a set of (`n`) surface points to the + * output iterator `pts`, as objects of type `std::pair`. If `n` is not given, the functor must provide enough + * points to initialize the mesh generation process.} + * \cgalParamDefault{`parameters::initial_points_generator(generator)`} + * \cgalParamSectionEnd * \cgalNamedParamsEnd * * Note that regardless of which optimization processes are activated, @@ -436,11 +476,13 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + auto initial_points_generator_param = choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), Null_functor()); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, features_param.features(), mesh_options_param, - manifold_options_param); + manifold_options_param, + initial_points_generator_param); return c3t3; } @@ -469,7 +511,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, * * @return The mesh as a C3T3 object */ -template +template void make_mesh_3_impl(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, @@ -481,7 +523,8 @@ void make_mesh_3_impl(C3T3& c3t3, const parameters::internal::Mesh_3_options& mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& - manifold_options = parameters::internal::Manifold_options()) + manifold_options = parameters::internal::Manifold_options(), + InitialPointsGenerator& generator = Null_functor()) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); @@ -492,11 +535,14 @@ void make_mesh_3_impl(C3T3& c3t3, C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value > () (c3t3, + ::CGAL::internal::has_Has_features::value, + int, /*Type of MeshDomain::Has_features not determined*/ + InitialPointsGenerator >() (c3t3, domain, criteria, with_features, - mesh_options); + mesh_options, + generator); CGAL_assertion( c3t3.triangulation().dimension() >= 2 ); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 09487cc44f9..195a7a271cb 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -11,6 +11,8 @@ #ifndef CGAL_MESH_OPTION_CLASSES_H #define CGAL_MESH_OPTION_CLASSES_H +#include + #include namespace CGAL { @@ -165,6 +167,43 @@ private: bool b_; }; +// Initial points generator +template +struct Initial_points_generator_wrapper +{ + template + Initial_points_generator_wrapper(Initial_points_generator& generator) + : initial_points_generator_default_(generator) + , initial_points_generator_(generator) + { } + + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + { + return initial_points_generator_default_(pts, domain, c3t3); + } + + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + { + return initial_points_generator_(pts, domain, c3t3, n); + } + +private: + std::function initial_points_generator_default_; + std::function initial_points_generator_; +}; +template +struct Initial_points_generator_default +{ + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + { + return domain.construct_initial_points_object()(pts); + } + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + { + return domain.construct_initial_points_object()(pts, n); + } +}; + // ----------------------------------- // Features generator // ----------------------------------- @@ -207,6 +246,25 @@ struct Domain_features_generator< MeshDomain, true > } }; +// struct Initial_points_generator_generator +template +struct Initial_points_generator_generator +{ + auto operator()(Initial_points_generator& generator) + { + return Initial_points_generator_wrapper(generator); + } +}; + +template +struct Initial_points_generator_generator +{ + auto operator()(Null_functor&) + { + return Initial_points_generator_default(); + } +}; + } // end namespace internal diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 7792ad5cdb6..1ef07d492d8 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -323,6 +323,7 @@ CGAL_add_named_parameter_with_compatibility(do_reset_c3t3_t, do_reset_c3t3, do_r CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) +CGAL_add_named_parameter_with_compatibility(initial_points_generator_param_t,initial_points_generator_param,initial_points_generator) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) From 2732dad5e47652fa05f744ccee3df4f63a50def0 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 16 Oct 2023 10:17:37 +0200 Subject: [PATCH 007/332] Fix CI --- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c77efc45446..19d36896e10 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -211,7 +211,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerato InitialPointsGenerator& generator = Null_functor()) { C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() - (c3t3,domain,criteria,with_features,mesh_options); + (c3t3,domain,criteria,with_features,mesh_options,generator); } }; From bec5358ff19ae67949065d7018b9578bfe5714f4 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 16 Oct 2023 12:39:04 +0200 Subject: [PATCH 008/332] Fix CI --- Mesh_3/include/CGAL/make_mesh_3.h | 12 ++++++------ STL_Extension/include/CGAL/tags.h | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 19d36896e10..cfd255cf075 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -41,7 +41,7 @@ namespace internal { template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitialPointsGenerator = Null_functor > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points, InitialPointsGenerator& generator = Null_functor()) + const int nb_initial_points, InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -184,7 +184,7 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerat const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { @@ -208,7 +208,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerato const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() (c3t3,domain,criteria,with_features,mesh_options,generator); @@ -230,7 +230,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGener const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -276,7 +276,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitialPointsGene const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { @@ -524,7 +524,7 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 6aa1988e1cc..c003234126f 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -53,6 +53,10 @@ struct Null_functor { typedef Null_tag result_type; typedef Null_tag second_argument_type; }; +namespace Null_functor_internal +{ + static Null_functor default_null_functor; +} // namespace Null_functor_internal // For concurrency struct Sequential_tag {}; From 0d0c1f3213c6bb16680a7017d570b4b409eee463 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 16 Oct 2023 13:26:20 +0200 Subject: [PATCH 009/332] Fix CI --- .../Mesh_3/mesh_3D_image_with_initial_points.cpp | 4 ++-- Mesh_3/include/CGAL/make_mesh_3.h | 14 +++++++------- STL_Extension/include/CGAL/tags.h | 4 ---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index e065062697d..cdf3a44e1a4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -46,8 +46,8 @@ int main() Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). cell_radius_edge_ratio(3).cell_size(3)); - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - params::initial_points_generator(Construct_initial_points_labeled_image(image)) + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria + , params::initial_points_generator(Construct_initial_points_labeled_image(image)) ); /// [Meshing] diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index cfd255cf075..6c04b14b67b 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -41,7 +41,7 @@ namespace internal { template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitialPointsGenerator = Null_functor > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points, InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const int nb_initial_points, InitialPointsGenerator& generator = Null_functor()) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -59,7 +59,7 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, // Mesh initialization : get some points and add them to the mesh Initial_points_vector initial_points; - auto& generator_wrapped = + auto generator_wrapped = Initial_points_generator_generator()(generator); if (nb_initial_points > -1) generator_wrapped(std::back_inserter(initial_points), domain, c3t3, @@ -184,7 +184,7 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerat const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { @@ -208,7 +208,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerato const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + InitialPointsGenerator& generator = Null_functor()) { C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() (c3t3,domain,criteria,with_features,mesh_options,generator); @@ -230,7 +230,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGener const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -276,7 +276,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitialPointsGene const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + InitialPointsGenerator& generator = Null_functor()) { if ( with_features ) { @@ -524,7 +524,7 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + InitialPointsGenerator& generator = Null_functor()) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index c003234126f..6aa1988e1cc 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -53,10 +53,6 @@ struct Null_functor { typedef Null_tag result_type; typedef Null_tag second_argument_type; }; -namespace Null_functor_internal -{ - static Null_functor default_null_functor; -} // namespace Null_functor_internal // For concurrency struct Sequential_tag {}; From 9fc7230e64764d83240f587facba6d89126fc41c Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 16 Oct 2023 14:04:45 +0200 Subject: [PATCH 010/332] Fix CI --- Mesh_3/include/CGAL/make_mesh_3.h | 12 ++++++------ .../STL_Extension/internal/mesh_option_classes.h | 4 ++-- STL_Extension/include/CGAL/tags.h | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6c04b14b67b..8c1581368f4 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -41,7 +41,7 @@ namespace internal { template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitialPointsGenerator = Null_functor > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points, InitialPointsGenerator& generator = Null_functor()) + const int nb_initial_points, InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -184,7 +184,7 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerat const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { @@ -208,7 +208,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerato const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() (c3t3,domain,criteria,with_features,mesh_options,generator); @@ -230,7 +230,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGener const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -276,7 +276,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitialPointsGene const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { if ( with_features ) { @@ -524,7 +524,7 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - InitialPointsGenerator& generator = Null_functor()) + InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 195a7a271cb..97defe20378 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -188,8 +188,8 @@ struct Initial_points_generator_wrapper } private: - std::function initial_points_generator_default_; - std::function initial_points_generator_; + const std::function initial_points_generator_default_; + const std::function initial_points_generator_; }; template struct Initial_points_generator_default diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 6aa1988e1cc..1fcff383e3e 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -53,6 +53,9 @@ struct Null_functor { typedef Null_tag result_type; typedef Null_tag second_argument_type; }; +namespace Null_functor_internal { + static Null_functor default_null_functor; +} // For concurrency struct Sequential_tag {}; From f2af65444d10eaa3164f5bee189467e9c203445f Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 17 Oct 2023 15:39:42 +0200 Subject: [PATCH 011/332] Use parameters instead of template Allows easier initialisation --- .../mesh_3D_image_with_initial_points.cpp | 5 +- Mesh_3/include/CGAL/make_mesh_3.h | 76 +++++++-------- .../internal/mesh_option_classes.h | 97 +++++++++++++------ .../internal/mesh_parameters_interface.h | 17 ++++ .../internal/parameters_interface.h | 2 +- STL_Extension/include/CGAL/tags.h | 3 - 6 files changed, 124 insertions(+), 76 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index cdf3a44e1a4..17e5fcb0638 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -43,8 +43,9 @@ int main() Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). - cell_radius_edge_ratio(3).cell_size(3)); + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1) + .cell_radius_edge_ratio(3).cell_size(3) + ); C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria , params::initial_points_generator(Construct_initial_points_labeled_image(image)) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 8c1581368f4..a62b87cf4da 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -38,10 +38,11 @@ namespace CGAL { namespace Mesh_3 { namespace internal { -template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitialPointsGenerator = Null_functor > +template < typename C3T3, typename MeshDomain, typename MeshCriteria > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points, InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const int nb_initial_points, + const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_options()()) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -49,23 +50,13 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, typedef typename Initial_points_vector::iterator Ipv_iterator; typedef typename C3T3::Vertex_handle Vertex_handle; - typedef typename - CGAL::parameters::internal::Initial_points_generator_generator< - std::back_insert_iterator, - MeshDomain, - C3T3, - InitialPointsGenerator> - Initial_points_generator_generator; - // Mesh initialization : get some points and add them to the mesh Initial_points_vector initial_points; - auto generator_wrapped = - Initial_points_generator_generator()(generator); if (nb_initial_points > -1) - generator_wrapped(std::back_inserter(initial_points), domain, c3t3, + generator(std::back_inserter(initial_points), domain, c3t3, nb_initial_points); else //use default number of points - generator_wrapped(std::back_inserter(initial_points), domain, c3t3); + generator(std::back_inserter(initial_points), domain, c3t3); typename C3T3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); @@ -169,22 +160,23 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria, bool MeshDomainHasHasFeatures, - typename HasFeatures = int, - typename InitialPointsGenerator = Null_functor> + typename HasFeatures = int> struct C3t3_initializer { }; // Partial specialization of C3t3_initializer // Handle cases where MeshDomain::Has_features is not a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitialPointsGenerator > -struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerator > +template < typename C3T3, typename MD, typename MC, typename HasFeatures> +struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures > { typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; + typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const Initial_points_generator_options& generator = Initial_points_generator_generator()()) { if ( with_features ) { @@ -199,18 +191,20 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitialPointsGenerat // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitialPointsGenerator > -struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerator > +template < typename C3T3, typename MD, typename MC, typename HasFeatures > +struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures > { typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; + typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const Initial_points_generator_options& generator = Initial_points_generator_generator()()) { - C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitialPointsGenerator >() + C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features >() (c3t3,domain,criteria,with_features,mesh_options,generator); } }; @@ -218,19 +212,21 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitialPointsGenerato // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_true -template < typename C3T3, typename MD, typename MC, typename InitialPointsGenerator > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGenerator > +template < typename C3T3, typename MD, typename MC > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > : public C3t3_initializer_base < C3T3, MD, MC > { virtual ~C3t3_initializer() { } typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; + typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const Initial_points_generator_options& generator = Initial_points_generator_generator()()) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -267,16 +263,18 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitialPointsGener // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_false -template < typename C3T3, typename MD, typename MC, typename InitialPointsGenerator > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitialPointsGenerator > +template < typename C3T3, typename MD, typename MC > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > { typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; + typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const Initial_points_generator_options& generator = Initial_points_generator_generator()()) { if ( with_features ) { @@ -476,13 +474,16 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - auto initial_points_generator_param = choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), Null_functor()); + + parameters::internal::Initial_points_generator_options initial_points_generator_options_param = + parameters::internal::Initial_points_generator_generator() + (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::default_initial_points_generation())); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, features_param.features(), mesh_options_param, manifold_options_param, - initial_points_generator_param); + initial_points_generator_options_param); return c3t3; } @@ -511,7 +512,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, * * @return The mesh as a C3T3 object */ -template +template void make_mesh_3_impl(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, @@ -524,25 +525,24 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - InitialPointsGenerator& generator = Null_functor_internal::default_null_functor) + const parameters::internal::Initial_points_generator_options& + initial_points_generator_options = parameters::internal::Initial_points_generator_generator()()) { +// InitialPointsGenerator& generator = Null_functor_internal::default_null_functor #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); #endif - // Initialize c3t3 Mesh_3::internal::C3t3_initializer< C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value, - int, /*Type of MeshDomain::Has_features not determined*/ - InitialPointsGenerator >() (c3t3, + ::CGAL::internal::has_Has_features::value>() (c3t3, domain, criteria, with_features, mesh_options, - generator); + initial_points_generator_options); CGAL_assertion( c3t3.triangulation().dimension() >= 2 ); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 97defe20378..c7bb4b368ad 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -168,41 +168,53 @@ private: }; // Initial points generator -template -struct Initial_points_generator_wrapper +// options_holder has two roles. +// 1 : determine if the default value is passed +// 2 : if not the default value, hold the user's generator +template +struct Initial_points_generator_options_holder { + static constexpr bool is_default = false; + + Initial_points_generator_options_holder(const Initial_points_generator& generator) + : generator_(generator) + { } + + const Initial_points_generator& generator_; +}; + +template <> +struct Initial_points_generator_options_holder +{ + static constexpr bool is_default = true; +}; + +// options is holding the generator (default or the user's one) +template +struct Initial_points_generator_options +{ + typedef typename std::back_insert_iterator>> OutputIterator; + template - Initial_points_generator_wrapper(Initial_points_generator& generator) - : initial_points_generator_default_(generator) + Initial_points_generator_options(const Initial_points_generator& generator) + : initial_points_generator_no_number_of_points_(generator) , initial_points_generator_(generator) { } - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) const { - return initial_points_generator_default_(pts, domain, c3t3); + return initial_points_generator_no_number_of_points_(pts, domain, c3t3); } - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) const { return initial_points_generator_(pts, domain, c3t3, n); } private: - const std::function initial_points_generator_default_; + const std::function initial_points_generator_no_number_of_points_; const std::function initial_points_generator_; }; -template -struct Initial_points_generator_default -{ - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) - { - return domain.construct_initial_points_object()(pts); - } - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) - { - return domain.construct_initial_points_object()(pts, n); - } -}; // ----------------------------------- // Features generator @@ -246,22 +258,43 @@ struct Domain_features_generator< MeshDomain, true > } }; -// struct Initial_points_generator_generator -template +// struct Initial_points_generator_generator evaluate the options_holder +// and returns the appropriate options. +template struct Initial_points_generator_generator { - auto operator()(Initial_points_generator& generator) - { - return Initial_points_generator_wrapper(generator); - } -}; + typedef typename std::back_insert_iterator>> OutputIterator; -template -struct Initial_points_generator_generator -{ - auto operator()(Null_functor&) + typedef Initial_points_generator_options Initial_points_generator_options; + + struct Initial_points_generator_domain_traductor { - return Initial_points_generator_default(); + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + { + return domain.construct_initial_points_object()(pts); + } + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + { + return domain.construct_initial_points_object()(pts, n); + } + }; + + template + Initial_points_generator_options operator()(const Initial_points_generator_options_holder& initial_points_generator_options_holder_param) + { + if constexpr (Initial_points_generator_options_holder::is_default) + { + return operator()(); + } + else + { + return Initial_points_generator_options(initial_points_generator_options_holder_param.generator_); + } + } + + Initial_points_generator_options operator()() + { + return Initial_points_generator_options(Initial_points_generator_domain_traductor()); } }; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index ece342c321b..93e77e5b46c 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -368,3 +368,20 @@ features(const MeshDomain& /*domain*/) typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; return CGAL_NP_BUILD(Param,Generator()()); } + +// ----------------------------------- +// Initial_points_generator_options +// ----------------------------------- +inline Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> +default_initial_points_generation() { + typedef Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Initial_points_generator_options_holder<>()); +} + +template +inline Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> +initial_points_generator(const InitialPointsGenerator& generator) +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Initial_points_generator_options_holder(generator)); +} diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 1ef07d492d8..57715ff5a2a 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -323,7 +323,7 @@ CGAL_add_named_parameter_with_compatibility(do_reset_c3t3_t, do_reset_c3t3, do_r CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) -CGAL_add_named_parameter_with_compatibility(initial_points_generator_param_t,initial_points_generator_param,initial_points_generator) +CGAL_add_named_parameter_with_compatibility(initial_points_generator_options_param_t,initial_points_generator_options_param,initial_points_generator_options) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 1fcff383e3e..6aa1988e1cc 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -53,9 +53,6 @@ struct Null_functor { typedef Null_tag result_type; typedef Null_tag second_argument_type; }; -namespace Null_functor_internal { - static Null_functor default_null_functor; -} // For concurrency struct Sequential_tag {}; From 268fd8b53c395cd9b87cc312ea4f2a65a0391519 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 17 Oct 2023 15:47:31 +0200 Subject: [PATCH 012/332] Fix CI confusion between typedef and struct --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index c7bb4b368ad..85c0c3390f0 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -265,7 +265,7 @@ struct Initial_points_generator_generator { typedef typename std::back_insert_iterator>> OutputIterator; - typedef Initial_points_generator_options Initial_points_generator_options; + typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; struct Initial_points_generator_domain_traductor { From 4ee4dff969e89668909f35688567f5229477b4fc Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 17 Oct 2023 16:02:28 +0200 Subject: [PATCH 013/332] Doc change + small fix --- Mesh_3/include/CGAL/make_mesh_3.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index a62b87cf4da..80fa460e502 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -42,7 +42,7 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria > void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, - const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_options()()) + const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_generator()()) { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; @@ -416,9 +416,11 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialisation} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. - * It must folow the `InitialPointsGenerator` concept and is specified with the param: + * It must folow the `InitialPointsGenerator` concept. + * The following two named parameters control this option: *
    *
  • `parameters::initial_points_generator(generator)` + *
  • `parameters::default_initial_points_generation()` *
* * The `InitialPointsGenerator` concept is a function object to construct @@ -437,7 +439,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * output iterator `pts`, as objects of type `std::pair`. If `n` is not given, the functor must provide enough * points to initialize the mesh generation process.} - * \cgalParamDefault{`parameters::initial_points_generator(generator)`} + * \cgalParamDefault{`parameters::default_initial_points_generation()`} * \cgalParamSectionEnd * \cgalNamedParamsEnd * @@ -532,12 +534,13 @@ void make_mesh_3_impl(C3T3& c3t3, #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); #endif + // Initialize c3t3 Mesh_3::internal::C3t3_initializer< C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value>() (c3t3, + ::CGAL::internal::has_Has_features::value >() (c3t3, domain, criteria, with_features, From c232929fd1c1a03d9a44604505044d9b6767edd8 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 17 Oct 2023 16:12:48 +0200 Subject: [PATCH 014/332] Fix error when no initial_points_generator --- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 80fa460e502..c6baa4e8626 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -479,7 +479,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Initial_points_generator_options initial_points_generator_options_param = parameters::internal::Initial_points_generator_generator() - (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::default_initial_points_generation())); + (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::default_initial_points_generation().v)); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, From e5d26511dc8d53f1fbb6af9e607a7e77a329759c Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 17 Oct 2023 17:54:27 +0200 Subject: [PATCH 015/332] Fix unvoluntary copy --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 85c0c3390f0..b6f54fe35d4 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -212,8 +212,8 @@ struct Initial_points_generator_options } private: - const std::function initial_points_generator_no_number_of_points_; - const std::function initial_points_generator_; + const std::function initial_points_generator_no_number_of_points_; + const std::function initial_points_generator_; }; // ----------------------------------- From cb715951d0bc6c8ee24b515d9ff12134a2c41035 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 10:31:19 +0200 Subject: [PATCH 016/332] Doc changed example + Doc added parameter + Doc make_mesh_3 + Doc Construct_initial_points_labeled_image header + Remove unwanted duplicata --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 43 +++++++++++++++++++ Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 +- ...struct_initial_points_from_labeled_image.h | 24 +++++++++++ ...tialize_triangulation_from_labeled_image.h | 7 --- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- 5 files changed, 70 insertions(+), 10 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index acfb0b6efd8..e744d460a69 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -451,6 +451,49 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v template unspecified_type perturb(const Named_function_parameters& np = parameters::default_values()); +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::default_initial_points_generation()` enables the user to tell the mesh generation function + * `make_mesh_3()` that the domlain's construct_initial_points_object will be called for the points initialization. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation using the domlain's construct_initial_points_object + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::default_initial_points_generation()); + * \endcode + * + * \sa `CGAL::parameters::initial_points_generator(generator)` + * \sa `CGAL::make_mesh_3()` + * \sa `MeshDomain_3::construct_initial_points_object()` + * + */ +unspecified_type default_initial_points_generation(); +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::initial_points_generator()` enables the user to specify to the mesh generation function + * `make_mesh_3()` a Functor of the `InitialPointsGenerator` concept that will be called for the points initialization. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation from labelled image with connexity checks. + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::initial_points_generator(Construct_initial_points_labeled_image(image))); + * \endcode + * + * \sa `CGAL::parameters::default_initial_points_generation()` + * \sa `CGAL::make_mesh_3()` + * \sa `Construct_initial_points_labeled_image()` + * + */ +template +unspecified_type initial_points_generator(const InitialPointsGenerator& generator); } /* namespace parameters */ } /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index abe63982656..6b4c003ac25 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -772,11 +772,11 @@ points in the `%c3t3` object, with the calls to The value of `index` must be consistent with the possible values of `Mesh_domain::Index`. In \ref -CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h, it is +CGAL/Mesh_3/Construct_initial_points_labeled_image.h, it is constructed using the API of the mesh domain, as follows. First the functor `construct_intersect` is created -\dontinclude CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +\dontinclude CGAL/Mesh_3/Construct_initial_points_labeled_image.h \skip Construct_intersection construct_intersection = \until construct_intersection_object then the `%Mesh_domain::Intersection` object (a `%tuple` with three diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h index 878af535821..41d2d2ce987 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h @@ -59,6 +59,30 @@ struct Get_point } }; +/*! +* \ingroup PkgMesh3Functions +* +* Functor for initial points generation in labeled images. +* This functor is a model of concept `InitialPointsGenerator`, +* and thus can be passed to `CGAL::make_mesh_3` with the parameter +* `CGAL::parameters::initial_points_generator(generator)` +* +* It is constructed using the API of the mesh domain, as follows. +* First the functor `construct_intersect` is created +* +* \dontinclude CGAL/Mesh_3/Construct_initial_points_labeled_image.h +* \skip Construct_intersection construct_intersection = +* \until construct_intersection_object +* then the `%MeshDomain_3::Intersection` object (a `%tuple` with three +* elements) is constructed using a call to the functor `construct_intersection` +* \skip Intersection intersect +* \until construct_intersection +* and eventually `%index` is the element \#1 of `%intersect`. +* \skipline get<1>(intersect) +* +* \sa `CGAL::parameters::initial_points_generator(generator)` +* \sa `CGAL::make_mesh_3()` +*/ struct Construct_initial_points_labeled_image { const CGAL::Image_3 & image; diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 5035fcfd26f..38db1b000cb 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -103,13 +103,6 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::cout << " -> " << tr.number_of_vertices() << " initial points." << std::endl; } std::cout << " " << tr.number_of_vertices() << " initial points." << std::endl; - if ( c3t3.triangulation().dimension() != 3 ) - { - std::cout << " not enough points: triangulation.dimension() == " - << c3t3.triangulation().dimension() << std::endl; - CGAL::Mesh_3::internal::init_c3t3(c3t3, domain, criteria, 20); - std::cout << " -> " << tr.number_of_vertices() << " initial points." << std::endl; - } } #endif // CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_LABELED_IMAGE_H diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c6baa4e8626..c25176f93a5 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -414,7 +414,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * } * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd - * \cgalParamSectionBegin{Mesh initialisation} + * \cgalParamSectionBegin{Mesh initialization} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. * It must folow the `InitialPointsGenerator` concept. * The following two named parameters control this option: From 6558190eda7a9f1ba7e2c605b88d625df4934d31 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 10:37:34 +0200 Subject: [PATCH 017/332] Fixed doc --- Mesh_3/doc/Mesh_3/examples.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index d9c2eb95d71..c80a3c2464f 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -10,6 +10,7 @@ \example Mesh_3/random_labeled_image.h \example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h \example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp From 91d66d0bfc76572e8bc1e1f06595405f5596b9f0 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 11:01:50 +0200 Subject: [PATCH 018/332] Renamed Construct_initial_points_from_labeled_image.h --- ...labeled_image.h => Construct_initial_points_labeled_image.h} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Mesh_3/include/CGAL/Mesh_3/{Construct_initial_points_from_labeled_image.h => Construct_initial_points_labeled_image.h} (99%) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h similarity index 99% rename from Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h rename to Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 41d2d2ce987..59aa7afaa98 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -8,7 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ange Clement +// Author(s) : Laurent Rineau and Ange Clement #ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H #define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H From 23af3eb0e21ba47cef0bb58a92b0507a66587f0c Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 12:38:03 +0200 Subject: [PATCH 019/332] Updated doc example snippets + Added group "Mesh Initialization Functions" + Added concept "InitialPointsGenerator" + Documented model "Construct_initial_points_labeled_image" + Updated demo parametters + Fix reneming errors --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 10 ++-- .../Mesh_3/Concepts/InitialPointsGenerator.h | 57 +++++++++++++++++++ Mesh_3/doc/Mesh_3/Mesh_3.txt | 9 +-- Mesh_3/doc/Mesh_3/PackageDescription.txt | 10 ++++ Mesh_3/doc/Mesh_3/examples.txt | 1 - .../mesh_3D_image_with_initial_points.cpp | 4 +- .../Construct_initial_points_labeled_image.h | 56 +++++++++++------- ...tialize_triangulation_from_labeled_image.h | 4 +- Mesh_3/include/CGAL/make_mesh_3.h | 21 +------ 9 files changed, 118 insertions(+), 54 deletions(-) create mode 100644 Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index e744d460a69..252206644aa 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -455,7 +455,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * \ingroup PkgMesh3Parameters * * The function `parameters::default_initial_points_generation()` enables the user to tell the mesh generation function - * `make_mesh_3()` that the domlain's construct_initial_points_object will be called for the points initialization. + * `make_mesh_3()` that the domain's `construct_initial_points_object()` will be called for the points initialization. * * \cgalHeading{Example} * @@ -466,9 +466,11 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * parameters::default_initial_points_generation()); * \endcode * - * \sa `CGAL::parameters::initial_points_generator(generator)` + * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `MeshDomain_3::construct_initial_points_object()` + * \sa `MeshDomain_3` + * \sa `construct_initial_points_object()` * */ unspecified_type default_initial_points_generation(); @@ -484,12 +486,12 @@ unspecified_type default_initial_points_generation(); * // Mesh generation from labelled image with connexity checks. * C3t3 c3t3 = make_mesh_3(domain, * criteria, - * parameters::initial_points_generator(Construct_initial_points_labeled_image(image))); + * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); * \endcode * * \sa `CGAL::parameters::default_initial_points_generation()` * \sa `CGAL::make_mesh_3()` - * \sa `Construct_initial_points_labeled_image()` + * \sa `CGAL::Construct_initial_points_labeled_image()` * */ template diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h new file mode 100644 index 00000000000..0aa5a26c7a9 --- /dev/null +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -0,0 +1,57 @@ +/*! +\ingroup PkgMesh3SecondaryConcepts +\cgalConcept + +The function object concept `InitialPointsGenerator` is designed to construct +a set of initial points on the surface of the domain. + +\cgalHasModelsBegin +\cgalHasModels{CGAL::Construct_initial_points_labeled_image} +\cgalHasModelsEnd + +\sa `MeshCellCriteria_3` +\sa `MeshFacetCriteria_3` +\sa `MeshCriteria_3` +\sa `MeshCriteriaWithFeatures_3` + +*/ + +class InitialPointsGenerator { +public: + +/// \name Operations +/// @{ + +/*! +Output a set of (`n`) surface points to the +output iterator `pts`, as objects of type `std::pair`. + +@tparam OutputIterator an `OutputIterator` of points of type +`std::pair` +@tparam MeshDomain a model of `MeshDomain_3` +@tparam C3t3 a model of `MeshDomainField_3` + +*/ +template +OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n); + +/*! +Output a set of surface points to the +output iterator `pts`, as objects of type `std::pair`. As `n` is not given, the functor must provide enough +points to initialize the mesh generation process. + +@tparam OutputIterator an `OutputIterator` of points of type +`std::pair` +@tparam MeshDomain a model of `MeshDomain_3` +@tparam C3t3 a model of `MeshDomainField_3` + +*/ +template +OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3); + + +/// @} + +}; /* end MeshEdgeCriteria_3 */ diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 6b4c003ac25..72fdb25ab11 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -776,15 +776,12 @@ CGAL/Mesh_3/Construct_initial_points_labeled_image.h, it is constructed using the API of the mesh domain, as follows. First the functor `construct_intersect` is created -\dontinclude CGAL/Mesh_3/Construct_initial_points_labeled_image.h -\skip Construct_intersection construct_intersection = -\until construct_intersection_object +\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h construct intersection then the `%Mesh_domain::Intersection` object (a `%tuple` with three elements) is constructed using a call to the functor `construct_intersection` -\skip Intersection intersect = -\until construct_intersection +\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h use construct intersection and eventually `%index` is the element \#1 of `%intersect`. -\skipline get<1>(intersect) +\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection The result of the custom initialization can be seen in \cgalFigureRef{mesh3custominitimage3D}. The generated 3D image contains a diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index e063c6eeee7..51b18e4ffa4 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -29,6 +29,9 @@ /// The two main functions to generate a mesh are `make_mesh_3()` and `refine_mesh_3()`. /// The other functions enable to optimize an existing mesh. +/// \defgroup PkgMesh3Initializers Mesh Initialization Functions +/// \ingroup PkgMesh3Ref + /// \defgroup PkgMesh3Parameters Parameter Functions /// \ingroup PkgMesh3Ref @@ -77,6 +80,7 @@ related to the template parameters of some models of the main concepts: - `BisectionGeometricTraits_3` - `IntersectionGeometricTraits_3` +- `InitialPointsGenerator` - `MeshCellBase_3` - `MeshVertexBase_3` - `MeshDomainField_3` @@ -110,6 +114,10 @@ The following functors are available for feature detection: - `CGAL::Mesh_3::Detect_features_in_image` - `CGAL::Mesh_3::Detect_features_on_image_bbox` +The following functors are available for mesh initialization: + +- `CGAL::Construct_initial_points_labeled_image` + \cgalCRPSection{Function Templates} - `CGAL::make_mesh_3()` @@ -135,6 +143,8 @@ The following functors are available for feature detection: - `CGAL::parameters::manifold()` - `CGAL::parameters::manifold_with_boundary()` - `CGAL::parameters::non_manifold()` +- `CGAL::parameters::default_initial_points_generation()` +- `CGAL::parameters::initial_points_generator()` \cgalCRPSection{Enumerations} diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index c80a3c2464f..d9c2eb95d71 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -10,7 +10,6 @@ \example Mesh_3/random_labeled_image.h \example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h \example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h -\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index 17e5fcb0638..a97170232b4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -48,7 +48,7 @@ int main() ); C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(Construct_initial_points_labeled_image(image)) + , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) ); /// [Meshing] diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 59aa7afaa98..4f28dd5e47a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -10,8 +10,8 @@ // // Author(s) : Laurent Rineau and Ange Clement -#ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H -#define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H +#ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_LABELED_IMAGE_H +#define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_LABELED_IMAGE_H #include @@ -22,6 +22,14 @@ #include +namespace CGAL +{ + +namespace Mesh_3 +{ +namespace internal +{ + template struct Get_point { @@ -59,28 +67,28 @@ struct Get_point } }; +} // end namespace internal +} // end namespace Mesh_3 + /*! -* \ingroup PkgMesh3Functions +* \ingroup PkgMesh3Initializers * * Functor for initial points generation in labeled images. * This functor is a model of concept `InitialPointsGenerator`, * and thus can be passed to `CGAL::make_mesh_3` with the parameter -* `CGAL::parameters::initial_points_generator(generator)` +* `CGAL::parameters::initial_points_generator()` * * It is constructed using the API of the mesh domain, as follows. * First the functor `construct_intersect` is created * -* \dontinclude CGAL/Mesh_3/Construct_initial_points_labeled_image.h -* \skip Construct_intersection construct_intersection = -* \until construct_intersection_object -* then the `%MeshDomain_3::Intersection` object (a `%tuple` with three +* \snippet this construct intersection +* then the `%Mesh_domain::Intersection` object (a `%tuple` with three * elements) is constructed using a call to the functor `construct_intersection` -* \skip Intersection intersect -* \until construct_intersection +* \snippet this use construct intersection * and eventually `%index` is the element \#1 of `%intersect`. -* \skipline get<1>(intersect) +* \snippet this get construct intersection * -* \sa `CGAL::parameters::initial_points_generator(generator)` +* \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` */ struct Construct_initial_points_labeled_image @@ -127,7 +135,7 @@ struct Construct_initial_points_labeled_image using Seeds = std::vector; Seeds seeds; - Get_point get_point(&image); + Mesh_3::internal::Get_point get_point(&image); std::cout << "Searching for connected components..." << std::endl; CGAL_IMAGE_IO_CASE(image.image(), search_for_connected_components_in_labeled_image(image, std::back_inserter(seeds), @@ -158,8 +166,10 @@ struct Construct_initial_points_labeled_image const double radius = double(seed.radius + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); + /// [construct intersection] typename MeshDomain::Construct_intersection construct_intersection = domain.construct_intersection_object(); + /// [construct intersection] std::vector directions; if(seed.radius < 2) { @@ -183,13 +193,17 @@ struct Construct_initial_points_labeled_image const Point_3 test = seed_point + v; const Segment_3 test_segment = Segment_3(seed_point, test); + /// [use construct intersection] const typename MeshDomain::Intersection intersect = construct_intersection(test_segment); + /// [use construct intersection] if (std::get<2>(intersect) != 0) { - const Point_3& bpi = std::get<0>(intersect); - const Index index = std::get<1>(intersect); - Weighted_point pi = Weighted_point(bpi); + /// [get construct intersection] + const Point_3& intersect_point = std::get<0>(intersect); + const Index& intersect_index = std::get<1>(intersect); + /// [get construct intersection] + Weighted_point pi = Weighted_point(intersect_point); // This would cause trouble to optimizers // check pi will not be hidden @@ -241,8 +255,8 @@ struct Construct_initial_points_labeled_image if (cwsr(cv_wp, FT(0)) == CGAL::EQUAL) // 0 == wp's weight continue; - // if the (squared) distance between bpi and cv is smaller or equal than cv's weight - if (cwsr(cv_wp, - tr.min_squared_distance(bpi, cp(cv_wp))) != CGAL::LARGER) + // if the (squared) distance between intersect_point and cv is smaller or equal than cv's weight + if (cwsr(cv_wp, - tr.min_squared_distance(intersect_point, cp(cv_wp))) != CGAL::LARGER) { pi_inside_protecting_sphere = true; break; @@ -251,7 +265,7 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = std::make_pair(bpi, index); + *pts++ = std::make_pair(intersect_point, intersect_index); } } } @@ -259,4 +273,6 @@ struct Construct_initial_points_labeled_image } }; -#endif // CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_FROM_LABELED_IMAGE_H +} // end namespace CGAL + +#endif // CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_LABELED_IMAGE_H diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 38db1b000cb..5cd16b83032 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -16,7 +16,7 @@ #include #include -#include +#include template void init_tr_from_labeled_image_call_init_features(C3T3&, @@ -73,7 +73,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::vector constructedPoints; - Construct_initial_points_labeled_image construct(image); + CGAL::Construct_initial_points_labeled_image construct(image); construct(std::back_inserter(constructedPoints), domain, c3t3); std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c25176f93a5..f790012f07d 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -416,29 +416,12 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialization} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. - * It must folow the `InitialPointsGenerator` concept. + * It must follow the `InitialPointsGenerator` concept. * The following two named parameters control this option: *
    - *
  • `parameters::initial_points_generator(generator)` + *
  • `parameters::initial_points_generator()` *
  • `parameters::default_initial_points_generation()` *
- * - * The `InitialPointsGenerator` concept is a function object to construct - * a set of initial points on the surface of the domain. Provides the - * following operators: - * - * `template ` - *
- * `OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3)` - * - * `template ` - *
- * `OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n)` - * - * Those two operators output a set of (`n`) surface points to the - * output iterator `pts`, as objects of type `std::pair`. If `n` is not given, the functor must provide enough - * points to initialize the mesh generation process.} * \cgalParamDefault{`parameters::default_initial_points_generation()`} * \cgalParamSectionEnd * \cgalNamedParamsEnd From 932e8a2b34fecdb771ede1f260498b2f8575531d Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 12:46:44 +0200 Subject: [PATCH 020/332] Fix Doc missing end of description --- Mesh_3/doc/Mesh_3/examples.txt | 1 + Mesh_3/include/CGAL/make_mesh_3.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index d9c2eb95d71..c80a3c2464f 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -10,6 +10,7 @@ \example Mesh_3/random_labeled_image.h \example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h \example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index f790012f07d..66685418615 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -421,7 +421,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    *
  • `parameters::initial_points_generator()` *
  • `parameters::default_initial_points_generation()` - *
+ * } * \cgalParamDefault{`parameters::default_initial_points_generation()`} * \cgalParamSectionEnd * \cgalNamedParamsEnd From df6d1ed6fd47b28f2f40dbab799d69e21674e60c Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 13:41:03 +0200 Subject: [PATCH 021/332] Fix Doc : Added Construct_initial_points_labeled_image to doxyfile --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 18 ++++++++++-------- .../Mesh_3/Concepts/InitialPointsGenerator.h | 4 ++-- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 ++- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 252206644aa..f3b79cd85d4 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -454,8 +454,10 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::default_initial_points_generation()` enables the user to tell the mesh generation function - * `make_mesh_3()` that the domain's `construct_initial_points_object()` will be called for the points initialization. + * The function `parameters::default_initial_points_generation()` enables the user to + * tell the mesh generation function `make_mesh_3()` + * that the domain's `construct_initial_points_object()` + * will be called for the points initialization. * * \cgalHeading{Example} * @@ -468,17 +470,17 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` - * \sa `MeshDomain_3::construct_initial_points_object()` - * \sa `MeshDomain_3` - * \sa `construct_initial_points_object()` + * \sa `MeshDomain_3::Construct_initial_points` * */ unspecified_type default_initial_points_generation(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points_generator()` enables the user to specify to the mesh generation function - * `make_mesh_3()` a Functor of the `InitialPointsGenerator` concept that will be called for the points initialization. + * The function `parameters::initial_points_generator()` enables the user to + * specify a Functor of the `InitialPointsGenerator` concept + * to the mesh generation function `make_mesh_3()`. + * The functor will be called for the points initialization. * * \cgalHeading{Example} * @@ -491,7 +493,7 @@ unspecified_type default_initial_points_generation(); * * \sa `CGAL::parameters::default_initial_points_generation()` * \sa `CGAL::make_mesh_3()` - * \sa `CGAL::Construct_initial_points_labeled_image()` + * \sa `MeshDomain_3::Construct_initial_points` * */ template diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 0aa5a26c7a9..a184a1efaff 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -30,7 +30,7 @@ output iterator `pts`, as objects of type `std::pair` @tparam MeshDomain a model of `MeshDomain_3` -@tparam C3t3 a model of `MeshDomainField_3` +@tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ template @@ -45,7 +45,7 @@ points to initialize the mesh generation process. @tparam OutputIterator an `OutputIterator` of points of type `std::pair` @tparam MeshDomain a model of `MeshDomain_3` -@tparam C3t3 a model of `MeshDomainField_3` +@tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ template diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 18c58c248e6..6f4e6300ac6 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -39,7 +39,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Compact_mesh_cell_base_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Detect_features_in_image.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Detect_features_on_image_bbox.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_edge_criteria_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_edge_criteria_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Construct_initial_points_labeled_image.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 51b18e4ffa4..a499ea4f3b0 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -143,8 +143,8 @@ The following functors are available for mesh initialization: - `CGAL::parameters::manifold()` - `CGAL::parameters::manifold_with_boundary()` - `CGAL::parameters::non_manifold()` -- `CGAL::parameters::default_initial_points_generation()` - `CGAL::parameters::initial_points_generator()` +- `CGAL::parameters::default_initial_points_generation()` \cgalCRPSection{Enumerations} From 3ac063992fa53a5ad5cdf0448a778b278cda042a Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 14:11:57 +0200 Subject: [PATCH 022/332] Small doc fix --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 1 - Mesh_3/doc/Mesh_3/examples.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index f3b79cd85d4..1c66b482543 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -493,7 +493,6 @@ unspecified_type default_initial_points_generation(); * * \sa `CGAL::parameters::default_initial_points_generation()` * \sa `CGAL::make_mesh_3()` - * \sa `MeshDomain_3::Construct_initial_points` * */ template diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index c80a3c2464f..d9c2eb95d71 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -10,7 +10,6 @@ \example Mesh_3/random_labeled_image.h \example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h \example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h -\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp From 6955dbdd5ad0ae56cd6678ffbf483b9b70605246 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 18 Oct 2023 15:20:42 +0200 Subject: [PATCH 023/332] Doc operator() of Construct_initial_points_labeled_image --- .../Construct_initial_points_labeled_image.h | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 4f28dd5e47a..21f2a04f461 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -78,16 +78,6 @@ struct Get_point * and thus can be passed to `CGAL::make_mesh_3` with the parameter * `CGAL::parameters::initial_points_generator()` * -* It is constructed using the API of the mesh domain, as follows. -* First the functor `construct_intersect` is created -* -* \snippet this construct intersection -* then the `%Mesh_domain::Intersection` object (a `%tuple` with three -* elements) is constructed using a call to the functor `construct_intersection` -* \snippet this use construct intersection -* and eventually `%index` is the element \#1 of `%intersect`. -* \snippet this get construct intersection -* * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` */ @@ -99,6 +89,22 @@ struct Construct_initial_points_labeled_image : image(image_) { } + /*! + * \brief operator () The points are constructed using the API of the mesh domain, as follows. + * First the functor `construct_intersect` is created + * + * \snippet this construct intersection + * then the `%Mesh_domain::Intersection` object (a `%tuple` with three + * elements) is constructed using a call to the functor `construct_intersection` + * \snippet this use construct intersection + * and eventually `%index` is the element \#1 of `%intersect`. + * \snippet this get construct intersection + * + * @tparam OutputIterator an `OutputIterator` of points of type + * `std::pair` + * @tparam MeshDomain a model of `MeshDomain_3` + * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const { From 7eff2725450064bdd1ed58dcd4e20f2355c0ffc2 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Thu, 19 Oct 2023 09:41:31 +0200 Subject: [PATCH 024/332] Fix doc missing ref --- Mesh_3/doc/Mesh_3/examples.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index d9c2eb95d71..c80a3c2464f 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -10,6 +10,7 @@ \example Mesh_3/random_labeled_image.h \example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h \example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp From c014741454367f9219f68e129e90950b41747599 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 25 Oct 2023 10:35:25 +0200 Subject: [PATCH 025/332] Doc add example + Fix for initialize_triangulation_from_gray_image --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 21 ++++++++++++------- Mesh_3/doc/Mesh_3/examples.txt | 1 + .../mesh_3D_image_with_initial_points.cpp | 1 + .../Construct_initial_points_labeled_image.h | 11 ++++++++-- ...initialize_triangulation_from_gray_image.h | 10 +++++++++ ...tialize_triangulation_from_labeled_image.h | 11 +++++++++- 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 72fdb25ab11..d6bd93edd26 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -759,10 +759,10 @@ that call is replaced by: \snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp Meshing The code of the function `initialize_triangulation_from_labeled_image()` is -in the non-documented header \ref -CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. As it is -undocumented and may be removed or modified at any time, if you wish to -use it then you should copy-paste it to your user code. The code of that +in the header \ref +CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. It get points from +\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and insert them +in the triangulation. The code of the Construct_initial_points_labeled_image function is rather complicated. The following lines show how to insert new points in the `%c3t3` object, with the calls to `MeshVertexBase_3::set_dimension()` and @@ -830,11 +830,16 @@ the segmented image example above, the code consists in: \snippet Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp Meshing The code of the function `initialize_triangulation_from_gray_image()` is -in the non-documented header \ref -CGAL/Mesh_3/initialize_triangulation_from_gray_image.h. As it is -undocumented and may be removed or modified at any time, if you wish to -use it then you should copy-paste it to your user code. +in the header \ref +CGAL/Mesh_3/initialize_triangulation_from_gray_image.h. +The example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp is another +way to achieve the same results. Instead of a custom initialization, +it uses the parameter `CGAL::parameters::initial_points_generator` for the function +`CGAL::make_mesh_3`. This parameter expect a functor that ouputs points for +the mesh initialization (concept `InitialPointsGenerator`). + +\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Meshing \subsection Mesh_3UsingVariableSizingField Using Variable Sizing Field diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index c80a3c2464f..f29c47e7e32 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -4,6 +4,7 @@ \example Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp \example Mesh_3/mesh_3D_image_with_features.cpp \example Mesh_3/mesh_3D_image_with_custom_initialization.cpp +\example Mesh_3/mesh_3D_image_with_initial_points.cpp \example Mesh_3/mesh_3D_image_with_detection_of_features.cpp \example Mesh_3/mesh_3D_image_with_input_features.cpp \example Mesh_3/mesh_3D_weighted_image.cpp diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index a97170232b4..c205f1502b9 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -47,6 +47,7 @@ int main() .cell_radius_edge_ratio(3).cell_size(3) ); + /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) ); diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 21f2a04f461..a05736193d1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -89,7 +89,7 @@ struct Construct_initial_points_labeled_image : image(image_) { } - /*! + /*! * \brief operator () The points are constructed using the API of the mesh domain, as follows. * First the functor `construct_intersect` is created * @@ -107,6 +107,13 @@ struct Construct_initial_points_labeled_image */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const + { + CGAL_IMAGE_IO_CASE(image.image(), operator()(pts, domain, CGAL::Identity(), c3t3, n)); + return pts; + } + + template + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const { typedef typename MeshDomain::Subdomain Subdomain; typedef typename MeshDomain::Point_3 Point_3; @@ -146,7 +153,7 @@ struct Construct_initial_points_labeled_image CGAL_IMAGE_IO_CASE(image.image(), search_for_connected_components_in_labeled_image(image, std::back_inserter(seeds), CGAL::Emptyset_iterator(), - CGAL::Identity(), + transform, Word())); std::cout << " " << seeds.size() << " components were found." << std::endl; std::cout << "Construct initial points..." << std::endl; diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h index 1d3a6b7601e..b42875390a1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h @@ -20,6 +20,16 @@ #include +/** + * @brief initialize_triangulation_from_gray_image Initialize a c3t3 by detecting all connected components in the 3D gray image segmented around isovalue + * @param c3t3 The c3t3 to initialize (output) + * @param domain The domain, see concept `MeshDomain_3` + * @param image The gray image + * @param criteria The initial meshing criteria + * @param iso_value The surface's value + * @param image_values_to_subdomain_indices An optional functor used to segment the gray image (default is using isovalue). + * @param protect_features Whether protect_features is called or not (default is false) + */ template > @@ -74,7 +83,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::vector constructedPoints; CGAL::Construct_initial_points_labeled_image construct(image); - construct(std::back_inserter(constructedPoints), domain, c3t3); + construct(std::back_inserter(constructedPoints), domain, transform, c3t3); std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; From 976e73cf89a75e072321033eff8a84ff31da4456 Mon Sep 17 00:00:00 2001 From: ange-clement <47100137+ange-clement@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:09:35 +0200 Subject: [PATCH 026/332] Update Mesh_3/doc/Mesh_3/Mesh_3.txt Co-authored-by: Jane Tournois --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index d6bd93edd26..96f4ad160ae 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -760,7 +760,7 @@ that call is replaced by: The code of the function `initialize_triangulation_from_labeled_image()` is in the header \ref -CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. It get points from +CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. It gets points from \ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and insert them in the triangulation. The code of the Construct_initial_points_labeled_image function is rather complicated. The following lines show how to insert new From ec5539eac3870a040e8e5a4ff70a317ce1679454 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 25 Oct 2023 14:57:48 +0200 Subject: [PATCH 027/332] Revision 1 : Doc fix + Deleted default_initial_points_generation() + Created Construct_initial_points_gray_image.h --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 28 +------ .../Mesh_3/Concepts/InitialPointsGenerator.h | 1 + Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- Mesh_3/doc/Mesh_3/Mesh_3.txt | 10 +-- Mesh_3/doc/Mesh_3/PackageDescription.txt | 1 + .../Construct_initial_points_gray_image.h | 76 +++++++++++++++++++ .../Construct_initial_points_labeled_image.h | 31 ++++++-- Mesh_3/include/CGAL/make_mesh_3.h | 8 +- .../internal/mesh_parameters_interface.h | 2 +- 9 files changed, 117 insertions(+), 43 deletions(-) create mode 100644 Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 1c66b482543..fd1164c2566 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -451,29 +451,6 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v template unspecified_type perturb(const Named_function_parameters& np = parameters::default_values()); -/*! - * \ingroup PkgMesh3Parameters - * - * The function `parameters::default_initial_points_generation()` enables the user to - * tell the mesh generation function `make_mesh_3()` - * that the domain's `construct_initial_points_object()` - * will be called for the points initialization. - * - * \cgalHeading{Example} - * - * \code{.cpp} - * // Mesh generation using the domlain's construct_initial_points_object - * C3t3 c3t3 = make_mesh_3(domain, - * criteria, - * parameters::default_initial_points_generation()); - * \endcode - * - * \sa `CGAL::parameters::initial_points_generator()` - * \sa `CGAL::make_mesh_3()` - * \sa `MeshDomain_3::Construct_initial_points` - * - */ -unspecified_type default_initial_points_generation(); /*! * \ingroup PkgMesh3Parameters * @@ -481,6 +458,9 @@ unspecified_type default_initial_points_generation(); * specify a Functor of the `InitialPointsGenerator` concept * to the mesh generation function `make_mesh_3()`. * The functor will be called for the points initialization. + * If this parameter is specified without argument, the default behaviour is executed, + * i.e. the domain's `construct_initial_points_object()` + * will be called for the points initialization. * * \cgalHeading{Example} * @@ -491,8 +471,8 @@ unspecified_type default_initial_points_generation(); * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); * \endcode * - * \sa `CGAL::parameters::default_initial_points_generation()` * \sa `CGAL::make_mesh_3()` + * \sa `MeshDomain_3::Construct_initial_points` * */ template diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index a184a1efaff..da5c6846a5a 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -7,6 +7,7 @@ a set of initial points on the surface of the domain. \cgalHasModelsBegin \cgalHasModels{CGAL::Construct_initial_points_labeled_image} +\cgalHasModels{CGAL::Construct_initial_points_gray_image} \cgalHasModelsEnd \sa `MeshCellCriteria_3` diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 6f4e6300ac6..5355f1a2635 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -40,7 +40,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Detect_features_in_image.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Detect_features_on_image_bbox.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_edge_criteria_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Construct_initial_points_labeled_image.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Construct_initial_points_labeled_image.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/Construct_initial_points_gray_image.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 96f4ad160ae..15182a243f3 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -751,7 +751,7 @@ For the meshing, in the previous example (\ref Mesh_3/mesh_3D_image.cpp), we cal In the example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp, that call is replaced by: -# the creation of an empty `%c3t3` object, - -# a call to a non-documented function + -# a call to the function `initialize_triangulation_from_labeled_image()` that inserts points in the triangulation, -# then the call to `refine_mesh_3()`. @@ -761,9 +761,9 @@ that call is replaced by: The code of the function `initialize_triangulation_from_labeled_image()` is in the header \ref CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. It gets points from -\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and insert them -in the triangulation. The code of the Construct_initial_points_labeled_image -function is rather complicated. The following lines show how to insert new +\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and inserts them +in the triangulation. The code of the `Construct_initial_points_labeled_image` +functor is rather complicated. The following lines show how to insert new points in the `%c3t3` object, with the calls to `MeshVertexBase_3::set_dimension()` and `MeshVertexBase_3::set_index()`. @@ -836,7 +836,7 @@ CGAL/Mesh_3/initialize_triangulation_from_gray_image.h. The example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp is another way to achieve the same results. Instead of a custom initialization, it uses the parameter `CGAL::parameters::initial_points_generator` for the function -`CGAL::make_mesh_3`. This parameter expect a functor that ouputs points for +`CGAL::make_mesh_3`. This parameter expects a functor that returns a set of points for the mesh initialization (concept `InitialPointsGenerator`). \snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Meshing diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index a499ea4f3b0..88c90fbac25 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -117,6 +117,7 @@ The following functors are available for feature detection: The following functors are available for mesh initialization: - `CGAL::Construct_initial_points_labeled_image` +- `CGAL::Construct_initial_points_gray_image` \cgalCRPSection{Function Templates} diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h new file mode 100644 index 00000000000..5eb0f51797d --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -0,0 +1,76 @@ +// Copyright (c) 20XX,20XX GeometryFactory +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Laurent Rineau and Ange Clement + +#ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H +#define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H + +#include + +#include +#include + +#include + +namespace CGAL +{ + +/*! +* \ingroup PkgMesh3Initializers +* +* Functor for initial points generation in gray images. +* This functor is a model of concept `InitialPointsGenerator`, +* and thus can be passed to `CGAL::make_mesh_3` with the parameter +* `CGAL::parameters::initial_points_generator()` +* +* \sa `CGAL::parameters::initial_points_generator()` +* \sa `CGAL::make_mesh_3()` +*/ +template +struct Construct_initial_points_gray_image +{ + const CGAL::Image_3 & image_; + double iso_value_; + Functor image_values_to_subdomain_indices_; + + template + Construct_initial_points_gray_image(const CGAL::Image_3 & image, + const FT& iso_value, + const Functor image_values_to_subdomain_indices = CGAL::Null_functor()) + : image_(image) + , iso_value_(iso_value) + , image_values_to_subdomain_indices_(image_values_to_subdomain_indices) + { } + + /*! + * \brief Constructs the initial points using the gray image. + * + * @tparam OutputIterator an `OutputIterator` of points of type + * `std::pair` + * @tparam MeshDomain a model of `MeshDomain_3` + * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + */ + template + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const + { + using CGAL::Mesh_3::internal::Create_gray_image_values_to_subdomain_indices; + typedef Create_gray_image_values_to_subdomain_indices C_i_v_t_s_i; + typedef typename C_i_v_t_s_i::type Image_values_to_subdomain_indices; + Image_values_to_subdomain_indices transform_fct = + C_i_v_t_s_i()(image_values_to_subdomain_indices_, iso_value_); + Construct_initial_points_labeled_image(image_).operator()(pts, domain, transform_fct, c3t3, n); + return pts; + } +}; + +} // end namespace CGAL + +#endif // CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index a05736193d1..50008701379 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -80,6 +80,7 @@ struct Get_point * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` +* \sa `CGAL::Construct_initial_points_gray_image()` */ struct Construct_initial_points_labeled_image { @@ -89,8 +90,8 @@ struct Construct_initial_points_labeled_image : image(image_) { } - /*! - * \brief operator () The points are constructed using the API of the mesh domain, as follows. + /*! + * \brief Constructs the points using the API of the mesh domain, as follows. * First the functor `construct_intersect` is created * * \snippet this construct intersection @@ -112,6 +113,20 @@ struct Construct_initial_points_labeled_image return pts; } + /*! + * \brief Same as above, but a `TransformOperator` is used + * + * @tparam OutputIterator an `OutputIterator` of points of type + * `std::pair` + * @tparam MeshDomain a model of `MeshDomain_3` + * @tparam TransformOperator a functor to transform values of the image. + * It must provides the following type:
+ * `result_type`
+ * and the following operator:
+ * `template`
+ * `result_type operator()(FT v)` + * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const { @@ -179,10 +194,10 @@ struct Construct_initial_points_labeled_image const double radius = double(seed.radius + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); - /// [construct intersection] + /// \noop [construct intersection] typename MeshDomain::Construct_intersection construct_intersection = domain.construct_intersection_object(); - /// [construct intersection] + /// \noop [construct intersection] std::vector directions; if(seed.radius < 2) { @@ -206,16 +221,16 @@ struct Construct_initial_points_labeled_image const Point_3 test = seed_point + v; const Segment_3 test_segment = Segment_3(seed_point, test); - /// [use construct intersection] + /// \noop [use construct intersection] const typename MeshDomain::Intersection intersect = construct_intersection(test_segment); - /// [use construct intersection] + /// \noop [use construct intersection] if (std::get<2>(intersect) != 0) { - /// [get construct intersection] + /// \noop [get construct intersection] const Point_3& intersect_point = std::get<0>(intersect); const Index& intersect_index = std::get<1>(intersect); - /// [get construct intersection] + /// \noop [get construct intersection] Weighted_point pi = Weighted_point(intersect_point); // This would cause trouble to optimizers diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 66685418615..46e6f4332c3 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -417,12 +417,12 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamSectionBegin{Mesh initialization} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. * It must follow the `InitialPointsGenerator` concept. - * The following two named parameters control this option: + * The following named parameter control this option: *
    *
  • `parameters::initial_points_generator()` - *
  • `parameters::default_initial_points_generation()` *
} - * \cgalParamDefault{`parameters::default_initial_points_generation()`} + * \cgalParamDefault{empty `parameters::initial_points_generator()`, the domain's `construct_initial_points_object()` + * will be called for the points initialization.} * \cgalParamSectionEnd * \cgalNamedParamsEnd * @@ -462,7 +462,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Initial_points_generator_options initial_points_generator_options_param = parameters::internal::Initial_points_generator_generator() - (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::default_initial_points_generation().v)); + (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::initial_points_generator().v)); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index 93e77e5b46c..04646c5eb55 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -373,7 +373,7 @@ features(const MeshDomain& /*domain*/) // Initial_points_generator_options // ----------------------------------- inline Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> -default_initial_points_generation() { +initial_points_generator() { typedef Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Initial_points_generator_options_holder<>()); } From 15e75d0d042e068463fb0568dc267a9b02ce9198 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 25 Oct 2023 15:08:30 +0200 Subject: [PATCH 028/332] Small doc fix --- Mesh_3/doc/Mesh_3/PackageDescription.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 88c90fbac25..1df5968afc6 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -145,7 +145,6 @@ The following functors are available for mesh initialization: - `CGAL::parameters::manifold_with_boundary()` - `CGAL::parameters::non_manifold()` - `CGAL::parameters::initial_points_generator()` -- `CGAL::parameters::default_initial_points_generation()` \cgalCRPSection{Enumerations} From 9d22242b6392df5d5f70b07108ebf20f7999d7dc Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 31 Oct 2023 12:21:52 +0100 Subject: [PATCH 029/332] Removed useless initialization files Removed initialize_triangulation_from_labeled_image Removed initialize_triangulation_from_gray_image --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 88 ++++++------- Mesh_3/doc/Mesh_3/examples.txt | 2 - ..._gray_image_with_custom_initialization.cpp | 52 +++++++- ...sh_3D_image_with_custom_initialization.cpp | 50 +++++++- ...initialize_triangulation_from_gray_image.h | 60 --------- ...tialize_triangulation_from_labeled_image.h | 117 ------------------ .../Plugins/Mesh_3/Mesh_3_plugin.cpp | 2 +- .../Mesh_3/Mesh_3_plugin_cgal_code.cpp | 15 +-- .../Polyhedron/Plugins/Mesh_3/Mesh_function.h | 86 +++++++++++-- 9 files changed, 211 insertions(+), 261 deletions(-) delete mode 100644 Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h delete mode 100644 Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 15182a243f3..7a0eae088a7 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -737,44 +737,21 @@ without the weights (left, 25563 vertices) and with the weights (right, 19936 ve \subsubsection Mesh_3DomainsFrom3DImagesWithCustomInitialization Domains From 3D Images, with a Custom Initialization -The example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp is a modification +The example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp is a modification of \ref Mesh_3/mesh_3D_image.cpp. The goal of that example is to show how the default initialization of the triangulation, using random rays, can be replaced by a new implementation. In this case, the initialization detects all connected components in the 3D segmented image, and inserts points in the triangulation for each connected component. -For the meshing, in the previous example (\ref Mesh_3/mesh_3D_image.cpp), we called `make_mesh_3()` as follows. +\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Meshing -\snippet Mesh_3/mesh_3D_image.cpp Meshing - -In the example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp, -that call is replaced by: - -# the creation of an empty `%c3t3` object, - -# a call to the function - `initialize_triangulation_from_labeled_image()` that inserts points in - the triangulation, - -# then the call to `refine_mesh_3()`. - -\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp Meshing - -The code of the function `initialize_triangulation_from_labeled_image()` is -in the header \ref -CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h. It gets points from -\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and inserts them -in the triangulation. The code of the `Construct_initial_points_labeled_image` -functor is rather complicated. The following lines show how to insert new -points in the `%c3t3` object, with the calls to -`MeshVertexBase_3::set_dimension()` and -`MeshVertexBase_3::set_index()`. - -\snippet CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h insert initial points - -The value of `index` must be consistent with the possible values of -`Mesh_domain::Index`. In \ref -CGAL/Mesh_3/Construct_initial_points_labeled_image.h, it is -constructed using the API of the mesh domain, as follows. First the functor -`construct_intersect` is created +The parameter `CGAL::parameters::initial_points_generator` is used. +It expects a functor that returns a set of points for the mesh +initialization (concept `InitialPointsGenerator`). The functor +\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h is used. +It constructs points using the API of the mesh domain, as follows. +First the functor `construct_intersect` is created \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h construct intersection then the `%Mesh_domain::Intersection` object (a `%tuple` with three @@ -807,40 +784,57 @@ the center is meshed Right: the mesh generated after the initialization of all connected components \cgalFigureCaptionEnd - Note that the example \ref -Mesh_3/mesh_3D_image_with_custom_initialization.cpp also shows how to +Mesh_3/mesh_3D_image_with_initial_points.cpp also shows how to create a 3D image using the undocumented API of CGAL_ImageIO. -\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp Create the image +\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Create the image The code of the function `%random_labeled_image()` is in the header file \ref Mesh_3/random_labeled_image.h. +The example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp features +another way to achieve these results. It is a modification +of \ref Mesh_3/mesh_3D_image.cpp. + +For the meshing, in the previous example (\ref Mesh_3/mesh_3D_image.cpp), we called `make_mesh_3()` as follows. + +\snippet Mesh_3/mesh_3D_image.cpp Meshing + +In the example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp, +that call is replaced by: + -# the creation of an empty `%c3t3` object, + -# a call to the function + `initialize_triangulation_from_labeled_image()` that inserts points in + the triangulation, + -# then the call to `refine_mesh_3()`. + +\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp Meshing + +The function `initialize_triangulation_from_labeled_image()` gets points from +\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and inserts them +in the triangulation. The following lines show how to insert new +points in the `%c3t3` object, with the calls to +`MeshVertexBase_3::set_dimension()` and +`MeshVertexBase_3::set_index()`. + +\snippet CGAL/Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points + +The value of `index` must be consistent with the possible values of +`Mesh_domain::Index`. + The example \ref Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp is another custom initialization example, for meshing of 3D gray-level images. Similarly to the segmented image example above, the code consists in: -# the creation of an empty `%c3t3` object, - -# a call to a non-documented function + -# a call to the function `initialize_triangulation_from_gray_image()` that inserts points in the triangulation, -# then the call to `refine_mesh_3()`. \snippet Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp Meshing -The code of the function `initialize_triangulation_from_gray_image()` is -in the header \ref -CGAL/Mesh_3/initialize_triangulation_from_gray_image.h. - -The example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp is another -way to achieve the same results. Instead of a custom initialization, -it uses the parameter `CGAL::parameters::initial_points_generator` for the function -`CGAL::make_mesh_3`. This parameter expects a functor that returns a set of points for -the mesh initialization (concept `InitialPointsGenerator`). - -\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Meshing - \subsection Mesh_3UsingVariableSizingField Using Variable Sizing Field \subsubsection Mesh_3SizingFieldasanAnalyticalFunction Sizing Field as an Analytical Function diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index f29c47e7e32..ee4ca63f372 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -9,8 +9,6 @@ \example Mesh_3/mesh_3D_image_with_input_features.cpp \example Mesh_3/mesh_3D_weighted_image.cpp \example Mesh_3/random_labeled_image.h -\example CGAL/Mesh_3/initialize_triangulation_from_gray_image.h -\example CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h \example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index afed1a34b52..1a450497c97 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -34,6 +34,51 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; namespace params = CGAL::parameters; +template +void initialize_triangulation_from_gray_image(C3T3& c3t3, + const MeshDomain& domain, + const CGAL::Image_3& image, + const FT& iso_value) +{ + typedef typename C3T3::Triangulation Tr; + typedef typename Tr::Geom_traits GT; + typedef typename Tr::Weighted_point Weighted_point; + typedef typename Tr::Vertex_handle Vertex_handle; + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; + + typedef typename std::pair ConstructedPoint; + + Tr& tr = c3t3.triangulation(); + + typename GT::Construct_weighted_point_3 cwp = + tr.geom_traits().construct_weighted_point_3_object(); + + std::vector constructedPoints; + + CGAL::Construct_initial_points_gray_image construct(image, iso_value); + construct(std::back_inserter(constructedPoints), domain, c3t3); + + std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; + + for (const ConstructedPoint & constructedPoint : constructedPoints) + { + const Point_3& point = constructedPoint.first; + const Index& index = constructedPoint.second; + + Weighted_point pi = cwp(point); + + /// The following lines show how to insert initial points in the + /// `c3t3` object. [insert initial points] + Vertex_handle v = tr.insert(pi); + // `v` could be null if `pi` is hidden by other vertices of `tr`. + CGAL_assertion(v != Vertex_handle()); + c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_index(v, index); + /// [insert initial points] + } +} + int main(int argc, char* argv[]) { const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("images/skull_2.9.inr"); @@ -57,9 +102,8 @@ int main(int argc, char* argv[]) initialize_triangulation_from_gray_image(c3t3, domain, image, - criteria, - 2.9f,//isolevel - Image_word_type(0)); + 2.9f//isolevel + ); CGAL::refine_mesh_3(c3t3, domain, criteria); /// [Meshing] diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 253c41a920b..9a0675d80f6 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -33,6 +33,50 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; namespace params = CGAL::parameters; +template +void initialize_triangulation_from_labeled_image(C3T3& c3t3, + const MeshDomain& domain, + const CGAL::Image_3& image) +{ + typedef typename C3T3::Triangulation Tr; + typedef typename Tr::Geom_traits GT; + typedef typename Tr::Weighted_point Weighted_point; + typedef typename Tr::Vertex_handle Vertex_handle; + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; + + typedef typename std::pair ConstructedPoint; + + Tr& tr = c3t3.triangulation(); + + typename GT::Construct_weighted_point_3 cwp = + tr.geom_traits().construct_weighted_point_3_object(); + + std::vector constructedPoints; + + CGAL::Construct_initial_points_labeled_image construct(image); + construct(std::back_inserter(constructedPoints), domain, c3t3); + + std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; + + for (const ConstructedPoint & constructedPoint : constructedPoints) + { + const Point_3& point = constructedPoint.first; + const Index& index = constructedPoint.second; + + Weighted_point pi = cwp(point); + + /// The following lines show how to insert initial points in the + /// `c3t3` object. [insert initial points] + Vertex_handle v = tr.insert(pi); + // `v` could be null if `pi` is hidden by other vertices of `tr`. + CGAL_assertion(v != Vertex_handle()); + c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_index(v, index); + /// [insert initial points] + } +} + int main() { /// [Create the image] @@ -50,9 +94,7 @@ int main() C3t3 c3t3; initialize_triangulation_from_labeled_image(c3t3, domain, - image, - criteria, - static_cast(0)); + image); CGAL::refine_mesh_3(c3t3, domain, criteria); /// [Meshing] diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h deleted file mode 100644 index b42875390a1..00000000000 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_gray_image.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2015,2016 GeometryFactory -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Laurent Rineau, Jane Tournois - -#ifndef CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_GRAY_IMAGE_H -#define CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_GRAY_IMAGE_H - -#include - -#include -#include - -#include - -/** - * @brief initialize_triangulation_from_gray_image Initialize a c3t3 by detecting all connected components in the 3D gray image segmented around isovalue - * @param c3t3 The c3t3 to initialize (output) - * @param domain The domain, see concept `MeshDomain_3` - * @param image The gray image - * @param criteria The initial meshing criteria - * @param iso_value The surface's value - * @param image_values_to_subdomain_indices An optional functor used to segment the gray image (default is using isovalue). - * @param protect_features Whether protect_features is called or not (default is false) - */ -template -void initialize_triangulation_from_gray_image(C3T3& c3t3, - const MeshDomain& domain, - const CGAL::Image_3& image, - const MeshCriteria& criteria, - const FT& iso_value, - Image_word_type, - const Functor image_values_to_subdomain_indices = CGAL::Null_functor(), - bool protect_features = false) -{ - typedef typename CGAL::Default::Get::type Functor_; - - using CGAL::Mesh_3::internal::Create_gray_image_values_to_subdomain_indices; - typedef Create_gray_image_values_to_subdomain_indices C_i_v_t_s_i; - typedef typename C_i_v_t_s_i::type Image_values_to_subdomain_indices; - Image_values_to_subdomain_indices transform_fct = - C_i_v_t_s_i()(image_values_to_subdomain_indices, iso_value); - - initialize_triangulation_from_labeled_image(c3t3, domain, image, criteria, - Image_word_type(), - protect_features, - transform_fct); -} - -#endif // CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_GRAY_IMAGE_H diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h deleted file mode 100644 index 14ac394d0b4..00000000000 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2015,2016 GeometryFactory -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Laurent Rineau - -#ifndef CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_LABELED_IMAGE_H -#define CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_LABELED_IMAGE_H - -#include -#include - -#include - -template -void init_tr_from_labeled_image_call_init_features(C3T3&, - const MeshDomain&, - const MeshCriteria&, - CGAL::Tag_false) -{ -} -template -void init_tr_from_labeled_image_call_init_features(C3T3& c3t3, - const MeshDomain& domain, - const MeshCriteria& criteria, - CGAL::Tag_true) -{ - CGAL::Mesh_3::internal::init_c3t3_with_features(c3t3, - domain, - criteria); - std::cout << c3t3.triangulation().number_of_vertices() - << " initial points on 1D-features" << std::endl; -} - -/** - * @brief initialize_triangulation_from_labeled_image Initialize a c3t3 by detecting all connected components in the 3D segmented image - * @param c3t3 The c3t3 to initialize (output) - * @param domain The domain, see concept `MeshDomain_3` - * @param image The segmented image - * @param criteria The initial meshing criteria - * @param protect_features Whether protect_features is called or not (default is false) - * @param transform An optional functor used to transform the image's value (default is no transformation). - */ -template > -void initialize_triangulation_from_labeled_image(C3T3& c3t3, - const MeshDomain& domain, - const CGAL::Image_3& image, - const MeshCriteria& criteria, - Image_word_type, - bool protect_features = false, - TransformOperator transform = CGAL::Identity()) -{ - typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits GT; - typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename MeshDomain::Point_3 Point_3; - typedef typename MeshDomain::Index Index; - - typedef typename std::pair ConstructedPoint; - - typedef MeshDomain Mesh_domain; - - Tr& tr = c3t3.triangulation(); - - typename GT::Construct_weighted_point_3 cwp = - tr.geom_traits().construct_weighted_point_3_object(); - - if(protect_features) { - init_tr_from_labeled_image_call_init_features - (c3t3, domain, criteria, - CGAL::internal::Has_features()); - } - - std::vector constructedPoints; - - CGAL::Construct_initial_points_labeled_image construct(image); - construct(std::back_inserter(constructedPoints), domain, transform, c3t3); - - std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; - - for (const ConstructedPoint & constructedPoint : constructedPoints) - { - const Point_3& point = constructedPoint.first; - const Index& index = constructedPoint.second; - - Weighted_point pi = cwp(point); - - /// The following lines show how to insert initial points in the - /// `c3t3` object. [insert initial points] - Vertex_handle v = tr.insert(pi); - // `v` could be null if `pi` is hidden by other vertices of `tr`. - CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, 2); // by construction, points are on surface - c3t3.set_index(v, index); - /// [insert initial points] - } - - if ( tr.dimension() != 3 ) - { - std::cout << " not enough points: triangulation.dimension() == " - << tr.dimension() << std::endl; - CGAL::Mesh_3::internal::init_c3t3(c3t3, domain, criteria, 20); - std::cout << " -> " << tr.number_of_vertices() << " initial points." << std::endl; - } - std::cout << " " << tr.number_of_vertices() << " initial points." << std::endl; -} - -#endif // CGAL_MESH_3_INITIALIZE_TRIANGULATION_FROM_LABELED_IMAGE_H diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp index c17f4879f1d..febdb922906 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -621,7 +621,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, ui.sharpFeaturesGroup->setEnabled(false); ui.facegraphCheckBox->setVisible(mesh_type == Mesh_type::SURFACE_ONLY); - ui.initializationGroup->setVisible(input_is_labeled_img); + ui.initializationGroup->setVisible(input_is_labeled_img || input_is_gray_img); ui.grayImgGroup->setVisible(input_is_gray_img); if (items->index() == POLYHEDRAL_MESH_ITEMS) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index abc82f15033..c2974d103f2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -20,19 +20,6 @@ using namespace CGAL::Three; typedef Tr::Bare_point Bare_point; -struct Compare_to_isovalue { - double iso_value; - bool less; - typedef bool result_type; - - Compare_to_isovalue(double iso_value, bool less) - : iso_value(iso_value), less(less) {} - - bool operator()(double x) const { - return (x < iso_value) == less; - } -}; - Meshing_thread* cgal_code_mesh_3(QList pMeshes, const Polylines_container& polylines, const SMesh* pBoundingMesh, @@ -337,6 +324,8 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage, param.protect_features = protect_features || protect_borders || !polylines.empty(); param.detect_connected_components = detect_connected_components; + param.iso_value = iso_value; + param.inside_is_less = inside_is_less; param.facet_angle = facet_angle; param.facet_sizing = facet_sizing; param.facet_min_sizing = facet_min_sizing; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index dfd31aadd84..0c91681b952 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -27,7 +27,8 @@ #include #include #include -#include +#include +#include #include "C3t3_type.h" #include "Meshing_thread.h" @@ -40,6 +41,19 @@ namespace CGAL { class Image_3; } +struct Compare_to_isovalue { + double iso_value; + bool less; + typedef bool result_type; + + Compare_to_isovalue(double iso_value, bool less) + : iso_value(iso_value), less(less) {} + + bool operator()(double x) const { + return (x < iso_value) == less; + } +}; + struct Mesh_parameters { double facet_angle; @@ -54,6 +68,8 @@ struct Mesh_parameters double edge_min_sizing; bool protect_features; bool detect_connected_components; + float iso_value; + bool inside_is_less; int manifold; const CGAL::Image_3* image_3_ptr; const CGAL::Image_3* weights_ptr; @@ -110,6 +126,7 @@ private: void initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag); void initialize(const Mesh_criteria& criteria, Mesh_fnt::Labeled_image_domain_tag); + void initialize(const Mesh_criteria& criteria, Mesh_fnt::Gray_image_domain_tag); Edge_criteria edge_criteria(double b, double minb, Mesh_fnt::Domain_tag); Edge_criteria edge_criteria(double b, double minb, Mesh_fnt::Polyhedral_domain_tag); @@ -204,16 +221,60 @@ Mesh_function:: initialize(const Mesh_criteria& criteria, Mesh_fnt::Labeled_image_domain_tag) // for a labeled image { - if(p_.detect_connected_components) { - CGAL_IMAGE_IO_CASE(p_.image_3_ptr->image(), - initialize_triangulation_from_labeled_image(c3t3_ - , *domain_ - , *p_.image_3_ptr - , criteria - , Word() - , p_.protect_features); - ); - } else { + namespace p = CGAL::parameters; + // Initialization of the labeled image, either with the protection of sharp + // features, or with the initial points (or both). + if (p_.detect_connected_components) + { + CGAL::Mesh_3::internal::C3t3_initializer< + C3t3, + Domain, + Mesh_criteria, + CGAL::internal::has_Has_features::value >() + (c3t3_, + *domain_, + criteria, + p_.protect_features, + p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, + p::nonlinear_growth_of_balls = true).v, + p::internal::Initial_points_generator_generator() + (p::initial_points_generator( + CGAL::Construct_initial_points_labeled_image(*p_.image_3_ptr)).v)); + } + else + { + initialize(criteria, Mesh_fnt::Domain_tag()); + } +} + +template < typename D_, typename Tag > +void +Mesh_function:: +initialize(const Mesh_criteria& criteria, Mesh_fnt::Gray_image_domain_tag) +// for a gray image +{ + namespace p = CGAL::parameters; + // Initialization of the gray image, either with the protection of sharp + // features, or with the initial points (or both). + if (p_.detect_connected_components) + { + CGAL::Mesh_3::internal::C3t3_initializer< + C3t3, + Domain, + Mesh_criteria, + CGAL::internal::has_Has_features::value >() + (c3t3_, + *domain_, + criteria, + p_.protect_features, + p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, + p::nonlinear_growth_of_balls = true).v, + p::internal::Initial_points_generator_generator() + (p::initial_points_generator( + CGAL::Construct_initial_points_gray_image(*p_.image_3_ptr, p_.iso_value, Compare_to_isovalue(p_.iso_value, p_.inside_is_less))).v)); + } + else + { initialize(criteria, Mesh_fnt::Domain_tag()); } } @@ -227,8 +288,7 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag) namespace p = CGAL::parameters; // Initialization of the mesh, either with the protection of sharp // features, or with the initial points (or both). - // If `detect_connected_components==true`, the initialization is - // already done. + CGAL::Mesh_3::internal::C3t3_initializer< C3t3, Domain, From d7f110e428b29cea0eee9a51f22e82bb631eeb0e Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 31 Oct 2023 15:34:42 +0100 Subject: [PATCH 030/332] Changed InitialPointsGenerator concept : The points' dimensions are also outputed by the initialisation. --- .../Mesh_3/Concepts/InitialPointsGenerator.h | 19 +++++++++++++------ Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- ..._gray_image_with_custom_initialization.cpp | 9 +++++---- ...sh_3D_image_with_custom_initialization.cpp | 9 +++++---- .../Construct_initial_points_gray_image.h | 6 +++--- .../Construct_initial_points_labeled_image.h | 8 ++++---- Mesh_3/include/CGAL/make_mesh_3.h | 10 +++++----- .../internal/mesh_option_classes.h | 4 ++-- 8 files changed, 38 insertions(+), 29 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index da5c6846a5a..57436a47d97 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -25,11 +25,14 @@ public: /*! Output a set of (`n`) surface points to the -output iterator `pts`, as objects of type `std::pair`. +output iterator `pts`, as objects of type +`std::tuple` where +`Point_3` is the point's position, +`int` is the point's dimension and +`Index` is the point's index. @tparam OutputIterator an `OutputIterator` of points of type -`std::pair` +`std::tuple` @tparam MeshDomain a model of `MeshDomain_3` @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` @@ -39,12 +42,16 @@ OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3 /*! Output a set of surface points to the -output iterator `pts`, as objects of type `std::pair`. As `n` is not given, the functor must provide enough +output iterator `pts`, as objects of type +`std::tuple` where +`Point_3` is the point's position, +`int` is the point's dimension and +`Index` is the point's index. +As `n` is not given, the functor must provide enough points to initialize the mesh generation process. @tparam OutputIterator an `OutputIterator` of points of type -`std::pair` +`std::tuple` @tparam MeshDomain a model of `MeshDomain_3` @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 7a0eae088a7..c401a91d2a1 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -819,7 +819,7 @@ points in the `%c3t3` object, with the calls to `MeshVertexBase_3::set_dimension()` and `MeshVertexBase_3::set_index()`. -\snippet CGAL/Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points +\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points The value of `index` must be consistent with the possible values of `Mesh_domain::Index`. diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 1a450497c97..b734240f4cc 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -47,7 +47,7 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef typename std::pair ConstructedPoint; + typedef typename std::tuple ConstructedPoint; Tr& tr = c3t3.triangulation(); @@ -63,8 +63,9 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, for (const ConstructedPoint & constructedPoint : constructedPoints) { - const Point_3& point = constructedPoint.first; - const Index& index = constructedPoint.second; + const Point_3& point = std::get<0>(constructedPoint); + const int& dimension = std::get<1>(constructedPoint); + const Index& index = std::get<2>(constructedPoint); Weighted_point pi = cwp(point); @@ -73,7 +74,7 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, Vertex_handle v = tr.insert(pi); // `v` could be null if `pi` is hidden by other vertices of `tr`. CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_dimension(v, dimension); c3t3.set_index(v, index); /// [insert initial points] } diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 9a0675d80f6..feff42b26b3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -45,7 +45,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef typename std::pair ConstructedPoint; + typedef typename std::tuple ConstructedPoint; Tr& tr = c3t3.triangulation(); @@ -61,8 +61,9 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, for (const ConstructedPoint & constructedPoint : constructedPoints) { - const Point_3& point = constructedPoint.first; - const Index& index = constructedPoint.second; + const Point_3& point = std::get<0>(constructedPoint); + const int& dimension = std::get<1>(constructedPoint); + const Index& index = std::get<2>(constructedPoint); Weighted_point pi = cwp(point); @@ -71,7 +72,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, Vertex_handle v = tr.insert(pi); // `v` could be null if `pi` is hidden by other vertices of `tr`. CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_dimension(v, dimension); c3t3.set_index(v, index); /// [insert initial points] } diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 5eb0f51797d..2095596d0a0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -1,4 +1,4 @@ -// Copyright (c) 20XX,20XX GeometryFactory +// Copyright (c) 2015,2016 GeometryFactory // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -8,7 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Laurent Rineau and Ange Clement +// Author(s) : Laurent Rineau, Jane Tournois and Ange Clement #ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H #define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H @@ -54,7 +54,7 @@ struct Construct_initial_points_gray_image * \brief Constructs the initial points using the gray image. * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 50008701379..1c277dc9f83 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -1,4 +1,4 @@ -// Copyright (c) 20XX,20XX GeometryFactory +// Copyright (c) 2015,2016 GeometryFactory // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -102,7 +102,7 @@ struct Construct_initial_points_labeled_image * \snippet this get construct intersection * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ @@ -117,7 +117,7 @@ struct Construct_initial_points_labeled_image * \brief Same as above, but a `TransformOperator` is used * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam TransformOperator a functor to transform values of the image. * It must provides the following type:
@@ -293,7 +293,7 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = std::make_pair(intersect_point, intersect_index); + *pts++ = std::make_tuple(intersect_point, 2, intersect_index); // dimension 2 by construction, points are on surface } } } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 46e6f4332c3..870cac12820 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -46,7 +46,7 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef std::vector > Initial_points_vector; + typedef std::vector > Initial_points_vector; typedef typename Initial_points_vector::iterator Ipv_iterator; typedef typename C3T3::Vertex_handle Vertex_handle; @@ -66,13 +66,13 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, it != initial_points.end() ; ++it ) { - Vertex_handle v = c3t3.triangulation().insert(cwp(it->first)); + Vertex_handle v = c3t3.triangulation().insert(cwp(std::get<0>(*it))); // v could be null if point is hidden if ( v != Vertex_handle() ) { - c3t3.set_dimension(v,2); // by construction, points are on surface - c3t3.set_index(v,it->second); + c3t3.set_dimension(v,std::get<1>(*it)); + c3t3.set_index(v,std::get<2>(*it)); } } } @@ -523,7 +523,7 @@ void make_mesh_3_impl(C3T3& c3t3, C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value >() (c3t3, + ::CGAL::internal::has_Has_features::value > () (c3t3, domain, criteria, with_features, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index b6f54fe35d4..7433f419ff9 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -193,7 +193,7 @@ struct Initial_points_generator_options_holder template struct Initial_points_generator_options { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename std::back_insert_iterator>> OutputIterator; template Initial_points_generator_options(const Initial_points_generator& generator) @@ -263,7 +263,7 @@ struct Domain_features_generator< MeshDomain, true > template struct Initial_points_generator_generator { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename std::back_insert_iterator>> OutputIterator; typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; From ea11f328d6e8ca5e26bdde49a9220e62bda653ae Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 3 Nov 2023 17:44:05 +0100 Subject: [PATCH 031/332] Doc update + Changed initial_point_generator default parameter + Fix previous change from pair to tuple --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 6 +- .../Mesh_3/Concepts/InitialPointsGenerator.h | 30 ++++----- Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- Mesh_3/doc/Mesh_3/examples.txt | 1 - .../Construct_initial_points_gray_image.h | 3 +- .../Construct_initial_points_labeled_image.h | 29 ++++----- Mesh_3/include/CGAL/make_mesh_3.h | 6 +- .../internal/mesh_option_classes.h | 62 +++++++++---------- .../internal/mesh_parameters_interface.h | 12 ++-- 10 files changed, 70 insertions(+), 85 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index fd1164c2566..dbf2ec22101 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -455,12 +455,12 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * \ingroup PkgMesh3Parameters * * The function `parameters::initial_points_generator()` enables the user to - * specify a Functor of the `InitialPointsGenerator` concept + * specify a functor following the `InitialPointsGenerator` concept * to the mesh generation function `make_mesh_3()`. - * The functor will be called for the points initialization. + * The functor will be called for initialization of the meshing process. * If this parameter is specified without argument, the default behaviour is executed, * i.e. the domain's `construct_initial_points_object()` - * will be called for the points initialization. + * is called for the initialization of the meshing process. * * \cgalHeading{Example} * diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 57436a47d97..c5097a9ca07 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -10,11 +10,6 @@ a set of initial points on the surface of the domain. \cgalHasModels{CGAL::Construct_initial_points_gray_image} \cgalHasModelsEnd -\sa `MeshCellCriteria_3` -\sa `MeshFacetCriteria_3` -\sa `MeshCriteria_3` -\sa `MeshCriteriaWithFeatures_3` - */ class InitialPointsGenerator { @@ -26,15 +21,16 @@ public: /*! Output a set of (`n`) surface points to the output iterator `pts`, as objects of type -`std::tuple` where +`std::tuple`. `Point_3` is the point's position, -`int` is the point's dimension and -`Index` is the point's index. +`int` is the dimension of the minimal dimension subcomplex on which the point lies, and +`Index` is the underlying subcomplex index. -@tparam OutputIterator an `OutputIterator` of points of type +@tparam OutputIterator model of `OutputIterator`, containing points of type `std::tuple` -@tparam MeshDomain a model of `MeshDomain_3` -@tparam C3t3 a model of `MeshComplex_3InTriangulation_3` +@tparam MeshDomain model of `MeshDomain_3` +@tparam C3t3 model of `MeshComplex_3InTriangulation_3` +@param n an estimation of the number of points to output */ template @@ -43,17 +39,17 @@ OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3 /*! Output a set of surface points to the output iterator `pts`, as objects of type -`std::tuple` where +`std::tuple`. `Point_3` is the point's position, -`int` is the point's dimension and -`Index` is the point's index. +`int` is the dimension of the minimal dimension subcomplex on which the point lies, and +`Index` is the underlying subcomplex index. As `n` is not given, the functor must provide enough points to initialize the mesh generation process. -@tparam OutputIterator an `OutputIterator` of points of type +@tparam OutputIterator model of `OutputIterator`, containing points of type `std::tuple` -@tparam MeshDomain a model of `MeshDomain_3` -@tparam C3t3 a model of `MeshComplex_3InTriangulation_3` +@tparam MeshDomain model of `MeshDomain_3` +@tparam C3t3 model of `MeshComplex_3InTriangulation_3` */ template diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index c401a91d2a1..1340e9ac3c6 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -748,8 +748,8 @@ the triangulation for each connected component. The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh -initialization (concept `InitialPointsGenerator`). The functor -\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h is used. +initialization (following the `InitialPointsGenerator`). The functor +\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h is used in this example. It constructs points using the API of the mesh domain, as follows. First the functor `construct_intersect` is created diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 1df5968afc6..df30cd0b5d6 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -133,6 +133,7 @@ The following functors are available for mesh initialization: - `CGAL::parameters::features()` - `CGAL::parameters::no_features()` +- `CGAL::parameters::initial_points_generator()` - `CGAL::parameters::exude()` - `CGAL::parameters::no_exude()` - `CGAL::parameters::perturb()` @@ -144,7 +145,6 @@ The following functors are available for mesh initialization: - `CGAL::parameters::manifold()` - `CGAL::parameters::manifold_with_boundary()` - `CGAL::parameters::non_manifold()` -- `CGAL::parameters::initial_points_generator()` \cgalCRPSection{Enumerations} diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index ee4ca63f372..e4528dfa9b1 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -9,7 +9,6 @@ \example Mesh_3/mesh_3D_image_with_input_features.cpp \example Mesh_3/mesh_3D_weighted_image.cpp \example Mesh_3/random_labeled_image.h -\example CGAL/Mesh_3/Construct_initial_points_labeled_image.h \example Mesh_3/mesh_3D_image_variable_size.cpp \example Mesh_3/mesh_hybrid_mesh_domain.cpp \example Mesh_3/mesh_implicit_domains.cpp diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 2095596d0a0..bef74411440 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -33,12 +33,13 @@ namespace CGAL * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` +* \sa `CGAL::Construct_initial_points_labeled_image` */ template struct Construct_initial_points_gray_image { const CGAL::Image_3 & image_; - double iso_value_; + const double iso_value_; Functor image_values_to_subdomain_indices_; template diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 1c277dc9f83..27ee3d09be0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -80,7 +80,7 @@ struct Get_point * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` -* \sa `CGAL::Construct_initial_points_gray_image()` +* \sa `CGAL::Construct_initial_points_gray_image` */ struct Construct_initial_points_labeled_image { @@ -91,20 +91,13 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief Constructs the points using the API of the mesh domain, as follows. - * First the functor `construct_intersect` is created + * \brief Constructs points by collecting them in all connected components. + * This guarantees to initialize them all. * - * \snippet this construct intersection - * then the `%Mesh_domain::Intersection` object (a `%tuple` with three - * elements) is constructed using a call to the functor `construct_intersection` - * \snippet this use construct intersection - * and eventually `%index` is the element \#1 of `%intersect`. - * \snippet this get construct intersection - * - * @tparam OutputIterator an `OutputIterator` of points of type + * @tparam OutputIterator model of `OutputIterator`, containing points of type * `std::tuple` - * @tparam MeshDomain a model of `MeshDomain_3` - * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain model of `MeshDomain_3` + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const @@ -116,16 +109,16 @@ struct Construct_initial_points_labeled_image /*! * \brief Same as above, but a `TransformOperator` is used * - * @tparam OutputIterator an `OutputIterator` of points of type + * @tparam OutputIterator model of `OutputIterator`, containing points of type * `std::tuple` - * @tparam MeshDomain a model of `MeshDomain_3` - * @tparam TransformOperator a functor to transform values of the image. - * It must provides the following type:
+ * @tparam MeshDomain model of `MeshDomain_3` + * @tparam TransformOperator functor that transforms values of the image. + * It must provide the following type:
* `result_type`
* and the following operator:
* `template`
* `result_type operator()(FT v)` - * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 870cac12820..6a5eec6a25a 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -415,13 +415,13 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialization} - * \cgalParamDescription{an `InitialPointsGenerator` can optionally be supplied before the meshing process. + * \cgalParamDescription{an `InitialPointsGenerator` can optionally be provided to start the meshing process. * It must follow the `InitialPointsGenerator` concept. - * The following named parameter control this option: + * The following named parameter controls this option: *
    *
  • `parameters::initial_points_generator()` *
} - * \cgalParamDefault{empty `parameters::initial_points_generator()`, the domain's `construct_initial_points_object()` + * \cgalParamDefault{`CGAL::Null_Functor()`, the domain's `construct_initial_points_object()` * will be called for the points initialization.} * \cgalParamSectionEnd * \cgalNamedParamsEnd diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 7433f419ff9..37f3c2052c1 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -167,27 +167,6 @@ private: bool b_; }; -// Initial points generator -// options_holder has two roles. -// 1 : determine if the default value is passed -// 2 : if not the default value, hold the user's generator -template -struct Initial_points_generator_options_holder -{ - static constexpr bool is_default = false; - - Initial_points_generator_options_holder(const Initial_points_generator& generator) - : generator_(generator) - { } - - const Initial_points_generator& generator_; -}; - -template <> -struct Initial_points_generator_options_holder -{ - static constexpr bool is_default = true; -}; // options is holding the generator (default or the user's one) template @@ -271,25 +250,42 @@ struct Initial_points_generator_generator { OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) { - return domain.construct_initial_points_object()(pts); + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; + typedef typename std::pair Domain_generated_point; + std::vector domain_generated_points; + domain.construct_initial_points_object()(std::back_inserter(domain_generated_points)); + for (Domain_generated_point domain_generated_point : domain_generated_points) + { + *pts++ = std::make_tuple(domain_generated_point.first, 2, domain_generated_point.second); + } + return pts; } OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) { - return domain.construct_initial_points_object()(pts, n); + typedef typename MeshDomain::Point_3 Point_3; + typedef typename MeshDomain::Index Index; + typedef typename std::pair Domain_generated_point; + std::vector domain_generated_points; + domain.construct_initial_points_object()(std::back_inserter(domain_generated_points), n); + for (Domain_generated_point domain_generated_point : domain_generated_points) + { + *pts++ = std::make_tuple(domain_generated_point.first, 2, domain_generated_point.second); + } + return pts; } }; - template - Initial_points_generator_options operator()(const Initial_points_generator_options_holder& initial_points_generator_options_holder_param) + template + Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) { - if constexpr (Initial_points_generator_options_holder::is_default) - { - return operator()(); - } - else - { - return Initial_points_generator_options(initial_points_generator_options_holder_param.generator_); - } + return Initial_points_generator_options(initial_points_generator); + } + + template <> + Initial_points_generator_options operator()(const Null_functor&) + { + return operator()(); } Initial_points_generator_options operator()() diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index 04646c5eb55..97ba587cf26 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -372,16 +372,16 @@ features(const MeshDomain& /*domain*/) // ----------------------------------- // Initial_points_generator_options // ----------------------------------- -inline Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> +inline Named_function_parameters<::CGAL::Null_functor, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> initial_points_generator() { - typedef Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder<>, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; - return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Initial_points_generator_options_holder<>()); + typedef Named_function_parameters<::CGAL::Null_functor, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::Null_functor()); } template -inline Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> +inline Named_function_parameters initial_points_generator(const InitialPointsGenerator& generator) { - typedef Named_function_parameters<::CGAL::parameters::internal::Initial_points_generator_options_holder, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; - return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Initial_points_generator_options_holder(generator)); + typedef Named_function_parameters Param; + return CGAL_NP_BUILD(Param, generator); } From 455e8654f7987f6519bc74ea1a2fc2175d7d6ed4 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 6 Nov 2023 09:48:35 +0100 Subject: [PATCH 032/332] Fix error --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 1 - 1 file changed, 1 deletion(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 37f3c2052c1..5a33d9d3cd1 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -282,7 +282,6 @@ struct Initial_points_generator_generator return Initial_points_generator_options(initial_points_generator); } - template <> Initial_points_generator_options operator()(const Null_functor&) { return operator()(); From ca7548b341e69b0c62f23dd05009eb52b46dd699 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 7 Nov 2023 15:25:50 +0100 Subject: [PATCH 033/332] Removed example + Modified example mesh_3D_image_with_custom_initialization to use new API + Changed InitialPointsGenerator concept : outputs std::tuple instead of std::tuple + custom initialization will be called even if a feature detector is set --- .../Mesh_3/Concepts/InitialPointsGenerator.h | 12 +- Mesh_3/doc/Mesh_3/Mesh_3.txt | 41 +------ Mesh_3/doc/Mesh_3/examples.txt | 1 - Mesh_3/examples/Mesh_3/CMakeLists.txt | 6 - ..._gray_image_with_custom_initialization.cpp | 115 ------------------ ...sh_3D_image_with_custom_initialization.cpp | 93 +++++++------- .../Construct_initial_points_labeled_image.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 21 ++-- .../internal/mesh_option_classes.h | 53 ++++---- 9 files changed, 88 insertions(+), 256 deletions(-) delete mode 100644 Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index c5097a9ca07..f2ea33d691b 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -21,13 +21,13 @@ public: /*! Output a set of (`n`) surface points to the output iterator `pts`, as objects of type -`std::tuple`. -`Point_3` is the point's position, +`std::tuple`. +`Weighted_point_3` is the point's position and weight, `int` is the dimension of the minimal dimension subcomplex on which the point lies, and `Index` is the underlying subcomplex index. @tparam OutputIterator model of `OutputIterator`, containing points of type -`std::tuple` +`std::tuple` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` @param n an estimation of the number of points to output @@ -39,15 +39,15 @@ OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3 /*! Output a set of surface points to the output iterator `pts`, as objects of type -`std::tuple`. -`Point_3` is the point's position, +`std::tuple`. +`Weighted_point_3` is the point's position and weight, `int` is the dimension of the minimal dimension subcomplex on which the point lies, and `Index` is the underlying subcomplex index. As `n` is not given, the functor must provide enough points to initialize the mesh generation process. @tparam OutputIterator model of `OutputIterator`, containing points of type -`std::tuple` +`std::tuple` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 1340e9ac3c6..edf2e81d985 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -795,45 +795,10 @@ Mesh_3/random_labeled_image.h. The example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp features -another way to achieve these results. It is a modification -of \ref Mesh_3/mesh_3D_image.cpp. +a custom functor that initialize the triangulation. -For the meshing, in the previous example (\ref Mesh_3/mesh_3D_image.cpp), we called `make_mesh_3()` as follows. - -\snippet Mesh_3/mesh_3D_image.cpp Meshing - -In the example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp, -that call is replaced by: - -# the creation of an empty `%c3t3` object, - -# a call to the function - `initialize_triangulation_from_labeled_image()` that inserts points in - the triangulation, - -# then the call to `refine_mesh_3()`. - -\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp Meshing - -The function `initialize_triangulation_from_labeled_image()` gets points from -\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h and inserts them -in the triangulation. The following lines show how to insert new -points in the `%c3t3` object, with the calls to -`MeshVertexBase_3::set_dimension()` and -`MeshVertexBase_3::set_index()`. - -\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points - -The value of `index` must be consistent with the possible values of -`Mesh_domain::Index`. - -The example \ref Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp is another -custom initialization example, for meshing of 3D gray-level images. Similarly to -the segmented image example above, the code consists in: - -# the creation of an empty `%c3t3` object, - -# a call to the function - `initialize_triangulation_from_gray_image()` that inserts points in - the triangulation, - -# then the call to `refine_mesh_3()`. - -\snippet Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp Meshing +A struct `Custom_Initial_points_generator` that places 1D-feature points +alongside a line is created. \subsection Mesh_3UsingVariableSizingField Using Variable Sizing Field diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index e4528dfa9b1..969fb7fd1bf 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -1,7 +1,6 @@ /*! \example Mesh_3/implicit_functions.cpp \example Mesh_3/mesh_3D_image.cpp -\example Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp \example Mesh_3/mesh_3D_image_with_features.cpp \example Mesh_3/mesh_3D_image_with_custom_initialization.cpp \example Mesh_3/mesh_3D_image_with_initial_points.cpp diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 90857127a80..4899a15d588 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -162,11 +162,6 @@ if(TARGET CGAL::CGAL_ImageIO) target_link_libraries(mesh_3D_image_with_custom_initialization PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program( - "mesh_3D_gray_image_with_custom_initialization.cpp") - target_link_libraries(mesh_3D_gray_image_with_custom_initialization - PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program( "mesh_3D_image_with_initial_points.cpp") target_link_libraries(mesh_3D_image_with_initial_points @@ -205,7 +200,6 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) mesh_3D_weighted_image mesh_3D_image_variable_size mesh_3D_image_with_custom_initialization - mesh_3D_gray_image_with_custom_initialization mesh_3D_image_with_initial_points mesh_3D_image_with_features mesh_3D_image_with_detection_of_features diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp deleted file mode 100644 index b734240f4cc..00000000000 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ /dev/null @@ -1,115 +0,0 @@ - -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -typedef float Image_word_type; - -// Domain -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; - -// Parallel tag -#ifdef CGAL_CONCURRENT_MESH_3 -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - -// Triangulation -typedef CGAL::Mesh_triangulation_3::type Tr; -typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; - -// Criteria -typedef CGAL::Mesh_criteria_3 Mesh_criteria; - -namespace params = CGAL::parameters; - -template -void initialize_triangulation_from_gray_image(C3T3& c3t3, - const MeshDomain& domain, - const CGAL::Image_3& image, - const FT& iso_value) -{ - typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits GT; - typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename MeshDomain::Point_3 Point_3; - typedef typename MeshDomain::Index Index; - - typedef typename std::tuple ConstructedPoint; - - Tr& tr = c3t3.triangulation(); - - typename GT::Construct_weighted_point_3 cwp = - tr.geom_traits().construct_weighted_point_3_object(); - - std::vector constructedPoints; - - CGAL::Construct_initial_points_gray_image construct(image, iso_value); - construct(std::back_inserter(constructedPoints), domain, c3t3); - - std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; - - for (const ConstructedPoint & constructedPoint : constructedPoints) - { - const Point_3& point = std::get<0>(constructedPoint); - const int& dimension = std::get<1>(constructedPoint); - const Index& index = std::get<2>(constructedPoint); - - Weighted_point pi = cwp(point); - - /// The following lines show how to insert initial points in the - /// `c3t3` object. [insert initial points] - Vertex_handle v = tr.insert(pi); - // `v` could be null if `pi` is hidden by other vertices of `tr`. - CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, dimension); - c3t3.set_index(v, index); - /// [insert initial points] - } -} - -int main(int argc, char* argv[]) -{ - const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("images/skull_2.9.inr"); - /// [Load image] - CGAL::Image_3 image; - if (!image.read(fname)) { - std::cerr << "Error: Cannot read file " << fname << std::endl; - return EXIT_FAILURE; - } - /// [Domain creation] - Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f)); - /// [Domain creation] - - /// [Mesh criteria] - Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). - cell_radius_edge_ratio(3).cell_size(8)); - - /// [Meshing] - C3t3 c3t3; - initialize_triangulation_from_gray_image(c3t3, - domain, - image, - 2.9f//isolevel - ); - CGAL::refine_mesh_3(c3t3, domain, criteria); - /// [Meshing] - - /// Output - CGAL::dump_c3t3(c3t3, "out"); - - return 0; -} diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index feff42b26b3..ff8716e85c4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -5,17 +5,19 @@ #include #include -#include - #include #include #include #include + +#include + // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; +typedef CGAL::Labeled_mesh_domain_3 Image_domain; +typedef CGAL::Mesh_domain_with_polyline_features_3 Mesh_domain; #ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_tag Concurrency_tag; @@ -33,70 +35,57 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; namespace params = CGAL::parameters; -template -void initialize_triangulation_from_labeled_image(C3T3& c3t3, - const MeshDomain& domain, - const CGAL::Image_3& image) +struct Custom_Initial_points_generator { - typedef typename C3T3::Triangulation Tr; - typedef typename Tr::Geom_traits GT; - typedef typename Tr::Weighted_point Weighted_point; - typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename MeshDomain::Point_3 Point_3; - typedef typename MeshDomain::Index Index; + CGAL::Image_3& image_; + Custom_Initial_points_generator(CGAL::Image_3& image) : image_(image) { } - typedef typename std::tuple ConstructedPoint; - - Tr& tr = c3t3.triangulation(); - - typename GT::Construct_weighted_point_3 cwp = - tr.geom_traits().construct_weighted_point_3_object(); - - std::vector constructedPoints; - - CGAL::Construct_initial_points_labeled_image construct(image); - construct(std::back_inserter(constructedPoints), domain, c3t3); - - std::cout << " " << constructedPoints.size() << " constructed points" << std::endl; - - for (const ConstructedPoint & constructedPoint : constructedPoints) + template + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 1) const { - const Point_3& point = std::get<0>(constructedPoint); - const int& dimension = std::get<1>(constructedPoint); - const Index& index = std::get<2>(constructedPoint); + typedef typename C3t3::Triangulation::Geom_traits::Point_3 Point_3; - Weighted_point pi = cwp(point); + typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = + c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - /// The following lines show how to insert initial points in the - /// `c3t3` object. [insert initial points] - Vertex_handle v = tr.insert(pi); - // `v` could be null if `pi` is hidden by other vertices of `tr`. - CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, dimension); - c3t3.set_index(v, index); - /// [insert initial points] + // Add points along the segment from + // ( 0.0 50.0 66.66) to + // (100.0 50.0 66.66) + double edge_size = 5; + std::size_t nb = static_cast(100.0 / edge_size); + for (std::size_t i = 1; i < nb; i++) + { + *pts++ = std::make_tuple( + cwp(Point_3(i*edge_size, 50.0, 66.66), edge_size*edge_size), 1, 0); + } + return pts; } -} +}; int main() { - /// [Create the image] - CGAL::Image_3 image = random_labeled_image(); - /// [Create the image] + const std::string fname = CGAL::data_file_path("images/420.inr"); + // Loads image + CGAL::Image_3 image; + if(!image.read(fname)){ + std::cerr << "Error: Cannot read file " << fname << std::endl; + return EXIT_FAILURE; + } // Domain - Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image + , params::features_detector(CGAL::Mesh_3::Detect_features_on_image_bbox()) + ); // Mesh criteria - Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). - cell_radius_edge_ratio(3).cell_size(3)); + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).edge_size(3) + .cell_radius_edge_ratio(3).cell_size(3) + ); /// [Meshing] - C3t3 c3t3; - initialize_triangulation_from_labeled_image(c3t3, - domain, - image); - CGAL::refine_mesh_3(c3t3, domain, criteria); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria + , params::initial_points_generator(Custom_Initial_points_generator(image)) + ); /// [Meshing] // Output diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 27ee3d09be0..f9cf60d1a8a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -286,7 +286,7 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = std::make_tuple(intersect_point, 2, intersect_index); // dimension 2 by construction, points are on surface + *pts++ = std::make_tuple(cwp(intersect_point), 2, intersect_index); // dimension 2 by construction, points are on surface } } } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6a5eec6a25a..5a8b83b88e9 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -44,10 +44,9 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_generator()()) { - typedef typename MeshDomain::Point_3 Point_3; + typedef typename C3T3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; typedef typename MeshDomain::Index Index; - typedef std::vector > Initial_points_vector; - typedef typename Initial_points_vector::iterator Ipv_iterator; + typedef std::vector > Initial_points_vector; typedef typename C3T3::Vertex_handle Vertex_handle; // Mesh initialization : get some points and add them to the mesh @@ -58,21 +57,15 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, else //use default number of points generator(std::back_inserter(initial_points), domain, c3t3); - typename C3T3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = - c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - // Insert points and set their index and dimension - for ( Ipv_iterator it = initial_points.begin() ; - it != initial_points.end() ; - ++it ) - { - Vertex_handle v = c3t3.triangulation().insert(cwp(std::get<0>(*it))); + for (const auto& [weighted_point_3, dimension, index] : initial_points) { + Vertex_handle v = c3t3.triangulation().insert(weighted_point_3); // v could be null if point is hidden if ( v != Vertex_handle() ) { - c3t3.set_dimension(v,std::get<1>(*it)); - c3t3.set_index(v,std::get<2>(*it)); + c3t3.set_dimension(v,dimension); + c3t3.set_index(v,index); } } } @@ -234,7 +227,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > // If c3t3 initialization is not sufficient (may happen if there is only // a planar curve as feature for example), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3; + bool need_more_init = c3t3.triangulation().dimension() != 3 || !generator.is_default(); if(!need_more_init) { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); helper.update_restricted_facets(); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 5a33d9d3cd1..c80235b10ab 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -14,6 +14,7 @@ #include #include +#include namespace CGAL { @@ -172,12 +173,15 @@ private: template struct Initial_points_generator_options { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; + typedef typename MeshDomain::Index Index; + typedef typename std::back_insert_iterator>> OutputIterator; template - Initial_points_generator_options(const Initial_points_generator& generator) + Initial_points_generator_options(const Initial_points_generator& generator, bool is_default = false) : initial_points_generator_no_number_of_points_(generator) , initial_points_generator_(generator) + , is_default_(is_default) { } OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) const @@ -190,7 +194,10 @@ struct Initial_points_generator_options return initial_points_generator_(pts, domain, c3t3, n); } + bool is_default() const { return is_default_; } + private: + const bool is_default_; const std::function initial_points_generator_no_number_of_points_; const std::function initial_points_generator_; }; @@ -242,7 +249,9 @@ struct Domain_features_generator< MeshDomain, true > template struct Initial_points_generator_generator { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; + typedef typename MeshDomain::Index Index; + typedef typename std::back_insert_iterator>> OutputIterator; typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; @@ -250,28 +259,26 @@ struct Initial_points_generator_generator { OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) { - typedef typename MeshDomain::Point_3 Point_3; - typedef typename MeshDomain::Index Index; - typedef typename std::pair Domain_generated_point; - std::vector domain_generated_points; - domain.construct_initial_points_object()(std::back_inserter(domain_generated_points)); - for (Domain_generated_point domain_generated_point : domain_generated_points) - { - *pts++ = std::make_tuple(domain_generated_point.first, 2, domain_generated_point.second); - } + // Use boost to easily create an output iterator. + // This iterator take the domain's construct_initial_points_object output : an std::pair + // and outputs an std::tuple + // As points are on the surfaces by construction, dimension is always 2. + typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = + c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); + domain.construct_initial_points_object()( + boost::make_function_output_iterator([&](const auto& domain_generated_point) { + *pts++ = std::make_tuple(cwp(domain_generated_point.first), 2, domain_generated_point.second); + })); return pts; } OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) { - typedef typename MeshDomain::Point_3 Point_3; - typedef typename MeshDomain::Index Index; - typedef typename std::pair Domain_generated_point; - std::vector domain_generated_points; - domain.construct_initial_points_object()(std::back_inserter(domain_generated_points), n); - for (Domain_generated_point domain_generated_point : domain_generated_points) - { - *pts++ = std::make_tuple(domain_generated_point.first, 2, domain_generated_point.second); - } + typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = + c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); + domain.construct_initial_points_object()( + boost::make_function_output_iterator([&](const auto& domain_generated_point) { + *pts++ = std::make_tuple(cwp(domain_generated_point.first), 2, domain_generated_point.second); + }), n); return pts; } }; @@ -279,7 +286,7 @@ struct Initial_points_generator_generator template Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) { - return Initial_points_generator_options(initial_points_generator); + return Initial_points_generator_options(initial_points_generator, false); } Initial_points_generator_options operator()(const Null_functor&) @@ -289,7 +296,7 @@ struct Initial_points_generator_generator Initial_points_generator_options operator()() { - return Initial_points_generator_options(Initial_points_generator_domain_traductor()); + return Initial_points_generator_options(Initial_points_generator_domain_traductor(), true); } }; From ca605fe57f9f82cd81e4c6af32f08f2bfa5f2ad6 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Tue, 7 Nov 2023 16:24:59 +0100 Subject: [PATCH 034/332] Fix doc build --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 3 +++ Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index f2ea33d691b..8d1493d8ebc 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -30,6 +30,9 @@ output iterator `pts`, as objects of type `std::tuple` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` +@param pts the output points +@param domain the input domain +@param c3t3 the input complex @param n an estimation of the number of points to output */ diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index edf2e81d985..aa003abdbd2 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -749,7 +749,7 @@ the triangulation for each connected component. The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh initialization (following the `InitialPointsGenerator`). The functor -\ref CGAL/Mesh_3/Construct_initial_points_labeled_image.h is used in this example. +`CGAL/Mesh_3/Construct_initial_points_labeled_image.h` is used in this example. It constructs points using the API of the mesh domain, as follows. First the functor `construct_intersect` is created From ec7a6ac87642a00c7556567317a3ae35cc6710c0 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 10 Nov 2023 17:06:04 +0100 Subject: [PATCH 035/332] Added meshing parameter : initial_points --- Mesh_3/include/CGAL/make_mesh_3.h | 35 +++++++-- .../internal/mesh_option_classes.h | 73 +++++++++++++++---- .../internal/parameters_interface.h | 1 + 3 files changed, 89 insertions(+), 20 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 5a8b83b88e9..2c3d642cf74 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -407,7 +407,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * } * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd - * \cgalParamSectionBegin{Mesh initialization} + * \cgalParamSectionBegin{Mesh initialization with a functor} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be provided to start the meshing process. * It must follow the `InitialPointsGenerator` concept. * The following named parameter controls this option: @@ -415,7 +415,24 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
  • `parameters::initial_points_generator()` * } * \cgalParamDefault{`CGAL::Null_Functor()`, the domain's `construct_initial_points_object()` - * will be called for the points initialization.} + * will be called for the points initialization.} + * \cgalParamSectionBegin{Mesh initialization with points} + * \cgalParamDescription{a `std::vector` of initial points, represented as + * `std::vector>` can optionally + * be provided to start the meshing process. + * `Weighted_point_3` is the point's position and weight, + * `int` is the dimension of the minimal dimension subcomplex on which + * the point lies, and + * `Index` is the underlying subcomplex index. + * The following named parameter controls this option: + *
      + *
    • `parameters::initial_points()` + *
    } + * \cgalParamDefault{`std::vector>()`} + * \cgalParamExtra{If this parameter is set, + * the domain's `construct_initial_points_object()` will not be called.} + * \cgalParamExtra{If the parameter `parameters::initial_points_generator()` is set, + * the points will be inserted before calling the functor.} * \cgalParamSectionEnd * \cgalNamedParamsEnd * @@ -444,6 +461,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C { using parameters::choose_parameter; using parameters::get_parameter; + using parameters::get_parameter_reference; C3T3 c3t3; parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); @@ -453,9 +471,16 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - parameters::internal::Initial_points_generator_options initial_points_generator_options_param = - parameters::internal::Initial_points_generator_generator() - (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), parameters::initial_points_generator().v)); + using Initial_points_generator_generator = parameters::internal::Initial_points_generator_generator; + using Initial_points = typename Initial_points_generator_generator::Initial_points; + Initial_points empty_vec; + const Initial_points& initial_points + = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); + parameters::internal::Initial_points_generator_options initial_points_generator_options_param = + Initial_points_generator_generator() + (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), + parameters::initial_points_generator().v), + initial_points); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index c80235b10ab..57989a1f008 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -175,31 +175,54 @@ struct Initial_points_generator_options { typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; typedef typename MeshDomain::Index Index; - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename std::vector> Initial_points; + typedef typename std::back_insert_iterator OutputIterator; template - Initial_points_generator_options(const Initial_points_generator& generator, bool is_default = false) + Initial_points_generator_options(const Initial_points_generator& generator, const Initial_points& initial_points, bool is_default = false) : initial_points_generator_no_number_of_points_(generator) , initial_points_generator_(generator) - , is_default_(is_default) - { } + , is_default_(is_default && initial_points.size() == 0) + { + if (initial_points.size() == 0) + { + initial_points_ = nullptr; + } + else + { + initial_points_ = &initial_points; + } + } OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) const { + add_initial_points(pts); return initial_points_generator_no_number_of_points_(pts, domain, c3t3); } OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) const { + add_initial_points(pts); return initial_points_generator_(pts, domain, c3t3, n); } + OutputIterator add_initial_points(OutputIterator pts) const + { + if (initial_points_ != nullptr) + { + for (const auto& point_tuple : *initial_points_) + *pts++ = point_tuple; + } + return pts; + } + bool is_default() const { return is_default_; } private: - const bool is_default_; const std::function initial_points_generator_no_number_of_points_; const std::function initial_points_generator_; + const Initial_points* initial_points_; + const bool is_default_; }; // ----------------------------------- @@ -249,11 +272,9 @@ struct Domain_features_generator< MeshDomain, true > template struct Initial_points_generator_generator { - typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; - typedef typename MeshDomain::Index Index; - typedef typename std::back_insert_iterator>> OutputIterator; - typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; + typedef typename Initial_points_generator_options::Initial_points Initial_points; + typedef typename Initial_points_generator_options::OutputIterator OutputIterator; struct Initial_points_generator_domain_traductor { @@ -283,20 +304,42 @@ struct Initial_points_generator_generator } }; - template - Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) + struct Initial_points_generator_empty { - return Initial_points_generator_options(initial_points_generator, false); + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + { return pts; } + OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + { return pts; } + }; + + // With a custom InitialPointsGenerator + template + Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator, const InitalPointsRange& input_features) + { + return Initial_points_generator_options(initial_points_generator, input_features, false); } - Initial_points_generator_options operator()(const Null_functor&) + // Without a custom InitialPointsGenerator + template + Initial_points_generator_options operator()(const InitalPointsRange& input_features) { - return operator()(); + // The domain's construct_initial_points_object is called only if input_features is empty + if (input_features.size() == 0) { + return Initial_points_generator_options(Initial_points_generator_domain_traductor(), input_features, true); + } + return Initial_points_generator_options(Initial_points_generator_empty(), input_features, true); + } + + template + Initial_points_generator_options operator()(const Null_functor&, const InitalPointsRange& input_features) + { + return operator()(input_features); } Initial_points_generator_options operator()() { - return Initial_points_generator_options(Initial_points_generator_domain_traductor(), true); + Initial_points empty_input_features; + return operator()(empty_input_features); } }; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 57715ff5a2a..8853e49bfd5 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -324,6 +324,7 @@ CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_optio CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) CGAL_add_named_parameter_with_compatibility(initial_points_generator_options_param_t,initial_points_generator_options_param,initial_points_generator_options) +CGAL_add_named_parameter_with_compatibility(initial_points_param_t,initial_points_param,initial_points) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) From c9eabbf101488d1b8de09052e6986973ff02fe4c Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 10 Nov 2023 18:20:58 +0100 Subject: [PATCH 036/332] Fix demo errors --- .../internal/mesh_option_classes.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 57989a1f008..0c7129803e9 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -319,9 +319,16 @@ struct Initial_points_generator_generator return Initial_points_generator_options(initial_points_generator, input_features, false); } + template + Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) + { + Initial_points empty_input_features; + return operator()(initial_points_generator, empty_input_features); + } + // Without a custom InitialPointsGenerator template - Initial_points_generator_options operator()(const InitalPointsRange& input_features) + Initial_points_generator_options operator()(const Null_functor&, const InitalPointsRange& input_features) { // The domain's construct_initial_points_object is called only if input_features is empty if (input_features.size() == 0) { @@ -330,16 +337,10 @@ struct Initial_points_generator_generator return Initial_points_generator_options(Initial_points_generator_empty(), input_features, true); } - template - Initial_points_generator_options operator()(const Null_functor&, const InitalPointsRange& input_features) - { - return operator()(input_features); - } - + // Default construction Initial_points_generator_options operator()() { - Initial_points empty_input_features; - return operator()(empty_input_features); + return operator()(Null_functor()); } }; From d9f0f258a5e6e2b7f71c78d35c9e2b8a09f8c9f6 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 13 Nov 2023 11:53:55 +0100 Subject: [PATCH 037/332] Added initial_points to the parameter doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index dbf2ec22101..5665782338c 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -462,6 +462,10 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * i.e. the domain's `construct_initial_points_object()` * is called for the initialization of the meshing process. * + * \tparam InitialPointsGenerator a functor following the `InitialPointsGenerator` concept + * + * @param generator an instance of the InitialPointsGenerator functor + * * \cgalHeading{Example} * * \code{.cpp} @@ -471,12 +475,48 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); * \endcode * + * \sa `CGAL::parameters::initial_points()` * \sa `CGAL::make_mesh_3()` * \sa `MeshDomain_3::Construct_initial_points` * */ template unspecified_type initial_points_generator(const InitialPointsGenerator& generator); +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::initial_points()` enables the user to + * specify a `std::vector` of initial points + * to the mesh generation function `make_mesh_3()`. + * The initial points vector is of type `std::vector>` where + * `Weighted_point_3` is the point's position and weight, + * `int` is the dimension of the minimal dimension subcomplex on which the point lies, and + * `Index` is the underlying subcomplex index. + * + * \tparam MeshDomain model of `MeshDomain_3` + * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * + * @param initial_points a vector containing points of type + * `std::tuple` + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Creation of the initial_points vector + * std::vector> initial_points; + * // Mesh generation from labelled image with connexity checks. + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::initial_points(std::cref(initial_points));//use std::cref to avoid a copy + * \endcode + * + * \sa `CGAL::parameters::initial_points_generator()` + * \sa `CGAL::make_mesh_3()` + * \sa `MeshDomain_3::Construct_initial_points` + * + */ +template +unspecified_type initial_points(const std::vector>& initial_points); } /* namespace parameters */ } /* namespace CGAL */ From 2c9fb5cd4edc7475eab740dee04cdbae7cfd063e Mon Sep 17 00:00:00 2001 From: ange-clement Date: Thu, 28 Mar 2024 14:14:29 +0100 Subject: [PATCH 038/332] doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 8 ++++---- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 4 ++-- Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 ++-- Mesh_3/include/CGAL/make_mesh_3.h | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 5665782338c..300fc2f5748 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -458,7 +458,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * specify a functor following the `InitialPointsGenerator` concept * to the mesh generation function `make_mesh_3()`. * The functor will be called for initialization of the meshing process. - * If this parameter is specified without argument, the default behaviour is executed, + * If this parameter is specified without arguments, the default behavior is executed, * i.e. the domain's `construct_initial_points_object()` * is called for the initialization of the meshing process. * @@ -469,7 +469,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * \cgalHeading{Example} * * \code{.cpp} - * // Mesh generation from labelled image with connexity checks. + * // Mesh generation from labeled image with connexity checks. * C3t3 c3t3 = make_mesh_3(domain, * criteria, * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); @@ -489,7 +489,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * specify a `std::vector` of initial points * to the mesh generation function `make_mesh_3()`. * The initial points vector is of type `std::vector>` where - * `Weighted_point_3` is the point's position and weight, + * `Weighted_point_3` contains the point's position and weight, * `int` is the dimension of the minimal dimension subcomplex on which the point lies, and * `Index` is the underlying subcomplex index. * @@ -504,7 +504,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \code{.cpp} * // Creation of the initial_points vector * std::vector> initial_points; - * // Mesh generation from labelled image with connexity checks. + * // Mesh generation from labeled image with connexity checks. * C3t3 c3t3 = make_mesh_3(domain, * criteria, * parameters::initial_points(std::cref(initial_points));//use std::cref to avoid a copy diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 8d1493d8ebc..9c0f6a10e7b 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -19,7 +19,7 @@ public: /// @{ /*! -Output a set of (`n`) surface points to the +Outputs a set of `n` surface points to the output iterator `pts`, as objects of type `std::tuple`. `Weighted_point_3` is the point's position and weight, @@ -46,7 +46,7 @@ output iterator `pts`, as objects of type `Weighted_point_3` is the point's position and weight, `int` is the dimension of the minimal dimension subcomplex on which the point lies, and `Index` is the underlying subcomplex index. -As `n` is not given, the functor must provide enough +Since there is no `n` given like above, the functor must provide enough points to initialize the mesh generation process. @tparam OutputIterator model of `OutputIterator`, containing points of type diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index aa003abdbd2..e221482e41b 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -751,7 +751,7 @@ It expects a functor that returns a set of points for the mesh initialization (following the `InitialPointsGenerator`). The functor `CGAL/Mesh_3/Construct_initial_points_labeled_image.h` is used in this example. It constructs points using the API of the mesh domain, as follows. -First the functor `construct_intersect` is created +First the functor `construct_intersection` is created \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h construct intersection then the `%Mesh_domain::Intersection` object (a `%tuple` with three @@ -795,7 +795,7 @@ Mesh_3/random_labeled_image.h. The example \ref Mesh_3/mesh_3D_image_with_custom_initialization.cpp features -a custom functor that initialize the triangulation. +a custom functor that initializes the triangulation. A struct `Custom_Initial_points_generator` that places 1D-feature points alongside a line is created. diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 2c3d642cf74..9fa756977e8 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -409,7 +409,6 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialization with a functor} * \cgalParamDescription{an `InitialPointsGenerator` can optionally be provided to start the meshing process. - * It must follow the `InitialPointsGenerator` concept. * The following named parameter controls this option: *
      *
    • `parameters::initial_points_generator()` From e64e28d5ef528f5e580c3fe5333dec54dba0ad09 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 29 Mar 2024 16:29:07 +0100 Subject: [PATCH 039/332] Made initial_point parameter work with any Range With doc and example ( example "mesh_3D_image_with_initial_points.cpp" has been renamed to "mesh_3D_image_with_image_initialization.cpp") --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 9 ++- Mesh_3/doc/Mesh_3/Mesh_3.txt | 12 ++- Mesh_3/doc/Mesh_3/examples.txt | 1 + Mesh_3/examples/Mesh_3/CMakeLists.txt | 6 ++ ...sh_3D_image_with_custom_initialization.cpp | 23 ++++-- ...esh_3D_image_with_image_initialization.cpp | 60 +++++++++++++++ .../mesh_3D_image_with_initial_points.cpp | 38 +++++++--- Mesh_3/include/CGAL/make_mesh_3.h | 45 +++++++++-- .../internal/mesh_option_classes.h | 75 ++++++++++++++++--- 9 files changed, 229 insertions(+), 40 deletions(-) create mode 100644 Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 300fc2f5748..6f773d0ab14 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -486,9 +486,10 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \ingroup PkgMesh3Parameters * * The function `parameters::initial_points()` enables the user to - * specify a `std::vector` of initial points + * specify a container model of `Range` of initial points * to the mesh generation function `make_mesh_3()`. - * The initial points vector is of type `std::vector>` where + * The initial points `Range` has elements of type + * `std::tuple` where * `Weighted_point_3` contains the point's position and weight, * `int` is the dimension of the minimal dimension subcomplex on which the point lies, and * `Index` is the underlying subcomplex index. @@ -496,7 +497,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \tparam MeshDomain model of `MeshDomain_3` * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` * - * @param initial_points a vector containing points of type + * @param initial_points a `Range` containing points of type * `std::tuple` * * \cgalHeading{Example} @@ -504,7 +505,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \code{.cpp} * // Creation of the initial_points vector * std::vector> initial_points; - * // Mesh generation from labeled image with connexity checks. + * // Mesh generation from labeled image with initial points. * C3t3 c3t3 = make_mesh_3(domain, * criteria, * parameters::initial_points(std::cref(initial_points));//use std::cref to avoid a copy diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index e221482e41b..3df3b964890 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -737,14 +737,14 @@ without the weights (left, 25563 vertices) and with the weights (right, 19936 ve \subsubsection Mesh_3DomainsFrom3DImagesWithCustomInitialization Domains From 3D Images, with a Custom Initialization -The example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp is a modification +The example \ref Mesh_3/mesh_3D_image_with_image_initialization.cpp is a modification of \ref Mesh_3/mesh_3D_image.cpp. The goal of that example is to show how the default initialization of the triangulation, using random rays, can be replaced by a new implementation. In this case, the initialization detects all connected components in the 3D segmented image, and inserts points in the triangulation for each connected component. -\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Meshing +\snippet Mesh_3/mesh_3D_image_with_image_initialization.cpp Meshing The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh @@ -785,10 +785,10 @@ Right: the mesh generated after the initialization of all connected components \cgalFigureCaptionEnd Note that the example \ref -Mesh_3/mesh_3D_image_with_initial_points.cpp also shows how to +Mesh_3/mesh_3D_image_with_image_initialization.cpp also shows how to create a 3D image using the undocumented API of CGAL_ImageIO. -\snippet Mesh_3/mesh_3D_image_with_initial_points.cpp Create the image +\snippet Mesh_3/mesh_3D_image_with_image_initialization.cpp Create the image The code of the function `%random_labeled_image()` is in the header file \ref Mesh_3/random_labeled_image.h. @@ -800,6 +800,10 @@ a custom functor that initializes the triangulation. A struct `Custom_Initial_points_generator` that places 1D-feature points alongside a line is created. +Finally, the exemple \ref Mesh_3/mesh_3D_image_with_initial_points.cpp features +a point container that initializes the triangulation using the meshing parameter +`parameters::initial_points()`. + \subsection Mesh_3UsingVariableSizingField Using Variable Sizing Field \subsubsection Mesh_3SizingFieldasanAnalyticalFunction Sizing Field as an Analytical Function diff --git a/Mesh_3/doc/Mesh_3/examples.txt b/Mesh_3/doc/Mesh_3/examples.txt index 969fb7fd1bf..2c895af603e 100644 --- a/Mesh_3/doc/Mesh_3/examples.txt +++ b/Mesh_3/doc/Mesh_3/examples.txt @@ -4,6 +4,7 @@ \example Mesh_3/mesh_3D_image_with_features.cpp \example Mesh_3/mesh_3D_image_with_custom_initialization.cpp \example Mesh_3/mesh_3D_image_with_initial_points.cpp +\example Mesh_3/mesh_3D_image_with_image_initialization.cpp \example Mesh_3/mesh_3D_image_with_detection_of_features.cpp \example Mesh_3/mesh_3D_image_with_input_features.cpp \example Mesh_3/mesh_3D_weighted_image.cpp diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 4899a15d588..34b829a03ea 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -162,6 +162,11 @@ if(TARGET CGAL::CGAL_ImageIO) target_link_libraries(mesh_3D_image_with_custom_initialization PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program( + "mesh_3D_image_with_image_initialization.cpp") + target_link_libraries(mesh_3D_image_with_image_initialization + PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program( "mesh_3D_image_with_initial_points.cpp") target_link_libraries(mesh_3D_image_with_initial_points @@ -201,6 +206,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) mesh_3D_image_variable_size mesh_3D_image_with_custom_initialization mesh_3D_image_with_initial_points + mesh_3D_image_with_image_initialization mesh_3D_image_with_features mesh_3D_image_with_detection_of_features mesh_3D_image_with_input_features diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index ff8716e85c4..7b82e482771 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -35,6 +35,11 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; namespace params = CGAL::parameters; +// Custom_Initial_points_generator will put points on the mesh for initialisation. +// Those points are objects of type std::tuple. +// Weighted_point_3 is the point's position and weight, +// int is the dimension of the minimal dimension subcomplex on which the point lies, +// Index is the underlying subcomplex index. struct Custom_Initial_points_generator { CGAL::Image_3& image_; @@ -43,20 +48,26 @@ struct Custom_Initial_points_generator template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 1) const { - typedef typename C3t3::Triangulation::Geom_traits::Point_3 Point_3; + typedef typename C3t3::Triangulation::Geom_traits::Point_3 Point_3; + typedef typename C3t3::Triangulation::Geom_traits::Vector_3 Vector_3; + typedef typename C3t3::Triangulation::Geom_traits::Segment_3 Segment_3; typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - // Add points along the segment from - // ( 0.0 50.0 66.66) to - // (100.0 50.0 66.66) + // Add points along the segment + Segment_3 segment(Point_3( 0.0, 50.0, 66.66), + Point_3(100.0, 50.0, 66.66)); + + + Point_3 source = segment.source(); + Vector_3 vector = segment.to_vector(); double edge_size = 5; - std::size_t nb = static_cast(100.0 / edge_size); + std::size_t nb = static_cast(CGAL::sqrt(segment.squared_length()) / edge_size); for (std::size_t i = 1; i < nb; i++) { *pts++ = std::make_tuple( - cwp(Point_3(i*edge_size, 50.0, 66.66), edge_size*edge_size), 1, 0); + cwp(source + (i/(double)nb)*vector, edge_size*edge_size), 1, 0); } return pts; } diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp new file mode 100644 index 00000000000..c205f1502b9 --- /dev/null +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -0,0 +1,60 @@ +#include "random_labeled_image.h" +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include + +// Domain +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; + +#ifdef CGAL_CONCURRENT_MESH_3 +typedef CGAL::Parallel_tag Concurrency_tag; +#else +typedef CGAL::Sequential_tag Concurrency_tag; +#endif + +// Triangulation +typedef CGAL::Mesh_triangulation_3::type Tr; + +typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; + +// Criteria +typedef CGAL::Mesh_criteria_3 Mesh_criteria; + +namespace params = CGAL::parameters; + +int main() +{ + /// [Create the image] + CGAL::Image_3 image = random_labeled_image(); + /// [Create the image] + + // Domain + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); + + // Mesh criteria + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1) + .cell_radius_edge_ratio(3).cell_size(3) + ); + + /// [Meshing] + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria + , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) + ); + /// [Meshing] + + // Output + CGAL::dump_c3t3(c3t3, "out"); + + return 0; +} diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index c205f1502b9..8487875382c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -5,17 +5,19 @@ #include #include -#include - #include #include #include #include + +#include + // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; +typedef CGAL::Labeled_mesh_domain_3 Image_domain; +typedef CGAL::Mesh_domain_with_polyline_features_3 Mesh_domain; #ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_tag Concurrency_tag; @@ -35,21 +37,39 @@ namespace params = CGAL::parameters; int main() { - /// [Create the image] - CGAL::Image_3 image = random_labeled_image(); - /// [Create the image] + const std::string fname = CGAL::data_file_path("images/420.inr"); + // Loads image + CGAL::Image_3 image; + if(!image.read(fname)){ + std::cerr << "Error: Cannot read file " << fname << std::endl; + return EXIT_FAILURE; + } // Domain - Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image + , params::features_detector(CGAL::Mesh_3::Detect_features_in_image()) + ); // Mesh criteria - Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1) + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).edge_size(3) .cell_radius_edge_ratio(3).cell_size(3) ); + using Point_3 = K::Point_3; + using Weighted_point_3 = K::Weighted_point_3; + using Index = Mesh_domain::Index; + using Initial_point_t = std::tuple; + + // Creation of the initial_points vector + std::vector initial_points = { + std::make_tuple(Weighted_point_3(Point_3(30.0, 50.0, 83.33), 30.0), 1, 0), + std::make_tuple(Weighted_point_3(Point_3(70.0, 50.0, 83.33), 50.0), 1, 0) + }; + /// [Meshing] + // Mesh generation from labeled image with initial points. C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) + , params::initial_points(std::cref(initial_points)) ); /// [Meshing] diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 9fa756977e8..abcef5d7181 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -40,9 +40,9 @@ namespace internal { template < typename C3T3, typename MeshDomain, typename MeshCriteria > void -init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, - const int nb_initial_points, - const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_generator()()) +add_points_from_generator(C3T3& c3t3, const MeshDomain& domain, + const int nb_initial_points, + const parameters::internal::Initial_points_generator_options& generator) { typedef typename C3T3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; typedef typename MeshDomain::Index Index; @@ -70,6 +70,39 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, } } +template < typename C3T3, typename MeshDomain, typename MeshCriteria > +void +init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, + const int nb_initial_points, + const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_generator()()) +{ + add_points_from_generator(c3t3, domain, nb_initial_points, generator); + + // If c3t3 initialization is not sufficient (may happen if + // the user has not specified enough points ), add some surface points + bool need_more_init = c3t3.triangulation().dimension() != 3 || !generator.is_default(); + if(!need_more_init) { + CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); + helper.update_restricted_facets(); + + if (c3t3.number_of_facets() == 0) { + need_more_init = true; + } + else + { + helper.update_restricted_cells(); + if(c3t3.number_of_cells() == 0) { + need_more_init = true; + } + } + } + if(need_more_init) { + parameters::internal::Initial_points_generator_options domain_generator = + parameters::internal::Initial_points_generator_generator()(); + add_points_from_generator(c3t3, domain, nb_initial_points, domain_generator); + } +} + template < typename EdgeCriteria > struct Edge_criteria_sizing_field_wrapper { @@ -471,9 +504,9 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); using Initial_points_generator_generator = parameters::internal::Initial_points_generator_generator; - using Initial_points = typename Initial_points_generator_generator::Initial_points; - Initial_points empty_vec; - const Initial_points& initial_points + using Value_type = typename Initial_points_generator_generator::Value_type; + std::vector empty_vec; + const auto& initial_points = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); parameters::internal::Initial_points_generator_options initial_points_generator_options_param = Initial_points_generator_generator() diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 0c7129803e9..b63baf3bb65 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -168,6 +168,54 @@ private: bool b_; }; +template +class Input_const_iterator_interface +{ +public: + virtual ~Input_const_iterator_interface() {} + virtual const Value& operator*() = 0; + virtual Input_const_iterator_interface* operator++() = 0; + virtual bool operator!=(const Input_const_iterator_interface* other) const = 0; + virtual Input_const_iterator_interface* clone() = 0; +}; + +template +struct Input_const_iterator_container + : Input_const_iterator_interface +{ + typedef Input_const_iterator_container Self; +public: + Input_const_iterator_container(const Iterator& it) : it_(it) {} + + virtual ~Input_const_iterator_container() {} + + virtual const Value& operator*() + { + return *it_; + } + + virtual Input_const_iterator_interface* operator++() + { + ++it_; + return this; + } + + virtual bool operator!=(const Input_const_iterator_interface* other) const + { + const Self* other_casted = dynamic_cast(other); + if (other_casted == nullptr) + return true; + return it_ != other_casted->it_; + } + + virtual Input_const_iterator_interface* clone() + { + return new Input_const_iterator_container(it_); + } + +private: + Iterator it_; +}; // options is holding the generator (default or the user's one) template @@ -175,10 +223,10 @@ struct Initial_points_generator_options { typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; typedef typename MeshDomain::Index Index; - typedef typename std::vector> Initial_points; - typedef typename std::back_insert_iterator OutputIterator; + typedef typename std::tuple Value_type; + typedef typename std::back_insert_iterator> OutputIterator; - template + template Initial_points_generator_options(const Initial_points_generator& generator, const Initial_points& initial_points, bool is_default = false) : initial_points_generator_no_number_of_points_(generator) , initial_points_generator_(generator) @@ -186,11 +234,14 @@ struct Initial_points_generator_options { if (initial_points.size() == 0) { - initial_points_ = nullptr; + begin_it = nullptr; + end_it = nullptr; } else { - initial_points_ = &initial_points; + using Iterator_type = typename Initial_points::const_iterator; + begin_it = new Input_const_iterator_container(initial_points.cbegin()); + end_it = new Input_const_iterator_container(initial_points.cend()); } } @@ -208,10 +259,11 @@ struct Initial_points_generator_options OutputIterator add_initial_points(OutputIterator pts) const { - if (initial_points_ != nullptr) + if (begin_it != nullptr && end_it != nullptr) { - for (const auto& point_tuple : *initial_points_) - *pts++ = point_tuple; + Input_const_iterator_interface& it = *(begin_it->clone()); + for (; it != end_it; ++it) + *pts++ = *it; } return pts; } @@ -221,7 +273,8 @@ struct Initial_points_generator_options private: const std::function initial_points_generator_no_number_of_points_; const std::function initial_points_generator_; - const Initial_points* initial_points_; + Input_const_iterator_interface* begin_it; + Input_const_iterator_interface* end_it; const bool is_default_; }; @@ -273,7 +326,7 @@ template struct Initial_points_generator_generator { typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef typename Initial_points_generator_options::Initial_points Initial_points; + typedef typename Initial_points_generator_options::Value_type Value_type; typedef typename Initial_points_generator_options::OutputIterator OutputIterator; struct Initial_points_generator_domain_traductor @@ -322,7 +375,7 @@ struct Initial_points_generator_generator template Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) { - Initial_points empty_input_features; + std::vector empty_input_features; return operator()(initial_points_generator, empty_input_features); } From ae0f8f37c997c171575b67ae67fec762dd8c152d Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 29 Mar 2024 16:49:33 +0100 Subject: [PATCH 040/332] Finished Merge --- Mesh_3/include/CGAL/make_mesh_3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6de7a2c5c7e..ff31c5b96d7 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -45,10 +45,12 @@ add_points_from_generator(C3T3& c3t3, const MeshDomain& domain, const parameters::internal::Initial_points_generator_options& generator) { typedef typename C3T3::Triangulation Tr; + typedef typename Tr::Geom_traits::Weighted_point_3 Weighted_point_3; typedef typename MeshDomain::Index Index; - typedef typename std::tuple Initialization_point + typedef typename std::tuple Initialization_point; typedef std::vector< Initialization_point > Initial_points_vector; + typedef typename C3T3::Vertex_handle Vertex_handle; typedef CGAL::Mesh_3::Triangulation_helpers Th; From b1fb29c22a919f6864511943f9e007ed4ff40052 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 29 Mar 2024 17:03:20 +0100 Subject: [PATCH 041/332] InitialPointsGenerator parameter 'n' explanation --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 9c0f6a10e7b..4a4e363d237 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -33,7 +33,9 @@ output iterator `pts`, as objects of type @param pts the output points @param domain the input domain @param c3t3 the input complex -@param n an estimation of the number of points to output +@param n an estimation of the number of points to output. +A generator can choose to ignore this parameter. +If a generator does not output enough points, then more points will be added automatically. */ template From da690fda1182fa8cd5e3551824a0104c78c6c45b Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 5 Apr 2024 11:09:33 +0200 Subject: [PATCH 042/332] Fixed warning unused variables --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index b63baf3bb65..659ed137860 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -359,9 +359,9 @@ struct Initial_points_generator_generator struct Initial_points_generator_empty { - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) + OutputIterator operator()(OutputIterator pts, const MeshDomain& , const C3t3& ) { return pts; } - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) + OutputIterator operator()(OutputIterator pts, const MeshDomain& , const C3t3& , int ) { return pts; } }; From f2a2051911632f50b5fb30b581ff81daea5763c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 5 Apr 2024 19:00:01 +0200 Subject: [PATCH 043/332] do not use deprecated include path --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 659ed137860..32dc74edc6a 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -14,7 +14,7 @@ #include #include -#include +#include namespace CGAL { From 27013140551cd8b77c0404e96e950cb72b838dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Apr 2024 13:53:47 +0200 Subject: [PATCH 044/332] fix warnings --- .../Mesh_3/mesh_3D_image_with_custom_initialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 7b82e482771..8ba0e155f2f 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -46,7 +46,7 @@ struct Custom_Initial_points_generator Custom_Initial_points_generator(CGAL::Image_3& image) : image_(image) { } template - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 1) const + OutputIterator operator()(OutputIterator pts, const MeshDomain& /* domain */, const C3t3& c3t3, int /* n */ = 1) const { typedef typename C3t3::Triangulation::Geom_traits::Point_3 Point_3; typedef typename C3t3::Triangulation::Geom_traits::Vector_3 Vector_3; From 561256ee0ba935ec7d4026d427a8e5249d45c48a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 15 Apr 2024 15:37:12 +0200 Subject: [PATCH 045/332] use override instead of virtual --- .../CGAL/STL_Extension/internal/mesh_option_classes.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 32dc74edc6a..201c50e1e4f 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -187,20 +187,20 @@ struct Input_const_iterator_container public: Input_const_iterator_container(const Iterator& it) : it_(it) {} - virtual ~Input_const_iterator_container() {} + ~Input_const_iterator_container() override {} - virtual const Value& operator*() + const Value& operator*() override { return *it_; } - virtual Input_const_iterator_interface* operator++() + Input_const_iterator_interface* operator++() override { ++it_; return this; } - virtual bool operator!=(const Input_const_iterator_interface* other) const + bool operator!=(const Input_const_iterator_interface* other) const override { const Self* other_casted = dynamic_cast(other); if (other_casted == nullptr) @@ -208,7 +208,7 @@ public: return it_ != other_casted->it_; } - virtual Input_const_iterator_interface* clone() + Input_const_iterator_interface* clone() override { return new Input_const_iterator_container(it_); } From cf01bdc179fcf248ee6c7e28655cf4dcbf046b88 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 15 Apr 2024 15:37:26 +0200 Subject: [PATCH 046/332] simplify the snippets --- .../Mesh_3/Construct_initial_points_labeled_image.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index f9cf60d1a8a..0ea81bf8085 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -187,10 +187,10 @@ struct Construct_initial_points_labeled_image const double radius = double(seed.radius + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); - /// \noop [construct intersection] + // [construct intersection] typename MeshDomain::Construct_intersection construct_intersection = domain.construct_intersection_object(); - /// \noop [construct intersection] + // [construct intersection] std::vector directions; if(seed.radius < 2) { @@ -214,16 +214,16 @@ struct Construct_initial_points_labeled_image const Point_3 test = seed_point + v; const Segment_3 test_segment = Segment_3(seed_point, test); - /// \noop [use construct intersection] + // [use construct intersection] const typename MeshDomain::Intersection intersect = construct_intersection(test_segment); - /// \noop [use construct intersection] + // [use construct intersection] if (std::get<2>(intersect) != 0) { - /// \noop [get construct intersection] + // [get construct intersection] const Point_3& intersect_point = std::get<0>(intersect); const Index& intersect_index = std::get<1>(intersect); - /// \noop [get construct intersection] + // [get construct intersection] Weighted_point pi = Weighted_point(intersect_point); // This would cause trouble to optimizers From d7ea10123140098f0bad5981efe731cd4f292445 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 29 Apr 2024 16:19:52 +0200 Subject: [PATCH 047/332] improve the doc sentences --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 34 +++++----------- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- .../Construct_initial_points_gray_image.h | 39 +++++++++---------- 3 files changed, 30 insertions(+), 45 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 6f773d0ab14..b068289faa4 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -454,22 +454,16 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points_generator()` enables the user to - * specify a functor following the `InitialPointsGenerator` concept - * to the mesh generation function `make_mesh_3()`. - * The functor will be called for initialization of the meshing process. - * If this parameter is specified without arguments, the default behavior is executed, - * i.e. the domain's `construct_initial_points_object()` - * is called for the initialization of the meshing process. + * The function `parameters::initial_points_generator()` allows the user to specify a functor that follows the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor will be called for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * - * \tparam InitialPointsGenerator a functor following the `InitialPointsGenerator` concept + * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept * * @param generator an instance of the InitialPointsGenerator functor * * \cgalHeading{Example} * * \code{.cpp} - * // Mesh generation from labeled image with connexity checks. + * // Mesh generation from a labeled image with connexity checks. * C3t3 c3t3 = make_mesh_3(domain, * criteria, * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); @@ -485,30 +479,22 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points()` enables the user to - * specify a container model of `Range` of initial points - * to the mesh generation function `make_mesh_3()`. - * The initial points `Range` has elements of type - * `std::tuple` where - * `Weighted_point_3` contains the point's position and weight, - * `int` is the dimension of the minimal dimension subcomplex on which the point lies, and - * `Index` is the underlying subcomplex index. + * The function `parameters::initial_points()` allows the user to specify a container model of `Range` that contains initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` should have elements of type `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, `int` represents the dimension of the minimal subcomplex on which the point lies, and `Index` represents the underlying subcomplex index. * - * \tparam MeshDomain model of `MeshDomain_3` - * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * \tparam MeshDomain a model of `MeshDomain_3` + * \tparam C3t3 a model of `MeshComplex_3InTriangulation_3` * - * @param initial_points a `Range` containing points of type - * `std::tuple` + * @param initial_points a `Range` that contains points of type `std::tuple` * * \cgalHeading{Example} * * \code{.cpp} - * // Creation of the initial_points vector + * // Create the initial_points vector * std::vector> initial_points; - * // Mesh generation from labeled image with initial points. + * // Perform mesh generation from a labeled image with initial points * C3t3 c3t3 = make_mesh_3(domain, * criteria, - * parameters::initial_points(std::cref(initial_points));//use std::cref to avoid a copy + * parameters::initial_points(std::cref(initial_points))); // Use std::cref to avoid a copy * \endcode * * \sa `CGAL::parameters::initial_points_generator()` diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index df30cd0b5d6..fd19c6b8276 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -129,7 +129,7 @@ The following functors are available for mesh initialization: - `CGAL::odt_optimize_mesh_3()` - `CGAL::Mesh_3::generate_label_weights()` -\cgalCRPSection{CGAL::parameters Functions} +\cgalCRPSection{%CGAL::parameters Functions} - `CGAL::parameters::features()` - `CGAL::parameters::no_features()` diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index bef74411440..a692c72cbc8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -24,17 +24,17 @@ namespace CGAL { /*! -* \ingroup PkgMesh3Initializers -* -* Functor for initial points generation in gray images. -* This functor is a model of concept `InitialPointsGenerator`, -* and thus can be passed to `CGAL::make_mesh_3` with the parameter -* `CGAL::parameters::initial_points_generator()` -* -* \sa `CGAL::parameters::initial_points_generator()` -* \sa `CGAL::make_mesh_3()` -* \sa `CGAL::Construct_initial_points_labeled_image` -*/ + * \ingroup PkgMesh3Initializers + * + * Functor for generating initial points in gray images. + * This functor is a model of the `InitialPointsGenerator` concept, + * and can be passed as a parameter to `CGAL::make_mesh_3` using the + * `CGAL::parameters::initial_points_generator()` parameter function. + * + * \sa `CGAL::parameters::initial_points_generator()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::Construct_initial_points_labeled_image` + */ template struct Construct_initial_points_gray_image { @@ -50,15 +50,14 @@ struct Construct_initial_points_gray_image , iso_value_(iso_value) , image_values_to_subdomain_indices_(image_values_to_subdomain_indices) { } - - /*! - * \brief Constructs the initial points using the gray image. - * - * @tparam OutputIterator an `OutputIterator` of points of type - * `std::tuple` - * @tparam MeshDomain a model of `MeshDomain_3` - * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` - */ + /*! + * \brief Constructs the initial points using the gray image. + * + * \tparam OutputIterator An `OutputIterator` of points of type + * `std::tuple`. + * \tparam MeshDomain A model of `MeshDomain_3`. + * \tparam C3t3 A model of `MeshComplex_3InTriangulation_3`. + */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const { From 2813d53c7f4578e6822e0bad5bc9bc981857cb15 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 29 Apr 2024 16:47:15 +0200 Subject: [PATCH 048/332] other changes I forgot to commit --- .../Construct_initial_points_labeled_image.h | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 0ea81bf8085..1b804f4dbdf 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -71,17 +71,17 @@ struct Get_point } // end namespace Mesh_3 /*! -* \ingroup PkgMesh3Initializers -* -* Functor for initial points generation in labeled images. -* This functor is a model of concept `InitialPointsGenerator`, -* and thus can be passed to `CGAL::make_mesh_3` with the parameter -* `CGAL::parameters::initial_points_generator()` -* -* \sa `CGAL::parameters::initial_points_generator()` -* \sa `CGAL::make_mesh_3()` -* \sa `CGAL::Construct_initial_points_gray_image` -*/ + * \ingroup PkgMesh3Initializers + * + * Functor for generating initial points in labeled images. + * This functor is a model of the `InitialPointsGenerator` concept, + * and can be passed as a parameter to `CGAL::make_mesh_3` using the + * `CGAL::parameters::initial_points_generator()` function. + * + * \sa `CGAL::parameters::initial_points_generator()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::Construct_initial_points_gray_image` + */ struct Construct_initial_points_labeled_image { const CGAL::Image_3 & image; @@ -90,15 +90,15 @@ struct Construct_initial_points_labeled_image : image(image_) { } - /*! - * \brief Constructs points by collecting them in all connected components. - * This guarantees to initialize them all. - * - * @tparam OutputIterator model of `OutputIterator`, containing points of type - * `std::tuple` - * @tparam MeshDomain model of `MeshDomain_3` - * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` - */ + /*! + * \brief Constructs points by collecting them from all connected components. + * This ensures that all points are initialized. + * + * @tparam OutputIterator a model of `OutputIterator` that contains points of type + * `std::tuple` + * @tparam MeshDomain a model of `MeshDomain_3` + * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const { @@ -107,18 +107,18 @@ struct Construct_initial_points_labeled_image } /*! - * \brief Same as above, but a `TransformOperator` is used + * \brief Same as above, but a `TransformOperator` is used. * - * @tparam OutputIterator model of `OutputIterator`, containing points of type - * `std::tuple` - * @tparam MeshDomain model of `MeshDomain_3` - * @tparam TransformOperator functor that transforms values of the image. + * @tparam OutputIterator A model of `OutputIterator` that contains points of type + * `std::tuple`. + * @tparam MeshDomain A model of `MeshDomain_3`. + * @tparam TransformOperator A functor that transforms values of the image. * It must provide the following type:
      * `result_type`
      * and the following operator:
      * `template`
      - * `result_type operator()(FT v)` - * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * `result_type operator()(FT v)`. + * @tparam C3t3 A model of `MeshComplex_3InTriangulation_3`. */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const From 8575f5358310caa7c67dd73aa8b94590f5ad72b4 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Thu, 2 May 2024 17:29:23 +0200 Subject: [PATCH 049/332] Doc upgrades + simplified initial_points_generator parameter + fixed memory leaks --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 13 ++++---- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- ...esh_3D_image_with_image_initialization.cpp | 5 +-- .../Construct_initial_points_gray_image.h | 7 +++- .../Construct_initial_points_labeled_image.h | 16 +++++---- Mesh_3/include/CGAL/make_mesh_3.h | 8 +++-- .../internal/mesh_option_classes.h | 33 ++++++++++++++++--- .../internal/mesh_parameters_interface.h | 17 ---------- .../internal/parameters_interface.h | 2 +- 10 files changed, 64 insertions(+), 41 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index b068289faa4..003ced5956a 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -456,18 +456,16 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * * The function `parameters::initial_points_generator()` allows the user to specify a functor that follows the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor will be called for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * + * If the generator does not generate enough points, the domain's `construct_initial_points_object()` will be called. + * If the parameter `parameters::initial_points()` is set, the functor will be called after insertion of the points. + * * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept * * @param generator an instance of the InitialPointsGenerator functor * * \cgalHeading{Example} * - * \code{.cpp} - * // Mesh generation from a labeled image with connexity checks. - * C3t3 c3t3 = make_mesh_3(domain, - * criteria, - * parameters::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image))); - * \endcode + * \snippet mesh_3D_image_with_image_initialization.cpp Meshing * * \sa `CGAL::parameters::initial_points()` * \sa `CGAL::make_mesh_3()` @@ -481,6 +479,9 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * * The function `parameters::initial_points()` allows the user to specify a container model of `Range` that contains initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` should have elements of type `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, `int` represents the dimension of the minimal subcomplex on which the point lies, and `Index` represents the underlying subcomplex index. * + * If this parameter is set, the domain's `construct_initial_points_object()` will not be called. + * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. + * * \tparam MeshDomain a model of `MeshDomain_3` * \tparam C3t3 a model of `MeshComplex_3InTriangulation_3` * diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 3df3b964890..d48984d0055 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -788,7 +788,7 @@ Note that the example \ref Mesh_3/mesh_3D_image_with_image_initialization.cpp also shows how to create a 3D image using the undocumented API of CGAL_ImageIO. -\snippet Mesh_3/mesh_3D_image_with_image_initialization.cpp Create the image +\snippet Mesh_3/mesh_3D_image_with_image_initialization.cpp Create_the_image The code of the function `%random_labeled_image()` is in the header file \ref Mesh_3/random_labeled_image.h. diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index c94fd737b7d..d1095639e14 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -31,7 +31,7 @@ /// \defgroup PkgMesh3Initializers Mesh Initialization Functions /// \ingroup PkgMesh3Ref - +/// The functors in this group perform mesh initialization by providing initial points. /// \defgroup PkgMesh3Parameters Parameter Functions /// \ingroup PkgMesh3Ref diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp index c205f1502b9..952df762d38 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -35,9 +35,9 @@ namespace params = CGAL::parameters; int main() { - /// [Create the image] + /// [Create_the_image] CGAL::Image_3 image = random_labeled_image(); - /// [Create the image] + /// [Create_the_image] // Domain Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); @@ -48,6 +48,7 @@ int main() ); /// [Meshing] + // Mesh generation with a custom initialization that places points in each of the image components. C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) ); diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index a692c72cbc8..fff140d0644 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -31,6 +31,9 @@ namespace CGAL * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * + * On images that contains multiple non-connected objects, + * this functor will output points on every object. + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_labeled_image` @@ -51,7 +54,9 @@ struct Construct_initial_points_gray_image , image_values_to_subdomain_indices_(image_values_to_subdomain_indices) { } /*! - * \brief Constructs the initial points using the gray image. + * \brief Constructs points by collecting them in all objects of the image, + * even if they are not connected. + * This guarantees to initialize all objects * * \tparam OutputIterator An `OutputIterator` of points of type * `std::tuple`. diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 1b804f4dbdf..24db92793f2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -78,6 +78,9 @@ struct Get_point * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` function. * + * On images that contains multiple non-connected objects, + * this functor will output points on every object. + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_gray_image` @@ -91,7 +94,8 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief Constructs points by collecting them from all connected components. + * \brief Constructs points by collecting them in all objects of the image, + * even if they are not connected. * This ensures that all points are initialized. * * @tparam OutputIterator a model of `OutputIterator` that contains points of type @@ -107,18 +111,18 @@ struct Construct_initial_points_labeled_image } /*! - * \brief Same as above, but a `TransformOperator` is used. + * \brief Same as above, but a `TransformOperator` that transforms values of the image is used. * * @tparam OutputIterator A model of `OutputIterator` that contains points of type * `std::tuple`. * @tparam MeshDomain A model of `MeshDomain_3`. * @tparam TransformOperator A functor that transforms values of the image. * It must provide the following type:
      - * `result_type`
      + * `result_type` : a type that support the '==' operator
      * and the following operator:
      - * `template`
      - * `result_type operator()(FT v)`. - * @tparam C3t3 A model of `MeshComplex_3InTriangulation_3`. + * `result_type operator()(Word v)` + * with `Word` the type of the image value. + * @tparam C3t3 A model of `MeshComplex_3InTriangulation_3` */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index ff31c5b96d7..9eee0934265 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -458,6 +458,10 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    } * \cgalParamDefault{`CGAL::Null_Functor()`, the domain's `construct_initial_points_object()` * will be called for the points initialization.} + * \cgalParamExtra{If the generator does not generate enough points, + * the domain's `construct_initial_points_object()` will be called.} + * \cgalParamExtra{If the parameter `parameters::initial_points()` is set, + * the functor will be called after insertion of the points.} * \cgalParamSectionBegin{Mesh initialization with points} * \cgalParamDescription{a `std::vector` of initial points, represented as * `std::vector>` can optionally @@ -520,8 +524,8 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); parameters::internal::Initial_points_generator_options initial_points_generator_options_param = Initial_points_generator_generator() - (choose_parameter(get_parameter(np, internal_np::initial_points_generator_options_param), - parameters::initial_points_generator().v), + (choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), + CGAL::Null_functor()), initial_points); make_mesh_3_impl(c3t3, domain, criteria, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 201c50e1e4f..c2172ed5887 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -168,6 +168,14 @@ private: bool b_; }; +// Mesh initialization +// This process has two parameters : `initial_points_generator` and `initial_points`. +// These two parameters are packed into a `Initial_points_generator_options` +// that do not know the parameters types. +// To remove the type of the `initial_points_generator` functor, two `std::function` are used. +// To remove the type of the `initial_points` container, two `Input_const_iterator_interface` are used. + +// A common interface for an iterator to a const value. template class Input_const_iterator_interface { @@ -179,6 +187,7 @@ public: virtual Input_const_iterator_interface* clone() = 0; }; +// An iterator container that implements the `Input_const_iterator_interface` interface. template struct Input_const_iterator_container : Input_const_iterator_interface @@ -217,7 +226,8 @@ private: Iterator it_; }; -// options is holding the generator (default or the user's one) +// Holds the two parameters `initial_points_generator` and `initial_points`, +// without knowing their types, into a single generator. template struct Initial_points_generator_options { @@ -245,6 +255,15 @@ struct Initial_points_generator_options } } + ~Initial_points_generator_options() + { + if (begin_it != nullptr) + delete begin_it; + if (end_it != nullptr) + delete end_it; + } + + // Firstly, the `initial_points` are inserted, then, the `initial_points_generator` is called. OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) const { add_initial_points(pts); @@ -261,9 +280,11 @@ struct Initial_points_generator_options { if (begin_it != nullptr && end_it != nullptr) { - Input_const_iterator_interface& it = *(begin_it->clone()); + Input_const_iterator_interface* it_ptr = begin_it->clone(); + Input_const_iterator_interface& it = *(it_ptr); for (; it != end_it; ++it) *pts++ = *it; + delete it_ptr; } return pts; } @@ -271,10 +292,13 @@ struct Initial_points_generator_options bool is_default() const { return is_default_; } private: + // The two functions holds the `initial_points_generator` functor const std::function initial_points_generator_no_number_of_points_; const std::function initial_points_generator_; + // The two iterators holds the `initial_points` container Input_const_iterator_interface* begin_it; Input_const_iterator_interface* end_it; + // Is the option a default-constructed one ? const bool is_default_; }; @@ -320,8 +344,9 @@ struct Domain_features_generator< MeshDomain, true > } }; -// struct Initial_points_generator_generator evaluate the options_holder -// and returns the appropriate options. +// Evaluate the two parameters `initial_points_generator` and `initial_points` +// and returns the appropriate `Initial_points_generator_options`. +// If no generator and no initial points, then use the domain's construct_initial_points_object. template struct Initial_points_generator_generator { diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index 00ffd6b769e..8fc2baca0c3 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -368,20 +368,3 @@ features(const MeshDomain& /*domain*/) typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; return CGAL_NP_BUILD(Param,Generator()()); } - -// ----------------------------------- -// Initial_points_generator_options -// ----------------------------------- -inline Named_function_parameters<::CGAL::Null_functor, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> -initial_points_generator() { - typedef Named_function_parameters<::CGAL::Null_functor, ::CGAL::internal_np::initial_points_generator_options_param_t, CGAL_NP_BASE> Param; - return CGAL_NP_BUILD(Param, ::CGAL::Null_functor()); -} - -template -inline Named_function_parameters -initial_points_generator(const InitialPointsGenerator& generator) -{ - typedef Named_function_parameters Param; - return CGAL_NP_BUILD(Param, generator); -} diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index f233d24b704..f24867aa76d 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -337,7 +337,7 @@ CGAL_add_named_parameter_with_compatibility(do_reset_c3t3_t, do_reset_c3t3, do_r CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) -CGAL_add_named_parameter_with_compatibility(initial_points_generator_options_param_t,initial_points_generator_options_param,initial_points_generator_options) +CGAL_add_named_parameter_with_compatibility(initial_points_generator_param_t,initial_points_generator_param,initial_points_generator) CGAL_add_named_parameter_with_compatibility(initial_points_param_t,initial_points_param,initial_points) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) From 58d5050d35b2b1a2d8aaec14a21d26228b50ef90 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Wed, 22 May 2024 13:05:16 +0200 Subject: [PATCH 050/332] Updated CHANGES.md --- Installation/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index e50986b2680..ab69a6cf614 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -55,6 +55,10 @@ Release date: June 2024 - Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3` which are deprecated since CGAL-4.13. +- Added two new meshing parameters that enable mesh initialization customization : + - `initial_points_generator` : enables the user to specify a functor that generate initial points. + - `initial_points` : enable the user to specify a `Range` of initial points. + ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree) - **Breaking change**: - Node splitting behavior and per-node data are now customizable via the Traits class. From c12be3782d494944bd1ef64bf66b31dfe873b7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:19:10 +0200 Subject: [PATCH 051/332] Add Euler::remove_degree_2_vertex --- .../CGAL/boost/graph/Euler_operations.h | 72 +++++++++++++++++-- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index f8c79165bc5..4ca35144f8a 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -12,10 +12,6 @@ #ifndef CGAL_EULER_OPERATIONS_H #define CGAL_EULER_OPERATIONS_H -#include -#include -#include - #include #include @@ -27,6 +23,10 @@ #include +#include +#include +#include + namespace CGAL { /// \cond SKIP_IN_MANUAL @@ -1866,10 +1866,72 @@ bool satisfies_link_condition(typename boost::graph_traits::edge_descript } /// \endcond #endif + +/// removes the target vertex of `h`, merging its incident edges into a single edge. +/// \pre `degree(target(h, g), g) == 2`. +/// \pre there is no pre-existing edge between source(h, g) and target(next(h, g), g) +template +typename boost::graph_traits::halfedge_descriptor +remove_degree_2_vertex(const typename boost::graph_traits::halfedge_descriptor h, + Graph& g) +{ + typedef boost::graph_traits Traits; + typedef typename Traits::vertex_descriptor vertex_descriptor; + typedef typename Traits::halfedge_descriptor halfedge_descriptor; + typedef typename Traits::face_descriptor face_descriptor; + + CGAL_precondition(degree(target(h, g), g) == 2); + + vertex_descriptor v = target(h, g); + halfedge_descriptor h1 = h; + halfedge_descriptor h2 = opposite(next(h1, g), g); + + if(is_border(h1, g)) + std::swap(h1, h2); + + vertex_descriptor v1 = source(h1, g); + vertex_descriptor v2 = source(h2, g); + + bool exists; + halfedge_descriptor huv; + std::tie(huv, exists) = halfedge(v1, v2, g); + if(exists) + return boost::graph_traits::null_halfedge(); + + if(is_border(h2, g)) + { + CGAL_assertion(!is_border(h1, g)); + + halfedge_descriptor oh1 = opposite(h1, g); + halfedge_descriptor nnh1 = next(next(h1, g), g); + halfedge_descriptor ph2 = prev(h2, g); + face_descriptor f1 = face(h1, g); + + set_target(h1, v2, g); + set_halfedge(v2, ph2, g); + set_next(h1, nnh1, g); + set_next(ph2, oh1, g); + set_halfedge(f1, h1, g); // in case it was nh1 + + remove_edge(edge(h2, g), g); + remove_vertex(v, g); + + return h1; + } + else + { + CGAL_assertion(!is_border(h1, g) && !is_border(h2, g)); + + halfedge_descriptor ph1 = prev(h1, g); + halfedge_descriptor ph2 = prev(h2, g); + Euler::remove_center_vertex(h, g); + return Euler::split_face(ph1, ph2, g); + } +} + /// @} } // namespace Euler - } // namespace CGAL #endif /* CGAL_EULER_OPERATIONS_H */ From 80c52020a125de6e8232b3b811bf0565b03d8e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:19:32 +0200 Subject: [PATCH 052/332] Avoid some copies --- Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp index 12e6a6ead33..6aa88f25d9c 100644 --- a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp @@ -109,7 +109,7 @@ QList CGAL_Lab_orient_soup_plugin::actions() const { << actionClean; } -void set_vcolors(SMesh* smesh, std::vector colors) +void set_vcolors(SMesh* smesh, const std::vector& colors) { typedef SMesh SMesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -123,7 +123,7 @@ void set_vcolors(SMesh* smesh, std::vector colors) vcolors[vd] = colors[color_id++]; } -void set_fcolors(SMesh* smesh, std::vector colors) +void set_fcolors(SMesh* smesh, const std::vector& colors) { typedef SMesh SMesh; typedef boost::graph_traits::face_descriptor face_descriptor; From 5664cfc520b1051f3564b649f3f58e11ee9fc350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:19:41 +0200 Subject: [PATCH 053/332] Avoid useless calls --- Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp index 6aa88f25d9c..f668a2ffa37 100644 --- a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp @@ -113,10 +113,10 @@ void set_vcolors(SMesh* smesh, const std::vector& colors) { typedef SMesh SMesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - SMesh::Property_map vcolors = - smesh->property_map("v:color").value(); + + SMesh::Property_map vcolors; bool created; - boost::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::IO::Color(0,0,0)); + std::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_vertices()); int color_id = 0; for(vertex_descriptor vd : vertices(*smesh)) @@ -127,10 +127,10 @@ void set_fcolors(SMesh* smesh, const std::vector& colors) { typedef SMesh SMesh; typedef boost::graph_traits::face_descriptor face_descriptor; - SMesh::Property_map fcolors = - smesh->property_map("f:color").value(); + + SMesh::Property_map fcolors; bool created; - boost::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::IO::Color(0,0,0)); + std::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_faces()); int color_id = 0; for(face_descriptor fd : faces(*smesh)) From bcdbaaf95398988dccd44ef7798652442b1763ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:22:03 +0200 Subject: [PATCH 054/332] Add removal of degree 2 vertices to the selection item --- Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp | 8 +++- Lab/demo/Lab/Plugins/PMP/Selection_widget.ui | 12 ++++-- .../Lab/Scene_polyhedron_selection_item.cpp | 40 +++++++++++++++---- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp index f9ce55fd6f7..d2ebcc051a2 100644 --- a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp @@ -977,13 +977,19 @@ public Q_SLOTS: } //Add vertex and face to border case 9: + { + QPixmap pm(":/cgal/Lab/resources/euler_deg2.png"); + ui_widget.docImage_Label->setPixmap(pm); + break; + } + case 10: { QPixmap pm(":/cgal/Lab/resources/add_facet1.png"); ui_widget.docImage_Label->setPixmap(pm); break; } //add facet to border - case 10: + case 11: { QPixmap pm(":/cgal/Lab/resources/add_facet2.png"); ui_widget.docImage_Label->setPixmap(pm); diff --git a/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui b/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui index f7d5f7e6302..6210dbf1e7b 100644 --- a/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui +++ b/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui @@ -6,7 +6,7 @@ 0 0 - 613 + 630 409 @@ -21,7 +21,6 @@ - 75 true @@ -72,7 +71,7 @@ - 0 + 1 @@ -618,6 +617,11 @@ Remove center vertex + + + Remove degree 2 vertex + + Add vertex and face to border (Advanced) @@ -638,7 +642,7 @@ - Instructions + Instructions diff --git a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp index 7df511b6169..e17a8804cfa 100644 --- a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp +++ b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp @@ -779,19 +779,26 @@ void Scene_polyhedron_selection_item::set_operation_mode(int mode) //set the selection type to vertex set_active_handle_type(static_cast(0)); break; - //Add vertex and face to border + //Remove degree 2 vertex case 9: - Q_EMIT updateInstructions("Select a border edge. (1/2)"); - //set the selection type to Edge - set_active_handle_type(static_cast(2)); + Q_EMIT updateInstructions("Select the vertex you want to remove." + "Warning: This will clear the undo stack."); + //set the selection type to vertex + set_active_handle_type(static_cast(0)); break; - //Add face to border + //Add vertex and face to border case 10: Q_EMIT updateInstructions("Select a border edge. (1/2)"); //set the selection type to Edge set_active_handle_type(static_cast(2)); break; + //Add face to border case 11: + Q_EMIT updateInstructions("Select a border edge. (1/2)"); + //set the selection type to Edge + set_active_handle_type(static_cast(2)); + break; + case 12: Q_EMIT updateInstructions("Select a vertex. (1/2)"); //set the selection type to Edge set_active_handle_type(static_cast(0)); @@ -1011,7 +1018,24 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::setinvalidateOpenGLBuffers(); + } + else + { + d->tempInstructions("Vertex not selected: The vertex must have degree 2 (and not be incident to a triangle)", + "Select the vertex you want to remove." + "Warning: This will clear the undo stack."); + } + break; + } + //Move point + case 12: CGAL::QGLViewer* viewer = Three::mainViewer(); const CGAL::qglviewer::Vec offset = viewer->offset(); if(viewer->manipulatedFrame() != d->manipulated_frame) @@ -1203,7 +1227,7 @@ bool Scene_polyhedron_selection_item:: treat_selection(const std::setfirst_selected) @@ -1255,7 +1279,7 @@ bool Scene_polyhedron_selection_item:: treat_selection(const std::setfirst_selected) From 0f164b166ad2933f26d49f2e468f0bd95c134704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:22:26 +0200 Subject: [PATCH 055/332] Clean up dead code --- Lab/demo/Lab/Scene_polyhedron_selection_item.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp index e17a8804cfa..29769c95ae4 100644 --- a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp +++ b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp @@ -1080,13 +1080,6 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::set= degree -/* -std::size_t facet_degree(fg_halfedge_descriptor h, const Face_graph& polyhedron) -{ - return degree(h,polyhedron); -} -*/ bool Scene_polyhedron_selection_item:: treat_selection(const std::set& selection) { VPmap vpm = get(CGAL::vertex_point, *polyhedron()); From 5392c7bde15197fe79cc521af4a22042449ef392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:22:34 +0200 Subject: [PATCH 056/332] Avoid a copy --- Lab/demo/Lab/Scene_surface_mesh_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Scene_surface_mesh_item.cpp b/Lab/demo/Lab/Scene_surface_mesh_item.cpp index 30e0d59ab83..35db3200f7f 100644 --- a/Lab/demo/Lab/Scene_surface_mesh_item.cpp +++ b/Lab/demo/Lab/Scene_surface_mesh_item.cpp @@ -545,7 +545,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } if(name.testFlag(Scene_item_rendering_helper::NORMALS)) { - EPICK::Vector_3 n = fnormals[fd]; + const EPICK::Vector_3& n = fnormals[fd]; CPF::add_normal_in_buffer(n, flat_normals); } if(name.testFlag(Scene_item_rendering_helper::COLORS)) From e8492605a22367ad813d087ae2f822512b07c14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 May 2024 16:22:41 +0200 Subject: [PATCH 057/332] Fix typo --- Lab/demo/Lab/Scene_surface_mesh_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Scene_surface_mesh_item.cpp b/Lab/demo/Lab/Scene_surface_mesh_item.cpp index 35db3200f7f..cf8ed877f77 100644 --- a/Lab/demo/Lab/Scene_surface_mesh_item.cpp +++ b/Lab/demo/Lab/Scene_surface_mesh_item.cpp @@ -553,7 +553,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: if(has_fpatch_id) { //The sharp features detection produces patch ids >=1, this - //is meant to insure the wanted id is in the range [min,max] + //is meant to ensure the wanted id is in the range [min,max] QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; CGAL::IO::Color color(c.red(),c.green(),c.blue()); CPF::add_color_in_buffer(color, f_colors); From c10dcf7daf6ba7fa8b382043a220430618492a9b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Jun 2024 18:18:59 +0200 Subject: [PATCH 058/332] allow to call save_binary_file on non-C3t3 type (like a CDT_3) --- SMDS_3/include/CGAL/IO/File_binary_mesh_3.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SMDS_3/include/CGAL/IO/File_binary_mesh_3.h b/SMDS_3/include/CGAL/IO/File_binary_mesh_3.h index e7363047a92..9d3aa0c5d22 100644 --- a/SMDS_3/include/CGAL/IO/File_binary_mesh_3.h +++ b/SMDS_3/include/CGAL/IO/File_binary_mesh_3.h @@ -46,14 +46,13 @@ save_binary_file(std::ostream& os, , bool binary = true) #endif { - typedef typename C3T3::Triangulation::Geom_traits::FT FT; if(binary) os << "binary "; os << "CGAL c3t3 " << CGAL::Get_io_signature()() << "\n"; if(binary) { CGAL::IO::set_binary_mode(os); } else { CGAL::IO::set_ascii_mode(os); - os.precision(std::numeric_limits::digits10+2); + os.precision(std::numeric_limits::max_digits10); } return !!(os << c3t3); // call operator!() twice, because operator bool() is C++11 From 93fd96644c9e2a1aab33433880afada3e4eed02c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 15 Apr 2024 11:03:20 +0200 Subject: [PATCH 059/332] use boost::unordered_flat_map to optimize Polyline_constraint_hierarchy_2 --- .../Polyline_constraint_hierarchy_2.h | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 73a7db231ac..b96752e91fe 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -21,6 +21,15 @@ #include #include #include + +#include +#if BOOST_VERSION >= 108100 +# include +# define CGAL_USE_BOOST_UNORDERED 1 +#else // BOOST before 1.81.0 +# include +#endif + #include #include @@ -134,24 +143,6 @@ public: } }; - class Pair_compare { - Compare comp; - - public: - Pair_compare(const Compare& comp) : comp(comp) {} - - bool operator()(const Edge& e1, const Edge& e2) const { - if(comp(e1.first, e2.first)) { - return true; - } else if((! comp(e2.first, e1.first)) && // !less(e1,e2) && !less(e2,e1) == equal - comp(e1.second, e2.second)) { - return true; - } else { - return false; - } - } - }; - class Context { friend class Polyline_constraint_hierarchy_2; private: @@ -171,8 +162,11 @@ public: typedef typename Context_list::iterator Context_iterator; typedef std::set Constraint_set; - typedef std::map Sc_to_c_map; +#if CGAL_USE_BOOST_UNORDERED + typedef boost::unordered_flat_map> Sc_to_c_map; +#else + typedef std::unordered_map> Sc_to_c_map; +#endif typedef typename Constraint_set::iterator C_iterator; typedef typename Sc_to_c_map::const_iterator Sc_iterator; typedef Sc_iterator Subconstraint_iterator; @@ -186,7 +180,7 @@ private: public: Polyline_constraint_hierarchy_2(const Compare& comp) : comp(comp) - , sc_to_c_map(Pair_compare(comp)) + , sc_to_c_map() { } Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch); Polyline_constraint_hierarchy_2(Polyline_constraint_hierarchy_2&&) = default; @@ -290,7 +284,7 @@ template Polyline_constraint_hierarchy_2:: Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch) : comp(ch.comp) - , sc_to_c_map(Pair_compare(comp)) + , sc_to_c_map() { copy(ch); } From 82b53596fd6beaaf6c5accf2182cbdd3553b3365 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 13 Jun 2024 16:31:32 +0200 Subject: [PATCH 060/332] Mesh_2: sort the sequence tr.subconstraints_begin(), tr.subconstraints_end() --- Mesh_2/include/CGAL/Mesh_2/Refine_edges.h | 24 ++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 852ec07faf0..b2bb3b50b3d 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -346,12 +346,26 @@ protected: { // with constraint hierarchy - for(typename Tr::Subconstraint_iterator it = tr.subconstraints_begin(); - it != tr.subconstraints_end(); ++it) - { - const Vertex_handle& v1 = it->first.first; - const Vertex_handle& v2 = it->first.second; + // create a vector of pairs of vertex handles, from the subconstraints + // and sort it to ensure the determinism + std::vector> subconstraints_vector(tr.number_of_subconstraints()); + std::transform(tr.subconstraints_begin(), tr.subconstraints_end(), subconstraints_vector.begin(), + [](const auto& sc) { + return std::array{sc.first.first, sc.first.second}; + }); + auto comp_vh = [&] (Vertex_handle va, Vertex_handle vb) { + return tr.compare_xy(va->point(), vb->point()) == SMALLER; + }; + auto comp_pair_vh = [&] (const auto& e1, const auto& e2) { + return comp_vh(e1[0], e2[0]) || + (!comp_vh(e2[0], e1[0]) && comp_vh(e1[1], e2[1])); + }; + + std::sort(subconstraints_vector.begin(), subconstraints_vector.end(), comp_pair_vh); + + for(const auto& [v1, v2] : subconstraints_vector) + { if(!is_locally_conform(tr, v1, v2) ){ add_constrained_edge_to_be_conformed(v1, v2); } From 2f25527e94aa8883b2a215dc0347325f09c5197b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 11:54:52 +0200 Subject: [PATCH 061/332] "at least n" --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 4a4e363d237..11a47461cce 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -19,7 +19,7 @@ public: /// @{ /*! -Outputs a set of `n` surface points to the +Outputs a set of at least `n` surface points to the output iterator `pts`, as objects of type `std::tuple`. `Weighted_point_3` is the point's position and weight, @@ -35,14 +35,14 @@ output iterator `pts`, as objects of type @param c3t3 the input complex @param n an estimation of the number of points to output. A generator can choose to ignore this parameter. -If a generator does not output enough points, then more points will be added automatically. +If it does not output enough points, then more points will be added automatically. */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n); /*! -Output a set of surface points to the +Outputs a set of surface points to the output iterator `pts`, as objects of type `std::tuple`. `Weighted_point_3` is the point's position and weight, From 86edcf8e04c7573d4b64084f8ed8d3abc22841e8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 11:55:31 +0200 Subject: [PATCH 062/332] rename Functions to Functors --- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index d1095639e14..5022fc0c026 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -29,7 +29,7 @@ /// The two main functions to generate a mesh are `make_mesh_3()` and `refine_mesh_3()`. /// The other functions enable to optimize an existing mesh. -/// \defgroup PkgMesh3Initializers Mesh Initialization Functions +/// \defgroup PkgMesh3Initializers Mesh Initialization Functors /// \ingroup PkgMesh3Ref /// The functors in this group perform mesh initialization by providing initial points. /// \defgroup PkgMesh3Parameters Parameter Functions From b75443637a85ca855be02340000cff2cb2f12ae6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 12:26:44 +0200 Subject: [PATCH 063/332] tell more about the "all connected components" thing --- .../Construct_initial_points_gray_image.h | 23 ++++++---- .../Construct_initial_points_labeled_image.h | 44 +++++++++++-------- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index fff140d0644..08d0f62d806 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -31,8 +31,9 @@ namespace CGAL * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * - * On images that contains multiple non-connected objects, - * this functor will output points on every object. + * On images that contain multiple non-connected components, + * this functor will scan the full image and + * output points on every component. * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` @@ -53,15 +54,19 @@ struct Construct_initial_points_gray_image , iso_value_(iso_value) , image_values_to_subdomain_indices_(image_values_to_subdomain_indices) { } + /*! - * \brief Constructs points by collecting them in all objects of the image, - * even if they are not connected. - * This guarantees to initialize all objects + * \brief Constructs points by collecting them on the surface of all objects + * in the image, + * even if they are non-connected components. + * Using this functor guarantees to initialize each connected component. * - * \tparam OutputIterator An `OutputIterator` of points of type - * `std::tuple`. - * \tparam MeshDomain A model of `MeshDomain_3`. - * \tparam C3t3 A model of `MeshComplex_3InTriangulation_3`. + * \tparam OutputIterator model of `OutputIterator`, collecting points of type + * `std::tuple` + * \tparam MeshDomain model of `MeshDomain_3` + * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * + * \param n a lower bound on the number of points to be constructed */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 24db92793f2..e1b4c689908 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -76,10 +76,11 @@ struct Get_point * Functor for generating initial points in labeled images. * This functor is a model of the `InitialPointsGenerator` concept, * and can be passed as a parameter to `CGAL::make_mesh_3` using the - * `CGAL::parameters::initial_points_generator()` function. + * `CGAL::parameters::initial_points_generator()` parameter function. * - * On images that contains multiple non-connected objects, - * this functor will output points on every object. + * On images that contain multiple non-connected components, + * this functor scans the complete image and + * outputs points to initialize each component. * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` @@ -94,14 +95,17 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief Constructs points by collecting them in all objects of the image, - * even if they are not connected. - * This ensures that all points are initialized. + * \brief Constructs points by scanning the image and + * collecting points in each object in the image, + * even if they are non-connected components. + * This ensures that each component will be initialized. * - * @tparam OutputIterator a model of `OutputIterator` that contains points of type + * @tparam OutputIterator model of `OutputIterator` that contains points of type * `std::tuple` - * @tparam MeshDomain a model of `MeshDomain_3` - * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain model of `MeshDomain_3` + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * + * @param n a lower bound on the number of constructed points */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const @@ -113,16 +117,18 @@ struct Construct_initial_points_labeled_image /*! * \brief Same as above, but a `TransformOperator` that transforms values of the image is used. * - * @tparam OutputIterator A model of `OutputIterator` that contains points of type - * `std::tuple`. - * @tparam MeshDomain A model of `MeshDomain_3`. - * @tparam TransformOperator A functor that transforms values of the image. - * It must provide the following type:
    - * `result_type` : a type that support the '==' operator
    - * and the following operator:
    - * `result_type operator()(Word v)` - * with `Word` the type of the image value. - * @tparam C3t3 A model of `MeshComplex_3InTriangulation_3` + * @tparam OutputIterator model of `OutputIterator` that contains points of type + * `std::tuple` + * @tparam MeshDomain model of `MeshDomain_3` + * @tparam TransformOperator functor that transforms values of the image. + * It must provide the following type:
    + * `result_type` : a type that supports the '==' operator
    + * and the following operator:
    + * `result_type operator()(Word v)` + * with `Word` the type of the image values. + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * + * @param n a lower bound on the number of constructed points */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const From f09c8d9a57b55a7ef63e051b5a45920eb23461ea Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 12:26:56 +0200 Subject: [PATCH 064/332] cleaning --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 003ced5956a..4e400391ba1 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -454,14 +454,17 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points_generator()` allows the user to specify a functor that follows the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor will be called for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. + * The function `parameters::initial_points_generator()` allows the user to specify a functor that follows + * the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor will be called + * for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior + * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * * If the generator does not generate enough points, the domain's `construct_initial_points_object()` will be called. * If the parameter `parameters::initial_points()` is set, the functor will be called after insertion of the points. * * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept * - * @param generator an instance of the InitialPointsGenerator functor + * @param generator an instance of `InitialPointsGenerator` * * \cgalHeading{Example} * @@ -477,7 +480,10 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points()` allows the user to specify a container model of `Range` that contains initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` should have elements of type `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, `int` represents the dimension of the minimal subcomplex on which the point lies, and `Index` represents the underlying subcomplex index. + * The function `parameters::initial_points()` allows the user to specify a container model of `Range` that contains + * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` should have elements of type + * `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, + * `int` represents the dimension of the minimal subcomplex on which the point lies, and `Index` represents the underlying subcomplex index. * * If this parameter is set, the domain's `construct_initial_points_object()` will not be called. * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. From a36074788f55a248761d4d61638e5a07db3e4276 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 12:31:18 +0200 Subject: [PATCH 065/332] typos --- Installation/CHANGES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index ab69a6cf614..410efd7d7a9 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -55,9 +55,9 @@ Release date: June 2024 - Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3` which are deprecated since CGAL-4.13. -- Added two new meshing parameters that enable mesh initialization customization : - - `initial_points_generator` : enables the user to specify a functor that generate initial points. - - `initial_points` : enable the user to specify a `Range` of initial points. +- Added two new meshing parameters that enable mesh initialization customization : + - `initial_points_generator` : enables the user to specify a functor that generates initial points. + - `initial_points` : enables the user to specify a `Range` of initial points. ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree) - **Breaking change**: From 4d40a050c3a7532c4155d943721f7582687be3f1 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 12:52:49 +0200 Subject: [PATCH 066/332] doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 21 +++++++++++-------- .../Mesh_3/Concepts/InitialPointsGenerator.h | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 4e400391ba1..babe7a9f9a1 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -454,36 +454,38 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points_generator()` allows the user to specify a functor that follows - * the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor will be called + * The function `parameters::initial_points_generator()` enables the user to specify a functor that follows + * the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor is called * for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * + * If the parameter `parameters::initial_points()` is used, the points it provides are inserted before any other initialization. + * * If the generator does not generate enough points, the domain's `construct_initial_points_object()` will be called. - * If the parameter `parameters::initial_points()` is set, the functor will be called after insertion of the points. * * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept * - * @param generator an instance of `InitialPointsGenerator` + * @param generator an instance of `InitialPointsGenerator` * * \cgalHeading{Example} * * \snippet mesh_3D_image_with_image_initialization.cpp Meshing * - * \sa `CGAL::parameters::initial_points()` * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::parameters::initial_points()` * \sa `MeshDomain_3::Construct_initial_points` * */ template unspecified_type initial_points_generator(const InitialPointsGenerator& generator); + /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points()` allows the user to specify a container model of `Range` that contains - * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` should have elements of type + * The function `parameters::initial_points()` enables the user to specify a container model of `Range` that contains + * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` contains elements of type * `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, - * `int` represents the dimension of the minimal subcomplex on which the point lies, and `Index` represents the underlying subcomplex index. + * `int` the dimension of the minimal subcomplex on which the point lies, and `Index` the corresponding subcomplex index. * * If this parameter is set, the domain's `construct_initial_points_object()` will not be called. * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. @@ -491,7 +493,8 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \tparam MeshDomain a model of `MeshDomain_3` * \tparam C3t3 a model of `MeshComplex_3InTriangulation_3` * - * @param initial_points a `Range` that contains points of type `std::tuple` + * @param initial_points a `Range` that contains points of type + * `std::tuple` * * \cgalHeading{Example} * diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 11a47461cce..d14a7ae1f87 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -24,7 +24,7 @@ output iterator `pts`, as objects of type `std::tuple`. `Weighted_point_3` is the point's position and weight, `int` is the dimension of the minimal dimension subcomplex on which the point lies, and -`Index` is the underlying subcomplex index. +`Index` is the corresponding subcomplex index. @tparam OutputIterator model of `OutputIterator`, containing points of type `std::tuple` @@ -47,7 +47,7 @@ output iterator `pts`, as objects of type `std::tuple`. `Weighted_point_3` is the point's position and weight, `int` is the dimension of the minimal dimension subcomplex on which the point lies, and -`Index` is the underlying subcomplex index. +`Index` is the corresponding subcomplex index. Since there is no `n` given like above, the functor must provide enough points to initialize the mesh generation process. From 636fceb129bd2144837415b4919e32d52f2d7f5c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 14:41:21 +0200 Subject: [PATCH 067/332] remove the hardly readable std::tuple and use MeshDomain::Intersection instead --- .../doc/Mesh_3/Concepts/InitialPointsGenerator.h | 14 ++++---------- .../Mesh_3/Construct_initial_points_gray_image.h | 2 +- .../Construct_initial_points_labeled_image.h | 4 ++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index d14a7ae1f87..3a9776ffcbd 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -21,13 +21,10 @@ public: /*! Outputs a set of at least `n` surface points to the output iterator `pts`, as objects of type -`std::tuple`. -`Weighted_point_3` is the point's position and weight, -`int` is the dimension of the minimal dimension subcomplex on which the point lies, and -`Index` is the corresponding subcomplex index. +`MeshDomain::Intersection`. @tparam OutputIterator model of `OutputIterator`, containing points of type -`std::tuple` +`MeshDomain::Intersection` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` @param pts the output points @@ -44,15 +41,12 @@ OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3 /*! Outputs a set of surface points to the output iterator `pts`, as objects of type -`std::tuple`. -`Weighted_point_3` is the point's position and weight, -`int` is the dimension of the minimal dimension subcomplex on which the point lies, and -`Index` is the corresponding subcomplex index. +`MeshDomain::Intersection`. Since there is no `n` given like above, the functor must provide enough points to initialize the mesh generation process. @tparam OutputIterator model of `OutputIterator`, containing points of type -`std::tuple` + `MeshDomain::Intersection` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 08d0f62d806..2acf6538916 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -62,7 +62,7 @@ struct Construct_initial_points_gray_image * Using this functor guarantees to initialize each connected component. * * \tparam OutputIterator model of `OutputIterator`, collecting points of type - * `std::tuple` + * `MeshDomain::Intersection` * \tparam MeshDomain model of `MeshDomain_3` * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` * diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index e1b4c689908..d5a137d9e7e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -101,7 +101,7 @@ struct Construct_initial_points_labeled_image * This ensures that each component will be initialized. * * @tparam OutputIterator model of `OutputIterator` that contains points of type - * `std::tuple` + * `MeshDomain::Intersection` * @tparam MeshDomain model of `MeshDomain_3` * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` * @@ -118,7 +118,7 @@ struct Construct_initial_points_labeled_image * \brief Same as above, but a `TransformOperator` that transforms values of the image is used. * * @tparam OutputIterator model of `OutputIterator` that contains points of type - * `std::tuple` + * `MeshDomain::Intersection` * @tparam MeshDomain model of `MeshDomain_3` * @tparam TransformOperator functor that transforms values of the image. * It must provide the following type:
    From c55477cda3592261887e0e41327863ade0841ee0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 14:48:28 +0200 Subject: [PATCH 068/332] document n --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 8 ++++---- .../CGAL/Mesh_3/Construct_initial_points_gray_image.h | 3 +-- .../CGAL/Mesh_3/Construct_initial_points_labeled_image.h | 7 ++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 3a9776ffcbd..ff9934dd44d 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -19,7 +19,7 @@ public: /// @{ /*! -Outputs a set of at least `n` surface points to the +Outputs a set of surface points, for mesh initialization, to the output iterator `pts`, as objects of type `MeshDomain::Intersection`. @@ -27,19 +27,19 @@ output iterator `pts`, as objects of type `MeshDomain::Intersection` @tparam MeshDomain model of `MeshDomain_3` @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + @param pts the output points @param domain the input domain @param c3t3 the input complex -@param n an estimation of the number of points to output. +@param n a lower bound on the number of points to construct for initialization. A generator can choose to ignore this parameter. If it does not output enough points, then more points will be added automatically. - */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n); /*! -Outputs a set of surface points to the +Outputs a set of surface points, for mesh initialization, to the output iterator `pts`, as objects of type `MeshDomain::Intersection`. Since there is no `n` given like above, the functor must provide enough diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 2acf6538916..19ae3698780 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -56,7 +56,7 @@ struct Construct_initial_points_gray_image { } /*! - * \brief Constructs points by collecting them on the surface of all objects + * \brief Constructs at least `n` points by collecting them on the surface of all objects * in the image, * even if they are non-connected components. * Using this functor guarantees to initialize each connected component. @@ -66,7 +66,6 @@ struct Construct_initial_points_gray_image * \tparam MeshDomain model of `MeshDomain_3` * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` * - * \param n a lower bound on the number of points to be constructed */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index d5a137d9e7e..dd57a09a1c4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -95,7 +95,8 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief Constructs points by scanning the image and + * \brief Constructs at least `n` initial points, + * by scanning the image and * collecting points in each object in the image, * even if they are non-connected components. * This ensures that each component will be initialized. @@ -104,8 +105,6 @@ struct Construct_initial_points_labeled_image * `MeshDomain::Intersection` * @tparam MeshDomain model of `MeshDomain_3` * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` - * - * @param n a lower bound on the number of constructed points */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const @@ -127,8 +126,6 @@ struct Construct_initial_points_labeled_image * `result_type operator()(Word v)` * with `Word` the type of the image values. * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` - * - * @param n a lower bound on the number of constructed points */ template OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const From ce9cd9e596ac7f811d3cba62fa73c30d47b47306 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 17 Sep 2024 18:02:36 +0200 Subject: [PATCH 069/332] wip PR https://github.com/CGAL/cgal/pull/7798 --- ...sh_3D_image_with_custom_initialization.cpp | 26 +-- .../mesh_3D_image_with_initial_points.cpp | 4 +- .../Construct_initial_points_labeled_image.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 172 ++++++++++------- .../internal/mesh_option_classes.h | 180 ++++++------------ 5 files changed, 168 insertions(+), 216 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 8ba0e155f2f..400b9df6be2 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -35,22 +35,23 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; namespace params = CGAL::parameters; -// Custom_Initial_points_generator will put points on the mesh for initialisation. +// Custom_initial_points_generator will put points on the mesh for initialisation. // Those points are objects of type std::tuple. // Weighted_point_3 is the point's position and weight, // int is the dimension of the minimal dimension subcomplex on which the point lies, // Index is the underlying subcomplex index. -struct Custom_Initial_points_generator +struct Custom_initial_points_generator { - CGAL::Image_3& image_; - Custom_Initial_points_generator(CGAL::Image_3& image) : image_(image) { } + const CGAL::Image_3& image_; - template - OutputIterator operator()(OutputIterator pts, const MeshDomain& /* domain */, const C3t3& c3t3, int /* n */ = 1) const + template + OutputIterator operator()(OutputIterator pts) const { - typedef typename C3t3::Triangulation::Geom_traits::Point_3 Point_3; - typedef typename C3t3::Triangulation::Geom_traits::Vector_3 Vector_3; - typedef typename C3t3::Triangulation::Geom_traits::Segment_3 Segment_3; + typedef Tr::Geom_traits Gt; + typedef Gt::Point_3 Point_3; + typedef Gt::Vector_3 Vector_3; + typedef Gt::Segment_3 Segment_3; + typedef Mesh_domain::Index Index; typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); @@ -64,10 +65,11 @@ struct Custom_Initial_points_generator Vector_3 vector = segment.to_vector(); double edge_size = 5; std::size_t nb = static_cast(CGAL::sqrt(segment.squared_length()) / edge_size); + const double frac = 1. / (double)nb; + for (std::size_t i = 1; i < nb; i++) { - *pts++ = std::make_tuple( - cwp(source + (i/(double)nb)*vector, edge_size*edge_size), 1, 0); + *pts++ = {cwp(source + (i * frac) * vector), 1, Index(1)); } return pts; } @@ -95,7 +97,7 @@ int main() /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(Custom_Initial_points_generator(image)) + , params::initial_points_generator(Custom_initial_points_generator{ image }) ); /// [Meshing] diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index 8487875382c..7b7e0cb41ea 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -62,8 +62,8 @@ int main() // Creation of the initial_points vector std::vector initial_points = { - std::make_tuple(Weighted_point_3(Point_3(30.0, 50.0, 83.33), 30.0), 1, 0), - std::make_tuple(Weighted_point_3(Point_3(70.0, 50.0, 83.33), 50.0), 1, 0) + {Weighted_point_3(Point_3(30.0, 50.0, 83.33), 30.0), 1, Index(1)}, + {Weighted_point_3(Point_3(70.0, 50.0, 83.33), 50.0), 1, Index(1)} }; /// [Meshing] diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index dd57a09a1c4..8c8ae6e4839 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -293,7 +293,7 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = std::make_tuple(cwp(intersect_point), 2, intersect_index); // dimension 2 by construction, points are on surface + *pts++ = {cwp(intersect_point), 2, intersect_index}; // dimension 2 by construction, points are on surface } } } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 9eee0934265..80a47480a4d 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -38,38 +38,55 @@ namespace CGAL { namespace Mesh_3 { namespace internal { -template < typename C3T3, typename MeshDomain, typename MeshCriteria > +template < typename C3T3, typename MeshDomain, typename InitialPointsGenerator > void -add_points_from_generator(C3T3& c3t3, const MeshDomain& domain, +add_points_from_generator(C3T3& c3t3, + const MeshDomain& domain, const int nb_initial_points, - const parameters::internal::Initial_points_generator_options& generator) + const InitialPointsGenerator& generator) { typedef typename C3T3::Triangulation Tr; - - typedef typename Tr::Geom_traits::Weighted_point_3 Weighted_point_3; - typedef typename MeshDomain::Index Index; - typedef typename std::tuple Initialization_point; - typedef std::vector< Initialization_point > Initial_points_vector; - typedef typename C3T3::Vertex_handle Vertex_handle; typedef CGAL::Mesh_3::Triangulation_helpers Th; - // Mesh initialization : get some points and add them to the mesh - Initial_points_vector initial_points; - if (nb_initial_points > -1) - generator(std::back_inserter(initial_points), domain, c3t3, - nb_initial_points); - else //use default number of points - generator(std::back_inserter(initial_points), domain, c3t3); + using Point_3 = typename Tr::Geom_traits::Point_3; + using Index = typename MeshDomain::Index; + using PointIndexPair = std::pair; + using PointDimIndex = parameters::internal::Initial_point_type; + + struct InitialPointPair2TupleConverter + { + PointDimIndex operator()(const PointDimIndex& wp_d_i) const + { + return wp_d_i; + } + PointDimIndex operator()(const PointIndexPair& p_i) const + { + auto cwp = Tr::Geom_traits().construct_weighted_point_3_object(); + return PointDimIndex{ cwp(p_i.first), 2, p_i.second }; + } + }; + + std::vector initial_points; + InitialPointPair2TupleConverter pair2tuple; + auto push_initial_point = [&](const auto& initial_pt)->void + { + initial_points.push_back(pair2tuple(initial_pt)); + }; + + if (nb_initial_points > 0) + generator(boost::make_function_output_iterator(push_initial_point), nb_initial_points); + else + generator(boost::make_function_output_iterator(push_initial_point)); - Tr& triangulation = c3t3.triangulation(); // Insert points and set their index and dimension - for (const auto& [weighted_point_3, dimension, index] : initial_points) { - if(Th().inside_protecting_balls(triangulation, Vertex_handle(), weighted_point_3.point())) + for (const auto& [wpoint, dimension, index] : initial_points) + { + if(Th().inside_protecting_balls(c3t3.triangulation(), Vertex_handle(), wpoint.point())) continue; - Vertex_handle v = c3t3.triangulation().insert(weighted_point_3); + Vertex_handle v = c3t3.triangulation().insert(wpoint); // v could be null if point is hidden if ( v != Vertex_handle() ) @@ -80,18 +97,19 @@ add_points_from_generator(C3T3& c3t3, const MeshDomain& domain, } } -template < typename C3T3, typename MeshDomain, typename MeshCriteria > +template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitializationOptions> void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, - const parameters::internal::Initial_points_generator_options& generator = parameters::internal::Initial_points_generator_generator()()) + const InitializationOptions& init_generator) { - add_points_from_generator(c3t3, domain, nb_initial_points, generator); + add_points_from_generator(c3t3, domain, nb_initial_points, init_generator); // If c3t3 initialization is not sufficient (may happen if // the user has not specified enough points ), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3 || !generator.is_default(); - if(!need_more_init) { + bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_generator.is_default(); + if(!need_more_init) + { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); helper.update_restricted_facets(); @@ -106,10 +124,10 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, } } } - if(need_more_init) { - parameters::internal::Initial_points_generator_options domain_generator = - parameters::internal::Initial_points_generator_generator()(); - add_points_from_generator(c3t3, domain, nb_initial_points, domain_generator); + if(need_more_init) + { + InitializationOptions init_options(domain.construct_initial_points_object()); + add_points_from_generator(c3t3, domain, nb_initial_points, init_options); } } @@ -196,23 +214,22 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria, bool MeshDomainHasHasFeatures, - typename HasFeatures = int> + typename HasFeatures, + typename InitOptions> struct C3t3_initializer { }; // Partial specialization of C3t3_initializer // Handle cases where MeshDomain::Has_features is not a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures> -struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures > +template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitOptions> +struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitOptions > { typedef parameters::internal::Mesh_3_options Mesh_3_options; - typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const Initial_points_generator_options& generator = Initial_points_generator_generator()()) + const InitOptions& init_options = InitOptions()) { if ( with_features ) { @@ -221,48 +238,47 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures > } init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points, generator); + mesh_options.number_of_initial_points, + init_options); } }; // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures > -struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures > +template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitOptions> +struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitOptions> { typedef parameters::internal::Mesh_3_options Mesh_3_options; - typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; + void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const Initial_points_generator_options& generator = Initial_points_generator_generator()()) + const InitOptions& init_options = InitOptions()) { - C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features >() - (c3t3,domain,criteria,with_features,mesh_options,generator); + C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitOptions >() + (c3t3,domain,criteria,with_features,mesh_options,init_options); } }; // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_true -template < typename C3T3, typename MD, typename MC > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > +template < typename C3T3, typename MD, typename MC, typename InitOptions > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitOptions > : public C3t3_initializer_base < C3T3, MD, MC > { virtual ~C3t3_initializer() { } typedef parameters::internal::Mesh_3_options Mesh_3_options; - typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; + void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const Initial_points_generator_options& generator = Initial_points_generator_generator()()) + const InitOptions& init_options = InitOptions()) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -270,7 +286,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > // If c3t3 initialization is not sufficient (may happen if there is only // a planar curve as feature for example), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3 || !generator.is_default(); + bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_options.is_default(); if(!need_more_init) { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); helper.update_restricted_facets(); @@ -288,29 +304,28 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > } if(need_more_init) { init_c3t3(c3t3, domain, criteria, - mesh_options.number_of_initial_points, generator); + mesh_options.number_of_initial_points, init_options); } } else { init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points, generator); } + mesh_options.number_of_initial_points, init_options); } } }; // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_false -template < typename C3T3, typename MD, typename MC > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > +template < typename C3T3, typename MD, typename MC, typename InitOptions > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitOptions > { typedef parameters::internal::Mesh_3_options Mesh_3_options; - typedef parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef parameters::internal::Initial_points_generator_generator Initial_points_generator_generator; + typedef parameters::internal::Initialization_options Initialization_options; void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const Initial_points_generator_options& generator = Initial_points_generator_generator()()) + const Initialization_options& init_options = Initialization_options()) { if ( with_features ) { @@ -319,7 +334,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > } init_c3t3(c3t3,domain,criteria, - mesh_options.number_of_initial_points, generator); + mesh_options.number_of_initial_points, init_options); } }; @@ -517,22 +532,28 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - using Initial_points_generator_generator = parameters::internal::Initial_points_generator_generator; - using Value_type = typename Initial_points_generator_generator::Value_type; - std::vector empty_vec; - const auto& initial_points - = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); - parameters::internal::Initial_points_generator_options initial_points_generator_options_param = - Initial_points_generator_generator() - (choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), - CGAL::Null_functor()), - initial_points); + // range of initial points + using Initial_point = parameters::internal::Initial_point_type; + using Initial_points_range_ref = typename internal_np::Lookup_named_param_def>::type; + std::vector empty_vec; + const Initial_points_range_ref initial_points = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); + + // initial points generator + using Initial_points_generator = typename internal_np::Lookup_named_param_def::reference; + Initial_points_generator initial_points_generator = choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), + domain.construct_initial_points_object()); + const parameters::internal::Initialization_options + initial_points_gen_param(initial_points_generator, initial_points); make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, features_param.features(), mesh_options_param, manifold_options_param, - initial_points_generator_options_param); + initial_points_gen_param); return c3t3; } @@ -561,7 +582,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, * * @return The mesh as a C3T3 object */ -template +template void make_mesh_3_impl(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, @@ -574,25 +595,28 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - const parameters::internal::Initial_points_generator_options& - initial_points_generator_options = parameters::internal::Initial_points_generator_generator()()) + const parameters::internal::Initialization_options& + initialization_options = parameters::internal::Initialization_options()) { -// InitialPointsGenerator& generator = Null_functor_internal::default_null_functor #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); #endif + using Init_options = parameters::internal::Initialization_options; + // Initialize c3t3 Mesh_3::internal::C3t3_initializer< C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value > () (c3t3, + ::CGAL::internal::has_Has_features::value, + int, + Init_options>() (c3t3, domain, criteria, with_features, mesh_options, - initial_points_generator_options); + initialization_options); CGAL_assertion( c3t3.triangulation().dimension() >= 2 ); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index c2172ed5887..14b9cdebef6 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -15,6 +15,8 @@ #include #include +#include +#include namespace CGAL { @@ -169,135 +171,59 @@ private: }; // Mesh initialization -// This process has two parameters : `initial_points_generator` and `initial_points`. -// These two parameters are packed into a `Initial_points_generator_options` -// that do not know the parameters types. -// To remove the type of the `initial_points_generator` functor, two `std::function` are used. -// To remove the type of the `initial_points` container, two `Input_const_iterator_interface` are used. -// A common interface for an iterator to a const value. -template -class Input_const_iterator_interface +template +struct Initial_point_type { -public: - virtual ~Input_const_iterator_interface() {} - virtual const Value& operator*() = 0; - virtual Input_const_iterator_interface* operator++() = 0; - virtual bool operator!=(const Input_const_iterator_interface* other) const = 0; - virtual Input_const_iterator_interface* clone() = 0; -}; - -// An iterator container that implements the `Input_const_iterator_interface` interface. -template -struct Input_const_iterator_container - : Input_const_iterator_interface -{ - typedef Input_const_iterator_container Self; -public: - Input_const_iterator_container(const Iterator& it) : it_(it) {} - - ~Input_const_iterator_container() override {} - - const Value& operator*() override - { - return *it_; - } - - Input_const_iterator_interface* operator++() override - { - ++it_; - return this; - } - - bool operator!=(const Input_const_iterator_interface* other) const override - { - const Self* other_casted = dynamic_cast(other); - if (other_casted == nullptr) - return true; - return it_ != other_casted->it_; - } - - Input_const_iterator_interface* clone() override - { - return new Input_const_iterator_container(it_); - } - -private: - Iterator it_; + typename C3t3::Triangulation::Point m_point; + int m_dimension; + typename MeshDomain::Index m_index; }; // Holds the two parameters `initial_points_generator` and `initial_points`, // without knowing their types, into a single generator. -template -struct Initial_points_generator_options +template > > +struct Initialization_options { - typedef typename C3t3::Triangulation::Geom_traits::Weighted_point_3 Weighted_point_3; - typedef typename MeshDomain::Index Index; - typedef typename std::tuple Value_type; - typedef typename std::back_insert_iterator> OutputIterator; + using DefaultGenerator = typename MeshDomain::Construct_initial_points; + using Initial_points_const_iterator = typename InitialPointsRange::const_iterator; + using Initial_point = typename std::iterator_traits::value_type; - template - Initial_points_generator_options(const Initial_points_generator& generator, const Initial_points& initial_points, bool is_default = false) - : initial_points_generator_no_number_of_points_(generator) - , initial_points_generator_(generator) - , is_default_(is_default && initial_points.size() == 0) - { - if (initial_points.size() == 0) - { - begin_it = nullptr; - end_it = nullptr; - } - else - { - using Iterator_type = typename Initial_points::const_iterator; - begin_it = new Input_const_iterator_container(initial_points.cbegin()); - end_it = new Input_const_iterator_container(initial_points.cend()); - } - } + Initialization_options() + : is_default_(true) + {} - ~Initial_points_generator_options() - { - if (begin_it != nullptr) - delete begin_it; - if (end_it != nullptr) - delete end_it; - } + Initialization_options(const InitialPointsGenerator& generator, + const InitialPointsRange& initial_points = InitialPointsRange()) + : initial_points_generator_(generator) + , begin_it(initial_points.begin()) + , end_it(initial_points.end()) + , is_default_(boost::is_same::value + && std::empty(initial_points)) + {} - // Firstly, the `initial_points` are inserted, then, the `initial_points_generator` is called. - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) const + template + OutputIterator operator()(OutputIterator pts, int n = 0) const { - add_initial_points(pts); - return initial_points_generator_no_number_of_points_(pts, domain, c3t3); - } + // add initial_points + for (typename InitialPointsRange::const_iterator it = begin_it; it != end_it; ++it) + *pts++ = *it; - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) const - { - add_initial_points(pts); - return initial_points_generator_(pts, domain, c3t3, n); - } - - OutputIterator add_initial_points(OutputIterator pts) const - { - if (begin_it != nullptr && end_it != nullptr) - { - Input_const_iterator_interface* it_ptr = begin_it->clone(); - Input_const_iterator_interface& it = *(it_ptr); - for (; it != end_it; ++it) - *pts++ = *it; - delete it_ptr; - } - return pts; + return initial_points_generator_(pts, n); } bool is_default() const { return is_default_; } private: - // The two functions holds the `initial_points_generator` functor - const std::function initial_points_generator_no_number_of_points_; - const std::function initial_points_generator_; - // The two iterators holds the `initial_points` container - Input_const_iterator_interface* begin_it; - Input_const_iterator_interface* end_it; + InitialPointsGenerator initial_points_generator_; + + // The two iterators point to the `initial_points` container + Initial_points_const_iterator begin_it; + Initial_points_const_iterator end_it; + // Is the option a default-constructed one ? const bool is_default_; }; @@ -345,14 +271,14 @@ struct Domain_features_generator< MeshDomain, true > }; // Evaluate the two parameters `initial_points_generator` and `initial_points` -// and returns the appropriate `Initial_points_generator_options`. +// and returns the appropriate `Initialization_options`. // If no generator and no initial points, then use the domain's construct_initial_points_object. template struct Initial_points_generator_generator { - typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options; - typedef typename Initial_points_generator_options::Value_type Value_type; - typedef typename Initial_points_generator_options::OutputIterator OutputIterator; + typedef typename CGAL::parameters::internal::Initialization_options Initialization_options; + typedef typename Initialization_options::Value_type Value_type; + typedef typename Initialization_options::OutputIterator OutputIterator; struct Initial_points_generator_domain_traductor { @@ -392,31 +318,31 @@ struct Initial_points_generator_generator // With a custom InitialPointsGenerator template - Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator, const InitalPointsRange& input_features) + Initialization_options operator()(const InitialPointsGenerator& initial_points_generator, const InitalPointsRange& input_points) { - return Initial_points_generator_options(initial_points_generator, input_features, false); + return Initialization_options(initial_points_generator, input_points, false); } template - Initial_points_generator_options operator()(const InitialPointsGenerator& initial_points_generator) + Initialization_options operator()(const InitialPointsGenerator& initial_points_generator) { - std::vector empty_input_features; - return operator()(initial_points_generator, empty_input_features); + std::vector empty_input_points; + return operator()(initial_points_generator, empty_input_points); } // Without a custom InitialPointsGenerator template - Initial_points_generator_options operator()(const Null_functor&, const InitalPointsRange& input_features) + Initialization_options operator()(const Null_functor&, const InitalPointsRange& input_points) { - // The domain's construct_initial_points_object is called only if input_features is empty - if (input_features.size() == 0) { - return Initial_points_generator_options(Initial_points_generator_domain_traductor(), input_features, true); + // The domain's construct_initial_points_object is called only if input_points is empty + if (input_points.empty()) { + return Initialization_options(Initial_points_generator_domain_traductor(), input_points, true); } - return Initial_points_generator_options(Initial_points_generator_empty(), input_features, true); + return Initialization_options(Initial_points_generator_empty(), input_features, true); } // Default construction - Initial_points_generator_options operator()() + Initialization_options operator()() { return operator()(Null_functor()); } From 026850cf974c484baa9f3c2a52fc3d50b591d3d9 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Sep 2024 12:24:18 +0200 Subject: [PATCH 070/332] use initial points vector --- Mesh_3/include/CGAL/make_mesh_3.h | 58 +++++++++---------- .../internal/mesh_option_classes.h | 4 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 80a47480a4d..692ab54d32e 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -27,6 +27,7 @@ #include #include +#include #include @@ -49,29 +50,24 @@ add_points_from_generator(C3T3& c3t3, typedef typename C3T3::Vertex_handle Vertex_handle; typedef CGAL::Mesh_3::Triangulation_helpers Th; - using Point_3 = typename Tr::Geom_traits::Point_3; - using Index = typename MeshDomain::Index; - using PointIndexPair = std::pair; using PointDimIndex = parameters::internal::Initial_point_type; - struct InitialPointPair2TupleConverter - { - PointDimIndex operator()(const PointDimIndex& wp_d_i) const - { - return wp_d_i; - } - PointDimIndex operator()(const PointIndexPair& p_i) const - { - auto cwp = Tr::Geom_traits().construct_weighted_point_3_object(); - return PointDimIndex{ cwp(p_i.first), 2, p_i.second }; - } - }; + const auto& cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); std::vector initial_points; - InitialPointPair2TupleConverter pair2tuple; auto push_initial_point = [&](const auto& initial_pt)->void { - initial_points.push_back(pair2tuple(initial_pt)); + using T = std::remove_cv_t < std::remove_reference_t>; + if constexpr (std::tuple_size_v == 3) + { + const auto& [wp, d, i] = initial_pt; + initial_points.push_back(PointDimIndex{ wp, d, i }); + } + else + { + const auto& [p, i] = initial_pt; + initial_points.push_back(PointDimIndex{ cwp(p), 2, i }); + } }; if (nb_initial_points > 0) @@ -101,13 +97,13 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename I void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, - const InitializationOptions& init_generator) + const InitializationOptions& init_options) { - add_points_from_generator(c3t3, domain, nb_initial_points, init_generator); + add_points_from_generator(c3t3, domain, nb_initial_points, init_options.generator()); // If c3t3 initialization is not sufficient (may happen if // the user has not specified enough points ), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_generator.is_default(); + bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_options.is_default(); if(!need_more_init) { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); @@ -126,8 +122,8 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, } if(need_more_init) { - InitializationOptions init_options(domain.construct_initial_points_object()); - add_points_from_generator(c3t3, domain, nb_initial_points, init_options); + add_points_from_generator(c3t3, domain, nb_initial_points, + domain.construct_initial_points_object()); } } @@ -536,17 +532,19 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C using Initial_point = parameters::internal::Initial_point_type; using Initial_points_range_ref = typename internal_np::Lookup_named_param_def>::type; + std::vector>::reference; + using Initial_points_range = std::remove_cv_t>; std::vector empty_vec; - const Initial_points_range_ref initial_points = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); + Initial_points_range initial_points = choose_parameter(get_parameter_reference(np, internal_np::initial_points_param), empty_vec); // initial points generator using Initial_points_generator = typename internal_np::Lookup_named_param_def::reference; + auto default_generator = domain.construct_initial_points_object(); Initial_points_generator initial_points_generator = choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), - domain.construct_initial_points_object()); - const parameters::internal::Initialization_options + default_generator); + const parameters::internal::Initialization_options initial_points_gen_param(initial_points_generator, initial_points); make_mesh_3_impl(c3t3, domain, criteria, @@ -582,7 +580,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, * * @return The mesh as a C3T3 object */ -template +template void make_mesh_3_impl(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, @@ -595,14 +593,14 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - const parameters::internal::Initialization_options& - initialization_options = parameters::internal::Initialization_options()) + const parameters::internal::Initialization_options& + initialization_options = parameters::internal::Initialization_options()) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); #endif - using Init_options = parameters::internal::Initialization_options; + using Init_options = parameters::internal::Initialization_options; // Initialize c3t3 Mesh_3::internal::C3t3_initializer< diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 14b9cdebef6..6df410a1f4b 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -175,7 +175,7 @@ private: template struct Initial_point_type { - typename C3t3::Triangulation::Point m_point; + typename C3t3::Triangulation::Point m_weighted_point; int m_dimension; typename MeshDomain::Index m_index; }; @@ -215,6 +215,8 @@ struct Initialization_options return initial_points_generator_(pts, n); } + InitialPointsGenerator generator() const { return initial_points_generator_; } + bool is_default() const { return is_default_; } private: From b5740393b2cae82c50797a87562c606d8043aebb Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 20 Sep 2024 13:58:24 +0200 Subject: [PATCH 071/332] compilation of examples fixed --- ...sh_3D_image_with_custom_initialization.cpp | 9 ++- ...esh_3D_image_with_image_initialization.cpp | 5 +- .../Construct_initial_points_labeled_image.h | 65 ++++++++++++------- Mesh_3/include/CGAL/make_mesh_3.h | 11 ++-- .../internal/parameters_interface.h | 1 + 5 files changed, 56 insertions(+), 35 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 400b9df6be2..600fa805b6a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -40,12 +40,13 @@ namespace params = CGAL::parameters; // Weighted_point_3 is the point's position and weight, // int is the dimension of the minimal dimension subcomplex on which the point lies, // Index is the underlying subcomplex index. + struct Custom_initial_points_generator { const CGAL::Image_3& image_; template - OutputIterator operator()(OutputIterator pts) const + OutputIterator operator()(OutputIterator pts, int n = 20) const { typedef Tr::Geom_traits Gt; typedef Gt::Point_3 Point_3; @@ -53,14 +54,12 @@ struct Custom_initial_points_generator typedef Gt::Segment_3 Segment_3; typedef Mesh_domain::Index Index; - typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = - c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); + Gt::Construct_weighted_point_3 cwp = Gt().construct_weighted_point_3_object(); // Add points along the segment Segment_3 segment(Point_3( 0.0, 50.0, 66.66), Point_3(100.0, 50.0, 66.66)); - Point_3 source = segment.source(); Vector_3 vector = segment.to_vector(); double edge_size = 5; @@ -69,7 +68,7 @@ struct Custom_initial_points_generator for (std::size_t i = 1; i < nb; i++) { - *pts++ = {cwp(source + (i * frac) * vector), 1, Index(1)); + *pts++ = std::make_tuple( cwp(source + (i * frac) * vector), 1, Index(1) ); } return pts; } diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp index 952df762d38..c08d245bf76 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -49,8 +49,9 @@ int main() /// [Meshing] // Mesh generation with a custom initialization that places points in each of the image components. - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(CGAL::Construct_initial_points_labeled_image(image)) + CGAL::Construct_initial_points_labeled_image img_pts_generator(image, domain); + + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::initial_points_generator(img_pts_generator) ); /// [Meshing] diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 8c8ae6e4839..024f2cc878f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -82,16 +82,23 @@ struct Get_point * this functor scans the complete image and * outputs points to initialize each component. * + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain model of `MeshDomain_3` + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_gray_image` */ +template struct Construct_initial_points_labeled_image { - const CGAL::Image_3 & image; + const CGAL::Image_3& image_; + const MeshDomain& domain_; - Construct_initial_points_labeled_image(const CGAL::Image_3 & image_) - : image(image_) + Construct_initial_points_labeled_image(const CGAL::Image_3& image, + const MeshDomain& domain) + : image_(image) + , domain_(domain) { } /*! @@ -102,14 +109,12 @@ struct Construct_initial_points_labeled_image * This ensures that each component will be initialized. * * @tparam OutputIterator model of `OutputIterator` that contains points of type - * `MeshDomain::Intersection` - * @tparam MeshDomain model of `MeshDomain_3` - * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * @todo describe type */ - template - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const + template + OutputIterator operator()(OutputIterator pts, int n = 20) const { - CGAL_IMAGE_IO_CASE(image.image(), operator()(pts, domain, CGAL::Identity(), c3t3, n)); + CGAL_IMAGE_IO_CASE(image_.image(), operator()(pts, CGAL::Identity(), n)); return pts; } @@ -127,8 +132,8 @@ struct Construct_initial_points_labeled_image * with `Word` the type of the image values. * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` */ - template - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, TransformOperator transform, const C3t3& c3t3, int n = 20) const + template + OutputIterator operator()(OutputIterator pts, TransformOperator transform, int n = 20) const { typedef typename MeshDomain::Subdomain Subdomain; typedef typename MeshDomain::Point_3 Point_3; @@ -143,7 +148,8 @@ struct Construct_initial_points_labeled_image typedef typename Tr::Cell_handle Cell_handle; typedef typename GT::Vector_3 Vector_3; - const Tr& tr = c3t3.triangulation(); + C3t3 c3t3; + Tr& tr = c3t3.triangulation(); typename GT::Compare_weighted_squared_radius_3 cwsr = tr.geom_traits().compare_weighted_squared_radius_3_object(); @@ -152,9 +158,9 @@ struct Construct_initial_points_labeled_image typename GT::Construct_weighted_point_3 cwp = tr.geom_traits().construct_weighted_point_3_object(); - const double max_v = (std::max)((std::max)(image.vx(), - image.vy()), - image.vz()); + const double max_v = (std::max)((std::max)(image_.vx(), + image_.vy()), + image_.vz()); struct Seed { std::size_t i, j, k; @@ -163,9 +169,9 @@ struct Construct_initial_points_labeled_image using Seeds = std::vector; Seeds seeds; - Mesh_3::internal::Get_point get_point(&image); + Mesh_3::internal::Get_point get_point(&image_); std::cout << "Searching for connected components..." << std::endl; - CGAL_IMAGE_IO_CASE(image.image(), search_for_connected_components_in_labeled_image(image, + CGAL_IMAGE_IO_CASE(image_.image(), search_for_connected_components_in_labeled_image(image_, std::back_inserter(seeds), CGAL::Emptyset_iterator(), transform, @@ -178,13 +184,13 @@ struct Construct_initial_points_labeled_image Cell_handle seed_cell = tr.locate(cwp(seed_point)); const Subdomain seed_label - = domain.is_in_domain_object()(seed_point); + = domain_.is_in_domain_object()(seed_point); const Subdomain seed_cell_label = ( tr.dimension() < 3 || seed_cell == Cell_handle() || tr.is_infinite(seed_cell)) ? Subdomain() //seed_point is OUTSIDE_AFFINE_HULL - : domain.is_in_domain_object()( + : domain_.is_in_domain_object()( seed_cell->weighted_circumcenter(tr.geom_traits())); if ( seed_label != std::nullopt @@ -196,7 +202,7 @@ struct Construct_initial_points_labeled_image CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); // [construct intersection] typename MeshDomain::Construct_intersection construct_intersection = - domain.construct_intersection_object(); + domain_.construct_intersection_object(); // [construct intersection] std::vector directions; @@ -219,7 +225,7 @@ struct Construct_initial_points_labeled_image for(const Vector_3& v : directions) { const Point_3 test = seed_point + v; - const Segment_3 test_segment = Segment_3(seed_point, test); + const Segment_3 test_segment(seed_point, test); // [use construct intersection] const typename MeshDomain::Intersection intersect = @@ -231,7 +237,7 @@ struct Construct_initial_points_labeled_image const Point_3& intersect_point = std::get<0>(intersect); const Index& intersect_index = std::get<1>(intersect); // [get construct intersection] - Weighted_point pi = Weighted_point(intersect_point); + Weighted_point pi(intersect_point); // This would cause trouble to optimizers // check pi will not be hidden @@ -293,7 +299,20 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = {cwp(intersect_point), 2, intersect_index}; // dimension 2 by construction, points are on surface + // insert point in temporary triangulation + + /// The following lines show how to insert initial points in the + /// `c3t3` object. [insert initial points] + Vertex_handle v = tr.insert(pi); + + // `v` could be null if `pi` is hidden by other vertices of `tr`. + CGAL_assertion(v != Vertex_handle()); + + c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_index(v, intersect_index); + /// [insert initial points] + + *pts++ = std::make_pair(pi, intersect_index); // dimension 2 by construction, points are on surface } } } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 692ab54d32e..438f5a01328 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -60,13 +60,13 @@ add_points_from_generator(C3T3& c3t3, using T = std::remove_cv_t < std::remove_reference_t>; if constexpr (std::tuple_size_v == 3) { - const auto& [wp, d, i] = initial_pt; - initial_points.push_back(PointDimIndex{ wp, d, i }); + const auto& [weighted_pt, dim, index] = initial_pt; + initial_points.push_back(PointDimIndex{ weighted_pt, dim, index }); } else { - const auto& [p, i] = initial_pt; - initial_points.push_back(PointDimIndex{ cwp(p), 2, i }); + const auto& [pt, index] = initial_pt; + initial_points.push_back(PointDimIndex{ cwp(pt), 2, index }); } }; @@ -519,7 +519,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C using parameters::choose_parameter; using parameters::get_parameter; using parameters::get_parameter_reference; - C3T3 c3t3; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); @@ -547,6 +547,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C const parameters::internal::Initialization_options initial_points_gen_param(initial_points_generator, initial_points); + C3T3 c3t3; make_mesh_3_impl(c3t3, domain, criteria, exude_param, perturb_param, odt_param, lloyd_param, features_param.features(), mesh_options_param, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index f24867aa76d..82e1778a9f0 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -339,6 +339,7 @@ CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, ma CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) CGAL_add_named_parameter_with_compatibility(initial_points_generator_param_t,initial_points_generator_param,initial_points_generator) CGAL_add_named_parameter_with_compatibility(initial_points_param_t,initial_points_param,initial_points) +CGAL_add_named_parameter_with_compatibility(c3t3_initializer_param_t, c3t3_initializer_param, c3t3_initializer) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) From 39254bb7dbcde5e65d190aebfc67f701c74950b8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 20 Sep 2024 17:17:41 +0200 Subject: [PATCH 072/332] introduce Dummy_initial_points_generator fix compilation of Mesh_3 tests and examples --- Mesh_3/include/CGAL/make_mesh_3.h | 57 +++++++++++-------- .../internal/mesh_option_classes.h | 29 ++++++---- 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 438f5a01328..4cc6827311e 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -50,7 +50,7 @@ add_points_from_generator(C3T3& c3t3, typedef typename C3T3::Vertex_handle Vertex_handle; typedef CGAL::Mesh_3::Triangulation_helpers Th; - using PointDimIndex = parameters::internal::Initial_point_type; + using PointDimIndex = parameters::internal::Initial_point_type; const auto& cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); @@ -210,22 +210,24 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria, bool MeshDomainHasHasFeatures, - typename HasFeatures, - typename InitOptions> -struct C3t3_initializer { }; + typename HasFeatures = int> +struct C3t3_initializer {}; // Partial specialization of C3t3_initializer // Handle cases where MeshDomain::Has_features is not a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitOptions> -struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitOptions > +template < typename C3T3, typename MD, typename MC, typename HasFeatures> +struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures> { typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initialization_options Default_init_options; + + template void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const InitOptions& init_options = InitOptions()) + const InitOptions& init_options = Default_init_options()) { if ( with_features ) { @@ -241,19 +243,21 @@ struct C3t3_initializer < C3T3, MD, MC, false, HasFeatures, InitOptions > // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type -template < typename C3T3, typename MD, typename MC, typename HasFeatures, typename InitOptions> -struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitOptions> +template < typename C3T3, typename MD, typename MC, typename HasFeatures> +struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures> { typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initialization_options Default_init_options; + template void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const InitOptions& init_options = InitOptions()) + const InitOptions& init_options = Default_init_options()) { - C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features, InitOptions >() + C3t3_initializer < C3T3, MD, MC, true, typename MD::Has_features >() (c3t3,domain,criteria,with_features,mesh_options,init_options); } }; @@ -261,20 +265,22 @@ struct C3t3_initializer < C3T3, MD, MC, true, HasFeatures, InitOptions> // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_true -template < typename C3T3, typename MD, typename MC, typename InitOptions > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitOptions > +template < typename C3T3, typename MD, typename MC > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true> : public C3t3_initializer_base < C3T3, MD, MC > { virtual ~C3t3_initializer() { } typedef parameters::internal::Mesh_3_options Mesh_3_options; + typedef parameters::internal::Initialization_options Default_init_options; + template void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const InitOptions& init_options = InitOptions()) + const InitOptions& init_options = Default_init_options()) { if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); @@ -311,17 +317,19 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true, InitOptions > // Partial specialization of C3t3_initializer // Handles cases where MeshDomain::Has_features is a valid type and is defined // to CGAL::Tag_false -template < typename C3T3, typename MD, typename MC, typename InitOptions > -struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false, InitOptions > +template < typename C3T3, typename MD, typename MC > +struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false> { typedef parameters::internal::Mesh_3_options Mesh_3_options; - typedef parameters::internal::Initialization_options Initialization_options; + typedef parameters::internal::Initialization_options Default_init_options; + + template void operator()(C3T3& c3t3, const MD& domain, const MC& criteria, bool with_features, Mesh_3_options mesh_options = Mesh_3_options(), - const Initialization_options& init_options = Initialization_options()) + const InitOptions& init_options = Default_init_options()) { if ( with_features ) { @@ -609,13 +617,12 @@ void make_mesh_3_impl(C3T3& c3t3, MeshDomain, MeshCriteria, ::CGAL::internal::has_Has_features::value, - int, - Init_options>() (c3t3, - domain, - criteria, - with_features, - mesh_options, - initialization_options); + int>()(c3t3, + domain, + criteria, + with_features, + mesh_options, + initialization_options); CGAL_assertion( c3t3.triangulation().dimension() >= 2 ); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 6df410a1f4b..180dd59b5f6 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace CGAL { @@ -180,20 +181,26 @@ struct Initial_point_type typename MeshDomain::Index m_index; }; +struct Dummy_initial_points_generator +{ + template + OutputIterator operator()(OutputIterator oit, int n = 0) const { return oit; } +}; + // Holds the two parameters `initial_points_generator` and `initial_points`, // without knowing their types, into a single generator. template > > struct Initialization_options { - using DefaultGenerator = typename MeshDomain::Construct_initial_points; + using DefaultGenerator = Dummy_initial_points_generator; using Initial_points_const_iterator = typename InitialPointsRange::const_iterator; using Initial_point = typename std::iterator_traits::value_type; + Initialization_options() - : is_default_(true) {} Initialization_options(const InitialPointsGenerator& generator, @@ -201,8 +208,6 @@ struct Initialization_options : initial_points_generator_(generator) , begin_it(initial_points.begin()) , end_it(initial_points.end()) - , is_default_(boost::is_same::value - && std::empty(initial_points)) {} template @@ -215,9 +220,16 @@ struct Initialization_options return initial_points_generator_(pts, n); } - InitialPointsGenerator generator() const { return initial_points_generator_; } + const InitialPointsGenerator& generator() const + { + return initial_points_generator_; + } - bool is_default() const { return is_default_; } + bool is_default() const + { + return begin_it == end_it + && std::is_same_v; + } private: InitialPointsGenerator initial_points_generator_; @@ -225,9 +237,6 @@ private: // The two iterators point to the `initial_points` container Initial_points_const_iterator begin_it; Initial_points_const_iterator end_it; - - // Is the option a default-constructed one ? - const bool is_default_; }; // ----------------------------------- From b3a8530dcf2b1cff7799ee332e2b3c974f7e32ca Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 24 Sep 2024 11:05:41 +0200 Subject: [PATCH 073/332] use new API with named paremeter initial_points_generator in demo and fix compilation issues --- Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h | 13 +++--- .../Construct_initial_points_gray_image.h | 19 +++++---- Mesh_3/include/CGAL/make_mesh_3.h | 29 +++++++++---- .../internal/mesh_option_classes.h | 41 +++++++++---------- 4 files changed, 60 insertions(+), 42 deletions(-) diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h index cf2ffaf9caa..99552b05b7f 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h +++ b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h @@ -257,9 +257,7 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Labeled_image_domain_tag) p_.protect_features, p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, p::nonlinear_growth_of_balls = true).v, - p::internal::Initial_points_generator_generator() - (p::initial_points_generator( - CGAL::Construct_initial_points_labeled_image(*p_.image_3_ptr)).v)); + CGAL::Construct_initial_points_labeled_image(*p_.image_3_ptr, *domain_)); } else { @@ -278,6 +276,11 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Gray_image_domain_tag) // features, or with the initial points (or both). if (p_.detect_connected_components) { + CGAL::Construct_initial_points_gray_image generator + (*p_.image_3_ptr, + *domain_, + p_.iso_value, + Compare_to_isovalue(p_.iso_value, p_.inside_is_less)); CGAL::Mesh_3::internal::C3t3_initializer< C3t3, Domain, @@ -289,9 +292,7 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Gray_image_domain_tag) p_.protect_features, p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, p::nonlinear_growth_of_balls = true).v, - p::internal::Initial_points_generator_generator() - (p::initial_points_generator( - CGAL::Construct_initial_points_gray_image(*p_.image_3_ptr, p_.iso_value, Compare_to_isovalue(p_.iso_value, p_.inside_is_less))).v)); + generator); } else { diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 19ae3698780..9264d44d844 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -39,19 +39,21 @@ namespace CGAL * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_labeled_image` */ -template +template struct Construct_initial_points_gray_image { const CGAL::Image_3 & image_; - const double iso_value_; + const MeshDomain& domain_; + const typename MeshDomain::R::FT iso_value_; Functor image_values_to_subdomain_indices_; - template Construct_initial_points_gray_image(const CGAL::Image_3 & image, - const FT& iso_value, + const MeshDomain& domain, + const double iso_value, const Functor image_values_to_subdomain_indices = CGAL::Null_functor()) : image_(image) - , iso_value_(iso_value) + , domain_(domain) + , iso_value_(static_cast(iso_value)) , image_values_to_subdomain_indices_(image_values_to_subdomain_indices) { } @@ -67,15 +69,16 @@ struct Construct_initial_points_gray_image * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` * */ - template - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n = 20) const + template + OutputIterator operator()(OutputIterator pts, int n = 20) const { using CGAL::Mesh_3::internal::Create_gray_image_values_to_subdomain_indices; typedef Create_gray_image_values_to_subdomain_indices C_i_v_t_s_i; typedef typename C_i_v_t_s_i::type Image_values_to_subdomain_indices; Image_values_to_subdomain_indices transform_fct = C_i_v_t_s_i()(image_values_to_subdomain_indices_, iso_value_); - Construct_initial_points_labeled_image(image_).operator()(pts, domain, transform_fct, c3t3, n); + Construct_initial_points_labeled_image init_pts{ image_, domain_ }; + init_pts(pts, transform_fct, n); return pts; } }; diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 4cc6827311e..6e38a36bc7b 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -50,7 +50,12 @@ add_points_from_generator(C3T3& c3t3, typedef typename C3T3::Vertex_handle Vertex_handle; typedef CGAL::Mesh_3::Triangulation_helpers Th; - using PointDimIndex = parameters::internal::Initial_point_type; + struct PointDimIndex + { + typename Tr::Point m_wpt; + int m_dim; + typename MeshDomain::Index m_index; + }; const auto& cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); @@ -99,11 +104,18 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, const InitializationOptions& init_options) { - add_points_from_generator(c3t3, domain, nb_initial_points, init_options.generator()); + add_points_from_generator(c3t3, domain, nb_initial_points, init_options); + + typedef CGAL::parameters::internal::Initialization_options Default_init_options; + bool is_default_init = false; + if constexpr (std::is_same_v) + { + is_default_init = init_options.is_default(); + } // If c3t3 initialization is not sufficient (may happen if // the user has not specified enough points ), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_options.is_default(); + bool need_more_init = c3t3.triangulation().dimension() != 3 || !is_default_init; if(!need_more_init) { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); @@ -287,8 +299,13 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true> // If c3t3 initialization is not sufficient (may happen if there is only // a planar curve as feature for example), add some surface points + bool is_default_init = false; + if constexpr (std::is_same_v) + { + is_default_init = init_options.is_default(); + } - bool need_more_init = c3t3.triangulation().dimension() != 3 || !init_options.is_default(); + bool need_more_init = c3t3.triangulation().dimension() != 3 || !is_default_init; if(!need_more_init) { CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); helper.update_restricted_facets(); @@ -537,7 +554,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); // range of initial points - using Initial_point = parameters::internal::Initial_point_type; + using Initial_point = std::pair; using Initial_points_range_ref = typename internal_np::Lookup_named_param_def>::reference; @@ -609,8 +626,6 @@ void make_mesh_3_impl(C3T3& c3t3, CGAL::get_default_random() = CGAL::Random(0); #endif - using Init_options = parameters::internal::Initialization_options; - // Initialize c3t3 Mesh_3::internal::C3t3_initializer< C3T3, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 180dd59b5f6..8505194049c 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -172,15 +173,6 @@ private: }; // Mesh initialization - -template -struct Initial_point_type -{ - typename C3t3::Triangulation::Point m_weighted_point; - int m_dimension; - typename MeshDomain::Index m_index; -}; - struct Dummy_initial_points_generator { template @@ -191,20 +183,27 @@ struct Dummy_initial_points_generator // without knowing their types, into a single generator. template > > + typename InitialPointsGenerator = CGAL::Default, + typename InitialPointsRange = CGAL::Default +> struct Initialization_options { - using DefaultGenerator = Dummy_initial_points_generator; - using Initial_points_const_iterator = typename InitialPointsRange::const_iterator; - using Initial_point = typename std::iterator_traits::value_type; + using Default_generator = Dummy_initial_points_generator; + using Initial_points_generator + = typename CGAL::Default::Get::type; + using Default_initial_point_type + = std::tuple; + using Initial_points_range + = typename CGAL::Default::Get>::type; + using Initial_points_const_iterator = typename Initial_points_range::const_iterator; + using Initial_point = typename std::iterator_traits::value_type; Initialization_options() {} - Initialization_options(const InitialPointsGenerator& generator, - const InitialPointsRange& initial_points = InitialPointsRange()) + Initialization_options(const Initial_points_generator& generator, + const Initial_points_range& initial_points = Initial_points_range()) : initial_points_generator_(generator) , begin_it(initial_points.begin()) , end_it(initial_points.end()) @@ -214,13 +213,13 @@ struct Initialization_options OutputIterator operator()(OutputIterator pts, int n = 0) const { // add initial_points - for (typename InitialPointsRange::const_iterator it = begin_it; it != end_it; ++it) + for (Initial_points_const_iterator it = begin_it; it != end_it; ++it) *pts++ = *it; return initial_points_generator_(pts, n); } - const InitialPointsGenerator& generator() const + const Initial_points_generator& generator() const { return initial_points_generator_; } @@ -228,11 +227,11 @@ struct Initialization_options bool is_default() const { return begin_it == end_it - && std::is_same_v; + && std::is_same_v; } private: - InitialPointsGenerator initial_points_generator_; + Initial_points_generator initial_points_generator_; // The two iterators point to the `initial_points` container Initial_points_const_iterator begin_it; @@ -349,7 +348,7 @@ struct Initial_points_generator_generator if (input_points.empty()) { return Initialization_options(Initial_points_generator_domain_traductor(), input_points, true); } - return Initialization_options(Initial_points_generator_empty(), input_features, true); + return Initialization_options(Initial_points_generator_empty(), input_points, true); } // Default construction From 490a6ad5894b015c75bee95816be97f35f185187 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 24 Sep 2024 12:22:32 +0200 Subject: [PATCH 074/332] update doc --- .../Mesh_3/Concepts/InitialPointsGenerator.h | 54 +++++++++++-------- Mesh_3/include/CGAL/make_mesh_3.h | 6 +-- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index ff9934dd44d..7d5f54eb107 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -15,46 +15,54 @@ a set of initial points on the surface of the domain. class InitialPointsGenerator { public: +/// \name Types +/// @{ + +/*! +* Mesh domain type to be meshed, model of `MeshDomain_3` +*/ +typedef unspecified_type MeshDomain; + +/*! + * Type of the output mesh complex, model of `MeshComplex_3InTriangulation_3` + */ +typedef unspecified_type C3t3; +/// @} + /// \name Operations /// @{ /*! Outputs a set of surface points, for mesh initialization, to the -output iterator `pts`, as objects of type -`MeshDomain::Intersection`. +output iterator `pts`. -@tparam OutputIterator model of `OutputIterator`, containing points of type -`MeshDomain::Intersection` -@tparam MeshDomain model of `MeshDomain_3` -@tparam C3t3 model of `MeshComplex_3InTriangulation_3` +@tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : + - a `C3t3::Triangulation::Point` : the point `p`, + - a `int` : the minimal dimension of the subcomplexes on which `p` lies, + - a `MeshDomain_3::Index` : the index of the corresponding subcomplex. @param pts the output points -@param domain the input domain -@param c3t3 the input complex @param n a lower bound on the number of points to construct for initialization. A generator can choose to ignore this parameter. -If it does not output enough points, then more points will be added automatically. +If this operator does not output enough points, then more points will be added automatically +by the mesher. */ -template -OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n); +template +OutputIterator operator()(OutputIterator pts, int n); /*! -Outputs a set of surface points, for mesh initialization, to the -output iterator `pts`, as objects of type -`MeshDomain::Intersection`. +Same as above, without the `n` parameter. Since there is no `n` given like above, the functor must provide enough points to initialize the mesh generation process. -@tparam OutputIterator model of `OutputIterator`, containing points of type - `MeshDomain::Intersection` -@tparam MeshDomain model of `MeshDomain_3` -@tparam C3t3 model of `MeshComplex_3InTriangulation_3` - +@tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : + - a `C3t3::Triangulation::Point` : the point `p`, + - a `int` : the minimal dimension of the subcomplexes to which `p` belongs, + - a `MeshDomain_3::Index` : the index of the corresponding subcomplex. */ -template -OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3); - +template +OutputIterator operator()(OutputIterator pts); /// @} -}; /* end MeshEdgeCriteria_3 */ +}; /* end InitialPointsGenerator */ diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6e38a36bc7b..3ca6e664809 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -499,13 +499,13 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false> * \cgalParamExtra{If the parameter `parameters::initial_points()` is set, * the functor will be called after insertion of the points.} * \cgalParamSectionBegin{Mesh initialization with points} - * \cgalParamDescription{a `std::vector` of initial points, represented as - * `std::vector>` can optionally + * \cgalParamDescription{a `Range` of initial points, represented as + * tuple-like objects made of `tuple-like` can optionally * be provided to start the meshing process. * `Weighted_point_3` is the point's position and weight, * `int` is the dimension of the minimal dimension subcomplex on which * the point lies, and - * `Index` is the underlying subcomplex index. + * `Index` is the corresponding subcomplex index. * The following named parameter controls this option: *
      *
    • `parameters::initial_points()` From f4e2b3db695482ece5ca914162987c110275dbd9 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Sep 2024 11:02:34 +0200 Subject: [PATCH 075/332] remove useless generator() accessor --- .../CGAL/STL_Extension/internal/mesh_option_classes.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 8505194049c..7b9fe4b2485 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -219,11 +219,6 @@ struct Initialization_options return initial_points_generator_(pts, n); } - const Initial_points_generator& generator() const - { - return initial_points_generator_; - } - bool is_default() const { return begin_it == end_it From 8d6e7f2fb489367a5c2f7e5124fd6f3d8d1c36ae Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Sep 2024 11:36:17 +0200 Subject: [PATCH 076/332] doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index babe7a9f9a1..bdbe61bcfce 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -487,6 +487,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, * `int` the dimension of the minimal subcomplex on which the point lies, and `Index` the corresponding subcomplex index. * + * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. * If this parameter is set, the domain's `construct_initial_points_object()` will not be called. * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. * From f3b5333b69f11fdfec2d075973a3502024177556 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Sep 2024 11:51:45 +0200 Subject: [PATCH 077/332] doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index bdbe61bcfce..4b6e03b5e59 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -483,19 +483,21 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \ingroup PkgMesh3Parameters * * The function `parameters::initial_points()` enables the user to specify a container model of `Range` that contains - * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` contains elements of type - * `std::tuple`, where `Weighted_point_3` represents the position and weight of the point, - * `int` the dimension of the minimal subcomplex on which the point lies, and `Index` the corresponding subcomplex index. + * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` contains + * tuple-like objects containing a `Weighted_point_3`, an `int`, and an `Index`, + * where `Weighted_point_3` represents the position and weight of the point, + * `int` the dimension of the minimal subcomplex on which the point lies, + * and `Index` the corresponding subcomplex index. * * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. - * If this parameter is set, the domain's `construct_initial_points_object()` will not be called. - * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. + * If the insertion of initial points, together with the input generator, do not generate enough points, + * the domain's `construct_initial_points_object()` will be called. * * \tparam MeshDomain a model of `MeshDomain_3` * \tparam C3t3 a model of `MeshComplex_3InTriangulation_3` * - * @param initial_points a `Range` that contains points of type - * `std::tuple` + * @param initial_points a `Range` that contains points of tuple-like objects of + * `C3t3::Triangulation::Geom_traits::Weighted_point_3, int, MeshDomain::Index`. * * \cgalHeading{Example} * From 88457ee5b38b6af8c50b837fcb08498d88a477e0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 11:10:14 +0200 Subject: [PATCH 078/332] make initialization logic consistent and fix doc accordingly 1. protect features 2. insert initial_points() range 3. use initial_points_generator(), if provided 4. use domain.construct_initial_points_object(), if initialization not complete --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 19 +++- .../Mesh_3/Concepts/InitialPointsGenerator.h | 14 ++- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- .../Construct_initial_points_gray_image.h | 7 +- .../Construct_initial_points_labeled_image.h | 14 ++- Mesh_3/include/CGAL/make_mesh_3.h | 98 +++++++++---------- 6 files changed, 91 insertions(+), 63 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 4b6e03b5e59..58934b9fe54 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -461,7 +461,11 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * * If the parameter `parameters::initial_points()` is used, the points it provides are inserted before any other initialization. * - * If the generator does not generate enough points, the domain's `construct_initial_points_object()` will be called. + * Initialization is considered to be complete if the triangulation is a 3D triangulation + * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the + * input surface). + * If the generator does not generate enough points for the initialization to be complete, + * the domain's `construct_initial_points_object()` will be called to generate enough input points. * * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept * @@ -489,8 +493,15 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * `int` the dimension of the minimal subcomplex on which the point lies, * and `Index` the corresponding subcomplex index. * - * If the parameter `parameters::initial_points_generator()` is set, the points will be inserted before calling the functor. - * If the insertion of initial points, together with the input generator, do not generate enough points, + * Initialization is considered to be complete if the triangulation is a 3D triangulation + * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the + * input surface). + * + * If the parameter `parameters::initial_points_generator()` is set, + * the points will be inserted before calling the functor. + * + * If after the insertion of initial points, together with the input generator, + * the initialization is not complete, * the domain's `construct_initial_points_object()` will be called. * * \tparam MeshDomain a model of `MeshDomain_3` @@ -510,8 +521,8 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * parameters::initial_points(std::cref(initial_points))); // Use std::cref to avoid a copy * \endcode * - * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::parameters::initial_points_generator()` * \sa `MeshDomain_3::Construct_initial_points` * */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 7d5f54eb107..958506295a7 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -36,6 +36,11 @@ typedef unspecified_type C3t3; Outputs a set of surface points, for mesh initialization, to the output iterator `pts`. +If, after insertion of these points, the triangulation is still not 3D, +or does not have any facets +in the restricted Delaunay triangulation, then more points will be added automatically +by the mesher. + @tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : - a `C3t3::Triangulation::Point` : the point `p`, - a `int` : the minimal dimension of the subcomplexes on which `p` lies, @@ -44,8 +49,7 @@ output iterator `pts`. @param pts the output points @param n a lower bound on the number of points to construct for initialization. A generator can choose to ignore this parameter. -If this operator does not output enough points, then more points will be added automatically -by the mesher. + */ template OutputIterator operator()(OutputIterator pts, int n); @@ -53,7 +57,11 @@ OutputIterator operator()(OutputIterator pts, int n); /*! Same as above, without the `n` parameter. Since there is no `n` given like above, the functor must provide enough -points to initialize the mesh generation process. +points to initialize the mesh generation process, i.e. to have a 3D triangulation +with at least one facet in the restricted Delaunay triangulation. + +If these conditions are not satisfied, then more points will be added automatically +by the mesher. @tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : - a `C3t3::Triangulation::Point` : the point `p`, diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index d48984d0055..dd2c6418279 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -749,7 +749,7 @@ the triangulation for each connected component. The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh initialization (following the `InitialPointsGenerator`). The functor -`CGAL/Mesh_3/Construct_initial_points_labeled_image.h` is used in this example. +`Construct_initial_points_labeled_image` is used in this example. It constructs points using the API of the mesh domain, as follows. First the functor `construct_intersection` is created diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 9264d44d844..3ad11f85df5 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -63,8 +63,11 @@ struct Construct_initial_points_gray_image * even if they are non-connected components. * Using this functor guarantees to initialize each connected component. * - * \tparam OutputIterator model of `OutputIterator`, collecting points of type - * `MeshDomain::Intersection` + * @tparam OutputIterator model of `OutputIterator` for + * tuple-like objects containing + * - a `Weighted_point_3` for the point + * - an `int` for the minimal dimension of the subcomplexes on which the point lies + * - a `MeshDomain::Index` for the corresponding subcomplex index * \tparam MeshDomain model of `MeshDomain_3` * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` * diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 024f2cc878f..423906d3cd4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -108,8 +108,11 @@ struct Construct_initial_points_labeled_image * even if they are non-connected components. * This ensures that each component will be initialized. * - * @tparam OutputIterator model of `OutputIterator` that contains points of type - * @todo describe type + * @tparam OutputIterator model of `OutputIterator` for + * tuple-like objects containing + * - a `Weighted_point_3` for the point + * - an `int` for the minimal dimension of the subcomplexes on which the point lies + * - a `MeshDomain::Index` for the corresponding subcomplex index */ template OutputIterator operator()(OutputIterator pts, int n = 20) const @@ -121,8 +124,11 @@ struct Construct_initial_points_labeled_image /*! * \brief Same as above, but a `TransformOperator` that transforms values of the image is used. * - * @tparam OutputIterator model of `OutputIterator` that contains points of type - * `MeshDomain::Intersection` + * @tparam OutputIterator model of `OutputIterator` for + * tuple-like objects containing + * - a `Weighted_point_3` for the point + * - an `int` for the minimal dimension of the subcomplexes on which the point lies + * - a `MeshDomain::Index` for the corresponding subcomplex index * @tparam MeshDomain model of `MeshDomain_3` * @tparam TransformOperator functor that transforms values of the image. * It must provide the following type:
      diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 3ca6e664809..f662736b73d 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -98,41 +98,48 @@ add_points_from_generator(C3T3& c3t3, } } +template +bool +needs_more_init(C3T3& c3t3, const MeshDomain& domain) +{ + // If c3t3 initialization is not sufficient (may happen if + // the user has not specified enough points ), add some surface points + + if (c3t3.triangulation().dimension() != 3) + return true; + else // dimension is 3 but it may not be enough + { + CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); + helper.update_restricted_facets(); + + if (c3t3.number_of_facets() == 0) { + return true; + } + else + { + helper.update_restricted_cells(); + if (c3t3.number_of_cells() == 0) { + return true; + } + } + return false; + } +} + template < typename C3T3, typename MeshDomain, typename MeshCriteria, typename InitializationOptions> void init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, const int nb_initial_points, const InitializationOptions& init_options) { + // 1st insert points from initial_points range and initial_points_generator add_points_from_generator(c3t3, domain, nb_initial_points, init_options); - typedef CGAL::parameters::internal::Initialization_options Default_init_options; - bool is_default_init = false; - if constexpr (std::is_same_v) - { - is_default_init = init_options.is_default(); - } - // If c3t3 initialization is not sufficient (may happen if // the user has not specified enough points ), add some surface points - bool need_more_init = c3t3.triangulation().dimension() != 3 || !is_default_init; - if(!need_more_init) - { - CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); - helper.update_restricted_facets(); - if (c3t3.number_of_facets() == 0) { - need_more_init = true; - } - else - { - helper.update_restricted_cells(); - if(c3t3.number_of_cells() == 0) { - need_more_init = true; - } - } - } - if(need_more_init) + // use mesh domain's Construct_initial_points to complete initialization + if(needs_more_init(c3t3, domain)) { add_points_from_generator(c3t3, domain, nb_initial_points, domain.construct_initial_points_object()); @@ -297,31 +304,21 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true> if ( with_features ) { this->initialize_features(c3t3, domain, criteria,mesh_options); - // If c3t3 initialization is not sufficient (may happen if there is only - // a planar curve as feature for example), add some surface points - bool is_default_init = false; - if constexpr (std::is_same_v) + // If the initial points are not provided by the default generator, + // there is no need to count the restricted facets and cells for now + // because more vertices will be inserted anyway. + // The check will be done later in init_c3t3() + bool use_default_initializer = false; + if constexpr (std::is_same_v) // check default type { - is_default_init = init_options.is_default(); + use_default_initializer = init_options.is_default(); //check it also has no additional vertices } - bool need_more_init = c3t3.triangulation().dimension() != 3 || !is_default_init; - if(!need_more_init) { - CGAL::Mesh_3::C3T3_helpers helper(c3t3, domain); - helper.update_restricted_facets(); - - if (c3t3.number_of_facets() == 0) { - need_more_init = true; - } - else - { - helper.update_restricted_cells(); - if(c3t3.number_of_cells() == 0) { - need_more_init = true; - } - } - } - if(need_more_init) { + // If c3t3 initialization from features initialization + // is not sufficient (may happen if there is only + // a planar curve as feature for example), add some surface points. + if (!use_default_initializer || CGAL::Mesh_3::internal::needs_more_init(c3t3, domain)) + { init_c3t3(c3t3, domain, criteria, mesh_options.number_of_initial_points, init_options); } @@ -492,15 +489,16 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false> *
        *
      • `parameters::initial_points_generator()` *
      } - * \cgalParamDefault{`CGAL::Null_Functor()`, the domain's `construct_initial_points_object()` + * \cgalParamDefault{the domain's `construct_initial_points_object()` * will be called for the points initialization.} * \cgalParamExtra{If the generator does not generate enough points, * the domain's `construct_initial_points_object()` will be called.} * \cgalParamExtra{If the parameter `parameters::initial_points()` is set, * the functor will be called after insertion of the points.} + * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialization with points} * \cgalParamDescription{a `Range` of initial points, represented as - * tuple-like objects made of `tuple-like` can optionally + * tuple-like objects made of `tuple-like` objects of `` can optionally * be provided to start the meshing process. * `Weighted_point_3` is the point's position and weight, * `int` is the dimension of the minimal dimension subcomplex on which @@ -512,7 +510,9 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false> *
    } * \cgalParamDefault{`std::vector>()`} * \cgalParamExtra{If this parameter is set, - * the domain's `construct_initial_points_object()` will not be called.} + * the domain's `construct_initial_points_object()` will be called + * only if there is no facet in the restricted Delaunay triangulation + * after points insertion.} * \cgalParamExtra{If the parameter `parameters::initial_points_generator()` is set, * the points will be inserted before calling the functor.} * \cgalParamSectionEnd From 76ee84e88eebf2c6195ae7df6f69671cf4d35cee Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 12:12:35 +0200 Subject: [PATCH 079/332] mention features initialization in the insertion order description --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 58934b9fe54..1da81734b87 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -459,7 +459,8 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * - * If the parameter `parameters::initial_points()` is used, the points it provides are inserted before any other initialization. + * If the parameter `parameters::initial_points()` is used, + * the points it provides are inserted after one dimensional features initialization. * * Initialization is considered to be complete if the triangulation is a 3D triangulation * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the @@ -488,10 +489,11 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * * The function `parameters::initial_points()` enables the user to specify a container model of `Range` that contains * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` contains - * tuple-like objects containing a `Weighted_point_3`, an `int`, and an `Index`, + * tuple-like objects containing a `Weighted_point_3`, an `int`, and a `MeshDomain::Index`, * where `Weighted_point_3` represents the position and weight of the point, * `int` the dimension of the minimal subcomplex on which the point lies, * and `Index` the corresponding subcomplex index. + * These initial points are inserted after one dimensional features initialization. * * Initialization is considered to be complete if the triangulation is a 3D triangulation * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the From f0ad731919ad31705a2a1b341c3a7aac937424d8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 12:12:54 +0200 Subject: [PATCH 080/332] cleaning --- .../internal/mesh_option_classes.h | 80 +------------------ 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 7b9fe4b2485..8e23e22a4cb 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -203,7 +203,7 @@ struct Initialization_options {} Initialization_options(const Initial_points_generator& generator, - const Initial_points_range& initial_points = Initial_points_range()) + const Initial_points_range& initial_points) : initial_points_generator_(generator) , begin_it(initial_points.begin()) , end_it(initial_points.end()) @@ -275,84 +275,6 @@ struct Domain_features_generator< MeshDomain, true > } }; -// Evaluate the two parameters `initial_points_generator` and `initial_points` -// and returns the appropriate `Initialization_options`. -// If no generator and no initial points, then use the domain's construct_initial_points_object. -template -struct Initial_points_generator_generator -{ - typedef typename CGAL::parameters::internal::Initialization_options Initialization_options; - typedef typename Initialization_options::Value_type Value_type; - typedef typename Initialization_options::OutputIterator OutputIterator; - - struct Initial_points_generator_domain_traductor - { - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3) - { - // Use boost to easily create an output iterator. - // This iterator take the domain's construct_initial_points_object output : an std::pair - // and outputs an std::tuple - // As points are on the surfaces by construction, dimension is always 2. - typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = - c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - domain.construct_initial_points_object()( - boost::make_function_output_iterator([&](const auto& domain_generated_point) { - *pts++ = std::make_tuple(cwp(domain_generated_point.first), 2, domain_generated_point.second); - })); - return pts; - } - OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3t3& c3t3, int n) - { - typename C3t3::Triangulation::Geom_traits::Construct_weighted_point_3 cwp = - c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); - domain.construct_initial_points_object()( - boost::make_function_output_iterator([&](const auto& domain_generated_point) { - *pts++ = std::make_tuple(cwp(domain_generated_point.first), 2, domain_generated_point.second); - }), n); - return pts; - } - }; - - struct Initial_points_generator_empty - { - OutputIterator operator()(OutputIterator pts, const MeshDomain& , const C3t3& ) - { return pts; } - OutputIterator operator()(OutputIterator pts, const MeshDomain& , const C3t3& , int ) - { return pts; } - }; - - // With a custom InitialPointsGenerator - template - Initialization_options operator()(const InitialPointsGenerator& initial_points_generator, const InitalPointsRange& input_points) - { - return Initialization_options(initial_points_generator, input_points, false); - } - - template - Initialization_options operator()(const InitialPointsGenerator& initial_points_generator) - { - std::vector empty_input_points; - return operator()(initial_points_generator, empty_input_points); - } - - // Without a custom InitialPointsGenerator - template - Initialization_options operator()(const Null_functor&, const InitalPointsRange& input_points) - { - // The domain's construct_initial_points_object is called only if input_points is empty - if (input_points.empty()) { - return Initialization_options(Initial_points_generator_domain_traductor(), input_points, true); - } - return Initialization_options(Initial_points_generator_empty(), input_points, true); - } - - // Default construction - Initialization_options operator()() - { - return operator()(Null_functor()); - } -}; - } // end namespace internal From f3b9a5ac84e306233a99e6d834cefb466ef8b0da Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 12:46:29 +0200 Subject: [PATCH 081/332] doc (Mael's review) --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 26 ++++++++++--------- .../Mesh_3/Concepts/InitialPointsGenerator.h | 12 ++++----- ...esh_3D_image_with_image_initialization.cpp | 7 +++-- .../mesh_3D_image_with_initial_points.cpp | 11 +++----- .../Construct_initial_points_gray_image.h | 9 ++++--- .../Construct_initial_points_labeled_image.h | 6 +++-- .../internal/mesh_option_classes.h | 6 ++--- 7 files changed, 40 insertions(+), 37 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 1da81734b87..5fabe1892eb 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -456,7 +456,8 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * * The function `parameters::initial_points_generator()` enables the user to specify a functor that follows * the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor is called - * for the initialization of the meshing process. If this parameter is specified without arguments, the default behavior + * for the initialization of the meshing process, by inserting well-distributed surface vertices. + * If this parameter is specified without arguments, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * * If the parameter `parameters::initial_points()` is used, @@ -468,7 +469,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * If the generator does not generate enough points for the initialization to be complete, * the domain's `construct_initial_points_object()` will be called to generate enough input points. * - * \tparam InitialPointsGenerator a functor that follows the `InitialPointsGenerator` concept + * \tparam InitialPointsGenerator a model of the `InitialPointsGenerator` concept * * @param generator an instance of `InitialPointsGenerator` * @@ -487,12 +488,12 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::initial_points()` enables the user to specify a container model of `Range` that contains - * initial points to be used in the `make_mesh_3()` function for mesh generation. The `Range` contains + * The function `parameters::initial_points()` enables the user to specify a container, model of `Range`, that contains + * initial points to be used in the `make_mesh_3()` function for mesh generation. Items in the container are * tuple-like objects containing a `Weighted_point_3`, an `int`, and a `MeshDomain::Index`, - * where `Weighted_point_3` represents the position and weight of the point, + * where `Weighted_point_3` represents the position and the weight of the point, * `int` the dimension of the minimal subcomplex on which the point lies, - * and `Index` the corresponding subcomplex index. + * and `MeshDomain::Index` the corresponding subcomplex index. * These initial points are inserted after one dimensional features initialization. * * Initialization is considered to be complete if the triangulation is a 3D triangulation @@ -500,17 +501,18 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * input surface). * * If the parameter `parameters::initial_points_generator()` is set, - * the points will be inserted before calling the functor. + * the points from this parameter will be inserted before calling the initial points generator * - * If after the insertion of initial points, together with the input generator, + * If after the insertion of initial points (possibly together with the input generator), * the initialization is not complete, * the domain's `construct_initial_points_object()` will be called. * * \tparam MeshDomain a model of `MeshDomain_3` * \tparam C3t3 a model of `MeshComplex_3InTriangulation_3` + * \tparam InitialPointsRange a model of `Range` containing tuple-like objects of + * `C3t3::Triangulation::Geom_traits::Weighted_point_3, int, MeshDomain::Index`. * - * @param initial_points a `Range` that contains points of tuple-like objects of - * `C3t3::Triangulation::Geom_traits::Weighted_point_3, int, MeshDomain::Index`. + * @param initial_points an instance of `InitialPointsRange` * * \cgalHeading{Example} * @@ -528,8 +530,8 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \sa `MeshDomain_3::Construct_initial_points` * */ -template -unspecified_type initial_points(const std::vector>& initial_points); +template +unspecified_type initial_points(const InitialPointsRange& initial_points); } /* namespace parameters */ } /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 958506295a7..ba7362204d3 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -33,7 +33,7 @@ typedef unspecified_type C3t3; /// @{ /*! -Outputs a set of surface points, for mesh initialization, to the +outputs a set of surface points for mesh initialization to the output iterator `pts`. If, after insertion of these points, the triangulation is still not 3D, @@ -41,12 +41,12 @@ or does not have any facets in the restricted Delaunay triangulation, then more points will be added automatically by the mesher. -@tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : +@tparam OutputIterator model of `OutputIterator` whose value type is a tuple-like object made of 3 elements: - a `C3t3::Triangulation::Point` : the point `p`, - - a `int` : the minimal dimension of the subcomplexes on which `p` lies, + - an `int` : the minimal dimension of the subcomplexes on which `p` lies, - a `MeshDomain_3::Index` : the index of the corresponding subcomplex. -@param pts the output points +@param pts an output iterator for the points @param n a lower bound on the number of points to construct for initialization. A generator can choose to ignore this parameter. @@ -63,9 +63,9 @@ with at least one facet in the restricted Delaunay triangulation. If these conditions are not satisfied, then more points will be added automatically by the mesher. -@tparam OutputIterator model of `OutputIterator`, containing tuple-like objects made of 3 elements : +@tparam OutputIterator model of `OutputIterator` whose value type is a tuple-like object made of 3 elements : - a `C3t3::Triangulation::Point` : the point `p`, - - a `int` : the minimal dimension of the subcomplexes to which `p` belongs, + - an `int` : the minimal dimension of the subcomplexes to which `p` belongs, - a `MeshDomain_3::Index` : the index of the corresponding subcomplex. */ template diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp index c08d245bf76..aff744355fb 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -44,15 +44,14 @@ int main() // Mesh criteria Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1) - .cell_radius_edge_ratio(3).cell_size(3) - ); + .cell_radius_edge_ratio(3).cell_size(3)); /// [Meshing] // Mesh generation with a custom initialization that places points in each of the image components. CGAL::Construct_initial_points_labeled_image img_pts_generator(image, domain); - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::initial_points_generator(img_pts_generator) - ); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + params::initial_points_generator(img_pts_generator)); /// [Meshing] // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index 7b7e0cb41ea..067c5e623f4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -47,13 +47,11 @@ int main() // Domain Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image - , params::features_detector(CGAL::Mesh_3::Detect_features_in_image()) - ); + , params::features_detector(CGAL::Mesh_3::Detect_features_in_image())); // Mesh criteria Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).edge_size(3) - .cell_radius_edge_ratio(3).cell_size(3) - ); + .cell_radius_edge_ratio(3).cell_size(3)); using Point_3 = K::Point_3; using Weighted_point_3 = K::Weighted_point_3; @@ -68,9 +66,8 @@ int main() /// [Meshing] // Mesh generation from labeled image with initial points. - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points(std::cref(initial_points)) - ); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + params::initial_points(std::cref(initial_points))); /// [Meshing] // Output diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 3ad11f85df5..db796094fd8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -35,6 +35,8 @@ namespace CGAL * this functor will scan the full image and * output points on every component. * + * \cgalModels{InitialPointsGenerator} + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_labeled_image` @@ -58,7 +60,7 @@ struct Construct_initial_points_gray_image { } /*! - * \brief Constructs at least `n` points by collecting them on the surface of all objects + * \brief constructs at least `n` points by collecting them on the surface of all objects * in the image, * even if they are non-connected components. * Using this functor guarantees to initialize each connected component. @@ -76,8 +78,9 @@ struct Construct_initial_points_gray_image OutputIterator operator()(OutputIterator pts, int n = 20) const { using CGAL::Mesh_3::internal::Create_gray_image_values_to_subdomain_indices; - typedef Create_gray_image_values_to_subdomain_indices C_i_v_t_s_i; - typedef typename C_i_v_t_s_i::type Image_values_to_subdomain_indices; + using C_i_v_t_s_i = Create_gray_image_values_to_subdomain_indices; + using Image_values_to_subdomain_indices = typename C_i_v_t_s_i::type; + Image_values_to_subdomain_indices transform_fct = C_i_v_t_s_i()(image_values_to_subdomain_indices_, iso_value_); Construct_initial_points_labeled_image init_pts{ image_, domain_ }; diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 423906d3cd4..f40adadc0e6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -85,6 +85,8 @@ struct Get_point * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` * @tparam MeshDomain model of `MeshDomain_3` * + * \cgalModels{InitialPointsGenerator} + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_gray_image` @@ -102,7 +104,7 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief Constructs at least `n` initial points, + * \brief constructs at least `n` initial points, * by scanning the image and * collecting points in each object in the image, * even if they are non-connected components. @@ -132,7 +134,7 @@ struct Construct_initial_points_labeled_image * @tparam MeshDomain model of `MeshDomain_3` * @tparam TransformOperator functor that transforms values of the image. * It must provide the following type:
    - * `result_type` : a type that supports the '==' operator
    + * `result_type` a type that supports the '==' operator
    * and the following operator:
    * `result_type operator()(Word v)` * with `Word` the type of the image values. diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 8e23e22a4cb..79db0543bab 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -11,14 +11,14 @@ #ifndef CGAL_MESH_OPTION_CLASSES_H #define CGAL_MESH_OPTION_CLASSES_H -#include - #include #include + #include -#include + #include #include +#include namespace CGAL { From 96455895a1909aee286110a6fced9dc8f90a81b2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 12:49:23 +0200 Subject: [PATCH 082/332] apply Mael's suggestions Co-authored-by: Mael --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index dd2c6418279..13751a868f8 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -748,10 +748,10 @@ the triangulation for each connected component. The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh -initialization (following the `InitialPointsGenerator`). The functor +initialization (following the concept `InitialPointsGenerator`). The functor `Construct_initial_points_labeled_image` is used in this example. It constructs points using the API of the mesh domain, as follows. -First the functor `construct_intersection` is created +First, the functor `construct_intersection` is created: \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h construct intersection then the `%Mesh_domain::Intersection` object (a `%tuple` with three From 7c4ab1ca0091068e603a3bd8048b0533eaad5eda Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 13:04:00 +0200 Subject: [PATCH 083/332] remove outdated named parameter --- .../include/CGAL/STL_Extension/internal/parameters_interface.h | 1 - 1 file changed, 1 deletion(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 82e1778a9f0..f24867aa76d 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -339,7 +339,6 @@ CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, ma CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) CGAL_add_named_parameter_with_compatibility(initial_points_generator_param_t,initial_points_generator_param,initial_points_generator) CGAL_add_named_parameter_with_compatibility(initial_points_param_t,initial_points_param,initial_points) -CGAL_add_named_parameter_with_compatibility(c3t3_initializer_param_t, c3t3_initializer_param, c3t3_initializer) CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) From 32f147f6e2b213c1de27222c0d0d99e019b660b0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 13:06:47 +0200 Subject: [PATCH 084/332] cleaning --- .../Mesh_3/mesh_3D_image_with_custom_initialization.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 600fa805b6a..37bdc503dbc 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -86,18 +86,15 @@ int main() // Domain Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image - , params::features_detector(CGAL::Mesh_3::Detect_features_on_image_bbox()) - ); + , params::features_detector(CGAL::Mesh_3::Detect_features_on_image_bbox())); // Mesh criteria Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).edge_size(3) - .cell_radius_edge_ratio(3).cell_size(3) - ); + .cell_radius_edge_ratio(3).cell_size(3)); /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(Custom_initial_points_generator{ image }) - ); + , params::initial_points_generator(Custom_initial_points_generator{ image })); /// [Meshing] // Output From 74cd65efcf31dec82652b7ec59adf26ebc6dc043 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 13:49:04 +0200 Subject: [PATCH 085/332] move to 6.1 --- Installation/CHANGES.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 410efd7d7a9..4ed784d0939 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,6 +1,16 @@ Release History =============== +[Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +----------- + +### [3D Mesh Generation](https://doc.cgal.org/6.0/Manual/packages.html#PkgMesh3) + +- Added two new meshing parameters that enable mesh initialization customization : + - `initial_points_generator` : enables the user to specify a functor that generates initial points. + - `initial_points` : enables the user to specify a `Range` of initial points. + + [Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) ----------- @@ -55,10 +65,6 @@ Release date: June 2024 - Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3` which are deprecated since CGAL-4.13. -- Added two new meshing parameters that enable mesh initialization customization : - - `initial_points_generator` : enables the user to specify a functor that generates initial points. - - `initial_points` : enables the user to specify a `Range` of initial points. - ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree) - **Breaking change**: - Node splitting behavior and per-node data are now customizable via the Traits class. From 4573f78d8b04f7b5833b2a45744ec357e080711b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 14:02:50 +0200 Subject: [PATCH 086/332] doc --- .../CGAL/Mesh_3/Construct_initial_points_labeled_image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index f40adadc0e6..b07cc5a7a1b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -134,7 +134,7 @@ struct Construct_initial_points_labeled_image * @tparam MeshDomain model of `MeshDomain_3` * @tparam TransformOperator functor that transforms values of the image. * It must provide the following type:
    - * `result_type` a type that supports the '==' operator
    + * `result_type`: a type that supports the '==' operator
    * and the following operator:
    * `result_type operator()(Word v)` * with `Word` the type of the image values. From 435ea6ea9cf80f8c4cc51d71ad9b4097aece2545 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 30 Sep 2024 14:29:47 +0200 Subject: [PATCH 087/332] doc --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 5fabe1892eb..07987f19ad4 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -501,7 +501,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * input surface). * * If the parameter `parameters::initial_points_generator()` is set, - * the points from this parameter will be inserted before calling the initial points generator + * the points from this parameter will be inserted before calling the initial points generator. * * If after the insertion of initial points (possibly together with the input generator), * the initialization is not complete, From a41cd1c626a0c9111a79262f48f90eb8d94fc453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Oct 2024 12:01:09 +0200 Subject: [PATCH 088/332] import @afabri files for Boolean using CDT --- .../demo/Triangulation_2/Boolean_2.cpp | 319 ++++++++++++++ .../demo/Triangulation_2/Boolean_2.qrc | 6 + .../demo/Triangulation_2/Boolean_2.ui | 257 +++++++++++ .../demo/Triangulation_2/CMakeLists.txt | 14 +- .../demo/Triangulation_2/about_Boolean_2.html | 10 + .../examples/Triangulation_2/CMakeLists.txt | 3 +- .../boolean_constrained_plus.cpp | 79 ++++ .../include/CGAL/Triangulation_2/Boolean.h | 410 ++++++++++++++++++ 8 files changed, 1096 insertions(+), 2 deletions(-) create mode 100644 GraphicsView/demo/Triangulation_2/Boolean_2.cpp create mode 100644 GraphicsView/demo/Triangulation_2/Boolean_2.qrc create mode 100644 GraphicsView/demo/Triangulation_2/Boolean_2.ui create mode 100644 GraphicsView/demo/Triangulation_2/about_Boolean_2.html create mode 100644 Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp create mode 100644 Triangulation_2/include/CGAL/Triangulation_2/Boolean.h diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp new file mode 100644 index 00000000000..b163eb14ad4 --- /dev/null +++ b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp @@ -0,0 +1,319 @@ +#include +// CGAL headers +#include +#include +#include +#include +#include +#include +#include + +// Qt headers +#include +#include +#include +#include +#include + +// GraphicsView items and event filters (input classes) +#include +#include +#include +#include +#include +#include + +// the two base classes +#include "ui_Boolean_2.h" +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point_2; +typedef K::Segment_2 Segment_2; +typedef K::Line_2 Line_2; + +typedef CGAL::Polygon_2 Polygon2; +typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; +typedef CGAL::Multipolygon_with_holes_2 Multipolygon_with_holes_2; + +typedef CGAL::Triangulations::Boolean Boolean; +typedef std::shared_ptr PolygonPtr ; + +typedef std::vector PolygonPtr_vector ; + +class MainWindow : + public CGAL::Qt::DemosMainWindow, + public Ui::Polygon_2 +{ + Q_OBJECT + +private: + + bool add_2_A = true; + CGAL::Qt::Converter convert; + Polygon2 poly; + Polygon_with_holes_2 pwhA, pwhB; + Multipolygon_with_holes_2 mpwhA, mpwhB, mpwhC; + QGraphicsScene scene; + + CGAL::Qt::MultipolygonWithHolesGraphicsItem *mpwhAgi, *mpwhBgi, *mpwhCgi; + + CGAL::Qt::GraphicsViewPolygonWithHolesInput * pi; + + +public: + MainWindow(); + +public Q_SLOTS: + + void processInput(CGAL::Object o); + + void on_actionClear_triggered(); + + void on_actionLoadPolygon_triggered(); + void on_actionSavePolygon_triggered(); + + void on_actionRecenter_triggered(); + + void on_actionAdd_to_A_triggered(); + void on_actionAdd_to_B_triggered(); + + void on_actionCreateInputPolygon_toggled(bool); + + void clear(); + + virtual void open(QString); +Q_SIGNALS: + void changed(); +}; + + +MainWindow::MainWindow() + : DemosMainWindow() +{ + setupUi(this); + + this->graphicsView->setAcceptDrops(false); + + mpwhAgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhA); + mpwhAgi->setBrush(QBrush(::Qt::green)); + mpwhAgi->setZValue(3); + QObject::connect(this, SIGNAL(changed()), + mpwhAgi, SLOT(modelChanged())); + + scene.addItem(mpwhAgi); + + mpwhBgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhB); + mpwhBgi->setZValue(4); + mpwhBgi->setBrush(QBrush(QColor(255, 0, 0, 100))); + QObject::connect(this, SIGNAL(changed()), + mpwhBgi, SLOT(modelChanged())); + + scene.addItem(mpwhBgi); + + mpwhCgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhC); + mpwhCgi->setZValue(5); + mpwhCgi->setBrush(QBrush(QColor(211, 211, 211, 150))); + QObject::connect(this, SIGNAL(changed()), + mpwhCgi, SLOT(modelChanged())); + + scene.addItem(mpwhCgi); + + + // Setup input handlers. They get events before the scene gets them + // pi = new CGAL::Qt::GraphicsViewPolylineInput(this, &scene, 0, true); + pi = new CGAL::Qt::GraphicsViewPolygonWithHolesInput(this, &scene); + pi->setZValue(10); + + this->actionCreateInputPolygon->setChecked(true); + QObject::connect(pi, SIGNAL(generate(CGAL::Object)), + this, SLOT(processInput(CGAL::Object))); + + // + // Manual handling of actions + // + QObject::connect(this->actionQuit, SIGNAL(triggered()), + this, SLOT(close())); + + + // + // Setup the scene and the view + // + scene.setItemIndexMethod(QGraphicsScene::NoIndex); + scene.setSceneRect(-100, -100, 100, 100); + this->graphicsView->setScene(&scene); + this->graphicsView->setMouseTracking(true); + + // Turn the vertical axis upside down + this->graphicsView->scale(1, -1); + + // The navigation adds zooming and translation functionality to the + // QGraphicsView + this->addNavigation(this->graphicsView); + + this->setupStatusBar(); + this->setupOptionsMenu(); + this->addAboutDemo(":/cgal/help/about_Polygon_2.html"); + this->addAboutCGAL(); + this->setupExportSVG(action_Export_SVG, graphicsView); + + this->addRecentFiles(this->menuFile, this->actionQuit); + connect(this, SIGNAL(openRecentFile(QString)), + this, SLOT(open(QString))); +} + + +void +MainWindow::processInput(CGAL::Object o) +{ + if(add_2_A){ + if(assign(pwhA, o)){ + mpwhA.add_polygon_with_holes(pwhA); + } + }else{ + if(assign(pwhB, o)){ + mpwhB.add_polygon_with_holes(pwhB); + } + } + if((! mpwhA.is_empty()) && (! mpwhB.is_empty())){ + Boolean boolean; + boolean.insert(mpwhA, mpwhB); + mpwhC = boolean([](bool a, bool b){ return a && b;}); + } + Q_EMIT( changed()); +} + +/* + * Qt Automatic Connections + * https://doc.qt.io/qt-5/designer-using-a-ui-file.html#automatic-connections + * + * setupUi(this) generates connections to the slots named + * "on__" + */ + +void +MainWindow::on_actionAdd_to_A_triggered() +{ + this->actionAdd_to_A->setEnabled(false); + this->actionAdd_to_B->setEnabled(true); + add_2_A = true; +} +void +MainWindow::on_actionAdd_to_B_triggered() +{ + this->actionAdd_to_B->setEnabled(false); + this->actionAdd_to_A->setEnabled(true); + add_2_A = false; +} + +void +MainWindow::on_actionClear_triggered() +{ + pwhA.clear(); + mpwhA.clear(); + clear(); + this->actionCreateInputPolygon->setChecked(true); + Q_EMIT( changed()); +} + + +void +MainWindow::on_actionLoadPolygon_triggered() +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open Polygon File"), + ".", + tr( "WKT files (*.wkt *.WKT);;" + "All file (*)")); + if(! fileName.isEmpty()){ + open(fileName); + } +} + +void +MainWindow::open(QString fileName) +{ + this->actionCreateInputPolygon->setChecked(false); + std::ifstream ifs(qPrintable(fileName)); + pwhA.clear(); + if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) + { + CGAL::IO::read_polygon_WKT(ifs, pwhA); + } + else + { + std::cout << "not supported" << std::endl; + } + clear(); + + this->addToRecentFiles(fileName); + Q_EMIT( changed()); +} + + +void +MainWindow::on_actionSavePolygon_triggered() +{ + QString fileName = QFileDialog::getSaveFileName(this, + tr("Save Polygon"), + ".", + tr( "WKT files (*.wkt *.WKT);;" + "All file (*)")); + if(! fileName.isEmpty()){ + std::ofstream ofs(qPrintable(fileName)); + if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) + { + CGAL::IO::write_polygon_WKT(ofs, pwhA); + } + else{ + std::cout << "not supported" << std::endl; + } + } +} + + +void +MainWindow::on_actionCreateInputPolygon_toggled(bool checked) +{ + // poly.clear(); + clear(); + if(checked){ + scene.installEventFilter(pi); + } else { + scene.removeEventFilter(pi); + } + Q_EMIT( changed()); +} + +void +MainWindow::on_actionRecenter_triggered() +{ + this->graphicsView->setSceneRect(mpwhAgi->boundingRect()); + this->graphicsView->fitInView(mpwhAgi->boundingRect(), Qt::KeepAspectRatio); +} + +void +MainWindow::clear() +{} + + +#include "Boolean_2.moc" +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + app.setOrganizationDomain("geometryfactory.com"); + app.setOrganizationName("GeometryFactory"); + app.setApplicationName("2D Boolean Operations"); + + // Import resources from libCGAL (Qt6). + // See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE + CGAL_QT_INIT_RESOURCES; + Q_INIT_RESOURCE(Boolean_2); + + MainWindow mainWindow; + mainWindow.show(); + return app.exec(); +} diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.qrc b/GraphicsView/demo/Triangulation_2/Boolean_2.qrc new file mode 100644 index 00000000000..010beb6b83a --- /dev/null +++ b/GraphicsView/demo/Triangulation_2/Boolean_2.qrc @@ -0,0 +1,6 @@ + + + ../resources/about_CGAL.html + about_Boolean_2.html + + diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.ui b/GraphicsView/demo/Triangulation_2/Boolean_2.ui new file mode 100644 index 00000000000..e02fb69fd47 --- /dev/null +++ b/GraphicsView/demo/Triangulation_2/Boolean_2.ui @@ -0,0 +1,257 @@ + + + GeometryFactory + Polygon_2 + + + + 0 + 0 + 568 + 325 + + + + CGAL 2D Polygon + + + + :/cgal/logos/cgal_icon:/cgal/logos/cgal_icon + + + + + + + Qt::Horizontal + + + + + 2 + 0 + + + + Qt::StrongFocus + + + Qt::ScrollBarAlwaysOn + + + Qt::ScrollBarAlwaysOn + + + QGraphicsView::NoAnchor + + + + + + + + + + File Tools + + + TopToolBarArea + + + false + + + + + + + + Visualization Tools + + + TopToolBarArea + + + false + + + + + + + 0 + 0 + 568 + 22 + + + + + &File + + + + + + + + + + + + &Algorithms + + + + + + + + + + + + &About + + + + + About &CGAL + + + + + &Quit + + + Ctrl+Q + + + + + + :/cgal/fileToolbar/fileNew.png:/cgal/fileToolbar/fileNew.png + + + &Clear + + + Ctrl+C + + + + + + :/cgal/fileToolbar/fileOpen.png:/cgal/fileToolbar/fileOpen.png + + + &Load Polygon + + + Ctrl+L + + + + + + :/cgal/fileToolbar/fileSave.png:/cgal/fileToolbar/fileSave.png + + + &Save Polygon + + + Ctrl+S + + + + + + :/cgal/Input/zoom-best-fit:/cgal/Input/zoom-best-fit + + + Re&center the viewport + + + Ctrl+R + + + + + Y-monotone Partition + + + + + true + + + Create Input Polygon + + + + + Minkowski sum with itself + + + + + Inner Skeleton + + + + + Outer Offset + + + + + Optimal Convex Partition + + + + + Approximate Convex Partition + + + + + Linear Least Squares Fitting of Points + + + + + Linear Least Squares Fitting of Segments + + + + + Maximum Area Triangle + + + + + &Export SVG... + + + + + Add to A + + + + + false + + + Add to B + + + + + + + + + + + diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index 515dfca6781..187ce6476dd 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -58,8 +58,20 @@ target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 add_to_cached_list(CGAL_EXECUTABLE_TARGETS Regular_triangulation_2) +#-------------------------------- +# The "Boolean" demo: Boolean_2 +#-------------------------------- + +qt_add_executable( + Boolean_2 Boolean_2.cpp + Boolean_2.ui Boolean_2.qrc) +target_link_libraries(Boolean_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 + Qt6::Widgets) + +add_to_cached_list(CGAL_EXECUTABLE_TARGETS Boolean_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) foreach(target Constrained_Delaunay_triangulation_2 Delaunay_triangulation_2 - Regular_triangulation_2) + Regular_triangulation_2 Boolean_2) cgal_add_compilation_test(${target}) endforeach() diff --git a/GraphicsView/demo/Triangulation_2/about_Boolean_2.html b/GraphicsView/demo/Triangulation_2/about_Boolean_2.html new file mode 100644 index 00000000000..b72bfadad22 --- /dev/null +++ b/GraphicsView/demo/Triangulation_2/about_Boolean_2.html @@ -0,0 +1,10 @@ + + +

    2D Boolean Operations

    +

    Copyright © 2024 GeometryFactory

    +

    This application illustrates the 2D Boolean operations based on 2D triangulations + of CGAL

    +

    See also the online + manual.

    + + diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 3e3aafa5f56..ed6100f50a9 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -16,7 +16,8 @@ foreach(cppfile ${cppfiles}) endforeach() if(CGAL_Qt6_FOUND) - target_link_libraries(constrained PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(boolean_constrained_plus PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(constrained PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(polygon_triangulation PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(star_conflict_zone PUBLIC CGAL::CGAL_Basic_viewer) diff --git a/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp b/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp new file mode 100644 index 00000000000..2b6748638e6 --- /dev/null +++ b/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp @@ -0,0 +1,79 @@ +#include + +#include +#include + + +#include +#include +#include + +#include + + +#include +#include + +#include + +using K = CGAL::Exact_predicates_exact_constructions_kernel; +using Vector_2 = K::Vector_2; +using Transformation = K::Aff_transformation_2; +using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; +using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; + +int +main(int argc, char* argv[]) +{ + CGAL::Triangulations::Boolean bops; + + Multipolygon_with_holes_2 pA, pB; + if(argc == 2) { + std::ifstream in(argv[1]); + CGAL::IO::read_multi_polygon_WKT(in, pA); + + CGAL::Bbox_2 bb = pA.bbox(); + double w = bb.xmax() - bb.xmin(); + Vector_2 vec(w / 10.0, w / 10.0); + pB = CGAL::transform(Transformation(CGAL::TRANSLATION, vec), pA); + } + else if (argc == 3) { + { + std::ifstream in(argv[1]); + CGAL::IO::read_multi_polygon_WKT(in, pA); + } + { + std::ifstream in(argv[2]); + CGAL::IO::read_multi_polygon_WKT(in, pB); + } + } + else { + { + std::istringstream is("MULTIPOLYGON( ((0 0, 20 0, 20 30, 0 30, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1 ) ) , (( 50 0, 60 0, 60 60, 50 60)) )"); + //std::istringstream is("MULTIPOLYGON( ((0 0, 2 0, 2 3, 0 3) ) )"); // (0.1 0.1, 0.1 0.4, 0.4 0.1) + CGAL::IO::read_multi_polygon_WKT(is, pA); + } + { + std::istringstream is("MULTIPOLYGON( ((10 1, 30 1, 30 2, 20 2, 20 4, 10 4)) )"); + //std::istringstream is("MULTIPOLYGON( ((2 1, 3 1, 3 2, 2 2)) "); + CGAL::IO::read_multi_polygon_WKT(is, pB); + } + } + + bops.insert(pA,pB); + Multipolygon_with_holes_2 mpwh = bops([](bool a, bool b){ return a || b;}); + std::ofstream out("result.wkt"); + CGAL::IO::write_multi_polygon_WKT(out, mpwh); + CGAL::draw(mpwh); + + /* + std::map map; + for(auto fh : bops.cdt.finite_face_handles()){ + map[fh] = fh->info().in_domain(0) || fh->info().in_domain(1); + assert(map[fh] == (fh->info().label != 0)); + } + + CGAL::draw(bops.cdt, boost::make_assoc_property_map(map)); + */ + return 0; +} diff --git a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h b/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h new file mode 100644 index 00000000000..a0d75456ad2 --- /dev/null +++ b/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h @@ -0,0 +1,410 @@ +// Copyright (c) 2024 GeometryFactory SARL (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_TRIANGULATION_2_BOOLEAN_H +#define CGAL_TRIANGULATION_2_BOOLEAN_H + +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +namespace CGAL { +namespace Triangulations { + +/*! +\ingroup PkgTriangulation2Miscellaneous + +\tparam Kernel must be +*/ + +template +class Boolean { + +private: + struct FaceInfo { + + FaceInfo() + {} + + int label; + int nesting_level[2]; + bool processed; + + bool + in_domain(int i) const + { + return nesting_level[i] % 2 == 1; + } + + template + bool + in_domain(const Fct& fct) const + { + return fct(in_domain(0), in_domain(1)); + } + + }; + + using K = Kernel; + using Point_2 = typename K::Point_2; + using Polygon_2 = CGAL::Polygon_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; + + using Itag = std::conditional_t, Exact_predicates_tag, Exact_intersections_tag>; + using Vb = CGAL::Triangulation_vertex_base_2; + using Fbb = CGAL::Triangulation_face_base_with_info_2; + using Fb = CGAL::Constrained_triangulation_face_base_2; + using Tds = CGAL::Triangulation_data_structure_2; + using CDT = CGAL::Constrained_Delaunay_triangulation_2; + using CDTplus = CGAL::Constrained_triangulation_plus_2; + using Face_handle = typename CDTplus::Face_handle; + using Face_circulator = typename CDTplus::Face_circulator; + using Vertex_handle = typename CDTplus::Vertex_handle; + using Constraint_id = typename CDTplus::Constraint_id; + using Edge = typename CDTplus::Edge; + using Context = typename CDTplus::Context; + + + // @todo taken from Polygon_repair should be factorized + struct Polygon_less { + + bool + operator()(const Polygon_2& pa, const Polygon_2& pb) const + { + typename Polygon_2::Vertex_iterator va = pa.vertices_begin(); + typename Polygon_2::Vertex_iterator vb = pb.vertices_begin(); + while (va != pa.vertices_end() && vb != pb.vertices_end()) { + if (*va != *vb) return *va < *vb; + ++va; + ++vb; + } + if (vb == pb.vertices_end()) return false; + return true; + } + + }; + + + // @todo taken from Polygon_repair should be factorized + struct Polygon_with_holes_less { + Polygon_less pl; + + bool + operator()(const Polygon_with_holes_2& pa, const Polygon_with_holes_2& pb) const + { + if (pl(pa.outer_boundary(), pb.outer_boundary())) return true; + if (pl(pb.outer_boundary(), pa.outer_boundary())) return false; + typename Polygon_with_holes_2::Hole_const_iterator ha = pa.holes_begin(); + typename Polygon_with_holes_2::Hole_const_iterator hb = pb.holes_begin(); + while (ha != pa.holes_end() && hb != pb.holes_end()) { + if (pl(*ha, *hb)) return true; + if (pl(*hb, *ha)) return false; + } + if (hb == pb.holes_end()) return false; + return true; + } + + }; + + + CDTplus cdt; + std::set idA, idB; + +public: + +/*! +default constructor. +*/ + Boolean() = default; + + +/*! +sets the polygons as input of the %Boolean operation. +*/ + void + insert(const Multipolygon_with_holes_2& pA, const Multipolygon_with_holes_2& pB) + { + for(const auto& pwh : pA.polygons_with_holes()){ + Constraint_id cidA = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); + idA.insert(cidA); + for(auto const& hole : pwh.holes()){ + cidA = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); + idA.insert(cidA); + } + } + + for(const auto& pwh : pB.polygons_with_holes()){ + Constraint_id cidB = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); + idB.insert(cidB); + for(auto const& hole : pwh.holes()){ + cidB = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); + idB.insert(cidB); + } + } + + mark_domains(idA, 0); + mark_domains(idB, 1); + } + +private: + + void + mark_domains(Face_handle start, + int index, + std::list& border, + const std::set& cids, + int aorb) + { + if(start->info().nesting_level[aorb] != -1){ + return; + } + std::list queue; + queue.push_back(start); + + while(! queue.empty()){ + Face_handle fh = queue.front(); + queue.pop_front(); + if(fh->info().nesting_level[aorb] == -1){ + fh->info().nesting_level[aorb] = index; + for(int i = 0; i < 3; i++){ + Edge e(fh,i); + Face_handle n = fh->neighbor(i); + if(n->info().nesting_level[aorb] == -1){ + if(cdt.is_constrained(e)){ + bool found = false; + for(Context c : cdt.contexts(e.first->vertex(cdt.cw(e.second)), + e.first->vertex(cdt.ccw(e.second)))){ + if(cids.find(c.id()) != cids.end()){ + found = true; + break; + } + } + if (found) { + border.push_back(e); + } else { + queue.push_back(n); + } + }else{ + queue.push_back(n); + } + } + } + } + } + } + + + // this marks the domains for either the first or the second multipolygon + void + mark_domains(const std::set& cids, int aorb) + { + for(Face_handle f : cdt.all_face_handles()){ + f->info().nesting_level[aorb] = -1; + } + + std::list border; + mark_domains(cdt.infinite_face(), 0, border, cids, aorb); + + while(! border.empty()){ + Edge e = border.front(); + border.pop_front(); + Face_handle n = e.first->neighbor(e.second); + if(n->info().nesting_level[aorb] == -1){ + mark_domains(n, e.first->info().nesting_level[aorb]+1, border, cids, aorb); + } + } + } + + + template + void + label_domains(Face_handle start, int label, const Fct& fct) + { + std::list queue; + start->info().label = label; + queue.push_back(start); + + while(! queue.empty()){ + Face_handle fh = queue.front(); + queue.pop_front(); + + for(int i = 0; i < 3; i++){ + Face_handle n = fh->neighbor(i); + if(n->info().in_domain(fct)){ + if(n->info().label == 0){ + n->info().label = label; + queue.push_back(n); + } + } + } + } + } + + // this marks the domain for the Boolean operation applied on the two multipolygons + template + int + label_domains(const Fct& fct) + { + for (auto const face: cdt.all_face_handles()) { + face->info().processed = false; + face->info().label = 0; + } + int label = 1; + for (auto const face: cdt.all_face_handles()) { + if(face->info().in_domain(fct) && face->info().label == 0){ + label_domains(face, label, fct); + ++label; + } + } + return label; + } + + + + // @todo taken from Polygon_repair and adapted; might be factorized + // Reconstruct ring boundary starting from an edge (face + opposite vertex) that is part of it + template + void + reconstruct_ring(std::list& ring, + Face_handle face_adjacent_to_boundary, + int opposite_vertex, + const Fct& fct) + { + // Create ring + Face_handle current_face = face_adjacent_to_boundary; + int current_opposite_vertex = opposite_vertex; + CGAL_assertion(face_adjacent_to_boundary->info().in_domain(fct)); + do { + CGAL_assertion(current_face->info().in_domain(fct) == face_adjacent_to_boundary->info().in_domain(fct)); + current_face->info().processed = true; + Vertex_handle pivot_vertex = current_face->vertex(current_face->cw(current_opposite_vertex)); + // std::cout << "\tAdding point " << pivot_vertex->point() << std::endl; + ring.push_back(pivot_vertex->point()); + Face_circulator fc = cdt.incident_faces(pivot_vertex, current_face); + do { + ++fc; + } while (fc->info().label != current_face->info().label); + current_face = fc; + current_opposite_vertex = fc->cw(fc->index(pivot_vertex)); + } while (current_face != face_adjacent_to_boundary || + current_opposite_vertex != opposite_vertex); + + // Start at lexicographically smallest vertex + typename std::list::iterator smallest_vertex = ring.begin(); + for (typename std::list::iterator current_vertex = ring.begin(); + current_vertex != ring.end(); ++current_vertex) { + if (*current_vertex < *smallest_vertex) smallest_vertex = current_vertex; + } + if (ring.front() != *smallest_vertex) { + ring.splice(ring.begin(), ring, smallest_vertex, ring.end()); + } + } + + +public: + + // @todo taken from Polygon_repair and adapted; might be factorized + +/*! +performs the Boolean operation applying `fct` and returns the result as a multipolygon with holes. + +\tparam Fct must have the operator `bool operator()(bool, bool)`. +*/ + template + Multipolygon_with_holes_2 + operator()(const Fct& fct) + { + int number_of_polygons = label_domains(fct) - 1; + + Multipolygon_with_holes_2 mp; + std::vector polygons; // outer boundaries + std::vector> holes; // holes are ordered (per polygon) + polygons.resize(number_of_polygons); + holes.resize(number_of_polygons); + + for (auto const face: cdt.all_face_handles()) { + face->info().processed = false; + } + + /* + for (auto const face: cdt.all_face_handles()) { + std::cout << face->vertex(0)->point() << " " << face->vertex(1)->point() << " " << face->vertex(2)->point() << std::endl; + std::cout << "label = " << face->info().label << std::endl; + if(face->info().in_domain(fct)) std::cout << "in domain" << std::endl; else std::cout << "not in domain" << std::endl; + } + */ + for (auto const &face: cdt.finite_face_handles()) { + if (! face->info().in_domain(fct)) continue; // exterior triangle + if (face->info().processed) continue; // already reconstructed + for (int opposite_vertex = 0; opposite_vertex < 3; ++opposite_vertex) { + if (face->info().in_domain(fct) == face->neighbor(opposite_vertex)->info().in_domain(fct)) continue; // not adjacent to boundary + + // Reconstruct ring + std::list ring; + reconstruct_ring(ring, face, opposite_vertex, fct); + + // Put ring in polygons + Polygon_2 polygon; + polygon.reserve(ring.size()); + polygon.insert(polygon.vertices_end(), ring.begin(), ring.end()); + if (polygon.orientation() == CGAL::COUNTERCLOCKWISE) { + polygons[face->info().label-1] = std::move(polygon); + } else { + holes[face->info().label-1].insert(std::move(polygon)); + } break; + } + } + + // Create polygons with holes and put in multipolygon + std::set ordered_polygons; + for (std::size_t i = 0; i < polygons.size(); ++i) { + ordered_polygons.insert(Polygon_with_holes_2(std::move(polygons[i]), + std::make_move_iterator(holes[i].begin()), + std::make_move_iterator(holes[i].end()))); + } + for (auto const& polygon: ordered_polygons) { + mp.add_polygon_with_holes(std::move(polygon)); + } + return mp; + } + + +/*! +access to the underlying constrained triangulation. +*/ + const CDTplus& + triangulation() const + { + return cdt; + } + +}; + + +} // namespace Triangulations +} //namespace CGAL + +#endif CGAL_TRIANGULATION_2_BOOLEAN_H From 69d56c5be050486e7aaedb57fa862e96b71ac30b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Oct 2024 09:07:52 +0100 Subject: [PATCH 089/332] const --- Polygon_repair/examples/Polygon_repair/repair_polygon_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/examples/Polygon_repair/repair_polygon_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_polygon_2.cpp index 0cc87355c7b..53f6612e0ea 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_polygon_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_polygon_2.cpp @@ -14,7 +14,7 @@ using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; int main(int argc, char* argv[]) { - char* filename = (argc > 1) ? argv[1] : "data/bridge-edge.wkt"; + const char* filename = (argc > 1) ? argv[1] : "data/bridge-edge.wkt"; std::ifstream in(filename); Polygon_with_holes_2 pin; From 8af54f73d1d8bdb9bde1b34244b24179b1f1ced4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Oct 2024 06:50:27 +0100 Subject: [PATCH 090/332] rename function --- .../include/CGAL/Polygon_repair/Union_rule.h | 35 +++++++++++++++++++ .../include/CGAL/Triangulation_2/Boolean.h | 4 +-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h new file mode 100644 index 00000000000..1e9d08fb5d7 --- /dev/null +++ b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h @@ -0,0 +1,35 @@ +// Copyright (c) 2024 GeometryFactory. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_POLYGON_REPAIR_UNION_RULE_H +#define CGAL_POLYGON_REPAIR_UNION_RULE_H + +#include + +namespace CGAL { + +namespace Polygon_repair { + +/// \addtogroup PkgPolygonRepairRef +/// @{ + +/*! + Tag class to select the union rule when calling `CGAL::Polygon_repair::repair()`. + */ + struct Union_rule {}; + +///@} + +} // namespace Polygon_repair + +} // namespace CGAL + +#endif // CGAL_POLYGON_REPAIR_UNION_RULE_H diff --git a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h b/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h index a0d75456ad2..34215bd2120 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h @@ -241,7 +241,7 @@ private: template void - label_domains(Face_handle start, int label, const Fct& fct) + label_domain(Face_handle start, int label, const Fct& fct) { std::list queue; start->info().label = label; @@ -275,7 +275,7 @@ private: int label = 1; for (auto const face: cdt.all_face_handles()) { if(face->info().in_domain(fct) && face->info().label == 0){ - label_domains(face, label, fct); + label_domain(face, label, fct); ++label; } } From ace1e7fd41485f9c59c47d4fef6495d7c57962cb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Oct 2024 10:42:28 +0100 Subject: [PATCH 091/332] Add repair() with Non_zero_rule --- .../repair_non_zero_polygon_2.cpp | 32 ++ .../{Union_rule.h => Non_zero_rule.h} | 10 +- .../include/CGAL/Polygon_repair/Winding.h | 353 ++++++++++++++++++ ...riangulation_with_even_odd_constraints_2.h | 6 +- .../include/CGAL/Polygon_repair/repair.h | 29 +- 5 files changed, 421 insertions(+), 9 deletions(-) create mode 100644 Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp rename Polygon_repair/include/CGAL/Polygon_repair/{Union_rule.h => Non_zero_rule.h} (63%) create mode 100644 Polygon_repair/include/CGAL/Polygon_repair/Winding.h diff --git a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp new file mode 100644 index 00000000000..9856375f3e7 --- /dev/null +++ b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +#include +#include +#include + +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_2 = Kernel::Point_2; +using Polygon_2 = CGAL::Polygon_2; +using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; +using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; +using Winding = CGAL::Polygon_repair::Winding; + +int main(int argc, char* argv[]) { + + const char* filename = (argc > 1) ? argv[1] : "data/winding.wkt"; + + std::ifstream in(filename); + Polygon_with_holes_2 pin; + CGAL::IO::read_polygon_WKT(in, pin); + + Multipolygon_with_holes_2 mp = CGAL::Polygon_repair::repair(pin, CGAL::Polygon_repair::Non_zero_rule()); + + if (mp.number_of_polygons_with_holes() > 1) { + CGAL::IO::write_multi_polygon_WKT(std::cout, mp); + } else { + CGAL::IO::write_polygon_WKT(std::cout, mp.polygons_with_holes()[0]); + } + return 0; +} diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h similarity index 63% rename from Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h rename to Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h index 1e9d08fb5d7..4c4585df59f 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h @@ -9,8 +9,8 @@ // // Author(s) : Andreas Fabri -#ifndef CGAL_POLYGON_REPAIR_UNION_RULE_H -#define CGAL_POLYGON_REPAIR_UNION_RULE_H +#ifndef CGAL_POLYGON_REPAIR_NON_ZERO_RULE_H +#define CGAL_POLYGON_REPAIR_NON_ZERO_RULE_H #include @@ -22,9 +22,9 @@ namespace Polygon_repair { /// @{ /*! - Tag class to select the union rule when calling `CGAL::Polygon_repair::repair()`. + Tag class to select the non zero rule when calling `CGAL::Polygon_repair::repair()`. */ - struct Union_rule {}; + struct Non_zero_rule {}; ///@} @@ -32,4 +32,4 @@ namespace Polygon_repair { } // namespace CGAL -#endif // CGAL_POLYGON_REPAIR_UNION_RULE_H +#endif // CGAL_POLYGON_REPAIR_NON_ZERO_RULE_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h new file mode 100644 index 00000000000..2155c94c0df --- /dev/null +++ b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h @@ -0,0 +1,353 @@ +// Copyright (c) 2024 GeometryFactory SARL (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_POLYGON_REPAIR_WINDING_H +#define CGAL_POLYGON_REPAIR_WINDING_H + +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +namespace CGAL { +namespace Polygon_repair { + +/*! +\ingroup PkgPolygonRepairFunctions + +\tparam Kernel must be +*/ + +template +class Winding { + +private: + struct FaceInfo { + + FaceInfo() + {} + + int wind; + int label; + int nesting_level[2]; + bool processed; + + bool + in_domain(int i) const + { + return nesting_level[i] % 2 == 1; + } + + template + bool + in_domain(const Fct& fct) const + { + return fct(in_domain(0), in_domain(1)); + } + + }; + + using K = Kernel; + using Point_2 = typename K::Point_2; + using Polygon_2 = CGAL::Polygon_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; + + using Itag = std::conditional_t, Exact_predicates_tag, Exact_intersections_tag>; + using Vb = CGAL::Triangulation_vertex_base_2; + using Fbb = CGAL::Triangulation_face_base_with_info_2; + using Fb = CGAL::Constrained_triangulation_face_base_2; + using Tds = CGAL::Triangulation_data_structure_2; + using CDT = CGAL::Constrained_Delaunay_triangulation_2; + using CDTplus = CGAL::Constrained_triangulation_plus_2; + using Face_handle = typename CDTplus::Face_handle; + using Face_circulator = typename CDTplus::Face_circulator; + using Vertex_handle = typename CDTplus::Vertex_handle; + using Constraint_id = typename CDTplus::Constraint_id; + using Edge = typename CDTplus::Edge; + using Context = typename CDTplus::Context; + + CDTplus cdt; + constexpr static int unintialized = std::numeric_limits::lowest(); + + + struct Polygon_less { + bool operator()(const Polygon_2& pa, const Polygon_2& pb) const { + typename Polygon_2::Vertex_iterator va = pa.vertices_begin(); + typename Polygon_2::Vertex_iterator vb = pb.vertices_begin(); + while (va != pa.vertices_end() && vb != pb.vertices_end()) { + if (*va != *vb) return *va < *vb; + ++va; + ++vb; + } + if (vb == pb.vertices_end()) return false; + return true; + } + }; + + struct Polygon_with_holes_less { + Polygon_less pl; + bool operator()(const Polygon_with_holes_2& pa, const Polygon_with_holes_2& pb) const { + if (pl(pa.outer_boundary(), pb.outer_boundary())) return true; + if (pl(pb.outer_boundary(), pa.outer_boundary())) return false; + typename Polygon_with_holes_2::Hole_const_iterator ha = pa.holes_begin(); + typename Polygon_with_holes_2::Hole_const_iterator hb = pb.holes_begin(); + while (ha != pa.holes_end() && hb != pb.holes_end()) { + if (pl(*ha, *hb)) return true; + if (pl(*hb, *ha)) return false; + } + if (hb == pb.holes_end()) return false; + return true; + } + }; + +public: + +/*! +default constructor. +*/ + Winding() = default; + + +*! +sets the polygon as input of the winding number computation. +*/ + void + insert(const Polygon_2& p) + { + Constraint_id cidA = cdt.insert_constraint(p.vertices_begin(), p.vertices_end(), true); + } + +/*! +sets the polygon as input of the winding number computation. +*/ + void + insert(const Polygon_with_holes_2& pwh) + { + Constraint_id cidA = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); + for(auto const& hole : pwh.holes()){ + cidA = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); + } + } + +/*! +sets the polygon as input of the winding number computation. +*/ + void + insert(const Multipolygon_with_holes_2& mpwh) + { + for(const auto& pwh : mpwh.polygons_with_holes()){ + Constraint_id cidA = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); + for(auto const& hole : pwh.holes()){ + cidA = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); + } + } + } + + void label(Face_handle f, int index, std::list>& border) + { + std::list queue; + queue.push_back(f); + while(! queue.empty()){ + Face_handle fh = queue.front(); + queue.pop_front(); + fh->info().wind = index; + for(int i = 0; i < 3; i++){ + Edge e(fh,i); + Face_handle n = fh->neighbor(i); + if(! cdt.is_constrained(e)){ + if(n->info().wind != index){ + queue.push_back(n); + } + }else{ + if(n->info().wind == unintialized){ + Vertex_handle u = e.first->vertex(cdt.cw(e.second)); + Vertex_handle v = e.first->vertex(cdt.ccw(e.second)); + int delta = 0; + for(Context c : cdt.contexts(u,v)){ + if(*c.current() ==u && *std::next(c.current()) == v){ + ++delta; + }else if(*c.current() ==v && *std::next(c.current()) == u){ + --delta; + }else{ + CGAL_assertion(false); + } + } + border.push_back(std::make_pair(Edge(n,n->index(fh)),index+delta)); + } + } + } + } + } + + void label() + { + std::list> border; + for(Face_handle f : cdt.all_face_handles()){ + f->info().wind = unintialized; + } + int index = 0; + label(cdt.infinite_face(),index++, border); + while(! border.empty()){ + Edge e; + int wind; + std::tie(e,wind) = border.front(); + border.pop_front(); + if(e.first->info().wind == unintialized){ + label(e.first, wind,border); + }else{ + CGAL_assertion(e.first->info().wind == wind); + } + } + } + + void + label_domain(Face_handle start, int label) + { + std::list queue; + queue.push_back(start); + + while(! queue.empty()){ + Face_handle fh = queue.front(); + queue.pop_front(); + fh->info().label = label; + + for(int i = 0; i < 3; i++){ + Face_handle n = fh->neighbor(i); + if(n->info().wind != 0 && n->info().label == 0){ + queue.push_back(n); + } + } + } + } + + int + label_domains() + { + for (auto const face: cdt.all_face_handles()) { + face->info().processed = false; + face->info().label = 0; + } + int label = 1; + for (auto const face: cdt.all_face_handles()) { + if(face->info().wind != 0 && face->info().label == 0){ + label_domain(face, label); + ++label; + } + } + return label; + } + + void + reconstruct_ring(std::list& ring, + Face_handle face_adjacent_to_boundary, + int opposite_vertex) + { + // Create ring + Face_handle current_face = face_adjacent_to_boundary; + int current_opposite_vertex = opposite_vertex; + CGAL_assertion(face_adjacent_to_boundary->info().wind != 0); + do { + current_face->info().processed = true; + Vertex_handle pivot_vertex = current_face->vertex(current_face->cw(current_opposite_vertex)); + // std::cout << "\tAdding point " << pivot_vertex->point() << std::endl; + ring.push_back(pivot_vertex->point()); + Face_circulator fc = cdt.incident_faces(pivot_vertex, current_face); + do { + ++fc; + } while (fc->info().label != current_face->info().label); + current_face = fc; + current_opposite_vertex = fc->cw(fc->index(pivot_vertex)); + } while (current_face != face_adjacent_to_boundary || + current_opposite_vertex != opposite_vertex); + + // Start at lexicographically smallest vertex + typename std::list::iterator smallest_vertex = ring.begin(); + for (typename std::list::iterator current_vertex = ring.begin(); + current_vertex != ring.end(); ++current_vertex) { + if (*current_vertex < *smallest_vertex) smallest_vertex = current_vertex; + } + if (ring.front() != *smallest_vertex) { + ring.splice(ring.begin(), ring, smallest_vertex, ring.end()); + } + } + + Multipolygon_with_holes_2 + operator()() + { + int number_of_polygons = label_domains() - 1; + + Multipolygon_with_holes_2 mp; + std::vector polygons; // outer boundaries + std::vector> holes; // holes are ordered (per polygon) + polygons.resize(number_of_polygons); + holes.resize(number_of_polygons); + + for (auto const face: cdt.all_face_handles()) { + face->info().processed = false; + } + + for (auto const &face: cdt.finite_face_handles()) { + if (face->info().wind==0) continue; // exterior triangle + if (face->info().processed) continue; // already reconstructed + for (int opposite_vertex = 0; opposite_vertex < 3; ++opposite_vertex) { + + if ((face->info().wind != 0) == (face->neighbor(opposite_vertex)->info().wind != 0)) continue; // not adjacent to boundary + + // Reconstruct ring + std::list ring; + reconstruct_ring(ring, face, opposite_vertex); + + // Put ring in polygons + Polygon_2 polygon; + polygon.reserve(ring.size()); + polygon.insert(polygon.vertices_end(), ring.begin(), ring.end()); + if (polygon.orientation() == CGAL::COUNTERCLOCKWISE) { + polygons[face->info().label-1] = std::move(polygon); + } else { + holes[face->info().label-1].insert(std::move(polygon)); + } break; + } + } + + // Create polygons with holes and put in multipolygon + std::set ordered_polygons; + for (std::size_t i = 0; i < polygons.size(); ++i) { + ordered_polygons.insert(Polygon_with_holes_2(std::move(polygons[i]), + std::make_move_iterator(holes[i].begin()), + std::make_move_iterator(holes[i].end()))); + } + for (auto const& polygon: ordered_polygons) { + mp.add_polygon_with_holes(std::move(polygon)); + } + return mp; + } + +}; + +} // namespace Polygon_repair + +} // namespace CGAL + +#endif CGAL_POLYGON_REPAIR_WINDING_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/internal/Triangulation_with_even_odd_constraints_2.h b/Polygon_repair/include/CGAL/Polygon_repair/internal/Triangulation_with_even_odd_constraints_2.h index e75be739e61..1203d1882a2 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/internal/Triangulation_with_even_odd_constraints_2.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/internal/Triangulation_with_even_odd_constraints_2.h @@ -9,8 +9,8 @@ // // Author(s) : Ken Arroyo Ohori -#ifndef CGAL_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H -#define CGAL_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H +#ifndef CGAL_POLYGON_REPAIR_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H +#define CGAL_POLYGON_REPAIR_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H #include #include @@ -124,4 +124,4 @@ public: } // namespace Polygon_repair } // namespace CGAL -#endif // CGAL_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H +#endif // CGAL_POLYGON_REPAIR_TRIANGULATION_WITH_EVEN_ODD_CONSTRAINTS_2_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index f6f2e84cfee..8fc0a2cb54f 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -24,9 +24,11 @@ #include #include #include +#include #include #include +#include namespace CGAL { @@ -71,11 +73,23 @@ Multipolygon_with_holes_2 repair(const Polygon_with_holes_2 +Multipolygon_with_holes_2 repair(const Polygon_with_holes_2& p, Non_zero_rule rule) +{ + Winding winding; + winding.insert(p); + winding.label(); + winding.label_domains(); + return winding(); +} + + /// \ingroup PkgPolygonRepairFunctions /// repairs multipolygon with holes `p` using the given rule /// \tparam Kernel parameter of the input and output polygons /// \tparam Container parameter of the input and output polygons -/// \tparam Rule must be `Even_odd_rule` +/// \tparam Rule must be `Even_odd_rule` or `Non_zero_rule` template Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Rule = Rule()) { @@ -87,6 +101,19 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole pr.reconstruct_multipolygon(); } return pr.multipolygon(); } +/* +template +Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Non_zero_rule rule) +{ + static_assert(std::is_same_v); + CGAL::Polygon_repair::Polygon_repair pr; + pr.add_to_triangulation_even_odd(p); + if (pr.triangulation().number_of_faces() > 0) { + pr.label_triangulation_even_odd(); + pr.reconstruct_multipolygon(); + } return pr.multipolygon(); +} +*/ template bool is_valid(const Polygon_2& polygon) { From 3076c16364d26e551c2159d3f1b65bd7f305969e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Oct 2024 11:12:17 +0100 Subject: [PATCH 092/332] Start changing the documentation --- .../doc/Polygon_repair/PackageDescription.txt | 3 ++- .../doc/Polygon_repair/Polygon_repair.txt | 24 ++++++++++++------- .../doc/Polygon_repair/examples.txt | 1 + .../include/CGAL/Polygon_repair/Winding.h | 4 ++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt index 0bd41658ad4..4aaac43b06e 100644 --- a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt +++ b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt @@ -15,7 +15,7 @@ \cgalPkgAuthors{Ken Arroyo Ohori} \cgalPkgDesc{This package provides algorithms to repair 2D polygons, polygons with holes, and multipolygons with holes, by selecting faces of the arrangement of the input based on a selection rule. -Currently, only the even-odd rule is provided. } +Currently, only the even-odd rule and the non-zero rule are provided. } \cgalPkgManuals{Chapter_2D_Polygon_repair,PkgPolygonRepairRef} \cgalPkgSummaryEnd @@ -35,4 +35,5 @@ Currently, only the even-odd rule is provided. } \cgalCRPSection{Simplification Rules} - `CGAL::Polygon_repair::Even_odd_rule` +- `CGAL::Polygon_repair::Non_zero_rule` */ diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 26b6f6d62c7..6fa329f9146 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -16,13 +16,14 @@ each face according to what it represents (exterior, polygon interior or hole), and reconstructs the polygon(s) represented by the arrangement. The method returns valid output stored in a multipolygon with holes. -Different arrangement and labelling heuristics are possible, but -currently only the even-odd rule is implemented in this package. -This rule results in areas that are alternately assigned as polygon +Different arrangement and labeling heuristics are possible, but +currently only the even-odd rule and non-zero rule are implemented in this package. +The even-odd rule results in areas that are alternately assigned as polygon interiors and exterior/holes each time that an input edge is passed. It does not distinguish between edges that are part of outer boundaries -from those of inner boundaries. In a next version we will add the -winding number rule. +from those of inner boundaries. + +The non-zero rule results in areas with a non-zero winding number. \section SectionPolygonRepair_Definitions Definitions @@ -81,7 +82,7 @@ order - The polygons with holes of a multipolygon with holes are also stored in lexicographic order -\section SectionPolygonRepair_Algorithm Algorithm +\section SectionPolygonRepair_Algorithm Even-Odd Algorithm Broadly, the algorithm consists of three steps: @@ -95,7 +96,7 @@ single multipolygon with holes. \cgalFigureBegin{inout, inout.svg} Examples of polygons with holes (a-d) and multipolygons with holes -(e-h) before (left) and after (right) being repaired. +(e-h) before (left) and after (right) being repaired with the even-odd rule. \cgalFigureEnd \subsection SubsectionPolygonRepair_Arrangement Arrangement @@ -133,7 +134,12 @@ into multipolygons using the face labels to know which polygon with holes inner/ boundaries belong to, and using the orientation to distinguish between the outer and inner boundaries of each polygon with holes. -\subsection SubsectionPolygonRepair_Notes Notes on the Output + +\section SectionPolygonRepair_Algorithm Non-Zero Algorithm + +Tbd. + +\section SubsectionPolygonRepair_Notes Notes on the Output If the input is already valid, the method will return a valid output representing the same area. However, the output might be different in order to conform to the @@ -148,7 +154,7 @@ with holes has zero holes and extract these if needed. \section SectionPolygonRepair_Examples Examples -\subsection SubsectionPolygonRepair_Repair Repairing a (Multi)polygon +\subsection SubsectionPolygonRepair_Repair Repairing a (Multi)polygon with the Even-Odd Rule It is possible to repair a polygon, polygon with holes or multipolygon with holes using the even-odd rule by calling the `Polygon_repair::repair()` function diff --git a/Polygon_repair/doc/Polygon_repair/examples.txt b/Polygon_repair/doc/Polygon_repair/examples.txt index e7d63a06e20..94e5ff33df3 100644 --- a/Polygon_repair/doc/Polygon_repair/examples.txt +++ b/Polygon_repair/doc/Polygon_repair/examples.txt @@ -1,4 +1,5 @@ /*! \example Polygon_repair/repair_polygon_2.cpp +\example Polygon_repair/repair_non_zero_polygon_2.cpp \example Polygon_repair/repair_multipolygon_2.cpp */ diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h index 2155c94c0df..1901e7b0112 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h @@ -130,7 +130,7 @@ default constructor. Winding() = default; -*! +/*! sets the polygon as input of the winding number computation. */ void @@ -350,4 +350,4 @@ sets the polygon as input of the winding number computation. } // namespace CGAL -#endif CGAL_POLYGON_REPAIR_WINDING_H +#endif // CGAL_POLYGON_REPAIR_WINDING_H From 80ffeac9c181087ef55e7312528a5795df99c5f5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Oct 2024 11:22:49 +0100 Subject: [PATCH 093/332] labeled --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index 8fc0a2cb54f..a838c3538d3 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -541,7 +541,7 @@ public: static void label_region(T& tt, Face_handle face, int label, std::list& to_check, std::list& to_check_added_by) { - // std::cout << "Labelling region with " << label << std::endl; + // std::cout << "Labeling region with " << label << std::endl; std::list to_check_in_region; face->label() = label; to_check_in_region.push_back(face); From f6da27d60913195bc5648413d9f41eb52c1fd9c9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Oct 2024 11:42:25 +0100 Subject: [PATCH 094/332] No need to include a kernel --- Polygon_repair/include/CGAL/Polygon_repair/Winding.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h index 1901e7b0112..2b975ce5d67 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h @@ -15,8 +15,6 @@ #include -#include - #include #include From d03325bb76f918e3f8f5e7bc75d6fe8bf5e9f805 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 4 Oct 2024 10:34:47 +0100 Subject: [PATCH 095/332] Move Boolean.h --- GraphicsView/demo/Triangulation_2/Boolean_2.cpp | 7 +++++-- .../examples/Polygon_repair/CMakeLists.txt | 9 +++++++-- .../Polygon_repair/repair_non_zero_polygon_2.cpp | 4 +++- .../include/CGAL/Polygon_repair}/Boolean.h | 14 ++++++-------- 4 files changed, 21 insertions(+), 13 deletions(-) rename {Triangulation_2/include/CGAL/Triangulation_2 => Polygon_repair/include/CGAL/Polygon_repair}/Boolean.h (97%) diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp index b163eb14ad4..1b0c6c05d55 100644 --- a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ typedef CGAL::Polygon_2 Polygon2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Multipolygon_with_holes_2 Multipolygon_with_holes_2; -typedef CGAL::Triangulations::Boolean Boolean; +typedef CGAL::Polygon_repair::Boolean Boolean; typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonPtr_vector ; @@ -211,6 +211,9 @@ MainWindow::on_actionClear_triggered() { pwhA.clear(); mpwhA.clear(); + pwhB.clear(); + mpwhB.clear(); + mpwhC.clear(); clear(); this->actionCreateInputPolygon->setChecked(true); Q_EMIT( changed()); diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 93722bb7c3b..2f77af2afe7 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12...3.29) project(Polygon_repair_Examples) -find_package(CGAL REQUIRED) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) # create a target per cppfile file( @@ -13,4 +13,9 @@ file( ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") -endforeach() \ No newline at end of file +endforeach() + + +if(CGAL_Qt6_FOUND) + target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer) +endif() diff --git a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp index 9856375f3e7..b87459e968d 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp @@ -5,13 +5,13 @@ #include #include #include +#include using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; using Point_2 = Kernel::Point_2; using Polygon_2 = CGAL::Polygon_2; using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; -using Winding = CGAL::Polygon_repair::Winding; int main(int argc, char* argv[]) { @@ -23,6 +23,8 @@ int main(int argc, char* argv[]) { Multipolygon_with_holes_2 mp = CGAL::Polygon_repair::repair(pin, CGAL::Polygon_repair::Non_zero_rule()); + CGAL::draw(mp); + if (mp.number_of_polygons_with_holes() > 1) { CGAL::IO::write_multi_polygon_WKT(std::cout, mp); } else { diff --git a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h similarity index 97% rename from Triangulation_2/include/CGAL/Triangulation_2/Boolean.h rename to Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index 34215bd2120..b355bc6909e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -10,12 +10,10 @@ // // Author(s) : Andreas Fabri -#ifndef CGAL_TRIANGULATION_2_BOOLEAN_H -#define CGAL_TRIANGULATION_2_BOOLEAN_H +#ifndef CGAL_POLYGON_REPAIR_BOOLEAN_H +#define CGAL_POLYGON_REPAIR_BOOLEAN_H -#include - -#include +#include #include #include @@ -31,7 +29,7 @@ #include namespace CGAL { -namespace Triangulations { +namespace Polygon_repair { /*! \ingroup PkgTriangulation2Miscellaneous @@ -404,7 +402,7 @@ access to the underlying constrained triangulation. }; -} // namespace Triangulations +} // namespace Polygon_repair } //namespace CGAL -#endif CGAL_TRIANGULATION_2_BOOLEAN_H +#endif CGAL_POLYGON_REPAIR_BOOLEAN_H From 75d3d30cb40b9b010bd0ef6be568e195627fb301 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Nov 2024 10:27:54 +0100 Subject: [PATCH 096/332] fix unused variable warnings and add a const --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 2 +- .../include/CGAL/Mesh_3/Construct_initial_points_gray_image.h | 2 +- .../CGAL/Mesh_3/Construct_initial_points_labeled_image.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index ba7362204d3..3453e3b27d1 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -52,7 +52,7 @@ A generator can choose to ignore this parameter. */ template -OutputIterator operator()(OutputIterator pts, int n); +OutputIterator operator()(OutputIterator pts, const int n); /*! Same as above, without the `n` parameter. diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index db796094fd8..9bbafbf57dd 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -75,7 +75,7 @@ struct Construct_initial_points_gray_image * */ template - OutputIterator operator()(OutputIterator pts, int n = 20) const + OutputIterator operator()(OutputIterator pts, const int n = 20) const { using CGAL::Mesh_3::internal::Create_gray_image_values_to_subdomain_indices; using C_i_v_t_s_i = Create_gray_image_values_to_subdomain_indices; diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index b07cc5a7a1b..caf5d0fe63f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -117,7 +117,7 @@ struct Construct_initial_points_labeled_image * - a `MeshDomain::Index` for the corresponding subcomplex index */ template - OutputIterator operator()(OutputIterator pts, int n = 20) const + OutputIterator operator()(OutputIterator pts, const int n = 20) const { CGAL_IMAGE_IO_CASE(image_.image(), operator()(pts, CGAL::Identity(), n)); return pts; diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c6f189abbeb..989cbe7d649 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -42,7 +42,7 @@ namespace internal { template < typename C3T3, typename MeshDomain, typename InitialPointsGenerator > void add_points_from_generator(C3T3& c3t3, - const MeshDomain& domain, + const MeshDomain&, const int nb_initial_points, const InitialPointsGenerator& generator) { diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 79db0543bab..b017dac3111 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -176,7 +176,7 @@ private: struct Dummy_initial_points_generator { template - OutputIterator operator()(OutputIterator oit, int n = 0) const { return oit; } + OutputIterator operator()(OutputIterator oit, const int) const { return oit; } }; // Holds the two parameters `initial_points_generator` and `initial_points`, @@ -210,7 +210,7 @@ struct Initialization_options {} template - OutputIterator operator()(OutputIterator pts, int n = 0) const + OutputIterator operator()(OutputIterator pts, const int n = 0) const { // add initial_points for (Initial_points_const_iterator it = begin_it; it != end_it; ++it) From e0ef774144df36a392cea844dbab867bab6a3939 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 13:55:21 +0000 Subject: [PATCH 097/332] Add code for repairing with a union or intersection rule --- .../examples/Polygon_repair/CMakeLists.txt | 2 + .../Polygon_repair/repair_join_intersect.cpp | 52 +++++++ .../include/CGAL/Polygon_repair/Boolean.h | 131 ++++++++++-------- .../boolean_constrained_plus.cpp | 79 ----------- 4 files changed, 125 insertions(+), 139 deletions(-) create mode 100644 Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp delete mode 100644 Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 2f77af2afe7..37f9b9423a9 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -16,6 +16,8 @@ foreach(cppfile ${cppfiles}) endforeach() + if(CGAL_Qt6_FOUND) target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(boolean PUBLIC CGAL::CGAL_Basic_viewer) endif() diff --git a/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp b/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp new file mode 100644 index 00000000000..52b438f05f1 --- /dev/null +++ b/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp @@ -0,0 +1,52 @@ +#include + +#include +#include +#include + +#include + +#include + + +#include +#include + +using K = CGAL::Exact_predicates_inexact_constructions_kernel; + +using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; +using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; + +int +main(int argc, char* argv[]) +{ + + + Multipolygon_with_holes_2 pA; + if (argc == 2) { + { + std::ifstream in(argv[1]); + CGAL::IO::read_multi_polygon_WKT(in, pA); + } + } else { + std::istringstream is("MULTIPOLYGON( ((0 0, 20 0, 20 20, 0 20), (1 1, 1 19, 19 19, 19 1) ) , (( 10 -2, 12 -2, 12 22, 10 22)) )"); + //std::istringstream is("MULTIPOLYGON( ((0 0, 2 0, 2 3, 0 3) ) )"); // (0.1 0.1, 0.1 0.4, 0.4 0.1) + CGAL::IO::read_multi_polygon_WKT(is, pA); + } + + Multipolygon_with_holes_2 mpwh = CGAL::Polygon_repair::join(pA); + { + std::ofstream out("union.wkt"); + CGAL::IO::write_multi_polygon_WKT(out, mpwh); + CGAL::draw(mpwh); + } + mpwh = CGAL::Polygon_repair::intersection(pA); + { + std::ofstream out("intersection.wkt"); + CGAL::IO::write_multi_polygon_WKT(out, mpwh); + CGAL::draw(mpwh); + } + + + return 0; +} diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index b355bc6909e..f03e800acbb 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -47,20 +47,14 @@ private: {} int label; - int nesting_level[2]; + int layers; bool processed; - bool - in_domain(int i) const - { - return nesting_level[i] % 2 == 1; - } - template bool in_domain(const Fct& fct) const { - return fct(in_domain(0), in_domain(1)); + return fct(layers); } }; @@ -129,7 +123,6 @@ private: CDTplus cdt; - std::set idA, idB; public: @@ -143,28 +136,16 @@ default constructor. sets the polygons as input of the %Boolean operation. */ void - insert(const Multipolygon_with_holes_2& pA, const Multipolygon_with_holes_2& pB) + insert(const Multipolygon_with_holes_2& pA) { for(const auto& pwh : pA.polygons_with_holes()){ - Constraint_id cidA = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); - idA.insert(cidA); + cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); for(auto const& hole : pwh.holes()){ - cidA = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); - idA.insert(cidA); + cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); } } - for(const auto& pwh : pB.polygons_with_holes()){ - Constraint_id cidB = cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); - idB.insert(cidB); - for(auto const& hole : pwh.holes()){ - cidB = cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); - idB.insert(cidB); - } - } - - mark_domains(idA, 0); - mark_domains(idB, 1); + mark_domains(); } private: @@ -172,11 +153,9 @@ private: void mark_domains(Face_handle start, int index, - std::list& border, - const std::set& cids, - int aorb) + std::list& border) { - if(start->info().nesting_level[aorb] != -1){ + if(start->info().layers != -1){ return; } std::list queue; @@ -185,26 +164,14 @@ private: while(! queue.empty()){ Face_handle fh = queue.front(); queue.pop_front(); - if(fh->info().nesting_level[aorb] == -1){ - fh->info().nesting_level[aorb] = index; + if(fh->info().layers == -1){ + fh->info().layers = index; for(int i = 0; i < 3; i++){ Edge e(fh,i); Face_handle n = fh->neighbor(i); - if(n->info().nesting_level[aorb] == -1){ + if(n->info().layers == -1){ if(cdt.is_constrained(e)){ - bool found = false; - for(Context c : cdt.contexts(e.first->vertex(cdt.cw(e.second)), - e.first->vertex(cdt.ccw(e.second)))){ - if(cids.find(c.id()) != cids.end()){ - found = true; - break; - } - } - if (found) { - border.push_back(e); - } else { - queue.push_back(n); - } + border.push_back(e); }else{ queue.push_back(n); } @@ -215,23 +182,37 @@ private: } - // this marks the domains for either the first or the second multipolygon + // this marks how many multipolygon interiors overlap a cell of the arrangement of mutipolygons void - mark_domains(const std::set& cids, int aorb) + mark_domains() { for(Face_handle f : cdt.all_face_handles()){ - f->info().nesting_level[aorb] = -1; + f->info().layers = -1; } + int overlays = 0; std::list border; - mark_domains(cdt.infinite_face(), 0, border, cids, aorb); + mark_domains(cdt.infinite_face(), overlays, border); while(! border.empty()){ Edge e = border.front(); border.pop_front(); - Face_handle n = e.first->neighbor(e.second); - if(n->info().nesting_level[aorb] == -1){ - mark_domains(n, e.first->info().nesting_level[aorb]+1, border, cids, aorb); + Face_handle fh = e.first; + int fi = e.second; + Face_handle n = fh->neighbor(fi); + if(n->info().layers == -1){ + Vertex_handle u = fh->vertex(cdt.cw(fi)), v = fh->vertex(cdt.ccw(fi)); + int delta = 0; + for(Context c : cdt.contexts(u,v)){ + if(*c.current() ==u && *std::next(c.current()) == v){ + ++delta; + }else if(*c.current() ==v && *std::next(c.current()) == u){ + --delta; + }else{ + CGAL_assertion(false); + } + } + mark_domains(n, fh->info().layers+delta, border); } } } @@ -336,7 +317,6 @@ performs the Boolean operation applying `fct` and returns the result as a multip operator()(const Fct& fct) { int number_of_polygons = label_domains(fct) - 1; - Multipolygon_with_holes_2 mp; std::vector polygons; // outer boundaries std::vector> holes; // holes are ordered (per polygon) @@ -347,13 +327,6 @@ performs the Boolean operation applying `fct` and returns the result as a multip face->info().processed = false; } - /* - for (auto const face: cdt.all_face_handles()) { - std::cout << face->vertex(0)->point() << " " << face->vertex(1)->point() << " " << face->vertex(2)->point() << std::endl; - std::cout << "label = " << face->info().label << std::endl; - if(face->info().in_domain(fct)) std::cout << "in domain" << std::endl; else std::cout << "not in domain" << std::endl; - } - */ for (auto const &face: cdt.finite_face_handles()) { if (! face->info().in_domain(fct)) continue; // exterior triangle if (face->info().processed) continue; // already reconstructed @@ -401,6 +374,44 @@ access to the underlying constrained triangulation. }; +template +Multipolygon_with_holes_2 +join(const Multipolygon_with_holes_2& pA) +{ + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + struct Larger_than_zero { + bool operator()(int i) const + { + return i > 0; + } + }; + Larger_than_zero ltz; + return bops(ltz); +} + + + +template +Multipolygon_with_holes_2 +intersection(const Multipolygon_with_holes_2& pA) +{ + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + struct Equal { + int val; + Equal(int val) + : val(val) + {} + + bool operator()(int i) const + { + return i == val; + } + }; + Equal equal(pA.number_of_polygons_with_holes()); + return bops(equal); +} } // namespace Polygon_repair } //namespace CGAL diff --git a/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp b/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp deleted file mode 100644 index 2b6748638e6..00000000000 --- a/Triangulation_2/examples/Triangulation_2/boolean_constrained_plus.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include - -#include -#include - - -#include -#include -#include - -#include - - -#include -#include - -#include - -using K = CGAL::Exact_predicates_exact_constructions_kernel; -using Vector_2 = K::Vector_2; -using Transformation = K::Aff_transformation_2; -using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; -using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; - -int -main(int argc, char* argv[]) -{ - CGAL::Triangulations::Boolean bops; - - Multipolygon_with_holes_2 pA, pB; - if(argc == 2) { - std::ifstream in(argv[1]); - CGAL::IO::read_multi_polygon_WKT(in, pA); - - CGAL::Bbox_2 bb = pA.bbox(); - double w = bb.xmax() - bb.xmin(); - Vector_2 vec(w / 10.0, w / 10.0); - pB = CGAL::transform(Transformation(CGAL::TRANSLATION, vec), pA); - } - else if (argc == 3) { - { - std::ifstream in(argv[1]); - CGAL::IO::read_multi_polygon_WKT(in, pA); - } - { - std::ifstream in(argv[2]); - CGAL::IO::read_multi_polygon_WKT(in, pB); - } - } - else { - { - std::istringstream is("MULTIPOLYGON( ((0 0, 20 0, 20 30, 0 30, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1 ) ) , (( 50 0, 60 0, 60 60, 50 60)) )"); - //std::istringstream is("MULTIPOLYGON( ((0 0, 2 0, 2 3, 0 3) ) )"); // (0.1 0.1, 0.1 0.4, 0.4 0.1) - CGAL::IO::read_multi_polygon_WKT(is, pA); - } - { - std::istringstream is("MULTIPOLYGON( ((10 1, 30 1, 30 2, 20 2, 20 4, 10 4)) )"); - //std::istringstream is("MULTIPOLYGON( ((2 1, 3 1, 3 2, 2 2)) "); - CGAL::IO::read_multi_polygon_WKT(is, pB); - } - } - - bops.insert(pA,pB); - Multipolygon_with_holes_2 mpwh = bops([](bool a, bool b){ return a || b;}); - std::ofstream out("result.wkt"); - CGAL::IO::write_multi_polygon_WKT(out, mpwh); - CGAL::draw(mpwh); - - /* - std::map map; - for(auto fh : bops.cdt.finite_face_handles()){ - map[fh] = fh->info().in_domain(0) || fh->info().in_domain(1); - assert(map[fh] == (fh->info().label != 0)); - } - - CGAL::draw(bops.cdt, boost::make_assoc_property_map(map)); - */ - return 0; -} From 8910d589c1b3ddbe0d3ff1943c63567565269497 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 14:06:23 +0000 Subject: [PATCH 098/332] Fix CMakeLists --- Polygon_repair/examples/Polygon_repair/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 37f9b9423a9..7d7bc62ab64 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -19,5 +19,5 @@ endforeach() if(CGAL_Qt6_FOUND) target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(boolean PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(repair_join_intersect PUBLIC CGAL::CGAL_Basic_viewer) endif() From a99dcc94f8a699eb971b95a2ae37df11efa3b966 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 15:18:35 +0000 Subject: [PATCH 099/332] Use repair() with two new rules --- .../Polygon_repair/repair_join_intersect.cpp | 8 ++-- .../CGAL/Polygon_repair/Intersection_rule.h | 35 ++++++++++++++++ .../include/CGAL/Polygon_repair/Union_rule.h | 35 ++++++++++++++++ .../include/CGAL/Polygon_repair/repair.h | 41 +++++++++++++++++++ 4 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h create mode 100644 Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h diff --git a/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp b/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp index 52b438f05f1..b8e5a9c752b 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include @@ -20,8 +20,6 @@ using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; int main(int argc, char* argv[]) { - - Multipolygon_with_holes_2 pA; if (argc == 2) { { @@ -34,13 +32,13 @@ main(int argc, char* argv[]) CGAL::IO::read_multi_polygon_WKT(is, pA); } - Multipolygon_with_holes_2 mpwh = CGAL::Polygon_repair::join(pA); + Multipolygon_with_holes_2 mpwh = CGAL::Polygon_repair::repair(pA, CGAL::Polygon_repair::Union_rule()); { std::ofstream out("union.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); CGAL::draw(mpwh); } - mpwh = CGAL::Polygon_repair::intersection(pA); + mpwh = CGAL::Polygon_repair::repair(pA, CGAL::Polygon_repair::Intersection_rule()); { std::ofstream out("intersection.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h new file mode 100644 index 00000000000..46e1aeaf51e --- /dev/null +++ b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h @@ -0,0 +1,35 @@ +// Copyright (c) 2024 GeometryFactory. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_POLYGON_REPAIR_INTERSECTION_RULE_H +#define CGAL_POLYGON_REPAIR_INTERSECTION_RULE_H + +#include + +namespace CGAL { + +namespace Polygon_repair { + +/// \addtogroup PkgPolygonRepairRef +/// @{ + +/*! + Tag class to select the %ntersection rule when calling `CGAL::Polygon_repair::repair()`. + */ + struct Intersection_rule {}; + +///@} + +} // namespace Polygon_repair + +} // namespace CGAL + +#endif // CGAL_POLYGON_REPAIR_INTERSECTION_RULE_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h new file mode 100644 index 00000000000..011b67da466 --- /dev/null +++ b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h @@ -0,0 +1,35 @@ +// Copyright (c) 2024 GeometryFactory. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_POLYGON_REPAIR_UNION_RULE_H +#define CGAL_POLYGON_REPAIR_UNION_RULE_H + +#include + +namespace CGAL { + +namespace Polygon_repair { + +/// \addtogroup PkgPolygonRepairRef +/// @{ + +/*! + Tag class to select the %union rule when calling `CGAL::Polygon_repair::repair()`. + */ + struct Union_rule {}; + +///@} + +} // namespace Polygon_repair + +} // namespace CGAL + +#endif // CGAL_POLYGON_REPAIR_UNION_RULE_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index a838c3538d3..c1966843c44 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -25,10 +25,13 @@ #include #include #include +#include +#include #include #include #include +#include namespace CGAL { @@ -101,6 +104,44 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole pr.reconstruct_multipolygon(); } return pr.multipolygon(); } + + +template +Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Union_rule rule) +{ + CGAL::Polygon_repair::Boolean bops; + bops.insert(p); + struct Larger_than_zero { + bool operator()(int i) const + { + return i > 0; + } + }; + Larger_than_zero ltz; + return bops(ltz); +} + + +template +Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Intersection_rule rule) +{ + CGAL::Polygon_repair::Boolean bops; + bops.insert(p); + struct Equal { + int val; + Equal(int val) + : val(val) + {} + + bool operator()(int i) const + { + return i == val; + } + }; + Equal equal(p.number_of_polygons_with_holes()); + return bops(equal); +} + /* template Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Non_zero_rule rule) From c835d10fb677b355783ecec43a8b3b34a4539616 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 15:26:52 +0000 Subject: [PATCH 100/332] Cleanup --- Polygon_repair/doc/Polygon_repair/PackageDescription.txt | 8 +++++--- Triangulation_2/examples/Triangulation_2/CMakeLists.txt | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt index 4aaac43b06e..98d974c7a43 100644 --- a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt +++ b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt @@ -15,7 +15,8 @@ \cgalPkgAuthors{Ken Arroyo Ohori} \cgalPkgDesc{This package provides algorithms to repair 2D polygons, polygons with holes, and multipolygons with holes, by selecting faces of the arrangement of the input based on a selection rule. -Currently, only the even-odd rule and the non-zero rule are provided. } +The even-odd rule and the non-zero rule are provided for dealing with self intersections. +The %union and the %intersection rule enable to combine similar polygons. } \cgalPkgManuals{Chapter_2D_Polygon_repair,PkgPolygonRepairRef} \cgalPkgSummaryEnd @@ -33,7 +34,8 @@ Currently, only the even-odd rule and the non-zero rule are provided. } \cgalCRPSection{Functions} - `CGAL::Polygon_repair::repair()` -\cgalCRPSection{Simplification Rules} +\cgalCRPSection{Repair Rules} - `CGAL::Polygon_repair::Even_odd_rule` -- `CGAL::Polygon_repair::Non_zero_rule` +- `CGAL::Polygon_repair::Union_rule` +- `CGAL::Polygon_repair::Intersection_rule` */ diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index ed6100f50a9..3e3aafa5f56 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -16,8 +16,7 @@ foreach(cppfile ${cppfiles}) endforeach() if(CGAL_Qt6_FOUND) - target_link_libraries(boolean_constrained_plus PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(constrained PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(constrained PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(polygon_triangulation PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(star_conflict_zone PUBLIC CGAL::CGAL_Basic_viewer) From c6e6307093918674f38ecb8b955f98a131d2dc29 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 15:35:49 +0000 Subject: [PATCH 101/332] Cleanup --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 9 +++++++-- Polygon_repair/doc/Polygon_repair/examples.txt | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 6fa329f9146..00ffc5f90dc 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -9,7 +9,7 @@ namespace CGAL { \section SectionPolygonRepair_Introduction Introduction -This package implements a polygon repair method. Starting from possibly +This package implements polygon repair methods. Starting from possibly invalid input in the form of a polygon, polygon with holes or multipolygon with holes, the method computes an arrangement of the input edges, labels each face according to what it represents (exterior, polygon interior @@ -17,7 +17,7 @@ or hole), and reconstructs the polygon(s) represented by the arrangement. The method returns valid output stored in a multipolygon with holes. Different arrangement and labeling heuristics are possible, but -currently only the even-odd rule and non-zero rule are implemented in this package. +currently the even-odd rule and non-zero rule are implemented in this package. The even-odd rule results in areas that are alternately assigned as polygon interiors and exterior/holes each time that an input edge is passed. It does not distinguish between edges that are part of outer boundaries @@ -25,6 +25,11 @@ from those of inner boundaries. The non-zero rule results in areas with a non-zero winding number. +Two additional repair rules are provided that are useful when given +several similar valid polygons with holes. They compute either their +union or their intersection to be conservative by bounding +from the interior or the exterior. + \section SectionPolygonRepair_Definitions Definitions - A valid polygon (without holes) is a point set in \f$ \mathbb{R}^2\f$ diff --git a/Polygon_repair/doc/Polygon_repair/examples.txt b/Polygon_repair/doc/Polygon_repair/examples.txt index 94e5ff33df3..cf2270b08fa 100644 --- a/Polygon_repair/doc/Polygon_repair/examples.txt +++ b/Polygon_repair/doc/Polygon_repair/examples.txt @@ -2,4 +2,5 @@ \example Polygon_repair/repair_polygon_2.cpp \example Polygon_repair/repair_non_zero_polygon_2.cpp \example Polygon_repair/repair_multipolygon_2.cpp +\example Polygon_repair/repair_join_intersect_2.cpp */ From 0de379d4bdd89b0daa5ac1a11726c7234cec3fe2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 15:46:33 +0000 Subject: [PATCH 102/332] Fix example file name --- Polygon_repair/doc/Polygon_repair/examples.txt | 2 +- .../{repair_join_intersect.cpp => repair_union_intersect_2.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Polygon_repair/examples/Polygon_repair/{repair_join_intersect.cpp => repair_union_intersect_2.cpp} (100%) diff --git a/Polygon_repair/doc/Polygon_repair/examples.txt b/Polygon_repair/doc/Polygon_repair/examples.txt index cf2270b08fa..3ae4d468ea4 100644 --- a/Polygon_repair/doc/Polygon_repair/examples.txt +++ b/Polygon_repair/doc/Polygon_repair/examples.txt @@ -2,5 +2,5 @@ \example Polygon_repair/repair_polygon_2.cpp \example Polygon_repair/repair_non_zero_polygon_2.cpp \example Polygon_repair/repair_multipolygon_2.cpp -\example Polygon_repair/repair_join_intersect_2.cpp +\example Polygon_repair/repair_union_intersect_2.cpp */ diff --git a/Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp similarity index 100% rename from Polygon_repair/examples/Polygon_repair/repair_join_intersect.cpp rename to Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp From 37e5922a930c17d1a14d8420e1a83aee33c5959a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Nov 2024 15:51:40 +0000 Subject: [PATCH 103/332] Fix anchor --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 00ffc5f90dc..ecb8a9f694a 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -140,7 +140,7 @@ boundaries belong to, and using the orientation to distinguish between the outer inner boundaries of each polygon with holes. -\section SectionPolygonRepair_Algorithm Non-Zero Algorithm +\section SectionPolygonRepair_NonZeroAlgorithm Non-Zero Algorithm Tbd. From 4020165b258ae1639ea373162c3b8ae6efe5b215 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 08:22:32 +0000 Subject: [PATCH 104/332] cleanup --- Polygon_repair/doc/Polygon_repair/PackageDescription.txt | 1 + Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 2 ++ Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt index 98d974c7a43..31e905f74c2 100644 --- a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt +++ b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt @@ -36,6 +36,7 @@ The %union and the %intersection rule enable to combine similar polygons. } \cgalCRPSection{Repair Rules} - `CGAL::Polygon_repair::Even_odd_rule` +- `CGAL::Polygon_repair::Non_zero_rule` - `CGAL::Polygon_repair::Union_rule` - `CGAL::Polygon_repair::Intersection_rule` */ diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index ecb8a9f694a..76206fa829e 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -194,6 +194,8 @@ to edges, which enables correct counting even on partially overlapping edges. Ken Arroyo Ohori developed this package during the Google Summer of Code 2023 mentored by SĂ©bastien Loriot and Andreas Fabri. +The GSoC project was limited to the even-odd rule. Further rules were added +with CGAL 6.1 by Andreas Fabri. */ } /* namespace CGAL */ diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h index 46e1aeaf51e..1bf449fb692 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h @@ -22,7 +22,7 @@ namespace Polygon_repair { /// @{ /*! - Tag class to select the %ntersection rule when calling `CGAL::Polygon_repair::repair()`. + Tag class to select the %intersection rule when calling `CGAL::Polygon_repair::repair()`. */ struct Intersection_rule {}; From a39d3cc723c178de2bdb7458a41beb7732112180 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 08:51:31 +0000 Subject: [PATCH 105/332] Fix example file name --- Polygon_repair/examples/Polygon_repair/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 7d7bc62ab64..bcdeb87181a 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -19,5 +19,5 @@ endforeach() if(CGAL_Qt6_FOUND) target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(repair_join_intersect PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(repair_union_intersect_2 PUBLIC CGAL::CGAL_Basic_viewer) endif() From a4940946a274e4b614c1b7c19215ec1a96abf5c7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 08:56:25 +0000 Subject: [PATCH 106/332] fix dependencies --- Polygon_repair/package_info/Polygon_repair/dependencies | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Polygon_repair/package_info/Polygon_repair/dependencies b/Polygon_repair/package_info/Polygon_repair/dependencies index 7e57c5ca79c..ca43222cc01 100644 --- a/Polygon_repair/package_info/Polygon_repair/dependencies +++ b/Polygon_repair/package_info/Polygon_repair/dependencies @@ -23,3 +23,6 @@ Spatial_sorting Stream_support TDS_2 Triangulation_2 +BGL +Homogeneous_kernel +Kernel_d From e4ce60c0c7f9fe3ddb8494d00d4e1bfb71712a19 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 09:42:50 +0000 Subject: [PATCH 107/332] Add winding.wkt --- Polygon_repair/examples/Polygon_repair/data/winding.wkt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Polygon_repair/examples/Polygon_repair/data/winding.wkt diff --git a/Polygon_repair/examples/Polygon_repair/data/winding.wkt b/Polygon_repair/examples/Polygon_repair/data/winding.wkt new file mode 100644 index 00000000000..6fd39f4923c --- /dev/null +++ b/Polygon_repair/examples/Polygon_repair/data/winding.wkt @@ -0,0 +1 @@ +POLYGON((0 0, 10 0, 10 6, 6 6, 6 4 , 10 4, 10 10, 0 10)) \ No newline at end of file From b24f19cecba8645caa68cf73bf49bd07e5ec402c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Nov 2024 10:45:40 +0100 Subject: [PATCH 108/332] fix warnings --- Polygon_repair/include/CGAL/Polygon_repair/Boolean.h | 2 +- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index f03e800acbb..35abad35d3a 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -416,4 +416,4 @@ intersection(const Multipolygon_with_holes_2& pA) } // namespace Polygon_repair } //namespace CGAL -#endif CGAL_POLYGON_REPAIR_BOOLEAN_H +#endif // CGAL_POLYGON_REPAIR_BOOLEAN_H diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index c1966843c44..33f88d06938 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -78,7 +78,7 @@ Multipolygon_with_holes_2 repair(const Polygon_with_holes_2 -Multipolygon_with_holes_2 repair(const Polygon_with_holes_2& p, Non_zero_rule rule) +Multipolygon_with_holes_2 repair(const Polygon_with_holes_2& p, Non_zero_rule) { Winding winding; winding.insert(p); @@ -107,7 +107,7 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole template -Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Union_rule rule) +Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Union_rule) { CGAL::Polygon_repair::Boolean bops; bops.insert(p); @@ -123,7 +123,7 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole template -Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Intersection_rule rule) +Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Intersection_rule) { CGAL::Polygon_repair::Boolean bops; bops.insert(p); From 13328c335e9596edb39e6c14897c124cf5ad88a6 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 6 Nov 2024 13:34:52 +0100 Subject: [PATCH 109/332] fix warning Co-authored-by: Andreas Fabri --- .../Mesh_3/mesh_3D_image_with_custom_initialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 37bdc503dbc..c0a78b4da3a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -46,7 +46,7 @@ struct Custom_initial_points_generator const CGAL::Image_3& image_; template - OutputIterator operator()(OutputIterator pts, int n = 20) const + OutputIterator operator()(OutputIterator pts, int) const { typedef Tr::Geom_traits Gt; typedef Gt::Point_3 Point_3; From 78c8b4480e31e4f47e96ca35d0358133db4642d0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 13:05:46 +0000 Subject: [PATCH 110/332] Add free functions join() and intersection() for any combination of P, MP, MPwH --- Polygon/include/CGAL/Polygon_with_holes_2.h | 4 +- .../repair_union_intersect_2.cpp | 12 ++- .../include/CGAL/Polygon_repair/Boolean.h | 75 ++++++++++++++++--- .../include/CGAL/Polygon_repair/repair.h | 12 ++- 4 files changed, 87 insertions(+), 16 deletions(-) diff --git a/Polygon/include/CGAL/Polygon_with_holes_2.h b/Polygon/include/CGAL/Polygon_with_holes_2.h index 032b2c52084..e7178d650ca 100644 --- a/Polygon/include/CGAL/Polygon_with_holes_2.h +++ b/Polygon/include/CGAL/Polygon_with_holes_2.h @@ -30,7 +30,7 @@ namespace CGAL { The class `Polygon_with_holes_2` models the concept `GeneralPolygonWithHoles_2`. It represents a linear polygon with holes. It is parameterized with two types (`Kernel` and `Container`) that are used to instantiate -the type `Polygon_2`. This poygon type is used to +the type `Polygon_2`. This polygon type is used to represent the outer boundary and the boundary of the holes (if any exist). \cgalModels{GeneralPolygonWithHoles_2} @@ -42,7 +42,7 @@ class Polygon_with_holes_2 : public General_polygon_with_holes_2 > { public: - + typedef Kernel Traits; typedef CGAL::Polygon_2 Polygon_2; typedef General_polygon_with_holes_2 Base; typedef typename Base::Hole_const_iterator Hole_const_iterator; diff --git a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp index b8e5a9c752b..f4d13ddaafb 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp @@ -14,6 +14,8 @@ using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_2 = K::Point_2; +using Polygon_2 = CGAL::Polygon_2; using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; @@ -45,6 +47,14 @@ main(int argc, char* argv[]) CGAL::draw(mpwh); } - + { + Polygon_2 pB; + pB.push_back(Point_2(-1,-1)); + pB.push_back(Point_2(1,-1)); + pB.push_back(Point_2(1,1)); + pB.push_back(Point_2(-1,1)); + mpwh = CGAL::Polygon_repair::join(pA,pB); + CGAL::draw(mpwh); + } return 0; } diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index 35abad35d3a..b794ecd9489 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -135,6 +135,22 @@ default constructor. /*! sets the polygons as input of the %Boolean operation. */ + void + insert(const Polygon_2& pA) + { + cdt.insert_constraint(pA.vertices_begin(), pA.vertices_end(), true); + } + + + void + insert(const Polygon_with_holes_2& pwh) + { + cdt.insert_constraint(pwh.outer_boundary().vertices_begin(), pwh.outer_boundary().vertices_end(), true); + for(auto const& hole : pwh.holes()){ + cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); + } + } + void insert(const Multipolygon_with_holes_2& pA) { @@ -144,10 +160,7 @@ sets the polygons as input of the %Boolean operation. cdt.insert_constraint(hole.vertices_begin(), hole.vertices_end(), true); } } - - mark_domains(); } - private: void @@ -181,7 +194,7 @@ private: } } - + public: // this marks how many multipolygon interiors overlap a cell of the arrangement of mutipolygons void mark_domains() @@ -217,7 +230,7 @@ private: } } - +private: template void label_domain(Face_handle start, int label, const Fct& fct) @@ -378,26 +391,45 @@ template Multipolygon_with_holes_2 join(const Multipolygon_with_holes_2& pA) { - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); struct Larger_than_zero { bool operator()(int i) const { return i > 0; } }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + bops.mark_domains(); Larger_than_zero ltz; return bops(ltz); } +template +decltype(auto) // Multipolygon_with_holes_2 +join(const PA& pA, const PB& pB, const K& k = Default()) +{ + typedef typename Default::Get::type Traits; + struct Larger_than_zero { + bool operator()(int i) const + { + return i > 0; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + bops.insert(pB); + bops.mark_domains(); + Larger_than_zero ltz; + return bops(ltz); +} template Multipolygon_with_holes_2 intersection(const Multipolygon_with_holes_2& pA) { - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); struct Equal { int val; Equal(int val) @@ -409,10 +441,35 @@ intersection(const Multipolygon_with_holes_2& pA) return i == val; } }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + bops.mark_domains(); Equal equal(pA.number_of_polygons_with_holes()); return bops(equal); } +template +decltype(auto) // Multipolygon_with_holes_2 +intersection(const PA& pA, const PB& pB, const K& k = Default()) +{ + typedef typename Default::Get::type Traits; + + struct Equal { + bool operator()(int i) const + { + return i == 2; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + bops.insert(pB); + bops.mark_domains(); + Equal equal; + return bops(equal); +} + } // namespace Polygon_repair } //namespace CGAL diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index 33f88d06938..51c81c3229f 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -109,14 +109,16 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole template Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Union_rule) { - CGAL::Polygon_repair::Boolean bops; - bops.insert(p); struct Larger_than_zero { bool operator()(int i) const { return i > 0; } }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(p); + bops.mark_domains(); Larger_than_zero ltz; return bops(ltz); } @@ -125,8 +127,6 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole template Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Intersection_rule) { - CGAL::Polygon_repair::Boolean bops; - bops.insert(p); struct Equal { int val; Equal(int val) @@ -138,6 +138,10 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole return i == val; } }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(p); + bops.mark_domains(); Equal equal(p.number_of_polygons_with_holes()); return bops(equal); } From db684c71e6e999f5b6014c9ac76329dbb75af2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Nov 2024 10:59:20 +0100 Subject: [PATCH 111/332] make draw conditional --- .../examples/Polygon_repair/repair_non_zero_polygon_2.cpp | 5 ++++- .../examples/Polygon_repair/repair_union_intersect_2.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp index b87459e968d..3ce04501ab0 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp @@ -5,7 +5,9 @@ #include #include #include +#ifdef CGAL_USE_BASIC_VIEWER #include +#endif using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; using Point_2 = Kernel::Point_2; @@ -22,8 +24,9 @@ int main(int argc, char* argv[]) { CGAL::IO::read_polygon_WKT(in, pin); Multipolygon_with_holes_2 mp = CGAL::Polygon_repair::repair(pin, CGAL::Polygon_repair::Non_zero_rule()); - +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mp); +#endif if (mp.number_of_polygons_with_holes() > 1) { CGAL::IO::write_multi_polygon_WKT(std::cout, mp); diff --git a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp index f4d13ddaafb..c9a16441d7c 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp @@ -2,7 +2,10 @@ #include #include + +#ifdef CGAL_USE_BASIC_VIEWER #include +#endif #include @@ -38,13 +41,17 @@ main(int argc, char* argv[]) { std::ofstream out("union.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mpwh); +#endif } mpwh = CGAL::Polygon_repair::repair(pA, CGAL::Polygon_repair::Intersection_rule()); { std::ofstream out("intersection.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mpwh); +#endif } { From 2385e5886d8d42fa2731705f303fd287547e691b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Nov 2024 14:29:37 +0100 Subject: [PATCH 112/332] fix warning + use verb for function name --- Polygon_repair/include/CGAL/Polygon_repair/Boolean.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index b794ecd9489..d6d8729b540 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -407,7 +407,7 @@ join(const Multipolygon_with_holes_2& pA) template decltype(auto) // Multipolygon_with_holes_2 -join(const PA& pA, const PB& pB, const K& k = Default()) +join(const PA& pA, const PB& pB, const K& = Default()) { typedef typename Default::Get::type Traits; @@ -428,7 +428,7 @@ join(const PA& pA, const PB& pB, const K& k = Default()) template Multipolygon_with_holes_2 -intersection(const Multipolygon_with_holes_2& pA) +intersect(const Multipolygon_with_holes_2& pA) { struct Equal { int val; @@ -451,7 +451,7 @@ intersection(const Multipolygon_with_holes_2& pA) template decltype(auto) // Multipolygon_with_holes_2 -intersection(const PA& pA, const PB& pB, const K& k = Default()) +intersect(const PA& pA, const PB& pB, const K& = Default()) { typedef typename Default::Get::type Traits; From c8aa6e447d477703b8313222b99a69b00e605aa4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Nov 2024 17:03:30 +0000 Subject: [PATCH 113/332] Move demo in the Polygon_repair directory --- .../Boolean_2.cpp | 4 +- .../Boolean_2.qrc | 0 .../Boolean_2.ui | 0 .../demo/Polygon_repair/CMakeLists.txt | 35 +++++++++++ .../about_Boolean_2.html | 0 .../Polygon_repair/icons/circumcenter.pdf | 57 ++++++++++++++++++ .../Polygon_repair/icons/circumcenter.png | Bin 0 -> 3862 bytes .../Polygon_repair/icons/conflict_zone.pdf | Bin 0 -> 2939 bytes .../Polygon_repair/icons/conflict_zone.png | Bin 0 -> 7715 bytes .../icons/constrained_triangulation.pdf | Bin 0 -> 1857 bytes .../icons/constrained_triangulation.png | Bin 0 -> 6800 bytes ...trained_triangulation_show_constraints.pdf | Bin 0 -> 2182 bytes ...trained_triangulation_show_constraints.png | Bin 0 -> 8076 bytes ...nstrained_triangulation_show_in_domain.pdf | Bin 0 -> 1915 bytes ...nstrained_triangulation_show_in_domain.png | Bin 0 -> 6988 bytes .../Polygon_repair/icons/moving_point.pdf | Bin 0 -> 2956 bytes .../Polygon_repair/icons/moving_point.png | Bin 0 -> 8074 bytes .../Polygon_repair/icons/triangulation.pdf | Bin 0 -> 2905 bytes .../Polygon_repair/icons/triangulation.png | Bin 0 -> 7547 bytes 19 files changed, 93 insertions(+), 3 deletions(-) rename GraphicsView/demo/{Triangulation_2 => Polygon_repair}/Boolean_2.cpp (98%) rename GraphicsView/demo/{Triangulation_2 => Polygon_repair}/Boolean_2.qrc (100%) rename GraphicsView/demo/{Triangulation_2 => Polygon_repair}/Boolean_2.ui (100%) create mode 100644 GraphicsView/demo/Polygon_repair/CMakeLists.txt rename GraphicsView/demo/{Triangulation_2 => Polygon_repair}/about_Boolean_2.html (100%) create mode 100644 GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/circumcenter.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/conflict_zone.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/conflict_zone.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_constraints.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_constraints.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/moving_point.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/moving_point.png create mode 100644 GraphicsView/demo/Polygon_repair/icons/triangulation.pdf create mode 100644 GraphicsView/demo/Polygon_repair/icons/triangulation.png diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp similarity index 98% rename from GraphicsView/demo/Triangulation_2/Boolean_2.cpp rename to GraphicsView/demo/Polygon_repair/Boolean_2.cpp index 1b0c6c05d55..7caa9c0ce29 100644 --- a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp +++ b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp @@ -176,9 +176,7 @@ MainWindow::processInput(CGAL::Object o) } } if((! mpwhA.is_empty()) && (! mpwhB.is_empty())){ - Boolean boolean; - boolean.insert(mpwhA, mpwhB); - mpwhC = boolean([](bool a, bool b){ return a && b;}); + mpwhC = CGAL::Polygon_repair::join(mpwhA, mpwhB); } Q_EMIT( changed()); } diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.qrc b/GraphicsView/demo/Polygon_repair/Boolean_2.qrc similarity index 100% rename from GraphicsView/demo/Triangulation_2/Boolean_2.qrc rename to GraphicsView/demo/Polygon_repair/Boolean_2.qrc diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.ui b/GraphicsView/demo/Polygon_repair/Boolean_2.ui similarity index 100% rename from GraphicsView/demo/Triangulation_2/Boolean_2.ui rename to GraphicsView/demo/Polygon_repair/Boolean_2.ui diff --git a/GraphicsView/demo/Polygon_repair/CMakeLists.txt b/GraphicsView/demo/Polygon_repair/CMakeLists.txt new file mode 100644 index 00000000000..afdc5237e1c --- /dev/null +++ b/GraphicsView/demo/Polygon_repair/CMakeLists.txt @@ -0,0 +1,35 @@ +# Created by the script cgal_create_cmake_script +# This is the CMake script for compiling a CGAL application. + +cmake_minimum_required(VERSION 3.12...3.29) +project(Triangulation_2_Demo) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) +find_package(Qt6 QUIET COMPONENTS Widgets) + +if(NOT CGAL_Qt6_FOUND OR NOT Qt6_FOUND) + message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.") + return() +endif() + +add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + + +qt_add_executable( + Boolean_2 Boolean_2.cpp + Boolean_2.ui Boolean_2.qrc) +target_link_libraries(Boolean_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 + Qt6::Widgets) + +add_to_cached_list(CGAL_EXECUTABLE_TARGETS Boolean_2) + +include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + +cgal_add_compilation_test(Boolean_2) + diff --git a/GraphicsView/demo/Triangulation_2/about_Boolean_2.html b/GraphicsView/demo/Polygon_repair/about_Boolean_2.html similarity index 100% rename from GraphicsView/demo/Triangulation_2/about_Boolean_2.html rename to GraphicsView/demo/Polygon_repair/about_Boolean_2.html diff --git a/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf b/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf new file mode 100644 index 00000000000..51a15a41082 --- /dev/null +++ b/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf @@ -0,0 +1,57 @@ +%PDF-1.3 +3 0 obj << +/Length 385 /Filter /FlateDecode >> +stream +xÚ}SąN1 íç+RSDNścŇŇ Ńź° BPlĹďăřČ$ZQ7~‡ídÁ˝şŕľŽ»_Üďúěâ™}kÍý \üOS¤˙Ťpő‰ę„ÇůFÜŕCŤS-LÎťm8Ôŕ.mšśÓp¶\«â˘ĹĹůÓ=?o×HĐ|˘č]HÚ‚S¬Kč&„€«Q0TŠŔQ-›v`ć*ĘMÚ2m>ggFť­ąZm›¶MÎű@¨A ű@’¦0‹qJÝÇ2˘XL˛g­â¦ą†˘h†6,ÎşŞ‘+Ő˛iËäĽTř)¤ĐDZł4DűÓŘżf;QíMš‘J]TŠ'g¶©°™ź:O“¤˘]¨jô7µ~w‘ď¶Ŕw1ž¸ďC‰˙ĐřqËs]iSá‘ŰJă­„‡+ĹHÁý˝żP}M}lşCŕk°/őô żL”Ú> +/MediaBox [ 0 0 595 842] +/CropBox [204.765 238.4 261.6 291.541] +/ArtBox [204.765 238.4 261.6 291.541] +/Parent 2 0 R +>> endobj +1 0 obj << +/Type /Ipe +/Length 322 /Filter /FlateDecode >> +stream +xÚµ”Ín0 Çď<…• &|LĄ§]ö)„6j Q ěăég@]é†vŘZ倉˙ţŮŽ•lµS0(ßiŰ,Cä9Ň+Ů[_°rf!‚ójĐęČą ¶ş­í¬QUÁžź8bŽŠHÄ‚sŤ­t­×}ű˝}+Xé­#mćäAÁÁëŞÓŞ`Q6¦0ň]yheC;Ň¸Łś¤S “«»l,{=ܨéOłęKÔőŢžH´7˛<1p–ây©ź4Bŕ(Ýś¬©ŠÖúFµ6ć¦čΦ÷˛–ý5Ő*ó1žáŕq:Ă“řđT8ú3řŕíŮMcíŹßüş ]A,L°Ýڏ;PŻ3˙uÁąc­·Ôy÷ěţ'qł:.ŻŞ5VČb!­‹Íc SL©ó4Ěé_-Č㽿ôŔě‚OR P© +endstream endobj +2 0 obj << +/Type /Pages +/Count 1 +/Kids [ 4 0 R ] +>> endobj +5 0 obj << +/Type /Catalog +/Pages 2 0 R +>> endobj +6 0 obj << +/Creator (Ipe 6.0 preview 28) +/Producer (Ipe 6.0 preview 28) +/CreationDate (D:20080609193922) +/ModDate (D:20080609193922) +>> endobj +xref +0 7 +0000000000 00000 f +0000000671 00000 n +0000001076 00000 n +0000000009 00000 n +0000000466 00000 n +0000001135 00000 n +0000001184 00000 n +trailer +<< +/Size 7 +/Root 5 0 R +/Info 6 0 R +>> +startxref +1327 +%%EOF diff --git a/GraphicsView/demo/Polygon_repair/icons/circumcenter.png b/GraphicsView/demo/Polygon_repair/icons/circumcenter.png new file mode 100644 index 0000000000000000000000000000000000000000..f743b7a64cacc527a5562ce0ae76d641675ad423 GIT binary patch literal 3862 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 literal 0 HcmV?d00001 diff --git a/GraphicsView/demo/Polygon_repair/icons/conflict_zone.png b/GraphicsView/demo/Polygon_repair/icons/conflict_zone.png new file mode 100644 index 0000000000000000000000000000000000000000..5fd4d5b4ce6920cb7982cc7c6f564ca4f3105231 GIT binary patch literal 7715 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 literal 0 HcmV?d00001 diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5138901d4978cd2987230d6a4715feba9ebafe46 GIT binary patch literal 1857 zcma)72~ZPf6xNDL77y;yI))zwBoLEqvLQrhG!SDsq9I5HEJs2%fI>ny8x5fGglGk; zgI2|g2q*{+h*Ho33ROfADGCUPQf~o8@TwPRH?&qpI@A8MGyCQp|Gf9j|9#IvED+9y zX)K5Z7(gXk20T0_L)m{=Ueh<~gUM+Io4N{#{^4^rb8Dvg7**OJq# zlt!@e#<#1XUd!`0ZL>rPp*wbM%KkQYal%jod)jPXN2`x^FkwQwC&&Dahb})p=l7g1 zIBh;5sjaDx^({3HcaN+ZT9SP{X~Dfp%{RR6x7u-mHKh@St=@XI$;4)V%2pqzB}v`k z;R_S=>09+J(A2_hQPuO6_15Iv(Ds>Ns?>k{7~acA`06uZA)9Y@nTG4XyIf*2=cU8A zqUXNUNy6m7FAsa1O0;_5bsnC}m)9OGXtQ6Wf9RNf+vfCQnso)4$1j#F97r}hTtEHp z4I?0bMMOLLs`BN{ORNTn!AEOCY)gRjV{uB&s%m z4~Q&G6&ZlyU@2h=gaCvRP6Bee2$jc3JylvFFq>ic*jzSnLztn&m6$4iID)v*5H^Pc zm<%qB2{QrALTGFjU~&-}i^C=|`56BH62(%CXc91od*tyx3F+1QL0td) z$+YgipzLIrru6F|&zDWty{-JG#L*Ly!=Q87ady|h1!Z$yzc|c`%WpoUFbVHA+oe+I zipu9dY`UsheYqt#+gR$z-_qD|py$|KGSAsh+<7wY)+xJJT2966Ui5h3ou|~-gX_#> zU)M{VH{Pf61JgghIOEli=6rNLnViude5^ae8oF@(<<(zwTIcDO52Egs?^#-bMYmcd zgb&6Cd+vNd?Mr_sj&nJBy{%7SQ|Df;Th^=Vj`gn?eAr}F78d8@KF`UKeH!_BugzTY zDw_=~T~BzAW!j7Fp_6L=sJs~17JDu9S(R0wb%511#ZojNednD6GW||WO)moHN>z|6<%ZKLpmWj5{%GZEo5s63b8&j2M z=~95Kr^-a!0>$@{$`hWcBtPzgd#TI~l!Kcn8%U86+atv0)Qm`BTCvw;>r=Mp)>gNX zl4y2?T{|z5hn$O3)+J9^5ReiOQJ`4sZO^{r=HqOmx1c&m=grF6`W%O*^-bRvM0#(_ zq6l>xUPK4)@4g?|IA!0*fu=hkx~+8lXQkZ!Bl!b5b`hV+IDB9 zp5zcD8YnW(vC9*9-nO^QU&J}ztfe~6%RIbk+8$H-GWm={o6Xmg#@dJmPOK2L^yAF& z_!2p(HY7Btv3OT*M6|6(J&uLU! z)t)2S4_3IT-;2xFR8;I8GOA%LuNkcf1~PpR*^i2#Hb{bo;2I3kePiTmg5L(|kPyWG z$UF9^QZFekja5ZK!>XblMO4=j1zv<$<0=d|5nKhXGzN&r&=oQ0O2BlZ5cQZ!u8AZ> z{@=sH#W5tH({6#|OPc^d0)Bpeg literal 0 HcmV?d00001 diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png new file mode 100644 index 0000000000000000000000000000000000000000..3a49172fa17b5d09511f331faf39f6c6ab637ed5 GIT binary patch literal 6800 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 literal 0 HcmV?d00001 diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4be89b1abfef93500bd95864a76997716c1792 GIT binary patch literal 6988 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 It&9fabEP)fQi=HSuO9k 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 Date: Wed, 6 Nov 2024 18:13:11 +0000 Subject: [PATCH 114/332] Document functions --- .../demo/Polygon_repair/CMakeLists.txt | 2 +- .../demo/Triangulation_2/CMakeLists.txt | 14 +---------- .../repair_union_intersect_2.cpp | 2 +- .../include/CGAL/Polygon_repair/Boolean.h | 24 +++++++++++++++++++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/GraphicsView/demo/Polygon_repair/CMakeLists.txt b/GraphicsView/demo/Polygon_repair/CMakeLists.txt index afdc5237e1c..82f4b3797de 100644 --- a/GraphicsView/demo/Polygon_repair/CMakeLists.txt +++ b/GraphicsView/demo/Polygon_repair/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.12...3.29) -project(Triangulation_2_Demo) +project(Polygon_repair_Demo) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index 187ce6476dd..515dfca6781 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -58,20 +58,8 @@ target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 add_to_cached_list(CGAL_EXECUTABLE_TARGETS Regular_triangulation_2) -#-------------------------------- -# The "Boolean" demo: Boolean_2 -#-------------------------------- - -qt_add_executable( - Boolean_2 Boolean_2.cpp - Boolean_2.ui Boolean_2.qrc) -target_link_libraries(Boolean_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 - Qt6::Widgets) - -add_to_cached_list(CGAL_EXECUTABLE_TARGETS Boolean_2) - include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) foreach(target Constrained_Delaunay_triangulation_2 Delaunay_triangulation_2 - Regular_triangulation_2 Boolean_2) + Regular_triangulation_2) cgal_add_compilation_test(${target}) endforeach() diff --git a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp index c9a16441d7c..4587d7d6fdd 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp @@ -60,7 +60,7 @@ main(int argc, char* argv[]) pB.push_back(Point_2(1,-1)); pB.push_back(Point_2(1,1)); pB.push_back(Point_2(-1,1)); - mpwh = CGAL::Polygon_repair::join(pA,pB); + mpwh = CGAL::Polygon_repair::join(mpwh, pB); CGAL::draw(mpwh); } return 0; diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index d6d8729b540..f006dc3d8c8 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -387,6 +387,12 @@ access to the underlying constrained triangulation. }; + + +/// \ingroup PkgPolygonRepairFunctions +/// omputes the union of all polygons with holes in `p` +/// \tparam K parameter of the input and output polygons +/// \pre Each polygon with hole must be non-self-intersecting template Multipolygon_with_holes_2 join(const Multipolygon_with_holes_2& pA) @@ -405,6 +411,12 @@ join(const Multipolygon_with_holes_2& pA) return bops(ltz); } +/// \ingroup PkgPolygonRepairFunctions +/// computes the union of two polygons +/// \tparam K parameter of the output polygons +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \pre The polygons `pA` and `pB` must be non-self-intersecting template decltype(auto) // Multipolygon_with_holes_2 join(const PA& pA, const PB& pB, const K& = Default()) @@ -426,6 +438,11 @@ join(const PA& pA, const PB& pB, const K& = Default()) return bops(ltz); } + +/// \ingroup PkgPolygonRepairFunctions +/// computes the intersection of all polygons with holes in `p` +/// \tparam K parameter of the input and output polygons +/// \pre Each polygon with hole must be non-self-intersecting template Multipolygon_with_holes_2 intersect(const Multipolygon_with_holes_2& pA) @@ -449,6 +466,13 @@ intersect(const Multipolygon_with_holes_2& pA) return bops(equal); } + +/// \ingroup PkgPolygonRepairFunctions +/// Computes the intersection of two polygons +/// \tparam K parameter of the output polygon +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \pre The polygons `pA` and `pB` must be non-self-intersecting template decltype(auto) // Multipolygon_with_holes_2 intersect(const PA& pA, const PB& pB, const K& = Default()) From d5203e3124e24aca8579c947ff5a5a1472e8e4ab Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Nov 2024 09:27:10 +0100 Subject: [PATCH 115/332] doc Co-authored-by: Andreas Fabri --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 4 ++-- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 07987f19ad4..8d170fdb076 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -464,7 +464,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * the points it provides are inserted after one dimensional features initialization. * * Initialization is considered to be complete if the triangulation is a 3D triangulation - * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the + * with at least one facet in the restricted Delaunay triangulation (i.e., its dual intersects the * input surface). * If the generator does not generate enough points for the initialization to be complete, * the domain's `construct_initial_points_object()` will be called to generate enough input points. @@ -497,7 +497,7 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * These initial points are inserted after one dimensional features initialization. * * Initialization is considered to be complete if the triangulation is a 3D triangulation - * with at least one facet in the restricted Delaunay triangulation (i.e. its dual intersects the + * with at least one facet in the restricted Delaunay triangulation (i.e., its dual intersects the * input surface). * * If the parameter `parameters::initial_points_generator()` is set, diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 3453e3b27d1..78639e752eb 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -57,7 +57,7 @@ OutputIterator operator()(OutputIterator pts, const int n); /*! Same as above, without the `n` parameter. Since there is no `n` given like above, the functor must provide enough -points to initialize the mesh generation process, i.e. to have a 3D triangulation +points to initialize the mesh generation process, i.e., to have a 3D triangulation with at least one facet in the restricted Delaunay triangulation. If these conditions are not satisfied, then more points will be added automatically From 4215e18a8b314d463364207e3d16f2abd7090314 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Nov 2024 09:37:52 +0100 Subject: [PATCH 116/332] fix CHANGES.md (lost by merge f77f9c68476de3abc9033e9f28b1b471e42c234b) --- Installation/CHANGES.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 405a1b25c5a..862196df915 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,14 +1,22 @@ # Release History -## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) +[Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +----------- + +Release date: + +### [3D Mesh Generation](https://doc.cgal.org/6.1/Manual/packages.html#PkgMesh3) + +- Added two new meshing parameters that enable mesh initialization customization : + - `initial_points_generator` : enables the user to specify a functor that generates initial points, + - `initial_points` : enables the user to specify a `Range` of initial points. + + +[Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) ### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3) - Made the implicit function thread-safe so that the parallel version of `make_mesh_3()` can be used. -## [Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) -[Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) ------------ - [Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) ----------- From 25b89cbd83c2f0cbe48adc97dc9c79e4beac2259 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Nov 2024 12:55:12 +0100 Subject: [PATCH 117/332] fix CHANGES.md --- Installation/CHANGES.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index bb0f4023393..697eb2ede8a 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -7,7 +7,6 @@ - **Breaking change**: Classes based on the RS Library are no longer provided. - ### [3D Mesh Generation](https://doc.cgal.org/6.1/Manual/packages.html#PkgMesh3) - Added two new meshing parameters that enable mesh initialization customization : @@ -15,14 +14,12 @@ - `initial_points` : enables the user to specify a `Range` of initial points. -[Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) +## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) ### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3) - Made the implicit function thread-safe so that the parallel version of `make_mesh_3()` can be used. - -[Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) ------------ +## [Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) Release date: September 2024 From ead629cc31c7e26a0669cb65efa432a1aa168a6b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Nov 2024 12:06:57 +0000 Subject: [PATCH 118/332] User Manual --- .../doc/Polygon_repair/Polygon_repair.txt | 65 ++++++----- .../include/CGAL/Polygon_repair/Boolean.h | 105 ----------------- .../include/CGAL/Polygon_repair/Winding.h | 5 +- .../include/CGAL/Polygon_repair/repair.h | 107 ++++++++++++++++++ 4 files changed, 149 insertions(+), 133 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 76206fa829e..ec41c0d9ce5 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -16,8 +16,9 @@ each face according to what it represents (exterior, polygon interior or hole), and reconstructs the polygon(s) represented by the arrangement. The method returns valid output stored in a multipolygon with holes. -Different arrangement and labeling heuristics are possible, but -currently the even-odd rule and non-zero rule are implemented in this package. +Different labeling heuristics are possible. This package offers +the even-odd rule, the non-zero rule, the union rule, +as well as the intersection rule. The even-odd rule results in areas that are alternately assigned as polygon interiors and exterior/holes each time that an input edge is passed. It does not distinguish between edges that are part of outer boundaries @@ -25,10 +26,10 @@ from those of inner boundaries. The non-zero rule results in areas with a non-zero winding number. -Two additional repair rules are provided that are useful when given -several similar valid polygons with holes. They compute either their -union or their intersection to be conservative by bounding -from the interior or the exterior. +The union and intersection rules are useful when given +two or more similar valid polygons with holes. They compute either their +union or their intersection, and they are hence conservative +by bounding from the interior or the exterior. \section SectionPolygonRepair_Definitions Definitions @@ -87,7 +88,37 @@ order - The polygons with holes of a multipolygon with holes are also stored in lexicographic order -\section SectionPolygonRepair_Algorithm Even-Odd Algorithm +\section SectionPolygonRepair_EvenOdd Even-Odd Rule + + +\cgalFigureBegin{inout, inout.svg} +Examples of polygons with holes (a-d) and multipolygons with holes +(e-h) before (left) and after (right) being repaired with the even-odd rule. +\cgalFigureEnd + + +\section SectionPolygonRepair_NonZero Non-Zero Rule + +Tbd. + +\section SectionPolygonRepair_UnionIntersection Union and Intersection Rule + +Tbd. + +\section SubsectionPolygonRepair_Notes Notes on the Output + +If the input is already valid, the method will return a valid output representing +the same area. However, the output might be different in order to conform to the +stricter conditions to generate deterministic output (see +\ref SubsectionPolygonRepair_Output). + +Also, it is worth noting that even the repair of a single polygon without holes +but with self-intersections can result in a multipolygon with holes. This is why +the repair function will always return a multipolygon with holes. The user can +then check whether it consists of a single polygon with holes, and if a polygon +with holes has zero holes and extract these if needed. + +\section SectionPolygonRepair_Algorithm Implementation Broadly, the algorithm consists of three steps: @@ -99,10 +130,6 @@ according to what they represent (exterior, polygon interior or hole). then these are assembled into individual polygons with holes and put into a single multipolygon with holes. -\cgalFigureBegin{inout, inout.svg} -Examples of polygons with holes (a-d) and multipolygons with holes -(e-h) before (left) and after (right) being repaired with the even-odd rule. -\cgalFigureEnd \subsection SubsectionPolygonRepair_Arrangement Arrangement @@ -140,22 +167,6 @@ boundaries belong to, and using the orientation to distinguish between the outer inner boundaries of each polygon with holes. -\section SectionPolygonRepair_NonZeroAlgorithm Non-Zero Algorithm - -Tbd. - -\section SubsectionPolygonRepair_Notes Notes on the Output - -If the input is already valid, the method will return a valid output representing -the same area. However, the output might be different in order to conform to the -stricter conditions to generate deterministic output (see -\ref SubsectionPolygonRepair_Output). - -Also, it is worth noting that even the repair of a single polygon without holes -but with self-intersections can result in a multipolygon with holes. This is why -the repair function will always return a multipolygon with holes. The user can -then check whether it consists of a single polygon with holes, and if a polygon -with holes has zero holes and extract these if needed. \section SectionPolygonRepair_Examples Examples diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index f006dc3d8c8..e2e76113741 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -389,111 +389,6 @@ access to the underlying constrained triangulation. -/// \ingroup PkgPolygonRepairFunctions -/// omputes the union of all polygons with holes in `p` -/// \tparam K parameter of the input and output polygons -/// \pre Each polygon with hole must be non-self-intersecting -template -Multipolygon_with_holes_2 -join(const Multipolygon_with_holes_2& pA) -{ - struct Larger_than_zero { - bool operator()(int i) const - { - return i > 0; - } - }; - - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); - bops.mark_domains(); - Larger_than_zero ltz; - return bops(ltz); -} - -/// \ingroup PkgPolygonRepairFunctions -/// computes the union of two polygons -/// \tparam K parameter of the output polygons -/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \pre The polygons `pA` and `pB` must be non-self-intersecting -template -decltype(auto) // Multipolygon_with_holes_2 -join(const PA& pA, const PB& pB, const K& = Default()) -{ - typedef typename Default::Get::type Traits; - - struct Larger_than_zero { - bool operator()(int i) const - { - return i > 0; - } - }; - - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); - bops.insert(pB); - bops.mark_domains(); - Larger_than_zero ltz; - return bops(ltz); -} - - -/// \ingroup PkgPolygonRepairFunctions -/// computes the intersection of all polygons with holes in `p` -/// \tparam K parameter of the input and output polygons -/// \pre Each polygon with hole must be non-self-intersecting -template -Multipolygon_with_holes_2 -intersect(const Multipolygon_with_holes_2& pA) -{ - struct Equal { - int val; - Equal(int val) - : val(val) - {} - - bool operator()(int i) const - { - return i == val; - } - }; - - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); - bops.mark_domains(); - Equal equal(pA.number_of_polygons_with_holes()); - return bops(equal); -} - - -/// \ingroup PkgPolygonRepairFunctions -/// Computes the intersection of two polygons -/// \tparam K parameter of the output polygon -/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \pre The polygons `pA` and `pB` must be non-self-intersecting -template -decltype(auto) // Multipolygon_with_holes_2 -intersect(const PA& pA, const PB& pB, const K& = Default()) -{ - typedef typename Default::Get::type Traits; - - struct Equal { - bool operator()(int i) const - { - return i == 2; - } - }; - - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); - bops.insert(pB); - bops.mark_domains(); - Equal equal; - return bops(equal); -} - } // namespace Polygon_repair } //namespace CGAL diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h index 2b975ce5d67..6986df67b27 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h @@ -31,7 +31,8 @@ namespace CGAL { namespace Polygon_repair { -/*! +#ifndef DOXYGEN_RUNNING +/* \ingroup PkgPolygonRepairFunctions \tparam Kernel must be @@ -344,6 +345,8 @@ sets the polygon as input of the winding number computation. }; +#endif + } // namespace Polygon_repair } // namespace CGAL diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index 51c81c3229f..a4b4a8745f1 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -784,6 +784,113 @@ protected: #endif // DOXYGEN_RUNNING + + +/// \ingroup PkgPolygonRepairFunctions +/// omputes the union of all polygons with holes in `p` +/// \tparam K parameter of the input and output polygons +/// \pre Each polygon with hole must be free of self-intersections +template +Multipolygon_with_holes_2 +join(const Multipolygon_with_holes_2& pA) +{ + struct Larger_than_zero { + bool operator()(int i) const + { + return i > 0; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pA); + bops.mark_domains(); + Larger_than_zero ltz; + return bops(ltz); +} + +/// \ingroup PkgPolygonRepairFunctions +/// computes the union of two polygons +/// \tparam K parameter of the output polygons +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \pre The polygons `pA` and `pB` must be free of self-intersections +template +decltype(auto) // Multipolygon_with_holes_2 +join(const PA& pa, const PB& pb, const K& = Default()) +{ + typedef typename Default::Get::type Traits; + + struct Larger_than_zero { + bool operator()(int i) const + { + return i > 0; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pa); + bops.insert(pb); + bops.mark_domains(); + Larger_than_zero ltz; + return bops(ltz); +} + + +/// \ingroup PkgPolygonRepairFunctions +/// computes the intersection of all polygons with holes in `p` +/// \tparam K parameter of the input and output polygons +/// \pre Each polygon with hole must be free of self-intersections +template +Multipolygon_with_holes_2 +intersect(const Multipolygon_with_holes_2& p) +{ + struct Equal { + int val; + Equal(int val) + : val(val) + {} + + bool operator()(int i) const + { + return i == val; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(p); + bops.mark_domains(); + Equal equal(p.number_of_polygons_with_holes()); + return bops(equal); +} + + +/// \ingroup PkgPolygonRepairFunctions +/// Computes the intersection of two polygons +/// \tparam K parameter of the output polygon +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \pre The polygons `pA` and `pB` must be free of self-intersections +template +decltype(auto) // Multipolygon_with_holes_2 +intersect(const PA& pa, const PB& pb, const K& = Default()) +{ + typedef typename Default::Get::type Traits; + + struct Equal { + bool operator()(int i) const + { + return i == 2; + } + }; + + CGAL::Polygon_repair::Boolean bops; + bops.insert(pa); + bops.insert(pb); + bops.mark_domains(); + Equal equal; + return bops(equal); +} + } // namespace Polygon_repair } // namespace CGAL From bdb93ff62b4a3d17a0e3326cd602566c6eb06354 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Nov 2024 17:46:20 +0000 Subject: [PATCH 119/332] Documention --- .../include/CGAL/Multipolygon_with_holes_2.h | 25 ++--- Polygon/include/CGAL/Polygon_2.h | 94 +++++++++---------- Polygon/include/CGAL/Polygon_with_holes_2.h | 19 ++-- .../doc/Polygon_repair/PackageDescription.txt | 2 + .../doc/Polygon_repair/Polygon_repair.txt | 2 +- .../include/CGAL/Polygon_repair/Boolean.h | 9 +- .../include/CGAL/Polygon_repair/repair.h | 87 ++++++++++------- 7 files changed, 129 insertions(+), 109 deletions(-) diff --git a/Polygon/include/CGAL/Multipolygon_with_holes_2.h b/Polygon/include/CGAL/Multipolygon_with_holes_2.h index bdfd3cb47bc..9228850edf5 100644 --- a/Polygon/include/CGAL/Multipolygon_with_holes_2.h +++ b/Polygon/include/CGAL/Multipolygon_with_holes_2.h @@ -24,14 +24,14 @@ namespace CGAL { /*! \ingroup PkgPolygon2Ref * * The class `Multipolygon_with_holes_2` models the concept `MultipolygonWithHoles_2`. - * It is parameterized with two types (`Kernel` and `Container`) that are used to instantiate - * the types `Polygon_2` and `Polygon_with_holes_2`. + * It is parameterized with two types (`Kernel` and `Container_`) that are used to instantiate + * the types `Polygon_2` and `Polygon_with_holes_2`. * The latter is used to represent each polygon with holes. The former is converted to the latter. * * \cgalModels{MultipolygonWithHoles_2} */ template > + class Container_ = std::vector> class Multipolygon_with_holes_2 { public: /// \name Definition @@ -39,14 +39,15 @@ public: /// @{ /// polygon type - using Polygon_2 = CGAL::Polygon_2; + using Polygon_2 = CGAL::Polygon_2; /// polygon with holes type - using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; /// @} using Traits = Kernel; + using Container = Container_; using value_type = Polygon_with_holes_2; using Polygon_with_holes_container = std::deque; @@ -183,10 +184,10 @@ order. \relates Multipolygon_with_holes_2 */ -template +template std::ostream& operator<<(std::ostream& os, - const Multipolygon_with_holes_2& mp) { - typename Multipolygon_with_holes_2::Polygon_with_holes_const_iterator i; + const Multipolygon_with_holes_2& mp) { + typename Multipolygon_with_holes_2::Polygon_with_holes_const_iterator i; switch(IO::get_mode(os)) { case IO::ASCII : @@ -214,11 +215,11 @@ std::ostream& operator<<(std::ostream& os, } } -template -Multipolygon_with_holes_2 transform(const Transformation& t, - const Multipolygon_with_holes_2& mp) +template +Multipolygon_with_holes_2 transform(const Transformation& t, + const Multipolygon_with_holes_2& mp) { - Multipolygon_with_holes_2 result; + Multipolygon_with_holes_2 result; for(const auto& pwh : mp.polygons_with_holes()){ result.add_polygon_with_holes(transform(t, pwh)); } diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index c3300d939fa..cfe9b4f3472 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -60,8 +60,8 @@ namespace CGAL { /// algorithms were used and what complexity they have. /// -template > +template > class Polygon_2 { public: @@ -70,33 +70,33 @@ class Polygon_2 { /// @{ /// The traits type. - typedef Traits_P Traits; + typedef Traits_ Traits; /// The container type. - typedef Container_P Container; + typedef Container_ Container; /// The number type of the coordinates of the points of the polygon. - typedef typename Traits_P::FT FT; + typedef typename Traits_::FT FT; /// The point type of the polygon. - typedef typename Traits_P::Point_2 Point_2; + typedef typename Traits_::Point_2 Point_2; /// The type of a segment between two points of the polygon. - typedef typename Traits_P::Segment_2 Segment_2; + typedef typename Traits_::Segment_2 Segment_2; /// @} - typedef typename Container_P::difference_type difference_type; - typedef typename Container_P::value_type value_type; - typedef typename Container_P::pointer pointer; - typedef typename Container_P::reference reference; - typedef typename Container_P::const_reference const_reference; + typedef typename Container_::difference_type difference_type; + typedef typename Container_::value_type value_type; + typedef typename Container_::pointer pointer; + typedef typename Container_::reference reference; + typedef typename Container_::const_reference const_reference; //-------------------------------------------------------// // this intermediary step is required by Sun C++ 4.1 - typedef typename Container_P::iterator iterator; - typedef typename Container_P::const_iterator const_iterator; + typedef typename Container_::iterator iterator; + typedef typename Container_::const_iterator const_iterator; //-------------------------------------------------------// typedef typename Container::iterator Vertex_const_iterator; - typedef Polygon_circulator Vertex_const_circulator; + typedef Polygon_circulator Vertex_const_circulator; /// \name Iterators /// @@ -141,11 +141,11 @@ class Polygon_2 { // #else typedef Vertex_const_circulator Vertex_circulator; - typedef Polygon_2_edge_iterator Edge_const_iterator; - typedef Polygon_2_const_edge_circulator Edge_const_circulator; + typedef Polygon_2_edge_iterator Edge_const_iterator; + typedef Polygon_2_const_edge_circulator Edge_const_circulator; - typedef Polygon_2_edge_iterator Vertex_pair_iterator; typedef Iterator_range Edges; @@ -162,7 +162,7 @@ class Polygon_2 { Polygon_2(const Traits & p_traits) : traits(p_traits) {} // Move constructor - // Polygon_2(Polygon_2&& polygon) = default; + // Polygon_2(Polygon_2&& polygon) = default; /// Creates a polygon with vertices from the sequence /// defined by the range \c [first,last). @@ -260,7 +260,7 @@ class Polygon_2 { { if (size() <= 1) return; - typename Container_P::iterator i = d_container.begin(); + typename Container_::iterator i = d_container.begin(); std::reverse(++i, d_container.end()); } @@ -500,32 +500,32 @@ class Polygon_2 { { return d_container.empty(); } /// Returns a const reference to the sequence of vertices of the polygon. - const Container_P& container() const + const Container_& container() const { return d_container; } /// Returns a reference to the sequence of vertices of the polygon. - Container_P& container() + Container_& container() { return d_container; } /// Returns an iterator to the first vertex of the polygon. - typename Container_P::iterator begin() + typename Container_::iterator begin() { return container().begin(); } /// Returns an iterator to the element after the last vertex of the polygon. - typename Container_P::iterator end() + typename Container_::iterator end() { return container().end(); } /// Returns a const iterator to the first vertex of the polygon. - const typename Container_P::const_iterator begin() const + const typename Container_::const_iterator begin() const { return container().begin(); } /// Returns a const iterator to the element after the last vertex of the polygon. - const typename Container_P::const_iterator end() const + const typename Container_::const_iterator end() const { return container().end(); } @@ -544,14 +544,14 @@ class Polygon_2 { /// @} - bool identical(const Polygon_2 &q) const + bool identical(const Polygon_2 &q) const { return this == &q; } - Traits_P const &traits_member() const { return traits;} + Traits_ const &traits_member() const { return traits;} private: - Container_P d_container; - Traits_P traits; + Container_ d_container; + Traits_ traits; }; @@ -563,23 +563,23 @@ class Polygon_2 { /// equal to the vertices of `p1`. Note that the template argument /// `%Container` of `p1` and `p2` may be different. /// \memberof Polygon_2 -template -bool operator==( const Polygon_2 &p1, - const Polygon_2 &p2 ); +template +bool operator==( const Polygon_2 &p1, + const Polygon_2 &p2 ); /// Test for inequality. /// \memberof Polygon_2 -template +template inline bool -operator!=(const Polygon_2 &p1, - const Polygon_2 &p2); +operator!=(const Polygon_2 &p1, + const Polygon_2 &p2); /// Returns the image of the polygon \c p under the transformation \c t. /// \relates Polygon_2 -template -Polygon_2 -transform(const Transformation& t, const Polygon_2& p); +template +Polygon_2 +transform(const Transformation& t, const Polygon_2& p); /// @} // global operators @@ -591,14 +591,14 @@ transform(const Transformation& t, const Polygon_2& p); /// Reads a polygon from stream `is` and assigns it to `p`. /// \pre The extract operator must be defined for `Point_2`. /// \relates Polygon_2 -template -std::istream &operator>>(std::istream &is, Polygon_2& p); +template +std::istream &operator>>(std::istream &is, Polygon_2& p); /// Inserts the polygon `p` into the stream `os`. /// \pre The insert operator must be defined for `Point_2`. /// \relates Polygon_2 -template -std::ostream &operator<<(std::ostream &os, const Polygon_2& p); +template +std::ostream &operator<<(std::ostream &os, const Polygon_2& p); /// @} // IO @@ -612,11 +612,11 @@ std::ostream &operator<<(std::ostream &os, const Polygon_2 namespace CGAL { -template +template inline bool -operator!=(const Polygon_2 &x, - const Polygon_2 &y) +operator!=(const Polygon_2 &x, + const Polygon_2 &y) { return !(x==y); } diff --git a/Polygon/include/CGAL/Polygon_with_holes_2.h b/Polygon/include/CGAL/Polygon_with_holes_2.h index e7178d650ca..7d581a28150 100644 --- a/Polygon/include/CGAL/Polygon_with_holes_2.h +++ b/Polygon/include/CGAL/Polygon_with_holes_2.h @@ -29,21 +29,22 @@ namespace CGAL { The class `Polygon_with_holes_2` models the concept `GeneralPolygonWithHoles_2`. It represents a linear polygon with holes. It is parameterized with two -types (`Kernel` and `Container`) that are used to instantiate -the type `Polygon_2`. This polygon type is used to +types (`Kernel` and `Container_`) that are used to instantiate +the type `Polygon_2`. This polygon type is used to represent the outer boundary and the boundary of the holes (if any exist). \cgalModels{GeneralPolygonWithHoles_2} */ template > + class Container_ = std::vector > class Polygon_with_holes_2 : - public General_polygon_with_holes_2 > + public General_polygon_with_holes_2 > { public: typedef Kernel Traits; - typedef CGAL::Polygon_2 Polygon_2; + typedef Container_ Container; + typedef CGAL::Polygon_2 Polygon_2; typedef General_polygon_with_holes_2 Base; typedef typename Base::Hole_const_iterator Hole_const_iterator; typedef typename Base::Size Size; @@ -90,11 +91,11 @@ public: }; - template - Polygon_with_holes_2 transform(const Transformation& t, - const Polygon_with_holes_2& pwh) + template + Polygon_with_holes_2 transform(const Transformation& t, + const Polygon_with_holes_2& pwh) { - Polygon_with_holes_2 result(transform(t, pwh.outer_boundary())); + Polygon_with_holes_2 result(transform(t, pwh.outer_boundary())); for(const auto& hole : pwh.holes()){ result.add_hole(transform(t, hole)); } diff --git a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt index 31e905f74c2..bd014eb61fd 100644 --- a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt +++ b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt @@ -33,6 +33,8 @@ The %union and the %intersection rule enable to combine similar polygons. } \cgalCRPSection{Functions} - `CGAL::Polygon_repair::repair()` +- `CGAL::Polygon_repair::join()` +- `CGAL::Polygon_repair::intersect()` \cgalCRPSection{Repair Rules} - `CGAL::Polygon_repair::Even_odd_rule` diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index ec41c0d9ce5..e5dc97ba11b 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -103,7 +103,7 @@ Tbd. \section SectionPolygonRepair_UnionIntersection Union and Intersection Rule -Tbd. +Given several valid polygons this rule computes their union or intersection. \section SubsectionPolygonRepair_Notes Notes on the Output diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index e2e76113741..4ea0eb62f39 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -37,7 +37,7 @@ namespace Polygon_repair { \tparam Kernel must be */ -template +template class Boolean { private: @@ -60,10 +60,11 @@ private: }; using K = Kernel; + using Container = Container_; using Point_2 = typename K::Point_2; - using Polygon_2 = CGAL::Polygon_2; - using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; - using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; + using Polygon_2 = CGAL::Polygon_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; using Itag = std::conditional_t, Exact_predicates_tag, Exact_intersections_tag>; using Vb = CGAL::Triangulation_vertex_base_2; diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index a4b4a8745f1..f33368aa2e0 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -44,9 +44,9 @@ class Polygon_repair; /// \ingroup PkgPolygonRepairFunctions /// repairs polygon `p` using the given rule -/// \tparam Kernel parameter of the input and output polygons +/// \tparam Kernel parameter of the input and output polygons. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` /// \tparam Container parameter of the input and output polygons -/// \tparam Rule must be `Even_odd_rule` +/// \tparam Rule must be `Even_odd_rule` or `Non_zero_rule` template Multipolygon_with_holes_2 repair(const Polygon_2& p , Rule = Rule()) { @@ -61,9 +61,9 @@ Multipolygon_with_holes_2 repair(const Polygon_2 Multipolygon_with_holes_2 repair(const Polygon_with_holes_2& p, Rule = Rule()) { @@ -90,9 +90,10 @@ Multipolygon_with_holes_2 repair(const Polygon_with_holes_2 Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Rule = Rule()) { @@ -116,7 +117,7 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(p); bops.mark_domains(); Larger_than_zero ltz; @@ -139,7 +140,7 @@ Multipolygon_with_holes_2 repair(const Multipolygon_with_hole } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(p); bops.mark_domains(); Equal equal(p.number_of_polygons_with_holes()); @@ -787,12 +788,13 @@ protected: /// \ingroup PkgPolygonRepairFunctions -/// omputes the union of all polygons with holes in `p` -/// \tparam K parameter of the input and output polygons +/// computes the union of all polygons with holes in `p` +/// \tparam Kernel parameter of the input and output polygons. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` +/// \tparam Container parameter of the input and output polygons /// \pre Each polygon with hole must be free of self-intersections -template -Multipolygon_with_holes_2 -join(const Multipolygon_with_holes_2& pA) +template +Multipolygon_with_holes_2 +join(const Multipolygon_with_holes_2& pa) { struct Larger_than_zero { bool operator()(int i) const @@ -801,8 +803,8 @@ join(const Multipolygon_with_holes_2& pA) } }; - CGAL::Polygon_repair::Boolean bops; - bops.insert(pA); + CGAL::Polygon_repair::Boolean bops; + bops.insert(pa); bops.mark_domains(); Larger_than_zero ltz; return bops(ltz); @@ -810,15 +812,21 @@ join(const Multipolygon_with_holes_2& pA) /// \ingroup PkgPolygonRepairFunctions /// computes the union of two polygons -/// \tparam K parameter of the output polygons -/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam Kernel parameter of the output polygons. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` +/// \tparam Container parameter of the input and output polygons +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` /// \pre The polygons `pA` and `pB` must be free of self-intersections -template -decltype(auto) // Multipolygon_with_holes_2 -join(const PA& pa, const PB& pb, const K& = Default()) +template +#ifdef DOXYGEN_RUNNING +Multipolygon_with_holes_2 +#else +decltype(auto) +#endif +join(const PA& pa, const PB& pb, const Kernel& = Default(), const Container& = Default()) { - typedef typename Default::Get::type Traits; + typedef typename Default::Get::type Traits; + typedef typename Default::Get::type Container; struct Larger_than_zero { bool operator()(int i) const @@ -827,7 +835,7 @@ join(const PA& pa, const PB& pb, const K& = Default()) } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(pa); bops.insert(pb); bops.mark_domains(); @@ -838,11 +846,12 @@ join(const PA& pa, const PB& pb, const K& = Default()) /// \ingroup PkgPolygonRepairFunctions /// computes the intersection of all polygons with holes in `p` -/// \tparam K parameter of the input and output polygons +/// \tparam Kernel parameter of the input and output polygons. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` +/// \tparam Container parameter of the input and output polygons /// \pre Each polygon with hole must be free of self-intersections -template -Multipolygon_with_holes_2 -intersect(const Multipolygon_with_holes_2& p) +template +Multipolygon_with_holes_2 +intersect(const Multipolygon_with_holes_2& p) { struct Equal { int val; @@ -856,7 +865,7 @@ intersect(const Multipolygon_with_holes_2& p) } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(p); bops.mark_domains(); Equal equal(p.number_of_polygons_with_holes()); @@ -866,15 +875,21 @@ intersect(const Multipolygon_with_holes_2& p) /// \ingroup PkgPolygonRepairFunctions /// Computes the intersection of two polygons -/// \tparam K parameter of the output polygon -/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam Kernel parameter of the output polygon. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` +/// \tparam Container parameter of the input and output polygons +/// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` +/// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` /// \pre The polygons `pA` and `pB` must be free of self-intersections -template -decltype(auto) // Multipolygon_with_holes_2 -intersect(const PA& pa, const PB& pb, const K& = Default()) +template +#ifdef DOXYGEN_RUNNING +Multipolygon_with_holes_2 +#else +decltype(auto) +#endif +intersect(const PA& pa, const PB& pb, const Kernel& = Default(), const Container& = Default()) { - typedef typename Default::Get::type Traits; + typedef typename Default::Get::type Traits; + typedef typename Default::Get::type Container; struct Equal { bool operator()(int i) const @@ -883,7 +898,7 @@ intersect(const PA& pa, const PB& pb, const K& = Default()) } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(pa); bops.insert(pb); bops.mark_domains(); From 4ff92c1f47b409bdf9c0e9e35e1429da23394e53 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Nov 2024 20:03:04 +0000 Subject: [PATCH 120/332] Documention --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index f33368aa2e0..1c380b43404 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -816,7 +816,7 @@ join(const Multipolygon_with_holes_2& pa) /// \tparam Container parameter of the input and output polygons /// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` /// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \pre The polygons `pA` and `pB` must be free of self-intersections +/// \pre The polygons `pa` and `pb` must be free of self-intersections template #ifdef DOXYGEN_RUNNING Multipolygon_with_holes_2 @@ -879,7 +879,7 @@ intersect(const Multipolygon_with_holes_2& p) /// \tparam Container parameter of the input and output polygons /// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` /// \tparam PB must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` -/// \pre The polygons `pA` and `pB` must be free of self-intersections +/// \pre The polygons `pa` and `pb` must be free of self-intersections template #ifdef DOXYGEN_RUNNING Multipolygon_with_holes_2 From 64bc98d6b5a4f15236aa03b2ea64cf5b4a86aaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 8 Nov 2024 09:57:24 +0100 Subject: [PATCH 121/332] add missing dependency --- Polygon_repair/doc/Polygon_repair/dependencies | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polygon_repair/doc/Polygon_repair/dependencies b/Polygon_repair/doc/Polygon_repair/dependencies index 6df3ace8d07..f5c7866adae 100644 --- a/Polygon_repair/doc/Polygon_repair/dependencies +++ b/Polygon_repair/doc/Polygon_repair/dependencies @@ -4,4 +4,5 @@ STL_Extension Algebraic_foundations Circulator Stream_support -Polygon \ No newline at end of file +Polygon +Triangulation_2 From eddf0b6dd0c677e7f6c91743e1e58a20a013a7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 8 Nov 2024 19:25:48 +0100 Subject: [PATCH 122/332] fix compilation errors --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index 1c380b43404..37957d30223 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -803,7 +803,7 @@ join(const Multipolygon_with_holes_2& pa) } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(pa); bops.mark_domains(); Larger_than_zero ltz; @@ -826,7 +826,7 @@ decltype(auto) join(const PA& pa, const PB& pb, const Kernel& = Default(), const Container& = Default()) { typedef typename Default::Get::type Traits; - typedef typename Default::Get::type Container; + typedef typename Default::Get::type Container_; struct Larger_than_zero { bool operator()(int i) const @@ -835,7 +835,7 @@ join(const PA& pa, const PB& pb, const Kernel& = Default(), const Container& = D } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(pa); bops.insert(pb); bops.mark_domains(); @@ -889,7 +889,7 @@ decltype(auto) intersect(const PA& pa, const PB& pb, const Kernel& = Default(), const Container& = Default()) { typedef typename Default::Get::type Traits; - typedef typename Default::Get::type Container; + typedef typename Default::Get::type Container_; struct Equal { bool operator()(int i) const @@ -898,7 +898,7 @@ intersect(const PA& pa, const PB& pb, const Kernel& = Default(), const Container } }; - CGAL::Polygon_repair::Boolean bops; + CGAL::Polygon_repair::Boolean bops; bops.insert(pa); bops.insert(pb); bops.mark_domains(); From 53c9987823ff1e1c9252b0ef1193fb050b36629a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 8 Nov 2024 19:54:17 +0100 Subject: [PATCH 123/332] use polygonal domain as MPWH can be more than one poly --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index 37957d30223..b9a595032d6 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -811,7 +811,7 @@ join(const Multipolygon_with_holes_2& pa) } /// \ingroup PkgPolygonRepairFunctions -/// computes the union of two polygons +/// computes the union of two polygonal domains /// \tparam Kernel parameter of the output polygons. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` /// \tparam Container parameter of the input and output polygons /// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` @@ -874,7 +874,7 @@ intersect(const Multipolygon_with_holes_2& p) /// \ingroup PkgPolygonRepairFunctions -/// Computes the intersection of two polygons +/// Computes the intersection of two polygonal domains /// \tparam Kernel parameter of the output polygon. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` /// \tparam Container parameter of the input and output polygons /// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` From b2b7de8514f437277ec4900b07530c50cbad89e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 12 Nov 2024 09:06:47 +0100 Subject: [PATCH 124/332] remove deps --- Polygon_repair/package_info/Polygon_repair/dependencies | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_repair/package_info/Polygon_repair/dependencies b/Polygon_repair/package_info/Polygon_repair/dependencies index fe4e50b3c29..517729e1d03 100644 --- a/Polygon_repair/package_info/Polygon_repair/dependencies +++ b/Polygon_repair/package_info/Polygon_repair/dependencies @@ -21,5 +21,3 @@ Stream_support TDS_2 Triangulation_2 BGL -Homogeneous_kernel -Kernel_d From b074e328fa1ff5439e32df7ba565a7b80b71e55b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 14 Nov 2024 07:12:00 +0000 Subject: [PATCH 125/332] Fix demo --- GraphicsView/demo/Polygon_repair/Boolean_2.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp index 7caa9c0ce29..3d3bd0947d6 100644 --- a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp +++ b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,7 +36,6 @@ typedef CGAL::Polygon_2 Polygon2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Multipolygon_with_holes_2 Multipolygon_with_holes_2; -typedef CGAL::Polygon_repair::Boolean Boolean; typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonPtr_vector ; @@ -155,7 +154,7 @@ MainWindow::MainWindow() this->setupOptionsMenu(); this->addAboutDemo(":/cgal/help/about_Polygon_2.html"); this->addAboutCGAL(); - this->setupExportSVG(action_Export_SVG, graphicsView); + // this->setupExportSVG(action_Export_SVG, graphicsView); this->addRecentFiles(this->menuFile, this->actionQuit); connect(this, SIGNAL(openRecentFile(QString)), From ce3fe4f04e2a7b212caf96fb79b1b4403eadb3fb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 14 Nov 2024 07:15:32 +0000 Subject: [PATCH 126/332] Fix example --- .../examples/Polygon_repair/repair_union_intersect_2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp index 4587d7d6fdd..bec35767d1c 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp @@ -61,7 +61,12 @@ main(int argc, char* argv[]) pB.push_back(Point_2(1,1)); pB.push_back(Point_2(-1,1)); mpwh = CGAL::Polygon_repair::join(mpwh, pB); + + std::ofstream out("joinn.wkt"); + CGAL::IO::write_multi_polygon_WKT(out, mpwh); +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mpwh); +#endif } return 0; } From f65b7f744f05d656573a67c54d4ea04b91e0e9cb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Nov 2024 15:27:17 +0000 Subject: [PATCH 127/332] Adress warnings and errors in the testsuite --- GraphicsView/demo/Polygon_repair/Boolean_2.cpp | 5 +++-- .../include/CGAL/Qt/GraphicsViewPolygonWithHolesInput.h | 4 ++-- Polygon_repair/include/CGAL/Polygon_repair/Boolean.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp index 3d3bd0947d6..a370033ff24 100644 --- a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp +++ b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp @@ -154,8 +154,9 @@ MainWindow::MainWindow() this->setupOptionsMenu(); this->addAboutDemo(":/cgal/help/about_Polygon_2.html"); this->addAboutCGAL(); - // this->setupExportSVG(action_Export_SVG, graphicsView); - +#if QT_SVG_LIB + this->setupExportSVG(action_Export_SVG, graphicsView); +#endif this->addRecentFiles(this->menuFile, this->actionQuit); connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewPolygonWithHolesInput.h b/GraphicsView/include/CGAL/Qt/GraphicsViewPolygonWithHolesInput.h index e97c999ee10..24c60dcdcf6 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewPolygonWithHolesInput.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewPolygonWithHolesInput.h @@ -90,7 +90,7 @@ private: template GraphicsViewPolygonWithHolesInput::GraphicsViewPolygonWithHolesInput(QObject *parent, QGraphicsScene* s) - : GraphicsViewInput(parent), scene_(s), polygon_input(false) + : GraphicsViewInput(parent), polygon_input(false), scene_(s) { pwhItem = new CGAL::Qt::PolygonWithHolesGraphicsItem(&pwh); pwhItem->setBrush(::Qt::yellow); @@ -151,7 +151,7 @@ GraphicsViewPolygonWithHolesInput::processInput(CGAL::Object o) template void -GraphicsViewPolygonWithHolesInput::keyPressEvent ( QKeyEvent * event ) +GraphicsViewPolygonWithHolesInput::keyPressEvent ( QKeyEvent * /* event */ ) { } diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index 4ea0eb62f39..a726139d70d 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -284,7 +284,7 @@ private: reconstruct_ring(std::list& ring, Face_handle face_adjacent_to_boundary, int opposite_vertex, - const Fct& fct) + const Fct& CGAL_assertion_code(fct)) { // Create ring Face_handle current_face = face_adjacent_to_boundary; From 0fe940555dbd08d4ddb332c0612c2e2cded6216e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:41:38 +0100 Subject: [PATCH 128/332] Fix namespace --- .../CGAL/Polygon_mesh_processing/internal/curvature.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 7b976fee3a6..aad4304c3fc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -21,6 +21,7 @@ namespace CGAL { namespace Polygon_mesh_processing { +namespace exprimental { template typename GetGeomTraits::type::FT @@ -179,6 +180,8 @@ void discrete_mean_curvature(const TriangleMesh& tm, discrete_mean_curvature(tm, vcm, parameters::all_default()); } -} } // CGAL::Polygon_mesh_processing::experimental +} // namespace experimental +} // namespace Polygon_mesh_processing +} // namespace CGAL #endif //CGAL_PMP_INTERNAL_CURVATURE_H From 693fd251747f050ce328fd2010be52ef7760b885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:42:31 +0100 Subject: [PATCH 129/332] Use a capital 'G' --- .../Polygon_mesh_processing/internal/curvature.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index aad4304c3fc..67f0a79b559 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -25,7 +25,7 @@ namespace exprimental { template typename GetGeomTraits::type::FT -vertex_discrete_gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, +vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, const TriangleMesh& tm, const NamedParameters& np) { @@ -80,14 +80,14 @@ vertex_discrete_gaussian_curvature(typename boost::graph_traits::v } template -void discrete_gaussian_curvature(const TriangleMesh& tm, +void discrete_Gaussian_curvature(const TriangleMesh& tm, VertexCurvatureMap vcm, const NamedParameters& np) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; for(vertex_descriptor v : vertices(tm)) - put(vcm, v, vertex_discrete_gaussian_curvature(v, tm, np)); + put(vcm, v, vertex_discrete_Gaussian_curvature(v, tm, np)); } @@ -152,17 +152,17 @@ void discrete_mean_curvature(const TriangleMesh& tm, template auto -vertex_discrete_gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, +vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, const TriangleMesh& tm) { - return vertex_discrete_gaussian_curvature(vd, tm, parameters::all_default()); + return vertex_discrete_Gaussian_curvature(vd, tm, parameters::all_default()); } template -void discrete_gaussian_curvature(const TriangleMesh& tm, +void discrete_Gaussian_curvature(const TriangleMesh& tm, VertexCurvatureMap vcm) { - discrete_gaussian_curvature(tm, vcm, parameters::all_default()); + discrete_Gaussian_curvature(tm, vcm, parameters::all_default()); } template From f2299f844f641b44c810d740c9530f74a413540d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:42:49 +0100 Subject: [PATCH 130/332] Use plural for the all-vertices function --- .../CGAL/Polygon_mesh_processing/internal/curvature.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 67f0a79b559..1cae4dd1ab9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -80,9 +80,9 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v } template -void discrete_Gaussian_curvature(const TriangleMesh& tm, - VertexCurvatureMap vcm, - const NamedParameters& np) +void discrete_Gaussian_curvatures(const TriangleMesh& tm, + VertexCurvatureMap vcm, + const NamedParameters& np) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -159,10 +159,10 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v } template -void discrete_Gaussian_curvature(const TriangleMesh& tm, +void discrete_Gaussian_curvatures(const TriangleMesh& tm, VertexCurvatureMap vcm) { - discrete_Gaussian_curvature(tm, vcm, parameters::all_default()); + discrete_Gaussian_curvatures(tm, vcm, parameters::all_default()); } template From a0e319e67b1d41e8c7784c9ecfe9aed43927df63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:43:07 +0100 Subject: [PATCH 131/332] Re-attach convenience overloads to their respective main function --- .../internal/curvature.h | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 1cae4dd1ab9..68ccebaa75e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -79,6 +79,14 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v return two_pi - ki; } +template +auto +vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, + const TriangleMesh& tm) +{ + return vertex_discrete_Gaussian_curvature(vd, tm, parameters::all_default()); +} + template void discrete_Gaussian_curvatures(const TriangleMesh& tm, VertexCurvatureMap vcm, @@ -90,6 +98,12 @@ void discrete_Gaussian_curvatures(const TriangleMesh& tm, put(vcm, v, vertex_discrete_Gaussian_curvature(v, tm, np)); } +template +void discrete_Gaussian_curvatures(const TriangleMesh& tm, + VertexCurvatureMap vcm) +{ + discrete_Gaussian_curvatures(tm, vcm, parameters::all_default()); +} template typename GetGeomTraits::type::FT @@ -148,23 +162,6 @@ void discrete_mean_curvature(const TriangleMesh& tm, put(vcm, v, vertex_discrete_mean_curvature(v, tm, np)); } -/// convenience overloads - -template -auto -vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, - const TriangleMesh& tm) -{ - return vertex_discrete_Gaussian_curvature(vd, tm, parameters::all_default()); -} - -template -void discrete_Gaussian_curvatures(const TriangleMesh& tm, - VertexCurvatureMap vcm) -{ - discrete_Gaussian_curvatures(tm, vcm, parameters::all_default()); -} - template auto vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, From 25cd25c477cc234337b56ba2ede0894a90a01300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:44:03 +0100 Subject: [PATCH 132/332] Tiny indentation fix --- .../internal/curvature.h | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 68ccebaa75e..9eca4794b80 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -25,9 +25,9 @@ namespace exprimental { template typename GetGeomTraits::type::FT -vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, - const TriangleMesh& tm, - const NamedParameters& np) +vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, + const TriangleMesh& tm, + const NamedParameters& np) { typedef typename GetGeomTraits::type GeomTraits; typedef typename GetVertexPointMap::const_type VertexPointMap; @@ -50,27 +50,30 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v const FT two_pi = 2 * CGAL_PI; FT ki = 0; - for(halfedge_descriptor h : CGAL::halfedges_around_target(vd, tm)) + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) { if(is_border(h, tm)) continue; - const Vector_3 v0 = vector(get(vpm, vd), get(vpm, target(next(h, tm), tm))); // p1p2 - const Vector_3 v1 = vector(get(vpm, vd), get(vpm, source(h, tm))); // p1p0 + const Vector_3 v0 = vector(get(vpm, v), get(vpm, target(next(h, tm), tm))); // p1p2 + const Vector_3 v1 = vector(get(vpm, v), get(vpm, source(h, tm))); // p1p0 const FT dot = scalar_product(v0, v1); const Vector_3 cross = cross_product(v0, v1); const FT sqcn = squared_length(cross); if(dot == FT(0)) + { ki += CGAL_PI/FT(2); + } else { - if (sqcn == FT(0)) + if(sqcn == FT(0)) { - if (dot < 0) + if(dot < 0) ki += CGAL_PI; } - else{ + else + { ki += std::atan2(CGAL::approximate_sqrt(sqcn), dot); } } @@ -81,10 +84,10 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v template auto -vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor vd, +vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, const TriangleMesh& tm) { - return vertex_discrete_Gaussian_curvature(vd, tm, parameters::all_default()); + return vertex_discrete_Gaussian_curvature(v, tm, parameters::all_default()); } template @@ -107,9 +110,9 @@ void discrete_Gaussian_curvatures(const TriangleMesh& tm, template typename GetGeomTraits::type::FT -vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, - const TriangleMesh& tm, - const NamedParameters& np) +vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor v, + const TriangleMesh& tm, + const NamedParameters& np) { typedef typename GetGeomTraits::type GeomTraits; typedef typename GetVertexPointMap::const_type VertexPointMap; @@ -130,7 +133,7 @@ vertex_discrete_mean_curvature(typename boost::graph_traits::verte const FT two_pi = 2 * CGAL_PI; FT hi = 0; - for(halfedge_descriptor h : CGAL::halfedges_around_target(vd, tm)) + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) { const Point_3& p = get(vpm, source(h, tm)); const Point_3& q = get(vpm, target(h, tm)); @@ -153,8 +156,8 @@ vertex_discrete_mean_curvature(typename boost::graph_traits::verte template void discrete_mean_curvature(const TriangleMesh& tm, - VertexCurvatureMap vcm, - const NamedParameters& np) + VertexCurvatureMap vcm, + const NamedParameters& np) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -165,14 +168,14 @@ void discrete_mean_curvature(const TriangleMesh& tm, template auto vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, - const TriangleMesh& tm) + const TriangleMesh& tm) { return vertex_discrete_mean_curvature(vd, tm, parameters::all_default()); } template void discrete_mean_curvature(const TriangleMesh& tm, - VertexCurvatureMap vcm) + VertexCurvatureMap vcm) { discrete_mean_curvature(tm, vcm, parameters::all_default()); } From e8602e1f4eaf77444a20c42274574bfd78c3bee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:50:02 +0100 Subject: [PATCH 133/332] Use modern typedefs --- .../internal/curvature.h | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 9eca4794b80..992db0a56a3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -29,15 +29,16 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v const TriangleMesh& tm, const NamedParameters& np) { - typedef typename GetGeomTraits::type GeomTraits; - typedef typename GetVertexPointMap::const_type VertexPointMap; - typedef typename GeomTraits::FT FT; - typedef typename GeomTraits::Vector_3 Vector_3; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - using parameters::choose_parameter; using parameters::get_parameter; + using GeomTraits = typename GetGeomTraits::type; + using tyFT = typename GeomTraits::FT; + using Vector_3 = typename GeomTraits::Vector_3; + + using VertexPointMap = typename GetVertexPointMap::const_type; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); @@ -95,7 +96,7 @@ void discrete_Gaussian_curvatures(const TriangleMesh& tm, VertexCurvatureMap vcm, const NamedParameters& np) { - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; for(vertex_descriptor v : vertices(tm)) put(vcm, v, vertex_discrete_Gaussian_curvature(v, tm, np)); @@ -114,15 +115,16 @@ vertex_discrete_mean_curvature(typename boost::graph_traits::verte const TriangleMesh& tm, const NamedParameters& np) { - typedef typename GetGeomTraits::type GeomTraits; - typedef typename GetVertexPointMap::const_type VertexPointMap; - typedef typename GeomTraits::FT FT; - typedef typename GeomTraits::Point_3 Point_3; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - using parameters::choose_parameter; using parameters::get_parameter; + using GeomTraits = typename GetGeomTraits::type; + using FT = typename GeomTraits::FT; + using Point_3 = typename GeomTraits::Point_3; + + using VertexPointMap = typename GetVertexPointMap::const_type; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); @@ -159,7 +161,7 @@ void discrete_mean_curvature(const TriangleMesh& tm, VertexCurvatureMap vcm, const NamedParameters& np) { - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; for(vertex_descriptor v : vertices(tm)) put(vcm, v, vertex_discrete_mean_curvature(v, tm, np)); From fdf51506d3b492c1dc8a6178b19fb38d6e1571be Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 12:07:55 +0000 Subject: [PATCH 134/332] Add ipe and svg figures --- .../doc/Polygon_repair/fig/WindingNonZero.ipe | 515 ++++++++++++ .../doc/Polygon_repair/fig/WindingNonZero.svg | 83 ++ .../fig/WindingNonZeroDifferent.ipe | 763 ++++++++++++++++++ .../fig/WindingNonZeroDifferent.svg | 181 +++++ 4 files changed, 1542 insertions(+) create mode 100644 Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.ipe create mode 100644 Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.svg create mode 100644 Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe create mode 100644 Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.ipe b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.ipe new file mode 100644 index 00000000000..131a5919dcc --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.ipe @@ -0,0 +1,515 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +64 704 m +192 704 l +192 768 l +64 768 l +h +32 752 m +128 752 l +128 720 l +32 720 l +h + + +64 704 m +192 704 l + + +192 704 m +192 768 l + + +192 768 m +64 768 l + + +64 768 m +64 704 l + + +128 720 m +32 720 l + + +32 720 m +32 752 l + + +32 752 m +128 752 l + + +128 752 m +128 720 l + + +384 640 m +256 640 l +256 592 l +320 592 l +320 576 l +304 576 l +304 608 l +384 608 l +h + + +384 528 m +256 528 l + + +256 528 m +256 480 l + + +256 480 m +320 480 l + + +320 480 m +320 464 l + + +320 464 m +304 464 l + + +304 464 m +304 496 l + + +304 496 m +384 496 l + + +384 496 m +384 528 l + + +384 640 m +256 640 l +256 592 l +320 592 l +320 576 l +304 576 l +304 608 l +384 608 l +h + + +384 528 m +256 528 l + + +256 528 m +256 480 l + + +304 496 m +384 496 l + + +384 496 m +384 528 l + + +64 704 m +192 704 l +192 768 l +64 768 l +h +32 752 m +128 752 l +128 720 l +32 720 l +h + + +64 704 m +192 704 l + + +192 704 m +192 768 l + + +192 768 m +64 768 l + + +256 592 m +304 592 l + + +304 592 m +304 608 l + + +304 576 m +320 576 l + + +320 576 m +320 592 l + + +320 592 m +304 592 l + + +304 592 m +304 576 l + + +256 768 m +256 752 l + + +256 752 m +320 752 l + + +320 752 m +320 720 l + + +320 720 m +256 720 l + + +256 720 m +256 704 l + + +224 720 m +256 720 l + + +256 720 m +256 752 l + + +256 752 m +224 752 l + + +224 752 m +224 720 l + + + diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.svg b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.svg new file mode 100644 index 00000000000..75d37586db8 --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZero.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe new file mode 100644 index 00000000000..7756c8405b8 --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe @@ -0,0 +1,763 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +64 528 m +64 464 l +192 464 l +192 528 l +h +96 512 m +96 480 l +160 480 l +160 512 l +h + + +304 576 m +384 576 l +384 640 l +256 640 l +256 592 l +304 592 l +h + + +256 688 m +384 688 l +384 768 l +304 768 l +304 752 l +256 752 l +h +272 736 m +304 736 l +304 720 l +368 720 l +368 704 l +272 704 l +h + + +256 688 m +384 688 l + + +384 688 m +384 768 l + + +368 720 m +368 704 l + + +368 704 m +272 704 l + + +272 704 m +272 736 l + + +256 752 m +256 688 l + + +336 752 m +256 752 l +256 688 l +384 688 l +384 768 l +304 768 l +304 720 l +368 720 l +368 704 l +272 704 l +272 736 l +336 736 l +h + + +256 688 m +384 688 l + + +384 688 m +384 768 l + + +384 768 m +304 768 l + + +304 768 m +304 720 l + + +304 720 m +368 720 l + + +368 720 m +368 704 l + + +368 704 m +272 704 l + + +272 704 m +272 736 l + + +256 752 m +256 688 l + + +384 640 m +256 640 l + + +256 640 m +256 592 l + + +304 576 m +384 576 l + + +384 576 m +384 640 l + + +192 640 m +64 640 l +64 592 l +128 592 l +128 608 l +112 608 l +112 576 l +192 576 l +h + + +384 640 m +256 640 l + + +256 640 m +256 592 l + + +304 608 m +304 576 l + + +304 576 m +384 576 l + + +384 576 m +384 640 l + + +336 752 m +256 752 l +256 688 l +384 688 l +384 768 l +304 768 l +304 720 l +368 720 l +368 704 l +272 704 l +272 736 l +336 736 l +h + + +256 688 m +384 688 l + + +384 688 m +384 768 l + + +384 768 m +304 768 l + + +304 768 m +304 720 l + + +304 720 m +368 720 l + + +368 720 m +368 704 l + + +368 704 m +272 704 l + + +272 704 m +272 736 l + + +272 736 m +336 736 l + + +336 736 m +336 752 l + + +336 752 m +256 752 l + + +256 752 m +256 688 l + + +384 768 m +304 768 l + + +272 736 m +304 736 l + + +304 736 m +304 720 l + + +304 720 m +368 720 l + + +304 768 m +304 752 l + + +304 752 m +256 752 l + + +496 768 m +496 752 l + + +496 752 m +528 752 l + + +528 752 m +528 736 l + + +528 736 m +496 736 l + + +464 736 m +496 736 l + + +496 736 m +496 752 l + + +496 752 m +448 752 l + + +192 640 m +64 640 l +64 592 l +128 592 l +128 608 l +112 608 l +112 576 l +192 576 l +h + + +384 640 m +256 640 l + + +256 640 m +256 592 l + + +256 592 m +320 592 l + + +320 592 m +320 608 l + + +320 608 m +304 608 l + + +304 608 m +304 576 l + + +304 576 m +384 576 l + + +384 576 m +384 640 l + + +512 592 m +496 592 l + + +496 592 m +496 608 l + + +496 608 m +512 608 l + + +512 608 m +512 592 l + + +448 592 m +496 592 l + + +256 592 m +304 592 l + + +304 592 m +304 576 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h + + +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +64 528 m +64 464 l + + +96 480 m +160 480 l + + +160 480 m +160 512 l + + +160 512 m +96 512 l + + +96 512 m +96 480 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +64 528 m +64 464 l + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +480 512 m +544 512 l + + +544 512 m +544 480 l + + +544 480 m +480 480 l + + +448 528 m +448 464 l + + +480 480 m +480 512 l + + +256 464 m +384 464 l + + + diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg new file mode 100644 index 00000000000..9f6b94ab1b6 --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 215feb7d1b912bbffcbb80a376e4b10219d53c13 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 12:49:30 +0000 Subject: [PATCH 135/332] Add ipe and svg figures --- .../Polygon_repair/fig/MultipolygonHole.ipe | 520 ++++++++++++++++++ .../Polygon_repair/fig/MultipolygonHole.svg | 82 +++ 2 files changed, 602 insertions(+) create mode 100644 Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe create mode 100644 Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg diff --git a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe new file mode 100644 index 00000000000..4cb98fad274 --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe @@ -0,0 +1,520 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +64 528 m +64 464 l +192 464 l +192 528 l +h +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 528 m +64 464 l +192 464 l +192 528 l +h + + +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +64 528 m +64 464 l + + +96 480 m +160 480 l + + +160 480 m +160 512 l + + +160 512 m +96 512 l + + +96 512 m +96 480 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +64 528 m +64 464 l + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +480 512 m +544 512 l + + +544 512 m +544 480 l + + +544 480 m +480 480 l + + +448 528 m +448 464 l + + +480 480 m +480 512 l + + +256 464 m +384 464 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h + + +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +64 528 m +64 464 l + + +96 656 m +96 688 l + + +96 688 m +160 688 l + + +160 688 m +160 656 l + + +160 656 m +96 656 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +480 512 m +544 512 l + + +544 512 m +544 480 l + + +544 480 m +480 480 l + + +448 528 m +448 464 l + + +480 480 m +480 512 l + + + diff --git a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg new file mode 100644 index 00000000000..7ad77f1444d --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b050344fe38caad6fda75923f6f4126fd774c9b7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 13:15:00 +0000 Subject: [PATCH 136/332] Add ipe and svg figures --- .../Polygon_repair/fig/UnionIntersection.ipe | 446 ++++++++++++++++++ .../Polygon_repair/fig/UnionIntersection.svg | 9 + 2 files changed, 455 insertions(+) create mode 100644 Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.ipe create mode 100644 Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.svg diff --git a/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.ipe b/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.ipe new file mode 100644 index 00000000000..5d9ad8bfc53 --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.ipe @@ -0,0 +1,446 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +138.353 615.529 m +201.6 633.6 l +229.895 638.316 l +261.333 629.333 l +304 608 l +317.333 613.333 l +336 608 l +432 640 l +480 640 l +501.333 645.333 l +544 624 l +544 592 l +496 592 l +464 576 l +448 576 l +408 560 l +368 560 l +276.364 546.909 l +256 552 l +256 560 l +208 560 l +200 552 l +176 544 l +130.286 562.286 l +112 576 l +138.353 615.529 l + + +96 720 m +130.286 706.286 l +176 672 l +200 696 l +224 704 l +256 696 l +256 688 l +276.364 690.909 l +288 688 l +368 688 l +408 704 l +432 704 l +464 720 l +512 720 l +544 736 l +560 736 l +544 800 l +501.333 789.333 l +480 800 l +432 784 l +384 784 l +317.333 757.333 l +261.333 773.333 l +240 784 l +229.895 782.316 l +224 784 l +201.6 777.6 l +144 768 l +138.353 759.529 l +112 752 l +96 720 l + + +112 720 m +176 672 l +208 704 l +256 704 l +256 688 l +368 704 l +432 704 l +496 736 l +560 736 l +544 800 l +480 784 l +384 784 l +304 752 l +240 784 l +144 768 l +112 720 l + + +96 720 m +176 688 l +224 704 l +288 688 l +368 688 l +448 720 l +512 720 l +544 736 l +544 768 l +480 800 l +336 752 l +224 784 l +112 752 l +96 720 l + + +112 720 m +176 672 l +208 704 l +256 704 l +256 688 l +368 704 l +432 704 l +496 736 l +560 736 l +544 800 l +480 784 l +384 784 l +304 752 l +240 784 l +144 768 l +112 720 l + + +96 720 m +176 688 l +224 704 l +288 688 l +368 688 l +448 720 l +512 720 l +544 736 l +544 768 l +480 800 l +336 752 l +224 784 l +112 752 l +96 720 l + + + diff --git a/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.svg b/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.svg new file mode 100644 index 00000000000..5374b62ecce --- /dev/null +++ b/Polygon_repair/doc/Polygon_repair/fig/UnionIntersection.svg @@ -0,0 +1,9 @@ + + + + + + + + + From 0f06b0aa43c642414b08cea466ca2b03b1a84b6b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 13:15:36 +0000 Subject: [PATCH 137/332] Add ipe and svg figures --- .../fig/WindingNonZeroDifferent.ipe | 117 +----------------- .../fig/WindingNonZeroDifferent.svg | 46 +------ 2 files changed, 3 insertions(+), 160 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe index 7756c8405b8..47617b1dcc9 100644 --- a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.ipe @@ -1,7 +1,7 @@ - + @@ -313,19 +313,7 @@ h - -64 528 m -64 464 l -192 464 l -192 528 l -h -96 512 m -96 480 l -160 480 l -160 512 l -h - - + 304 576 m 384 576 l 384 640 l @@ -658,106 +646,5 @@ h 304 592 m 304 576 l - -64 528 m -64 464 l -192 464 l -192 528 l -h - - -96 512 m -96 480 l -160 480 l -160 512 l -h - - -64 464 m -192 464 l - - -192 464 m -192 528 l - - -192 528 m -64 528 l - - -64 528 m -64 464 l - - -96 480 m -160 480 l - - -160 480 m -160 512 l - - -160 512 m -96 512 l - - -96 512 m -96 480 l - - -64 528 m -64 464 l -192 464 l -192 528 l -h - - -192 464 m -192 528 l - - -192 528 m -64 528 l - - -64 528 m -64 464 l - - -64 464 m -192 464 l - - -192 464 m -192 528 l - - -192 528 m -64 528 l - - -480 512 m -544 512 l - - -544 512 m -544 480 l - - -544 480 m -480 480 l - - -448 528 m -448 464 l - - -480 480 m -480 512 l - - -256 464 m -384 464 l - diff --git a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg index 9f6b94ab1b6..537b74fa694 100644 --- a/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg +++ b/Polygon_repair/doc/Polygon_repair/fig/WindingNonZeroDifferent.svg @@ -1,6 +1,5 @@ - - + @@ -135,47 +134,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 42014bd81cbdab2aee736cdd1afd381cdd96011d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 14:02:44 +0000 Subject: [PATCH 138/332] Reorganize User Manual --- .../doc/Polygon_repair/Polygon_repair.txt | 105 +++++++----------- 1 file changed, 38 insertions(+), 67 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index e5dc97ba11b..41df9ef4bb9 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -70,7 +70,44 @@ Invalid: (a) self-intersecting polygon self-intersection, (b) self-touching poly with overlapping polygons, and (h) multipolygon with polygons that touch at an edge. \cgalFigureEnd -\subsection SubsectionPolygonRepair_Output Stricter Conditions for Output + +\section SectionPolygonRepair_EvenOdd Even-Odd and Non-Zero Rule + +While the even-odd rule switches between inside/outside at each edge only taking +into account multiplicity, the non-zero rule takes also into account +the orientation of the edge. + +This leads to different results as can be seen in the figure below. + +\cgalFigureBegin{WindingNonZeroDifferent, WindingNonZeroDifferent.svg} +Input (left), non-zero (middle) even-odd (right). +\cgalFigureEnd + +And there are other configurations where the two rules lead to the same result. + +\cgalFigureBegin{WindingNonZero, WindingNonZero.svg} +Input (left), non-zero and even-odd (right). +\cgalFigureEnd + +A valid polygon with holes, obviously has the same result with both rules applied +as it is just the identity. However an invalid multipolygon with one polygon +enclosing the other one results in a polygon with hole. + +\cgalFigureBegin{MultipolygonHole, MultipolygonHole.svg} +Input (left), non-zero (middle) even-odd (right). +\cgalFigureEnd + +\section SectionPolygonRepair_UnionIntersection Union and Intersection Rule + +Given several valid polygons this rule computes their union or intersection. + +\cgalFigureBegin{UnionIntersection, UnionIntersection.svg} +Union (top) and Intersection (bottom). +\cgalFigureEnd + + + +\subsection SubsectionPolygonRepair_Output Notes on the Output The conditions listed above are sufficient to define valid polygons, polygons with holes and multipolygons with holes for most applications. However, in @@ -88,24 +125,6 @@ order - The polygons with holes of a multipolygon with holes are also stored in lexicographic order -\section SectionPolygonRepair_EvenOdd Even-Odd Rule - - -\cgalFigureBegin{inout, inout.svg} -Examples of polygons with holes (a-d) and multipolygons with holes -(e-h) before (left) and after (right) being repaired with the even-odd rule. -\cgalFigureEnd - - -\section SectionPolygonRepair_NonZero Non-Zero Rule - -Tbd. - -\section SectionPolygonRepair_UnionIntersection Union and Intersection Rule - -Given several valid polygons this rule computes their union or intersection. - -\section SubsectionPolygonRepair_Notes Notes on the Output If the input is already valid, the method will return a valid output representing the same area. However, the output might be different in order to conform to the @@ -118,54 +137,6 @@ the repair function will always return a multipolygon with holes. The user can then check whether it consists of a single polygon with holes, and if a polygon with holes has zero holes and extract these if needed. -\section SectionPolygonRepair_Algorithm Implementation - -Broadly, the algorithm consists of three steps: - --# Arrangement: the edges in the polygon, polygon with -holes or multipolygon with holes are added as edges in the arrangement. --# Labeling of the faces: the resulting faces are labeled with ids -according to what they represent (exterior, polygon interior or hole). --# Reconstruction of the multipolygon: each boundary is reconstructed, -then these are assembled into individual polygons with holes and put into a -single multipolygon with holes. - - -\subsection SubsectionPolygonRepair_Arrangement Arrangement - -For the purposes of the repair operation, the input polygon, polygon with holes -or multipolygon is merely used as a container of input line segments. These line -segments are added to the arrangement as edges. Internally, this is done using -a constrained triangulation where they are added as constraints. - -With the even-odd rule, only the edges that are present an odd number of -times in the input will be edges in the final arrangement. -When these edges are only partially overlapping, only the parts that overlap -an odd number of times will be edges in the final arrangement. - -This procedure is done in two steps: 1. preprocessing to eliminate identical -edges that are present an even number of times, and 2. adding edges incrementally -while applying an even-odd counting mechanism, which erases existing (parts of) -edges when new overlapping ones are added. - -\subsection SubsectionPolygonRepair_Labeling Labeling - -First, the polygon exterior is labeled. For this, all of the faces that can be -accessed from the exterior without passing through an edge are labeled as exterior -faces. - -Then, all other faces are labeled. For the even-odd rule, the label applied -alternates between polygon interior and hole every time that an edge is passed. - -\subsection SubsectionPolygonRepair_Reconstruction Reconstruction of the Multipolygon - -The algorithm reconstructs the multipolygon boundary by boundary, obtaining -counter-clockwise cycles for outer boundaries and clockwise cycles for inner -boundaries. Once all boundaries have been reconstructed, the boundaries are assembled -into multipolygons using the face labels to know which polygon with holes inner/outer -boundaries belong to, and using the orientation to distinguish between the outer and -inner boundaries of each polygon with holes. - \section SectionPolygonRepair_Examples Examples From 98e4e5eae923ab81c1da1ca1df5f653047139de7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 14:14:50 +0000 Subject: [PATCH 139/332] Reorganize User Manual --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 41df9ef4bb9..d1c0e97671e 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -77,7 +77,7 @@ While the even-odd rule switches between inside/outside at each edge only taking into account multiplicity, the non-zero rule takes also into account the orientation of the edge. -This leads to different results as can be seen in the figure below. +For some configurations this leads to different results, as can be seen in the figure below. \cgalFigureBegin{WindingNonZeroDifferent, WindingNonZeroDifferent.svg} Input (left), non-zero (middle) even-odd (right). @@ -91,7 +91,8 @@ Input (left), non-zero and even-odd (right). A valid polygon with holes, obviously has the same result with both rules applied as it is just the identity. However an invalid multipolygon with one polygon -enclosing the other one results in a polygon with hole. +enclosing the other one results in the union of the two, that is the enclosing one +for the non-zero rule, while it results in a polygon with hole for the even-odd rule. \cgalFigureBegin{MultipolygonHole, MultipolygonHole.svg} Input (left), non-zero (middle) even-odd (right). @@ -100,6 +101,7 @@ Input (left), non-zero (middle) even-odd (right). \section SectionPolygonRepair_UnionIntersection Union and Intersection Rule Given several valid polygons this rule computes their union or intersection. +This approaches from outside and from inside, respectively. \cgalFigureBegin{UnionIntersection, UnionIntersection.svg} Union (top) and Intersection (bottom). @@ -107,7 +109,7 @@ Union (top) and Intersection (bottom). -\subsection SubsectionPolygonRepair_Output Notes on the Output +\section SubsectionPolygonRepair_Output Notes on the Output The conditions listed above are sufficient to define valid polygons, polygons with holes and multipolygons with holes for most applications. However, in From aa004bef9ae2ebe40fb793cd7638a2bdb741d5c4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 14:34:33 +0000 Subject: [PATCH 140/332] fix figures --- .../Polygon_repair/fig/MultipolygonHole.ipe | 64 ++++++- .../Polygon_repair/fig/MultipolygonHole.svg | 177 ++++++++++-------- 2 files changed, 151 insertions(+), 90 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe index 4cb98fad274..6da403058d4 100644 --- a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe +++ b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.ipe @@ -1,7 +1,7 @@ - + @@ -472,7 +472,7 @@ h 160 656 m 96 656 l - + 64 528 m 64 464 l 192 464 l @@ -484,35 +484,79 @@ h 160 512 l h - + 64 464 m 192 464 l - + 192 464 m 192 528 l - + 192 528 m 64 528 l - + 480 512 m 544 512 l - + 544 512 m 544 480 l - + 544 480 m 480 480 l - + 448 528 m 448 464 l - + +480 480 m +480 512 l + + +64 528 m +64 464 l +192 464 l +192 528 l +h +96 512 m +96 480 l +160 480 l +160 512 l +h + + +64 464 m +192 464 l + + +192 464 m +192 528 l + + +192 528 m +64 528 l + + +480 512 m +544 512 l + + +544 512 m +544 480 l + + +544 480 m +480 480 l + + +448 528 m +448 464 l + + 480 480 m 480 512 l diff --git a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg index 7ad77f1444d..fb0747ad459 100644 --- a/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg +++ b/Polygon_repair/doc/Polygon_repair/fig/MultipolygonHole.svg @@ -1,82 +1,99 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 60a3343093ecc531a9e8906b54c03572bb7c05b9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 14:40:12 +0000 Subject: [PATCH 141/332] Combine in a single paragraph --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index d1c0e97671e..028da39c5db 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -23,9 +23,7 @@ The even-odd rule results in areas that are alternately assigned as polygon interiors and exterior/holes each time that an input edge is passed. It does not distinguish between edges that are part of outer boundaries from those of inner boundaries. - The non-zero rule results in areas with a non-zero winding number. - The union and intersection rules are useful when given two or more similar valid polygons with holes. They compute either their union or their intersection, and they are hence conservative From e77a873ec220c2cec6bff6d6c317493e8bfd8c5c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Dec 2024 15:07:01 +0000 Subject: [PATCH 142/332] typo --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 028da39c5db..c4350b2a320 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -99,7 +99,7 @@ Input (left), non-zero (middle) even-odd (right). \section SectionPolygonRepair_UnionIntersection Union and Intersection Rule Given several valid polygons this rule computes their union or intersection. -This approaches from outside and from inside, respectively. +This approximates from outside and from inside, respectively. \cgalFigureBegin{UnionIntersection, UnionIntersection.svg} Union (top) and Intersection (bottom). From 2838ad24d9c537edb9abd64c5fc067882a516f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 17:09:31 +0100 Subject: [PATCH 143/332] Delay to_double call --- Kernel_23/include/CGAL/Kernel/function_objects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 5a7b0774e6d..71d0f4d5130 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -965,7 +965,7 @@ namespace CommonKernelFunctors { typename K::Compute_scalar_product_3 scalar_product = k.compute_scalar_product_3_object(); - double product = CGAL::sqrt(to_double(scalar_product(u,u)) * to_double(scalar_product(v,v))); + double product = to_double(approximate_sqrt(scalar_product(u,u) * scalar_product(v,v))); if(product == 0) return 0; From 20115d3dcb70e4b1c1677837c1b8e3a087d4b98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 17:09:54 +0100 Subject: [PATCH 144/332] Use std::clamp --- Kernel_23/include/CGAL/Kernel/function_objects.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 71d0f4d5130..c49094aefb2 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -972,15 +972,7 @@ namespace CommonKernelFunctors { // cosine double dot = to_double(scalar_product(u,v)); - double cosine = dot / product; - - if(cosine > 1.){ - cosine = 1.; - } - if(cosine < -1.){ - cosine = -1.; - } - + double cosine = std::clamp(dot / product, -1., 1.); return std::acos(cosine) * 180./CGAL_PI; } From f7c36ea81d5c3b889df889ce798ef1cb9f363127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 17:10:11 +0100 Subject: [PATCH 145/332] Make the bottom and top of the ramp not have same colors --- Lab/demo/Lab/Color_map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lab/demo/Lab/Color_map.h b/Lab/demo/Lab/Color_map.h index a7a608112eb..909fc2f6a93 100644 --- a/Lab/demo/Lab/Color_map.h +++ b/Lab/demo/Lab/Color_map.h @@ -23,9 +23,9 @@ compute_color_map(QColor base_color, std::size_t nb_of_colors, Output_color_iterator out) { - qreal hue = base_color.hueF(); - const qreal step = (static_cast(1)) / nb_of_colors; + const qreal step = (static_cast(0.85)) / nb_of_colors; + qreal hue = base_color.hueF(); qreal h = (hue == -1) ? 0 : hue; for(std::size_t i=0; i Date: Tue, 10 Dec 2024 21:17:36 +0100 Subject: [PATCH 146/332] Improve discrete curvature implementation --- .../internal/curvature.h | 268 +++++++++++++----- .../include/CGAL/Weights/cotangent_weights.h | 1 - 2 files changed, 196 insertions(+), 73 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 992db0a56a3..94860c496d3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -15,42 +15,129 @@ #include -#include -#include #include +#include +#include +#include + +#include +#include namespace CGAL { namespace Polygon_mesh_processing { -namespace exprimental { -template -typename GetGeomTraits::type::FT -vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, - const TriangleMesh& tm, - const NamedParameters& np) +// Discrete Gaussian Curvature + +/** + * \ingroup PMP_vertex_angle_grp + * + * computes the sum of the angles around a vertex. + * + * @tparam PolygonMesh a model of `HalfedgeGraph` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param v the vertex whose sum of angles is computed + * @param pmesh the polygon mesh to which `v` belongs + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `pmesh`} + * \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`} + * \cgalParamNEnd + * + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class} + * \cgalParamType{The traits class must provide the nested functor `Compute_approximate_angle_3`, + * model of `Kernel::ComputeApproximateAngle_3`.} + * \cgalParamDefault{a \cgal kernel deduced from the point type, using `CGAL::Kernel_traits`} + * \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * @return the sum of angles around `v`. The return type `FT` is a number type either deduced + * from the `geom_traits` \ref bgl_namedparameters "Named Parameters" if provided, + * or the geometric traits class deduced from the point property map of `pmesh`. + * + * \warning This function involves trigonometry. + * + */ +template +#ifdef DOXYGEN_RUNNING +FT +#else +typename GetGeomTraits::type::FT +#endif +angle_sum(typename boost::graph_traits::vertex_descriptor v, + const PolygonMesh& pmesh, + const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; - using GeomTraits = typename GetGeomTraits::type; - using tyFT = typename GeomTraits::FT; + using Geom_traits = typename GetGeomTraits::type; + using FT = typename Geom_traits::FT; + + typename GetVertexPointMap::const_type + vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + get_const_property_map(CGAL::vertex_point, pmesh)); + + Geom_traits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); + + CGAL_precondition(is_valid_vertex_descriptor(v, pmesh)); + + typename Geom_traits::Construct_vector_3 approx_angle = gt.compute_approximate_angle_3_object(); + + FT angle_sum = 0; + for(auto h : halfedges_around_source(v, pmesh)) + { + angle_sum += approx_angle(get(vpm, target(h, pmesh)), + get(vpm, source(h, pmesh)), + get(vpm, source(prev(h,pmesh), pmesh))); + } + + return angle_sum; +} + +template +#ifdef DOXYGEN_RUNNING +FT +#else +typename GetGeomTraits::type::FT +#endif +discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, + const TriangleMesh& tm, + const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + + using GeomTraits = typename GetGeomTraits::type; + using FT = typename GeomTraits::FT; using Vector_3 = typename GeomTraits::Vector_3; - using VertexPointMap = typename GetVertexPointMap::const_type; + using VertexPointMap = typename GetVertexPointMap::const_type; using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); - typename GeomTraits::Construct_vector_3 vector = gt.construct_vector_3_object(); - typename GeomTraits::Compute_scalar_product_3 scalar_product = gt.compute_scalar_product_3_object(); - typename GeomTraits::Compute_squared_length_3 squared_length = gt.compute_squared_length_3_object(); - typename GeomTraits::Construct_cross_product_vector_3 cross_product = gt.construct_cross_product_vector_3_object(); + typename GeomTraits::Construct_vector_3 vector = + gt.construct_vector_3_object(); + typename GeomTraits::Construct_cross_product_vector_3 cross_product = + gt.construct_cross_product_vector_3_object(); + typename GeomTraits::Compute_scalar_product_3 scalar_product = + gt.compute_scalar_product_3_object(); + typename GeomTraits::Compute_squared_length_3 squared_length = + gt.compute_squared_length_3_object(); - const FT two_pi = 2 * CGAL_PI; + FT angle_sum = 0; - FT ki = 0; for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) { if(is_border(h, tm)) @@ -62,75 +149,81 @@ vertex_discrete_Gaussian_curvature(typename boost::graph_traits::v const FT dot = scalar_product(v0, v1); const Vector_3 cross = cross_product(v0, v1); const FT sqcn = squared_length(cross); - if(dot == FT(0)) + if(is_zero(dot)) { - ki += CGAL_PI/FT(2); + angle_sum += CGAL_PI/FT(2); } else { - if(sqcn == FT(0)) + if(is_zero(sqcn)) // collinear { if(dot < 0) - ki += CGAL_PI; + angle_sum += CGAL_PI; + // else + // angle_sum += 0; } else { - ki += std::atan2(CGAL::approximate_sqrt(sqcn), dot); + angle_sum += std::atan2(CGAL::approximate_sqrt(sqcn), dot); } } } - return two_pi - ki; + Weights::Secure_cotangent_weight_with_voronoi_area wc(tm, vpm, gt); + + const FT gaussian_curvature = (2 * CGAL_PI - angle_sum) / wc.voronoi(v); + + return gaussian_curvature; } -template -auto -vertex_discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, - const TriangleMesh& tm) -{ - return vertex_discrete_Gaussian_curvature(v, tm, parameters::all_default()); -} - -template +template void discrete_Gaussian_curvatures(const TriangleMesh& tm, VertexCurvatureMap vcm, - const NamedParameters& np) + const CGAL_NP_CLASS& np = parameters::default_values()) { using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; for(vertex_descriptor v : vertices(tm)) - put(vcm, v, vertex_discrete_Gaussian_curvature(v, tm, np)); + put(vcm, v, discrete_Gaussian_curvature(v, tm, np)); } -template -void discrete_Gaussian_curvatures(const TriangleMesh& tm, - VertexCurvatureMap vcm) -{ - discrete_Gaussian_curvatures(tm, vcm, parameters::all_default()); -} +// Discrete Mean Curvature -template -typename GetGeomTraits::type::FT -vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor v, - const TriangleMesh& tm, - const NamedParameters& np) +template +#ifdef DOXYGEN_RUNNING +FT +#else +typename GetGeomTraits::type::FT +#endif +discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor v, + const TriangleMesh& tm, + const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; - using GeomTraits = typename GetGeomTraits::type; + using GeomTraits = typename GetGeomTraits::type; using FT = typename GeomTraits::FT; - using Point_3 = typename GeomTraits::Point_3; + using Vector_3 = typename GeomTraits::Vector_3; - using VertexPointMap = typename GetVertexPointMap::const_type; + using VertexPointMap = typename GetVertexPointMap::const_type; + using Point_ref = typename boost::property_traits::reference; + + using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); - typename GeomTraits::Compute_squared_distance_3 squared_distance = gt.compute_squared_distance_3_object(); - typename GeomTraits::Compute_approximate_dihedral_angle_3 approximate_dihedral_angle= gt.compute_approximate_dihedral_angle_3_object(); +#if 0 + typename GeomTraits::Compute_squared_distance_3 squared_distance = + gt.compute_squared_distance_3_object(); + typename GeomTraits::Compute_approximate_dihedral_angle_3 dihedral_angle = + gt.compute_approximate_dihedral_angle_3_object(); const FT two_pi = 2 * CGAL_PI; @@ -143,7 +236,7 @@ vertex_discrete_mean_curvature(typename boost::graph_traits::verte const Point_3& s = get(vpm, target(next(opposite(h, tm), tm), tm)); const FT l = squared_distance(p,q); - FT phi = CGAL_PI * approximate_dihedral_angle(p, q, r, s) / FT(180); + FT phi = CGAL_PI * dihedral_angle(p, q, r, s) / FT(180); if(phi < 0) phi += two_pi; @@ -154,35 +247,66 @@ vertex_discrete_mean_curvature(typename boost::graph_traits::verte } return FT(0.5) * hi; +#else + typename GeomTraits::Construct_vector_3 vector = + gt.construct_vector_3_object(); + typename GeomTraits::Construct_sum_of_vectors_3 vector_sum = + gt.construct_sum_of_vectors_3_object(); + typename GeomTraits::Construct_scaled_vector_3 scaled_vector = + gt.construct_scaled_vector_3_object(); + typename GeomTraits::Compute_squared_length_3 squared_length = + gt.compute_squared_length_3_object(); + + Weights::Secure_cotangent_weight_with_voronoi_area wc(tm, vpm, gt); + + Vector_3 kh = vector(CGAL::NULL_VECTOR); + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) + { + const vertex_descriptor v1 = source(h, tm); + + const Point_ref p0 = get(vpm, v); + const Point_ref p1 = get(vpm, v1); + + FT local_c = 0; + if(!is_border(h, tm)) + { + const vertex_descriptor v2 = target(next(h, tm), tm); + const Point_ref p2 = get(vpm, v2); + local_c += Weights::cotangent_3_clamped(p0, p2, p1, gt); + } + + if(!is_border(opposite(h, tm), tm)) + { + const vertex_descriptor v3 = target(next(opposite(h, tm), tm), tm); + const Point_ref p3 = get(vpm, v3); + local_c += Weights::cotangent_3_clamped(p1, p3, p0, gt); + } + + kh = vector_sum(kh, scaled_vector(vector(p0, p1), local_c)); + } + + const FT khn = CGAL::approximate_sqrt(squared_length(kh)); + const FT va = wc.voronoi(v); + CGAL_assertion(!is_zero(va)); + + const FT mean_curvature = khn / (FT(4) * va); + return mean_curvature; +#endif } -template -void discrete_mean_curvature(const TriangleMesh& tm, - VertexCurvatureMap vcm, - const NamedParameters& np) +template +void discrete_mean_curvatures(const TriangleMesh& tm, + VertexCurvatureMap vcm, + const CGAL_NP_CLASS& np = parameters::default_values()) { using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; for(vertex_descriptor v : vertices(tm)) - put(vcm, v, vertex_discrete_mean_curvature(v, tm, np)); + put(vcm, v, discrete_mean_curvature(v, tm, np)); } -template -auto -vertex_discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor vd, - const TriangleMesh& tm) -{ - return vertex_discrete_mean_curvature(vd, tm, parameters::all_default()); -} - -template -void discrete_mean_curvature(const TriangleMesh& tm, - VertexCurvatureMap vcm) -{ - discrete_mean_curvature(tm, vcm, parameters::all_default()); -} - -} // namespace experimental } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Weights/include/CGAL/Weights/cotangent_weights.h b/Weights/include/CGAL/Weights/cotangent_weights.h index 4f389e3b06b..0d971f0fd17 100644 --- a/Weights/include/CGAL/Weights/cotangent_weights.h +++ b/Weights/include/CGAL/Weights/cotangent_weights.h @@ -344,7 +344,6 @@ public: return cotangent_weight_calculator(he); } -private: FT voronoi(const vertex_descriptor v0) const { auto squared_length_3 = m_traits.compute_squared_length_3_object(); From 1189356739f455768591dd8ffb95ac220c181159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 21:17:57 +0100 Subject: [PATCH 147/332] Add discrete curvatures to display plugin --- .../Display/Display_property_plugin.cpp | 74 ++++++++++++++++--- 1 file changed, 63 insertions(+), 11 deletions(-) diff --git a/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp b/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp index f0eb9086215..4156305559e 100644 --- a/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -350,11 +351,11 @@ private: template void displayMapLegend(const std::vector& values) { - const std::size_t size = (std::min)(color_map.size(), std::size_t(1024)); + const std::size_t size = (std::min)(color_map.size(), std::size_t(4096)); const int text_height = 20; const int height = text_height * static_cast(size) + text_height; - const int width = 140; + const int width = 200; const int cell_width = width / 3; const int top_margin = 15; const int left_margin = 5; @@ -381,13 +382,13 @@ private: tick_height, color); - QRect text_rect(left_margin + cell_width + 10, drawing_height - top_margin - j, 50, text_height); - painter.drawText(text_rect, Qt::AlignCenter, QObject::tr("%1").arg(values[i], 0, 'f', 3, QLatin1Char(' '))); + QRect text_rect(left_margin + cell_width + 10, drawing_height - top_margin - j, 100, text_height); + painter.drawText(text_rect, Qt::AlignCenter, QObject::tr("%1").arg(values[i], 0, 'f', 6, QLatin1Char(' '))); } if(color_map.size() > size) { - QRect text_rect(left_margin + cell_width + 10, 0, 50, text_height); + QRect text_rect(left_margin + cell_width + 10, 0, 100, text_height); painter.drawText(text_rect, Qt::AlignCenter, QObject::tr("[...]")); } @@ -463,6 +464,8 @@ private: "Largest Angle Per Face", "Scaled Jacobian", "Face Area", + "Discrete Mean Curvature", + "Discrete Gaussian Curvature", "Interpolated Corrected Mean Curvature", "Interpolated Corrected Gaussian Curvature"}); property_simplex_types = { Property_simplex_type::FACE, @@ -470,6 +473,8 @@ private: Property_simplex_type::FACE, Property_simplex_type::FACE, Property_simplex_type::VERTEX, + Property_simplex_type::VERTEX, + Property_simplex_type::VERTEX, Property_simplex_type::VERTEX }; detectSMScalarProperties(*(sm_item->face_graph())); } @@ -516,12 +521,12 @@ private Q_SLOTS: // Curvature property-specific slider const std::string& property_name = dock_widget->propertyBox->currentText().toStdString(); - const bool is_curvature_property = (property_name == "Interpolated Corrected Mean Curvature" || - property_name == "Interpolated Corrected Gaussian Curvature"); - dock_widget->expandingRadiusLabel->setVisible(is_curvature_property); - dock_widget->expandingRadiusSlider->setVisible(is_curvature_property); - dock_widget->expandingRadiusLabel->setEnabled(is_curvature_property); - dock_widget->expandingRadiusSlider->setEnabled(is_curvature_property); + const bool is_interpolated_curvature_property = (property_name == "Interpolated Corrected Mean Curvature" || + property_name == "Interpolated Corrected Gaussian Curvature"); + dock_widget->expandingRadiusLabel->setVisible(is_interpolated_curvature_property); + dock_widget->expandingRadiusSlider->setVisible(is_interpolated_curvature_property); + dock_widget->expandingRadiusLabel->setEnabled(is_interpolated_curvature_property); + dock_widget->expandingRadiusSlider->setEnabled(is_interpolated_curvature_property); } else // no or broken property { @@ -570,6 +575,16 @@ private: { displayArea(sm_item); } + else if(property_name == "Discrete Mean Curvature") + { + displayDiscreteCurvatureMeasure(sm_item, MEAN_CURVATURE); + sm_item->setRenderingMode(Gouraud); + } + else if(property_name == "Discrete Gaussian Curvature") + { + displayDiscreteCurvatureMeasure(sm_item, GAUSSIAN_CURVATURE); + sm_item->setRenderingMode(Gouraud); + } else if(property_name == "Interpolated Corrected Mean Curvature") { displayInterpolatedCurvatureMeasure(sm_item, MEAN_CURVATURE); @@ -682,6 +697,8 @@ private: removeDisplayPluginProperty(item, "f:display_plugin_largest_angle"); removeDisplayPluginProperty(item, "f:display_plugin_scaled_jacobian"); removeDisplayPluginProperty(item, "f:display_plugin_area"); + removeDisplayPluginProperty(item, "v:display_plugin_discrete_mean_curvature"); + removeDisplayPluginProperty(item, "v:display_plugin_discrete_Gaussian_curvature"); removeDisplayPluginProperty(item, "v:display_plugin_interpolated_corrected_mean_curvature"); removeDisplayPluginProperty(item, "v:display_plugin_interpolated_corrected_Gaussian_curvature"); } @@ -864,6 +881,35 @@ private: displaySMProperty("f:display_plugin_area", *sm); } +private: + void displayDiscreteCurvatureMeasure(Scene_surface_mesh_item* sm_item, + CurvatureType mu_index) + { + SMesh* sm = sm_item->face_graph(); + if(sm == nullptr) + return; + + if(mu_index != MEAN_CURVATURE && mu_index != GAUSSIAN_CURVATURE) + return; + + std::string vdc_name = (mu_index == MEAN_CURVATURE) ? "v:display_plugin_discrete_mean_curvature" + : "v:display_plugin_discrete_Gaussian_curvature"; + + bool not_initialized; + SMesh::Property_map vdc; + std::tie(vdc, not_initialized) = sm->add_property_map(vdc_name, 0); + + if(not_initialized) + { + if(mu_index == MEAN_CURVATURE) + PMP::discrete_mean_curvatures(*sm, vdc); + else + PMP::discrete_Gaussian_curvatures(*sm, vdc); + } + + displaySMProperty(vdc_name, *sm); + } + private Q_SLOTS: void setExpandingRadius() { @@ -1131,6 +1177,10 @@ private: zoomToSimplexWithPropertyExtremum(faces(mesh), mesh, "f:display_plugin_scaled_jacobian", extremum); else if(property_name == "Face Area") zoomToSimplexWithPropertyExtremum(faces(mesh), mesh, "f:display_plugin_area", extremum); + else if(property_name == "Discrete Mean Curvature") + zoomToSimplexWithPropertyExtremum(vertices(mesh), mesh, "v:display_plugin_discrete_mean_curvature", extremum); + else if(property_name == "Discrete Gaussian Curvature") + zoomToSimplexWithPropertyExtremum(vertices(mesh), mesh, "v:display_plugin_discrete_Gaussian_curvature", extremum); else if(property_name == "Interpolated Corrected Mean Curvature") zoomToSimplexWithPropertyExtremum(vertices(mesh), mesh, "v:display_plugin_interpolated_corrected_mean_curvature", extremum); else if(property_name == "Interpolated Corrected Gaussian Curvature") @@ -1470,6 +1520,8 @@ isSMPropertyScalar(const std::string& name, name == "f:display_plugin_largest_angle" || name == "f:display_plugin_scaled_jacobian" || name == "f:display_plugin_area" || + name == "v:display_plugin_discrete_mean_curvature" || + name == "v:display_plugin_discrete_Gaussian_curvature" || name == "v:display_plugin_interpolated_corrected_mean_curvature" || name == "v:display_plugin_interpolated_corrected_Gaussian_curvature") return false; From 5ece39385f2ba40b66965a952781d62d2b7031d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 21:18:11 +0100 Subject: [PATCH 148/332] Fix placement of assertion --- Weights/include/CGAL/Weights/cotangent_weights.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Weights/include/CGAL/Weights/cotangent_weights.h b/Weights/include/CGAL/Weights/cotangent_weights.h index 0d971f0fd17..34a6d79f178 100644 --- a/Weights/include/CGAL/Weights/cotangent_weights.h +++ b/Weights/include/CGAL/Weights/cotangent_weights.h @@ -353,11 +353,12 @@ public: for (const halfedge_descriptor he : halfedges_around_target(halfedge(v0, m_pmesh), m_pmesh)) { CGAL_assertion(v0 == target(he, m_pmesh)); - CGAL_assertion(CGAL::is_triangle(he, m_pmesh)); if (is_border(he, m_pmesh)) continue; + CGAL_assertion(CGAL::is_triangle(he, m_pmesh)); + const vertex_descriptor v1 = source(he, m_pmesh); const vertex_descriptor v2 = target(next(he, m_pmesh), m_pmesh); From 38142206b69a71f3cec646cd7869ab347f56050f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 21:18:28 +0100 Subject: [PATCH 149/332] Do not use an inexact SQRT if an exact one exists --- Weights/include/CGAL/Weights/internal/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Weights/include/CGAL/Weights/internal/utils.h b/Weights/include/CGAL/Weights/internal/utils.h index 850fccff1e8..80822b68c84 100644 --- a/Weights/include/CGAL/Weights/internal/utils.h +++ b/Weights/include/CGAL/Weights/internal/utils.h @@ -44,7 +44,7 @@ private: public: FT operator()(const FT value) const { - return static_cast(CGAL::sqrt(CGAL::to_double(CGAL::abs(value)))); + return CGAL::approximate_sqrt(CGAL::abs(value)); } }; From 927d52e79ee37e3487fb92628c289e54c30cd552 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 12 Dec 2024 09:54:04 +0000 Subject: [PATCH 150/332] Add to changes.md --- Installation/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..6498876bccc 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -11,6 +11,10 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. +### [Polygon Repair](https://doc.cgal.org/6.1/Manual/packages.html#PkgPolygonRepair) + +- Add a the non-zero rule, as well as functions to compute the conservative inner and outer hull of similar polygons. + ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) ### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3) From 40c6a25fe0b169654e03ab9f20ba6304ee619db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:17:00 +0100 Subject: [PATCH 151/332] Move functions --- .../Hyperbolic_Delaunay_triangulation_2.h | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h index d95bfe27fba..0b79c1af1b3 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -740,6 +740,32 @@ public: Hyperbolic_segment segment(const Edge& e) const { return hyperbolic_segment(e); } Hyperbolic_segment segment(const Edge_circulator& e) const { return hyperbolic_segment(e); } + const Point& point(const Vertex_handle vh) const + { + CGAL_precondition(!is_infinite(vh)); + return vh->point(); + } + + const Point& point(const Face_handle fh, const int i) const + { + CGAL_precondition(!is_infinite(fh->vertex(i))); + CGAL_precondition(0 <= i && i <= 2); + return fh->vertex(i)->point(); + } + + Point& point(const Vertex_handle vh) + { + CGAL_precondition(!is_infinite(vh)); + return vh->point(); + } + + Point& point(const Face_handle fh, const int i) + { + CGAL_precondition(!is_infinite(fh->vertex(i))); + CGAL_precondition(0 <= i && i <= 2); + return fh->vertex(i)->point(); + } + size_type number_of_vertices() const { return Base::number_of_vertices(); } Vertex_circulator adjacent_vertices(Vertex_handle v) const { return Vertex_circulator(v, *this); } @@ -825,32 +851,6 @@ public: } public: - const Point& point(const Vertex_handle vh) const - { - CGAL_precondition(!is_infinite(vh)); - return vh->point(); - } - - const Point& point(const Face_handle fh, const int i) const - { - CGAL_precondition(!is_infinite(fh->vertex(i))); - CGAL_precondition(0 <= i && i <= 2); - return fh->vertex(i)->point(); - } - - Point& point(const Vertex_handle vh) - { - CGAL_precondition(!is_infinite(vh)); - return vh->point(); - } - - Point& point(const Face_handle fh, const int i) - { - CGAL_precondition(!is_infinite(fh->vertex(i))); - CGAL_precondition(0 <= i && i <= 2); - return fh->vertex(i)->point(); - } - bool is_valid() { if (!Base::is_valid()) From 1bd0c37aadba35f733555abe07a0b9e913f049e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:17:17 +0100 Subject: [PATCH 152/332] Document point() in hyperbolic triangulations --- .../CGAL/Hyperbolic_Delaunay_triangulation_2.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h index ef2d984340b..b89c95f5656 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -200,7 +200,19 @@ public: /*! Returns the hyperbolic segment formed by the vertices of edge `e`. */ - Hyperbolic_segment hyperbolic_segment (const Edge& e) const; + Hyperbolic_segment hyperbolic_segment(const Edge& e) const; + + /*! + Returns the hyperbolic point given by the finite vertex `vh`. + */ + Point point(const Vertex_handle vh) const; + + /*! + Returns the point given by vertex `i` of face `fh`. + \pre `t.dimension()` \f$ \geq0\f$ and \f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite. + */ + Point point(const Face_handle fh, const int i) const; + ///@} From da3cf102212644182432a489186e801dc1fe663f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:18:22 +0100 Subject: [PATCH 153/332] Document point() in periodic triangulations --- .../CGAL/Periodic_2_triangulation_2.h | 12 ++++++++++++ .../CGAL/Periodic_3_triangulation_3.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h index 05f9da516bc..bf38307c1b6 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h @@ -593,6 +593,18 @@ public: */ Triangle triangle(const Periodic_triangle & t) const; + /*! + Equivalent to + the call `t.point(t.periodic_point(fh,i));` + */ + Point point(Face_handle fh, int i) const; + + /*! + Equivalent to + the call `t.point(t.periodic_point(v));` + */ + Point point(Vertex_handle v) const; + /*! Equivalent to the call `t.segment(t.periodic_segment(f,i));` diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h index 254a7a26b11..8a4de97b43a 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h @@ -551,6 +551,24 @@ size_type number_of_stored_facets() const; /// `Periodic_triangle`, and `Periodic_tetrahedron`, which have inner type `Point`. /// @{ +/*! +Converts the `Periodic_point` `pp` (point-offset pair) to the +corresponding `Point` in \f$ \mathbb R^3\f$. +*/ +Point point(const Periodic_point& pp) const; + +/*! +Equivalent to +the call `t.point(t.periodic_point(v));` +*/ +Point point(Vertex_handle v) const; + +/*! +Equivalent to +the call `t.point(t.periodic_point(c,idx));` +*/ +Point point(Cell_handle c, int idx) const; + /*! Returns the periodic point given by vertex `v`. If `t` is represented in the 1-sheeted covering space, the offset is always From 195616fcf36d5fdccb425164502d33b2d4f19ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:18:35 +0100 Subject: [PATCH 154/332] Document point() in 2D Euclidean triangulations --- .../doc/Triangulation_2/CGAL/Triangulation_2.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index 570114a5b99..14f52513543 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -1191,6 +1191,18 @@ Returns the line segment corresponding to edge `*ei`. Segment segment(const Edge_iterator& ei) const; +/*! +Returns the point given by vertex `i` of face `f`. +\pre `t.dimension()` \f$ \geq0\f$ and f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite. +*/ +const Point& point(Face_handle f, int i) const; + +/*! +Same as the previous method for vertex `v`. +\pre `t.dimension()` \f$ \geq0\f$ and the vertex is finite. +*/ +const Point& point(Vertex_handle v) const; + /*! Compute the circumcenter of the face pointed to by f. This function is available only if the corresponding function is provided in the From f15f8c691cafd235538d6f70dab9749267b56c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:18:46 +0100 Subject: [PATCH 155/332] Fix typo --- .../CGAL/Periodic_2_triangulation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h index bf38307c1b6..1124eeab784 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h @@ -579,7 +579,7 @@ public: /*! Converts the `Periodic_point` `pp` (point-offset pair) to the - corresponding `Point` in \f$ \mathbb R^3\f$. + corresponding `Point` in \f$ \mathbb R^2\f$. */ Point point(const Periodic_point & pp ) const; From 2b5682f72dd727365f937ba93bc44366382ddd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 14:32:48 +0100 Subject: [PATCH 156/332] Fix missing backslash in math equation --- Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index 14f52513543..a8ac0f354cc 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -1193,7 +1193,7 @@ segment(const Edge_iterator& ei) const; /*! Returns the point given by vertex `i` of face `f`. -\pre `t.dimension()` \f$ \geq0\f$ and f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite. +\pre `t.dimension()` \f$ \geq0\f$ and \f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite. */ const Point& point(Face_handle f, int i) const; From 2db11f6a2c786a20b6d3d1cf5aaa9836efecba76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 22:18:13 +0100 Subject: [PATCH 157/332] Allow removing degree 2 vertices incident to a triangle face --- .../CGAL/boost/graph/Euler_operations.h | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 4ca35144f8a..c3a05f61180 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -1869,7 +1869,6 @@ bool satisfies_link_condition(typename boost::graph_traits::edge_descript /// removes the target vertex of `h`, merging its incident edges into a single edge. /// \pre `degree(target(h, g), g) == 2`. -/// \pre there is no pre-existing edge between source(h, g) and target(next(h, g), g) template typename boost::graph_traits::halfedge_descriptor remove_degree_2_vertex(const typename boost::graph_traits::halfedge_descriptor h, @@ -1895,28 +1894,34 @@ remove_degree_2_vertex(const typename boost::graph_traits::halfedge_descr bool exists; halfedge_descriptor huv; std::tie(huv, exists) = halfedge(v1, v2, g); - if(exists) - return boost::graph_traits::null_halfedge(); if(is_border(h2, g)) { CGAL_assertion(!is_border(h1, g)); - halfedge_descriptor oh1 = opposite(h1, g); - halfedge_descriptor nnh1 = next(next(h1, g), g); - halfedge_descriptor ph2 = prev(h2, g); - face_descriptor f1 = face(h1, g); + if(exists) + { + Euler::remove_face(h1, g); + return huv; + } + else + { + halfedge_descriptor oh1 = opposite(h1, g); + halfedge_descriptor nnh1 = next(next(h1, g), g); + halfedge_descriptor ph2 = prev(h2, g); + face_descriptor f1 = face(h1, g); - set_target(h1, v2, g); - set_halfedge(v2, ph2, g); - set_next(h1, nnh1, g); - set_next(ph2, oh1, g); - set_halfedge(f1, h1, g); // in case it was nh1 + set_target(h1, v2, g); + set_halfedge(v2, ph2, g); + set_next(h1, nnh1, g); + set_next(ph2, oh1, g); + set_halfedge(f1, h1, g); // in case it was nh1 - remove_edge(edge(h2, g), g); - remove_vertex(v, g); + remove_edge(edge(h2, g), g); + remove_vertex(v, g); - return h1; + return h1; + } } else { @@ -1925,7 +1930,11 @@ remove_degree_2_vertex(const typename boost::graph_traits::halfedge_descr halfedge_descriptor ph1 = prev(h1, g); halfedge_descriptor ph2 = prev(h2, g); Euler::remove_center_vertex(h, g); - return Euler::split_face(ph1, ph2, g); + + if(exists) + return huv; + else + return Euler::split_face(ph1, ph2, g); } } From f744f03d5285515c26b2812a08a030853d1ebbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 13 Dec 2024 22:18:52 +0100 Subject: [PATCH 158/332] Test remove_degree_2_vertex --- BGL/test/BGL/data/degree_2_collection.off | 52 ++++++++++++++++++ BGL/test/BGL/test_Euler_operations.cpp | 64 +++++++++++++++++++++++ BGL/test/BGL/test_Prefix.h | 2 - 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 BGL/test/BGL/data/degree_2_collection.off diff --git a/BGL/test/BGL/data/degree_2_collection.off b/BGL/test/BGL/data/degree_2_collection.off new file mode 100644 index 00000000000..629a920c99d --- /dev/null +++ b/BGL/test/BGL/data/degree_2_collection.off @@ -0,0 +1,52 @@ +OFF +29 19 0 + +0 0 0 +0.20000000000000001 0 0 +0.40000000000000002 0 0 +0.59999999999999998 0 0 +0.80000000000000004 0 0 +1 0 0 +0 0.20000000000000001 0 +0.20000000000000001 0.20000000000000001 0 +0 1 0 +0.59999999999999998 0.20000000000000001 0 +0.80000000000000004 0.20000000000000001 0 +1 0.20000000000000001 0 +0 0.40000000000000002 0 +0.20000000000000001 1 0 +0.40000000000000002 0.40000000000000002 0 +0.59999999999999998 0.40000000000000002 0 +1 1 0 +1 0.40000000000000002 0 +0 0.59999999999999998 0 +1 0.80000000000000004 0 +0.59999999999999998 1 0 +0.59999999999999998 0.59999999999999998 0 +0.80000000000000004 1 0 +1 0.59999999999999998 0 +0 0.80000000000000004 0 +0.20000000000000001 0.80000000000000004 0 +0.40000000000000002 1 0 +0.59999999999999998 0.80000000000000004 0 +0.80000000000000004 0.80000000000000004 0 +4 1 7 6 0 +3 28 19 22 +3 6 7 12 +3 4 10 9 +3 3 4 9 +3 27 20 26 +3 9 15 14 +3 5 11 10 +3 24 25 8 +3 25 13 8 +3 1 2 7 +8 17 23 28 27 21 15 10 11 +3 9 10 15 +3 19 16 22 +12 25 24 18 12 7 2 3 9 14 15 21 27 +3 4 5 10 +3 28 22 20 +3 27 28 20 +3 23 19 28 + diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 615a4fd756d..f6361af7736 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -448,6 +448,67 @@ remove_center_vertex_test() assert(CGAL::internal::exact_num_halfedges(f.m) == nh-(2*deg)); } +template +void +remove_degree_2_vertex_test() +{ + CGAL_GRAPH_TRAITS_MEMBERS(T); + + // vertex at .first should be removable, and after removal, + // there should .second[0] nv, .second[1] ne, and .second[2] nf + // anything not in the map should not be removable + std::map > removable; + removable[0] = CGAL::make_array(28, 92, 19); + removable[13] = CGAL::make_array(28, 90, 18); + removable[14] = CGAL::make_array(28, 90, 18); + removable[16] = CGAL::make_array(28, 90, 18); + removable[17] = CGAL::make_array(28, 92, 19); + removable[18] = CGAL::make_array(28, 92, 19); + removable[21] = CGAL::make_array(28, 92, 19); + removable[26] = CGAL::make_array(28, 90, 18); + + auto test = [&removable](const std::size_t hi) // intentional copy of 'm' + { + T m; + const bool ok = CGAL::IO::read_polygon_mesh("data/degree_2_collection.off", m); + assert(ok); + assert(CGAL::is_valid_polygon_mesh(m)); + + auto vim = get_initialized_vertex_index_map(m); + + const halfedge_descriptor h = *(std::next(halfedges(m).begin(), hi)); + const vertex_descriptor v = target(h, m); + auto vid = get(vim, v); + if(degree(v, m) != 2) + { + assert(removable.count(vid) == 0); + return; + } + + const halfedge_descriptor res = CGAL::Euler::remove_degree_2_vertex(h, m); + assert(res != boost::graph_traits::null_halfedge()); + + const std::array& ns = removable.at(vid); + + assert(ns[0] == vertices(m).size()); + assert(ns[1] == halfedges(m).size()); + assert(ns[2] == faces(m).size()); + }; + + T m; + const bool ok = CGAL::IO::read_polygon_mesh("data/degree_2_collection.off", m); + assert(ok); + assert(CGAL::is_valid_polygon_mesh(m)); + + std::size_t nv = num_vertices(m); + std::size_t nh = num_halfedges(m); + std::size_t nf = num_faces(m); + assert(nv == 29 && nh == 94 && nf == 19); + + for(std::size_t hi=0; hi void join_split_inverse() @@ -670,6 +731,8 @@ template void test_Euler_operations() { + std::cout << "== Test with Graph: " << typeid(Graph).name() << std::endl; + test_copy_face_graph_nm_umbrella(); test_copy_face_graph_isolated_vertices(); join_face_test(); @@ -684,6 +747,7 @@ test_Euler_operations() split_face_test(); make_hole_test(); remove_center_vertex_test(); + remove_degree_2_vertex_test(); join_split_inverse(); does_satisfy_link_condition(); test_swap_edges(); diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index ca92ed230f2..390b7f835d1 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -521,8 +521,6 @@ struct Surface_fixture_8 { Graph m; typename boost::graph_traits::halfedge_descriptor h1, h2, h3; - }; - #endif /* CGAL_TEST_PREFIX_H */ From f6a121d33562f3d4a7f5016209bbf773eb3d47c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 16 Dec 2024 09:20:21 +0100 Subject: [PATCH 159/332] Add doc for BGL's remove_degree_2_vertex() --- BGL/doc/BGL/PackageDescription.txt | 1 + .../CGAL/boost/graph/Euler_operations.h | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index e058589c3bf..39d72cd330d 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -741,6 +741,7 @@ user might encounter. - `CGAL::Euler::join_vertex()` - `CGAL::Euler::make_hole()` - `CGAL::Euler::remove_center_vertex()` +- `CGAL::Euler::remove_degree_2_vertex()` - `CGAL::Euler::remove_face()` - `CGAL::Euler::split_edge()` - `CGAL::Euler::split_face()` diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index c3a05f61180..0a554c683de 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -1867,8 +1867,22 @@ bool satisfies_link_condition(typename boost::graph_traits::edge_descript /// \endcond #endif -/// removes the target vertex of `h`, merging its incident edges into a single edge. -/// \pre `degree(target(h, g), g) == 2`. +/** + * removes the target vertex of `h`, merging its incident edges into a single edge linking + * the two vertices adjacent to the vertex being removed. + * + * \tparam Graph must be a model of `MutableFaceGraph` + * + * \param h halfedge descriptor + * \param g the graph + * + * \returns an halfedge linking the two vertices adjacent to the vertex being removed. + * + * \pre `degree(target(h, g), g) == 2`. + * + * \sa `remove_center_vertex()` + */ + template typename boost::graph_traits::halfedge_descriptor remove_degree_2_vertex(const typename boost::graph_traits::halfedge_descriptor h, From f91a8f8408b2d49c673b2a2d3707283cb894a98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 17 Dec 2024 11:13:43 +0100 Subject: [PATCH 160/332] Add header include --- BGL/test/BGL/test_Euler_operations.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index f6361af7736..4cfaaf31976 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -1,12 +1,15 @@ #include "test_Prefix.h" -#include + #include #include +#include +#include +#include #include -#include -#include + +#include template void @@ -474,7 +477,7 @@ remove_degree_2_vertex_test() assert(ok); assert(CGAL::is_valid_polygon_mesh(m)); - auto vim = get_initialized_vertex_index_map(m); + auto vim = CGAL::get_initialized_vertex_index_map(m); const halfedge_descriptor h = *(std::next(halfedges(m).begin(), hi)); const vertex_descriptor v = target(h, m); From 5c70d487a1f817b0c50fcb49b66244789d4823cd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Dec 2024 18:27:13 +0100 Subject: [PATCH 161/332] actually allow tuple-like objects, and test that feature --- Mesh_3/include/CGAL/make_mesh_3.h | 25 ++++++++++++++----- .../Mesh_3/test_meshing_unit_tetrahedron.cpp | 12 +++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 989cbe7d649..04de44c7d73 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,18 @@ namespace CGAL { namespace Mesh_3 { namespace internal { +template +constexpr bool has_tuple_size_v = false; + +template +constexpr bool has_tuple_size_v::value)>> = true; + +template > +constexpr bool tuple_like_of_size_2 = false; + +template +constexpr bool tuple_like_of_size_2 = (std::tuple_size_v == 2); + template < typename C3T3, typename MeshDomain, typename InitialPointsGenerator > void add_points_from_generator(C3T3& c3t3, @@ -62,16 +75,16 @@ add_points_from_generator(C3T3& c3t3, std::vector initial_points; auto push_initial_point = [&](const auto& initial_pt)->void { - using T = std::remove_cv_t < std::remove_reference_t>; - if constexpr (std::tuple_size_v == 3) + using T = CGAL::cpp20::remove_cvref_t; + if constexpr (tuple_like_of_size_2) { - const auto& [weighted_pt, dim, index] = initial_pt; - initial_points.push_back(PointDimIndex{ weighted_pt, dim, index }); + const auto& [pt, index] = initial_pt; + initial_points.push_back(PointDimIndex{cwp(pt), 2, index}); } else { - const auto& [pt, index] = initial_pt; - initial_points.push_back(PointDimIndex{ cwp(pt), 2, index }); + const auto& [weighted_pt, dim, index] = initial_pt; + initial_points.push_back(PointDimIndex{weighted_pt, dim, index}); } }; diff --git a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp index 5781f445050..ff2028a926a 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp @@ -66,6 +66,18 @@ struct Polyhedron_tester : public Tester // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); + // test initial_points with a tuple-like object + using Weighted_point = typename K::Weighted_point_3; + using Index = typename Mesh_domain::Index; + struct Initial_point + { + Weighted_point weighted_point; + int dimension; + Index index; + }; + std::vector initial_points = { Initial_point{ Weighted_point(.5, .5, .5), 3, Index{}} }; + c3t3 = CGAL::make_mesh_3(domain, criteria, CGAL::parameters::initial_points(initial_points)); + CGAL::remove_far_points_in_mesh_3(c3t3); double vol = 1/6.; From 79ebe7aa4d162505bd025dacb7773738c73dc09d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Dec 2024 18:35:00 +0100 Subject: [PATCH 162/332] minor fixes --- Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index 78639e752eb..b20f602123b 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -6,8 +6,8 @@ The function object concept `InitialPointsGenerator` is designed to construct a set of initial points on the surface of the domain. \cgalHasModelsBegin -\cgalHasModels{CGAL::Construct_initial_points_labeled_image} -\cgalHasModels{CGAL::Construct_initial_points_gray_image} +\cgalHasModels{CGAL::Construct_initial_points_labeled_image} +\cgalHasModels{CGAL::Construct_initial_points_gray_image} \cgalHasModelsEnd */ @@ -39,7 +39,7 @@ output iterator `pts`. If, after insertion of these points, the triangulation is still not 3D, or does not have any facets in the restricted Delaunay triangulation, then more points will be added automatically -by the mesher. +by the mesh generator. @tparam OutputIterator model of `OutputIterator` whose value type is a tuple-like object made of 3 elements: - a `C3t3::Triangulation::Point` : the point `p`, @@ -61,7 +61,7 @@ points to initialize the mesh generation process, i.e., to have a 3D triangulati with at least one facet in the restricted Delaunay triangulation. If these conditions are not satisfied, then more points will be added automatically -by the mesher. +by the mesh generator. @tparam OutputIterator model of `OutputIterator` whose value type is a tuple-like object made of 3 elements : - a `C3t3::Triangulation::Point` : the point `p`, From 9803ab49dc147d9c5688ec2d3e4efec490c4c537 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Dec 2024 18:37:29 +0100 Subject: [PATCH 163/332] add test of initial_points_generator with a generator generating tuple-like object --- Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp index ff2028a926a..e8e9268e323 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp @@ -78,6 +78,14 @@ struct Polyhedron_tester : public Tester std::vector initial_points = { Initial_point{ Weighted_point(.5, .5, .5), 3, Index{}} }; c3t3 = CGAL::make_mesh_3(domain, criteria, CGAL::parameters::initial_points(initial_points)); + // test initial_points_generator with a generator generating tuple-like object + auto initial_points_generator = [](auto oit, const int) { + *oit++ = Initial_point{ Weighted_point(.5, .5, .5), 3, Index{} }; + return oit; + }; + c3t3 = CGAL::make_mesh_3(domain, criteria, + CGAL::parameters::initial_points_generator(initial_points_generator)); + CGAL::remove_far_points_in_mesh_3(c3t3); double vol = 1/6.; From 820762da524216fe8fa6badb38b25fa18d9d2bd5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 11:00:55 +0100 Subject: [PATCH 164/332] proposal for a rewrite using a lamba expression as the point generator --- .../Mesh_3/Concepts/InitialPointsGenerator.h | 3 +- ...sh_3D_image_with_custom_initialization.cpp | 91 ++++++++----------- 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index b20f602123b..eb89399fd75 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -15,8 +15,9 @@ a set of initial points on the surface of the domain. class InitialPointsGenerator { public: -/// \name Types +/// \name Types (exposition only) /// @{ +/// These types are used in the concept's description but are not part of the concept itself. /*! * Mesh domain type to be meshed, model of `MeshDomain_3` diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index c0a78b4da3a..a3d5209a74b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -15,65 +15,25 @@ #include // Domain -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Labeled_mesh_domain_3 Image_domain; -typedef CGAL::Mesh_domain_with_polyline_features_3 Mesh_domain; +using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using Image_domain = CGAL::Labeled_mesh_domain_3; +using Mesh_domain = CGAL::Mesh_domain_with_polyline_features_3; #ifdef CGAL_CONCURRENT_MESH_3 -typedef CGAL::Parallel_tag Concurrency_tag; +using Concurrency_tag = CGAL::Parallel_tag; #else -typedef CGAL::Sequential_tag Concurrency_tag; +using Concurrency_tag = CGAL::Sequential_tag; #endif // Triangulation -typedef CGAL::Mesh_triangulation_3::type Tr; - -typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; +using Tr = CGAL::Mesh_triangulation_3::type; +using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3; // Criteria -typedef CGAL::Mesh_criteria_3 Mesh_criteria; +using Mesh_criteria = CGAL::Mesh_criteria_3; namespace params = CGAL::parameters; -// Custom_initial_points_generator will put points on the mesh for initialisation. -// Those points are objects of type std::tuple. -// Weighted_point_3 is the point's position and weight, -// int is the dimension of the minimal dimension subcomplex on which the point lies, -// Index is the underlying subcomplex index. - -struct Custom_initial_points_generator -{ - const CGAL::Image_3& image_; - - template - OutputIterator operator()(OutputIterator pts, int) const - { - typedef Tr::Geom_traits Gt; - typedef Gt::Point_3 Point_3; - typedef Gt::Vector_3 Vector_3; - typedef Gt::Segment_3 Segment_3; - typedef Mesh_domain::Index Index; - - Gt::Construct_weighted_point_3 cwp = Gt().construct_weighted_point_3_object(); - - // Add points along the segment - Segment_3 segment(Point_3( 0.0, 50.0, 66.66), - Point_3(100.0, 50.0, 66.66)); - - Point_3 source = segment.source(); - Vector_3 vector = segment.to_vector(); - double edge_size = 5; - std::size_t nb = static_cast(CGAL::sqrt(segment.squared_length()) / edge_size); - const double frac = 1. / (double)nb; - - for (std::size_t i = 1; i < nb; i++) - { - *pts++ = std::make_tuple( cwp(source + (i * frac) * vector), 1, Index(1) ); - } - return pts; - } -}; - int main() { const std::string fname = CGAL::data_file_path("images/420.inr"); @@ -89,12 +49,41 @@ int main() , params::features_detector(CGAL::Mesh_3::Detect_features_on_image_bbox())); // Mesh criteria - Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).edge_size(3) + const double edge_size = 3; + Mesh_criteria criteria(params::edge_size(edge_size) + .facet_angle(30).facet_size(3).facet_distance(1) .cell_radius_edge_ratio(3).cell_size(3)); + // custom_initial_points_generator will put points on the mesh for initialisation. + // Those points are objects of type std::tuple. + // Weighted_point_3 is the point's position and weight, + // int is the dimension of the minimal dimension subcomplex on which the point lies, + // Index is the underlying subcomplex index. + auto custom_initial_points_generator = [&](auto pts_out_iterator, int) { + using Point_3 = K::Point_3; + using Weighted_point_3 = K::Weighted_point_3; + using Index = Mesh_domain::Index; + using Point_dim_index = std::tuple; + + Point_3 a{0.0, 50.0, 66.66}; + Point_3 b{100.0, 50.0, 66.66}; + + // Add points along the segment [a, b] + double dist_ab = CGAL::sqrt(CGAL::squared_distance(a, b)); + int nb = static_cast(std::floor(dist_ab / edge_size)); + auto vector = (b - a) / static_cast(nb); + + Point_3 p = a; + for(int i = 0; i < nb; ++i) { + *pts_out_iterator++ = Point_dim_index{Weighted_point_3{p}, 1, Index(1)}; + p += vector; + } + return pts_out_iterator; + }; + /// [Meshing] - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria - , params::initial_points_generator(Custom_initial_points_generator{ image })); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + params::initial_points_generator(custom_initial_points_generator)); /// [Meshing] // Output From e2d11a0fc5b384fd65bdaec27b4ed9d5c0212a59 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 13:44:54 +0100 Subject: [PATCH 165/332] allow a range as parameter The preview implementation enforced the use of a full container. --- Mesh_3/include/CGAL/make_mesh_3.h | 6 +++--- .../Mesh_3/test_meshing_unit_tetrahedron.cpp | 12 ++++++++++++ .../STL_Extension/internal/mesh_option_classes.h | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 04de44c7d73..8563c016e41 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -88,11 +88,11 @@ add_points_from_generator(C3T3& c3t3, } }; + auto output_it = boost::make_function_output_iterator(push_initial_point); if (nb_initial_points > 0) - generator(boost::make_function_output_iterator(push_initial_point), nb_initial_points); + generator(output_it, nb_initial_points); else - generator(boost::make_function_output_iterator(push_initial_point)); - + generator(output_it); // Insert points and set their index and dimension for (const auto& [wpoint, dimension, index] : initial_points) diff --git a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp index e8e9268e323..6276758bfcc 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp @@ -10,6 +10,14 @@ #include +template class Non_copyable_range_view { + Range& r; +public: + Non_copyable_range_view(Range& r) : r(r) {} + auto begin() const { return r.begin(); } + auto end() const { return r.end(); } +}; + template struct Polyhedron_tester : public Tester { @@ -78,6 +86,10 @@ struct Polyhedron_tester : public Tester std::vector initial_points = { Initial_point{ Weighted_point(.5, .5, .5), 3, Index{}} }; c3t3 = CGAL::make_mesh_3(domain, criteria, CGAL::parameters::initial_points(initial_points)); + // test initial_points with a non-copyable range + Non_copyable_range_view initial_points_view{ initial_points }; + c3t3 = CGAL::make_mesh_3(domain, criteria, CGAL::parameters::initial_points(initial_points_view)); + // test initial_points_generator with a generator generating tuple-like object auto initial_points_generator = [](auto oit, const int) { *oit++ = Initial_point{ Weighted_point(.5, .5, .5), 3, Index{} }; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index b017dac3111..6061a523675 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -196,8 +196,16 @@ struct Initialization_options using Initial_points_range = typename CGAL::Default::Get>::type; - using Initial_points_const_iterator = typename Initial_points_range::const_iterator; - using Initial_point = typename std::iterator_traits::value_type; + template + static auto cbegin(Range&& range) { + return std::cbegin(std::forward(range)); + } + + template + static auto cend(Range&& range) { + return std::cend(std::forward(range)); + } + using Initial_points_const_iterator = decltype(cbegin(std::declval())); Initialization_options() {} @@ -205,8 +213,8 @@ struct Initialization_options Initialization_options(const Initial_points_generator& generator, const Initial_points_range& initial_points) : initial_points_generator_(generator) - , begin_it(initial_points.begin()) - , end_it(initial_points.end()) + , begin_it(cbegin(initial_points)) + , end_it(cend(initial_points)) {} template From eecff9d71a68fa53a51cd2d1116c307bdc0aeb35 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 13:48:21 +0100 Subject: [PATCH 166/332] add initial_points to the list of available functors for mesh initialization --- Mesh_3/doc/Mesh_3/PackageDescription.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 5022fc0c026..18541cbb3de 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -133,6 +133,7 @@ The following functors are available for mesh initialization: - `CGAL::parameters::features()` - `CGAL::parameters::no_features()` +- `CGAL::parameters::initial_points()` - `CGAL::parameters::initial_points_generator()` - `CGAL::parameters::exude()` - `CGAL::parameters::no_exude()` From 8e5fab0c98479c7383af0207f76d2eb85c96591e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 16:22:18 +0100 Subject: [PATCH 167/332] allow the initial points generator to be non-const A lot of type erasure was necessary. --- Mesh_3/include/CGAL/make_mesh_3.h | 60 ++++---- .../Mesh_3/test_meshing_unit_tetrahedron.cpp | 4 +- .../internal/mesh_option_classes.h | 140 +++++++++++++++--- 3 files changed, 152 insertions(+), 52 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 8563c016e41..7110489d4db 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,17 +41,33 @@ namespace CGAL { namespace Mesh_3 { namespace internal { -template -constexpr bool has_tuple_size_v = false; +template +struct Push_to_initial_point { + // This struct cannot be a lambda-expression before C++20, because we need it to be copyable/assignable. + std::vector* points_vector_ptr; + C3T3* c3t3_ptr; -template -constexpr bool has_tuple_size_v::value)>> = true; + Push_to_initial_point(std::vector* points_vector_ptr, C3T3* c3t3_ptr) + : points_vector_ptr(points_vector_ptr) + , c3t3_ptr(c3t3_ptr) + {} -template > -constexpr bool tuple_like_of_size_2 = false; - -template -constexpr bool tuple_like_of_size_2 = (std::tuple_size_v == 2); + template + void operator()(const Initial_point_and_info& initial_pt) const { + using T = CGAL::cpp20::remove_cvref_t; + if constexpr (tuple_like_of_size_2) + { + const auto& [pt, index] = initial_pt; + const auto& cwp = c3t3_ptr->triangulation().geom_traits().construct_weighted_point_3_object(); + points_vector_ptr->push_back(PointDimIndex{cwp(pt), 2, index}); + } + else + { + const auto& [weighted_pt, dim, index] = initial_pt; + points_vector_ptr->push_back(PointDimIndex{weighted_pt, dim, index}); + } + }; +}; template < typename C3T3, typename MeshDomain, typename InitialPointsGenerator > void @@ -70,24 +87,9 @@ add_points_from_generator(C3T3& c3t3, typename MeshDomain::Index m_index; }; - const auto& cwp = c3t3.triangulation().geom_traits().construct_weighted_point_3_object(); std::vector initial_points; - auto push_initial_point = [&](const auto& initial_pt)->void - { - using T = CGAL::cpp20::remove_cvref_t; - if constexpr (tuple_like_of_size_2) - { - const auto& [pt, index] = initial_pt; - initial_points.push_back(PointDimIndex{cwp(pt), 2, index}); - } - else - { - const auto& [weighted_pt, dim, index] = initial_pt; - initial_points.push_back(PointDimIndex{weighted_pt, dim, index}); - } - }; - + Push_to_initial_point push_initial_point{&initial_points, &c3t3}; auto output_it = boost::make_function_output_iterator(push_initial_point); if (nb_initial_points > 0) generator(output_it, nb_initial_points); @@ -621,7 +623,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, const C auto default_generator = domain.construct_initial_points_object(); Initial_points_generator initial_points_generator = choose_parameter(get_parameter(np, internal_np::initial_points_generator_param), default_generator); - const parameters::internal::Initialization_options + const parameters::internal::Initialization_options initial_points_gen_param(initial_points_generator, initial_points); C3T3 c3t3; @@ -658,7 +660,7 @@ C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, * * @return The mesh as a C3T3 object */ -template +template void make_mesh_3_impl(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, @@ -671,8 +673,8 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options(), const parameters::internal::Manifold_options& manifold_options = parameters::internal::Manifold_options(), - const parameters::internal::Initialization_options& - initialization_options = parameters::internal::Initialization_options()) + const parameters::internal::Initialization_options& + initialization_options = parameters::internal::Initialization_options()) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); diff --git a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp index 6276758bfcc..3e62a7d11ae 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_unit_tetrahedron.cpp @@ -90,8 +90,8 @@ struct Polyhedron_tester : public Tester Non_copyable_range_view initial_points_view{ initial_points }; c3t3 = CGAL::make_mesh_3(domain, criteria, CGAL::parameters::initial_points(initial_points_view)); - // test initial_points_generator with a generator generating tuple-like object - auto initial_points_generator = [](auto oit, const int) { + // test initial_points_generator with a non-const generator generating tuple-like object + auto initial_points_generator = [](auto oit, const int) mutable { *oit++ = Initial_point{ Weighted_point(.5, .5, .5), 3, Index{} }; return oit; }; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 6061a523675..fe7e7d75287 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -13,6 +13,8 @@ #include #include +#include +#include #include @@ -173,26 +175,17 @@ private: }; // Mesh initialization -struct Dummy_initial_points_generator -{ - template - OutputIterator operator()(OutputIterator oit, const int) const { return oit; } -}; - // Holds the two parameters `initial_points_generator` and `initial_points`, // without knowing their types, into a single generator. template struct Initialization_options { - using Default_generator = Dummy_initial_points_generator; - using Initial_points_generator - = typename CGAL::Default::Get::type; + using Point = typename C3t3::Triangulation::Point; using Default_initial_point_type - = std::tuple; + = std::tuple; using Initial_points_range = typename CGAL::Default::Get>::type; @@ -207,34 +200,139 @@ struct Initialization_options } using Initial_points_const_iterator = decltype(cbegin(std::declval())); + struct Output_function_ref { + // This reference-like type uses type erasure to store a reference to a callable + // + // See the video "Breaking Dependencies - C++ Type Erasure - The Implementation Details" + // by Klaus Iglberger at CppCon 2022, from time code 49:57. + // URL: https://youtu.be/qn6OqefuH08?si=YzhwpgNLur8_jOeC&t=2997" + + using Erased_call_function_pointer_type = void(*)(void*, const Default_initial_point_type&); + + // store the address of the callable + void* const f_ = nullptr; + // and the call function (the non-capturing lambda generated by the templated constructor) + Erased_call_function_pointer_type const call_ = nullptr; + + template , + Output_function_ref> + > + > + Output_function_ref(Function&& f) + : f_(std::addressof(f)) + , call_( [](void* f, const Default_initial_point_type& p) { + using F = CGAL::cpp20::remove_cvref_t; + auto* real_f = static_cast(f); + (*real_f)(p); + } ) + { + } + + template + void operator()(Tuple_like&& p) const + { + using Tuple_like_no_cvref = CGAL::cpp20::remove_cvref_t; + if constexpr (CGAL::Mesh_3::internal::tuple_like_of_size_2) { + const auto& [pt, index] = p; + call_(f_, Default_initial_point_type(pt, 2, index)); + } else if constexpr (std::is_same_v) { + call_(f_, std::forward(p)); + } else { + const auto& [pt, dim, index] = p; + call_(f_, Default_initial_point_type(pt, dim, index)); + } + } + }; // end of struct Output_function_ref + + using Point_output_function_iterator = boost::function_output_iterator; + + struct Generator_ref { // type-erased reference to a generator, same as Output_function_ref + using Erased_call_function_pointer_type = Point_output_function_iterator(*)(void*, Point_output_function_iterator, const int); + + void * const generator_ = nullptr; + Erased_call_function_pointer_type const call_ = nullptr; + + template , + Generator_ref> + > + > + Generator_ref(Generator&& generator) + : generator_(std::addressof(generator)) + , call_( [](void* g, Point_output_function_iterator oit, const int n) { + using Real_generator = CGAL::cpp20::remove_cvref_t; + auto* real_g = static_cast(g); + return (*real_g)(oit, n); + } ) + { + } + + Generator_ref() = default; + + Point_output_function_iterator operator()(Point_output_function_iterator oit, const int n) const + { + return call_(generator_, oit, n); + } + + Point_output_function_iterator operator()(Point_output_function_iterator oit, const int n) + { + return call_(generator_, oit, n); + } + + bool operator==(std::nullptr_t) const { return generator_ == nullptr; } + }; // end of struct Generator_ref + Initialization_options() {} - Initialization_options(const Initial_points_generator& generator, + template + Initialization_options(Initial_points_generator& generator, const Initial_points_range& initial_points) - : initial_points_generator_(generator) + : initial_points_generator_(std::forward(generator)) , begin_it(cbegin(initial_points)) , end_it(cend(initial_points)) {} + template + static OutputIterator call_operator(Self& self, OutputIterator pts_it, const int n) + { + // add initial_points + pts_it = std::copy(self.begin_it, self.end_it, pts_it); + + if(self.initial_points_generator_ == nullptr) { + return pts_it; + } + + // Now, create an output iterator type-erasing the type of `pts_it`... + auto output_to_pts_it = [&](const Default_initial_point_type& p) { *pts_it++ = p; }; + Output_function_ref function_ref{ output_to_pts_it }; // maintains a non-const reference to pts_it + Point_output_function_iterator output_iterator{ function_ref }; + + // ...and use the type-erased output iterator with the type-erased generator. + self.initial_points_generator_(output_iterator, n); + return pts_it; + } + + template + OutputIterator operator()(OutputIterator pts, const int n = 0) + { + return call_operator(*this, pts, n); + } + template OutputIterator operator()(OutputIterator pts, const int n = 0) const { - // add initial_points - for (Initial_points_const_iterator it = begin_it; it != end_it; ++it) - *pts++ = *it; - - return initial_points_generator_(pts, n); + return call_operator(*this, pts, n); } bool is_default() const { - return begin_it == end_it - && std::is_same_v; + return begin_it == end_it && initial_points_generator_ == nullptr; } private: - Initial_points_generator initial_points_generator_; + Generator_ref initial_points_generator_; //reference that type-erases the generator type // The two iterators point to the `initial_points` container Initial_points_const_iterator begin_it; From 9ef32fb832a0b8af6660d88421cbdc7114511311 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 18:25:55 +0100 Subject: [PATCH 168/332] remove memory leaks with VTK objects --- Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp index ce8fc8db39c..d3d718138ad 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp @@ -1,5 +1,5 @@ -#include +#include #include #include #include @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) const std::string fname = (argc>1)?argv[1]:CGAL::data_file_path("images/squircle.nii"); - vtkImageData* vtk_image = nullptr; + vtkSmartPointer vtk_image = nullptr; Image_word_type iso = (argc>2)? boost::lexical_cast(argv[2]): 1; double fs = (argc>3)? boost::lexical_cast(argv[3]): 1; double fd = (argc>4)? boost::lexical_cast(argv[4]): 0.1; @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) if (path.has_extension()){ fs::path stem = path.stem(); if ((path.extension() == ".nii") || (stem.has_extension() && (stem.extension() == ".nii") && (path.extension() == ".gz"))) { - vtkNIFTIImageReader* reader = vtkNIFTIImageReader::New(); + auto reader = vtkSmartPointer::New(); reader->SetFileName(fname.c_str()); reader->Update(); vtk_image = reader->GetOutput(); @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) } } else if (fs::is_directory(path)) { - vtkDICOMImageReader* dicom_reader = vtkDICOMImageReader::New(); + auto dicom_reader = vtkSmartPointer::New(); dicom_reader->SetDirectoryName(argv[1]); vtkDemandDrivenPipeline* executive = @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) executive->SetReleaseDataFlag(0, 0); // where 0 is the port index } - vtkImageGaussianSmooth* smoother = vtkImageGaussianSmooth::New(); + auto smoother = vtkSmartPointer::New(); smoother->SetStandardDeviations(1., 1., 1.); smoother->SetInputConnection(dicom_reader->GetOutputPort()); smoother->Update(); From 51b9c4a4b2635cf1be2d24a516cab4a3ac4f955b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 18:50:02 +0100 Subject: [PATCH 169/332] cleanup --- Mesh_3/include/CGAL/make_mesh_3.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 7110489d4db..68e5534096e 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -669,12 +669,10 @@ void make_mesh_3_impl(C3T3& c3t3, const parameters::internal::Odt_options& odt, const parameters::internal::Lloyd_options& lloyd, const bool with_features, - const parameters::internal::Mesh_3_options& - mesh_options = parameters::internal::Mesh_3_options(), - const parameters::internal::Manifold_options& - manifold_options = parameters::internal::Manifold_options(), + const parameters::internal::Mesh_3_options& mesh_options = {}, + const parameters::internal::Manifold_options& manifold_options = {}, const parameters::internal::Initialization_options& - initialization_options = parameters::internal::Initialization_options()) + initialization_options = {}) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING CGAL::get_default_random() = CGAL::Random(0); From 740863cb024d1d9831319dc36fc51896a9a6bc03 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 11:50:10 +0100 Subject: [PATCH 170/332] doc review --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 8 +++-- .../Mesh_3/Concepts/InitialPointsGenerator.h | 31 ++++++------------- .../mesh_3D_image_with_initial_points.cpp | 8 ++--- .../Construct_initial_points_gray_image.h | 12 ++++--- 4 files changed, 25 insertions(+), 34 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 8d170fdb076..b770c01a8ee 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -460,12 +460,14 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * If this parameter is specified without arguments, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * - * If the parameter `parameters::initial_points()` is used, - * the points it provides are inserted after one dimensional features initialization. - * * Initialization is considered to be complete if the triangulation is a 3D triangulation * with at least one facet in the restricted Delaunay triangulation (i.e., its dual intersects the * input surface). + * + * If one dimensional features are requested, their initialization is performed first. + * If provided, the points of `parameters::initial_points()` are inserted next. + * Then, `parameters::initial_points_generator()` is used to generate more initial points + * and complete the initialization. * If the generator does not generate enough points for the initialization to be complete, * the domain's `construct_initial_points_object()` will be called to generate enough input points. * diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index eb89399fd75..23c1a07a7d5 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -32,10 +32,11 @@ typedef unspecified_type C3t3; /// \name Operations /// @{ +/// Initial points generators are designed to output, via their operators `operator(OutputIterator)`, +/// a set of surface points for mesh initialization to an output iterator. /*! -outputs a set of surface points for mesh initialization to the -output iterator `pts`. +outputs a set of surface points for mesh initialization. If, after insertion of these points, the triangulation is still not 3D, or does not have any facets @@ -49,28 +50,14 @@ by the mesh generator. @param pts an output iterator for the points @param n a lower bound on the number of points to construct for initialization. -A generator can choose to ignore this parameter. - + When `n` is set to its default value `0`, the functor must provide enough + points to initialize the mesh generation process, i.e., to have a 3D triangulation + with at least one facet in the restricted Delaunay triangulation. + If these conditions are not satisfied, then more points will be added automatically + by the mesh generator. */ template -OutputIterator operator()(OutputIterator pts, const int n); - -/*! -Same as above, without the `n` parameter. -Since there is no `n` given like above, the functor must provide enough -points to initialize the mesh generation process, i.e., to have a 3D triangulation -with at least one facet in the restricted Delaunay triangulation. - -If these conditions are not satisfied, then more points will be added automatically -by the mesh generator. - -@tparam OutputIterator model of `OutputIterator` whose value type is a tuple-like object made of 3 elements : - - a `C3t3::Triangulation::Point` : the point `p`, - - an `int` : the minimal dimension of the subcomplexes to which `p` belongs, - - a `MeshDomain_3::Index` : the index of the corresponding subcomplex. -*/ -template -OutputIterator operator()(OutputIterator pts); +OutputIterator operator()(OutputIterator pts, const int n = 0); /// @} diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp index 067c5e623f4..947fe4d890d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_initial_points.cpp @@ -9,11 +9,10 @@ #include #include -#include - - #include +#include + // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Labeled_mesh_domain_3 Image_domain; @@ -71,7 +70,8 @@ int main() /// [Meshing] // Output - CGAL::dump_c3t3(c3t3, "out"); + std::ofstream ofs("out.mesh"); + CGAL::IO::write_MEDIT(ofs, c3t3); return 0; } diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 9bbafbf57dd..5ef09bb565e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -31,9 +31,11 @@ namespace CGAL * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * - * On images that contain multiple non-connected components, + * On images that contain multiple connected components, * this functor will scan the full image and - * output points on every component. + * output enough points on the surface of each component + * to initialize them all. Each connected component is guaranteed to be + * represented by at least one cell of the triangulation. * * \cgalModels{InitialPointsGenerator} * @@ -60,9 +62,9 @@ struct Construct_initial_points_gray_image { } /*! - * \brief constructs at least `n` points by collecting them on the surface of all objects - * in the image, - * even if they are non-connected components. + * \brief constructs at least `n` points by collecting them on the surface of all + * subdomains in the image, + * even if they are not connected components. * Using this functor guarantees to initialize each connected component. * * @tparam OutputIterator model of `OutputIterator` for From 7e5b9eec9b79ec75effc1b92882e147e326fa6fc Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 12:04:10 +0100 Subject: [PATCH 171/332] rename concept with _3 postfix --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 4 ++-- ...{InitialPointsGenerator.h => InitialPointsGenerator_3.h} | 6 +++--- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- Mesh_3/doc/Mesh_3/PackageDescription.txt | 2 +- .../CGAL/Mesh_3/Construct_initial_points_gray_image.h | 4 ++-- .../CGAL/Mesh_3/Construct_initial_points_labeled_image.h | 4 ++-- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) rename Mesh_3/doc/Mesh_3/Concepts/{InitialPointsGenerator.h => InitialPointsGenerator_3.h} (93%) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index b770c01a8ee..a5d349e5ed7 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -455,7 +455,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * \ingroup PkgMesh3Parameters * * The function `parameters::initial_points_generator()` enables the user to specify a functor that follows - * the `InitialPointsGenerator` concept to the mesh generation function `make_mesh_3()`. This functor is called + * the `InitialPointsGenerator_3` concept to the mesh generation function `make_mesh_3()`. This functor is called * for the initialization of the meshing process, by inserting well-distributed surface vertices. * If this parameter is specified without arguments, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. @@ -471,7 +471,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * If the generator does not generate enough points for the initialization to be complete, * the domain's `construct_initial_points_object()` will be called to generate enough input points. * - * \tparam InitialPointsGenerator a model of the `InitialPointsGenerator` concept + * \tparam InitialPointsGenerator a model of the `InitialPointsGenerator_3` concept * * @param generator an instance of `InitialPointsGenerator` * diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator_3.h similarity index 93% rename from Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h rename to Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator_3.h index 23c1a07a7d5..351ac34126f 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator_3.h @@ -2,7 +2,7 @@ \ingroup PkgMesh3SecondaryConcepts \cgalConcept -The function object concept `InitialPointsGenerator` is designed to construct +The function object concept `InitialPointsGenerator_3` is designed to construct a set of initial points on the surface of the domain. \cgalHasModelsBegin @@ -12,7 +12,7 @@ a set of initial points on the surface of the domain. */ -class InitialPointsGenerator { +class InitialPointsGenerator_3 { public: /// \name Types (exposition only) @@ -61,4 +61,4 @@ OutputIterator operator()(OutputIterator pts, const int n = 0); /// @} -}; /* end InitialPointsGenerator */ +}; /* end InitialPointsGenerator_3 */ diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 28c08630ec5..73fc0b179f2 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -748,7 +748,7 @@ the triangulation for each connected component. The parameter `CGAL::parameters::initial_points_generator` is used. It expects a functor that returns a set of points for the mesh -initialization (following the concept `InitialPointsGenerator`). The functor +initialization (following the concept `InitialPointsGenerator_3`). The functor `Construct_initial_points_labeled_image` is used in this example. It constructs points using the API of the mesh domain, as follows. First, the functor `construct_intersection` is created: diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 18541cbb3de..926491fc627 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -80,7 +80,7 @@ related to the template parameters of some models of the main concepts: - `BisectionGeometricTraits_3` - `IntersectionGeometricTraits_3` -- `InitialPointsGenerator` +- `InitialPointsGenerator_3` - `MeshCellBase_3` - `MeshVertexBase_3` - `MeshDomainField_3` diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 5ef09bb565e..b7e3b8cfad7 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -27,7 +27,7 @@ namespace CGAL * \ingroup PkgMesh3Initializers * * Functor for generating initial points in gray images. - * This functor is a model of the `InitialPointsGenerator` concept, + * This functor is a model of the `InitialPointsGenerator_3` concept, * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * @@ -37,7 +37,7 @@ namespace CGAL * to initialize them all. Each connected component is guaranteed to be * represented by at least one cell of the triangulation. * - * \cgalModels{InitialPointsGenerator} + * \cgalModels{InitialPointsGenerator_3} * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index caf5d0fe63f..60ea8523258 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -74,7 +74,7 @@ struct Get_point * \ingroup PkgMesh3Initializers * * Functor for generating initial points in labeled images. - * This functor is a model of the `InitialPointsGenerator` concept, + * This functor is a model of the `InitialPointsGenerator_3` concept, * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * @@ -85,7 +85,7 @@ struct Get_point * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` * @tparam MeshDomain model of `MeshDomain_3` * - * \cgalModels{InitialPointsGenerator} + * \cgalModels{InitialPointsGenerator_3} * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 68e5534096e..a2ead361ee6 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -538,7 +538,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false> * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd * \cgalParamSectionBegin{Mesh initialization with a functor} - * \cgalParamDescription{an `InitialPointsGenerator` can optionally be provided to start the meshing process. + * \cgalParamDescription{an `InitialPointsGenerator_3` can optionally be provided to start the meshing process. * The following named parameter controls this option: *

      *
    • `parameters::initial_points_generator()` From 249612270767e37a9062ed5cce0240af1cde9ebe Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 19 Dec 2024 12:20:27 +0100 Subject: [PATCH 172/332] fix missing fix --- .../CGAL/Mesh_3/internal/tuple_like_helpers.h | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h b/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h new file mode 100644 index 00000000000..22eebb94f98 --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h @@ -0,0 +1,35 @@ +// Copyright (c) 2024 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H +#define CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H + +#include + +#include +#include + +namespace CGAL::Mesh_3::internal { + + template + constexpr bool has_tuple_size_v = false; + + template + constexpr bool has_tuple_size_v::value)>> = true; + + template > + constexpr bool tuple_like_of_size_2 = false; + + template + constexpr bool tuple_like_of_size_2 = (std::tuple_size_v == 2); + +} // end namespace CGAL::Mesh_3::internal + +#endif // CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H From 7f4e5b7e84ac4b649fb6d3ab496751788406104d Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 12:45:29 +0100 Subject: [PATCH 173/332] make doc more clear --- .../mesh_3D_image_with_image_initialization.cpp | 3 ++- .../Construct_initial_points_labeled_image.h | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp index aff744355fb..e90af4e9868 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -47,7 +47,8 @@ int main() .cell_radius_edge_ratio(3).cell_size(3)); /// [Meshing] - // Mesh generation with a custom initialization that places points in each of the image components. + // Mesh generation with a custom initialization that places points + // on the surface of each connected component of the image. CGAL::Construct_initial_points_labeled_image img_pts_generator(image, domain); C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 60ea8523258..e4819813c8d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -78,9 +78,12 @@ struct Get_point * and can be passed as a parameter to `CGAL::make_mesh_3` using the * `CGAL::parameters::initial_points_generator()` parameter function. * - * On images that contain multiple non-connected components, - * this functor scans the complete image and - * outputs points to initialize each component. + * This functor scans the complete image to detect all its connected components, + * and constructs points on the surface of each of them. + * Its goal is to initialize each component, each of them corresponding + * to a subdomain. + * It ensures that each component will be initialized, i.e. represented + * by at least one cell of the triangulation. * * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` * @tparam MeshDomain model of `MeshDomain_3` @@ -104,11 +107,7 @@ struct Construct_initial_points_labeled_image { } /*! - * \brief constructs at least `n` initial points, - * by scanning the image and - * collecting points in each object in the image, - * even if they are non-connected components. - * This ensures that each component will be initialized. + * \brief constructs at least `n` initial points. * * @tparam OutputIterator model of `OutputIterator` for * tuple-like objects containing @@ -131,7 +130,6 @@ struct Construct_initial_points_labeled_image * - a `Weighted_point_3` for the point * - an `int` for the minimal dimension of the subcomplexes on which the point lies * - a `MeshDomain::Index` for the corresponding subcomplex index - * @tparam MeshDomain model of `MeshDomain_3` * @tparam TransformOperator functor that transforms values of the image. * It must provide the following type:
      * `result_type`: a type that supports the '==' operator
      From 1a4cc658f361b1ef17c567632b8e73d07e26817b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 16:53:49 +0100 Subject: [PATCH 174/332] wip apply Laurent's reviews --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 3 ++- .../Mesh_3/mesh_3D_image_with_image_initialization.cpp | 6 ++++-- .../CGAL/Mesh_3/Construct_initial_points_gray_image.h | 3 +++ .../CGAL/Mesh_3/Construct_initial_points_labeled_image.h | 9 ++++----- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index a5d349e5ed7..3a834536db6 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -491,7 +491,8 @@ unspecified_type initial_points_generator(const InitialPointsGenerator& generato * \ingroup PkgMesh3Parameters * * The function `parameters::initial_points()` enables the user to specify a container, model of `Range`, that contains - * initial points to be used in the `make_mesh_3()` function for mesh generation. Items in the container are + * initial points constructed on surfaces, + * to be used in the `make_mesh_3()` function for mesh generation. Items in the container are * tuple-like objects containing a `Weighted_point_3`, an `int`, and a `MeshDomain::Index`, * where `Weighted_point_3` represents the position and the weight of the point, * `int` the dimension of the minimal subcomplex on which the point lies, diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp index e90af4e9868..1117c2ed351 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_image_initialization.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -56,7 +56,9 @@ int main() /// [Meshing] // Output - CGAL::dump_c3t3(c3t3, "out"); + std::ofstream medit_file("out.mesh"); + CGAL::IO::write_MEDIT(medit_file, c3t3); + medit_file.close(); return 0; } diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index b7e3b8cfad7..83e9896ec27 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -51,6 +51,9 @@ struct Construct_initial_points_gray_image const typename MeshDomain::R::FT iso_value_; Functor image_values_to_subdomain_indices_; + /*! + * @todo + */ Construct_initial_points_gray_image(const CGAL::Image_3 & image, const MeshDomain& domain, const double iso_value, diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index e4819813c8d..79982147582 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -100,6 +100,9 @@ struct Construct_initial_points_labeled_image const CGAL::Image_3& image_; const MeshDomain& domain_; + /*! + * @todo + */ Construct_initial_points_labeled_image(const CGAL::Image_3& image, const MeshDomain& domain) : image_(image) @@ -122,7 +125,7 @@ struct Construct_initial_points_labeled_image return pts; } - /*! + /* //internal undocumented * \brief Same as above, but a `TransformOperator` that transforms values of the image is used. * * @tparam OutputIterator model of `OutputIterator` for @@ -306,9 +309,6 @@ struct Construct_initial_points_labeled_image continue; // insert point in temporary triangulation - - /// The following lines show how to insert initial points in the - /// `c3t3` object. [insert initial points] Vertex_handle v = tr.insert(pi); // `v` could be null if `pi` is hidden by other vertices of `tr`. @@ -316,7 +316,6 @@ struct Construct_initial_points_labeled_image c3t3.set_dimension(v, 2); // by construction, points are on surface c3t3.set_index(v, intersect_index); - /// [insert initial points] *pts++ = std::make_pair(pi, intersect_index); // dimension 2 by construction, points are on surface } From 2ed54dfa3a23190a10588d29bef4bff27f267a27 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 17:17:30 +0100 Subject: [PATCH 175/332] add constructors documentation --- .../Construct_initial_points_gray_image.h | 21 ++++++++++++++++--- .../Construct_initial_points_labeled_image.h | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 83e9896ec27..6dd6c4a3c9c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -39,6 +39,12 @@ namespace CGAL * * \cgalModels{InitialPointsGenerator_3} * + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain model of `MeshDomain_3` + * @tparam Functor a function object that takes the number type in which the image is encoded, + * and returns the `MeshDomain::Index` of the corresponding subcomplex index. + * The default type is `CGAL::Null_functor`. + * * \sa `CGAL::parameters::initial_points_generator()` * \sa `CGAL::make_mesh_3()` * \sa `CGAL::Construct_initial_points_labeled_image` @@ -52,7 +58,16 @@ struct Construct_initial_points_gray_image Functor image_values_to_subdomain_indices_; /*! - * @todo + * Constructs a functor for generating initial points in gray images. + * @param image the gray image that defines the mesh domain + * @param domain the mesh domain + * @param iso_value the iso value corresponding to the surface of the domain + * @param image_values_to_subdomain_indices a function object that takes + * the number type in which `image` is encoded, + * and returns the corresponding `MeshDomain::Index`. + * The default functor is `CGAL::Null_functor` + * and corresponds to meshing the areas where the image values are + * greater than `iso_value`. */ Construct_initial_points_gray_image(const CGAL::Image_3 & image, const MeshDomain& domain, @@ -75,8 +90,8 @@ struct Construct_initial_points_gray_image * - a `Weighted_point_3` for the point * - an `int` for the minimal dimension of the subcomplexes on which the point lies * - a `MeshDomain::Index` for the corresponding subcomplex index - * \tparam MeshDomain model of `MeshDomain_3` - * \tparam C3t3 model of `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain model of `MeshDomain_3` + * @tparam C3t3 model of `MeshComplex_3InTriangulation_3` * */ template diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 79982147582..ac79ecce0b6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -101,7 +101,9 @@ struct Construct_initial_points_labeled_image const MeshDomain& domain_; /*! - * @todo + * Constructs a functor for generating initial points in labeled images. + * @param image the labeled image that defines the mesh domain + * @param domain the mesh domain */ Construct_initial_points_labeled_image(const CGAL::Image_3& image, const MeshDomain& domain) From 84e55c39821cef6b2f35228786cabefdc6e12a15 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 17:23:57 +0100 Subject: [PATCH 176/332] fix include --- Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h b/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h index 22eebb94f98..d88bf624a0e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h @@ -14,7 +14,7 @@ #include #include -#include +#include namespace CGAL::Mesh_3::internal { From a98101aa75c90dfa0f09a464b39b1e90d333d9e9 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 17:38:14 +0100 Subject: [PATCH 177/332] move tuple_like_helpers.h to STL_Extension to avoid dependency on Mesh_3 --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 4 ++-- .../include/CGAL/STL_Extension}/internal/tuple_like_helpers.h | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename {Mesh_3/include/CGAL/Mesh_3 => STL_Extension/include/CGAL/STL_Extension}/internal/tuple_like_helpers.h (100%) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index fe7e7d75287..10611ef80bd 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -233,7 +233,7 @@ struct Initialization_options void operator()(Tuple_like&& p) const { using Tuple_like_no_cvref = CGAL::cpp20::remove_cvref_t; - if constexpr (CGAL::Mesh_3::internal::tuple_like_of_size_2) { + if constexpr (CGAL::STL_Extension::internal::tuple_like_of_size_2) { const auto& [pt, index] = p; call_(f_, Default_initial_point_type(pt, 2, index)); } else if constexpr (std::is_same_v) { diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h b/STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h similarity index 100% rename from Mesh_3/include/CGAL/Mesh_3/internal/tuple_like_helpers.h rename to STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h From 7e3aa09f2a1a3b5bdfc15503563030a2972ad387 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Dec 2024 22:03:28 +0100 Subject: [PATCH 178/332] complete move file --- Mesh_3/include/CGAL/make_mesh_3.h | 4 ++-- .../CGAL/STL_Extension/internal/tuple_like_helpers.h | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index a2ead361ee6..4350b92faff 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ struct Push_to_initial_point { template void operator()(const Initial_point_and_info& initial_pt) const { using T = CGAL::cpp20::remove_cvref_t; - if constexpr (tuple_like_of_size_2) + if constexpr (CGAL::STL_Extension::internal::tuple_like_of_size_2) { const auto& [pt, index] = initial_pt; const auto& cwp = c3t3_ptr->triangulation().geom_traits().construct_weighted_point_3_object(); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h b/STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h index d88bf624a0e..de9cc33c7eb 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/tuple_like_helpers.h @@ -8,15 +8,13 @@ // // Author(s) : Laurent Rineau -#ifndef CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H -#define CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H - -#include +#ifndef CGAL_STL_EXTENSION_INTERNAL_TUPLE_LIKE_HELPERS_H +#define CGAL_STL_EXTENSION_INTERNAL_TUPLE_LIKE_HELPERS_H #include #include -namespace CGAL::Mesh_3::internal { +namespace CGAL::STL_Extension::internal { template constexpr bool has_tuple_size_v = false; @@ -30,6 +28,6 @@ namespace CGAL::Mesh_3::internal { template constexpr bool tuple_like_of_size_2 = (std::tuple_size_v == 2); -} // end namespace CGAL::Mesh_3::internal +} // end namespace CGAL::STL_Extension::internal -#endif // CGAL_MESH_3_INTERNAL_TUPLE_LIKE_HELPERS_H +#endif // CGAL_STL_EXTENSION_INTERNAL_TUPLE_LIKE_HELPERS_H From ec1c6453eed8f1b00325326512f8b610cf1fc290 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 2 Jan 2025 12:11:11 +0100 Subject: [PATCH 179/332] Update Polygon_repair/include/CGAL/Polygon_repair/repair.h Co-authored-by: Sebastien Loriot --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index b9a595032d6..e96e5439249 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -874,7 +874,7 @@ intersect(const Multipolygon_with_holes_2& p) /// \ingroup PkgPolygonRepairFunctions -/// Computes the intersection of two polygonal domains +/// computes the intersection of two polygonal domains /// \tparam Kernel parameter of the output polygon. Must be model of `ConstrainedDelaunayTriangulationTraits_2 ` /// \tparam Container parameter of the input and output polygons /// \tparam PA must be `Polygon_2`, or `Polygon_with_holes_2`, or `Multipolygon_with_holes_2` From aabf9750fa032d64137599d2104662b00397900e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 2 Jan 2025 11:17:29 +0000 Subject: [PATCH 180/332] Remove link --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index c4350b2a320..79e3f01096f 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -128,8 +128,7 @@ lexicographic order If the input is already valid, the method will return a valid output representing the same area. However, the output might be different in order to conform to the -stricter conditions to generate deterministic output (see -\ref SubsectionPolygonRepair_Output). +stricter conditions to generate deterministic output. Also, it is worth noting that even the repair of a single polygon without holes but with self-intersections can result in a multipolygon with holes. This is why From 9e9c710c51905dd33be0122e95aaa610ebf97ebc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 2 Jan 2025 12:33:05 +0000 Subject: [PATCH 181/332] Remove demo that compiles but needs major improvements to be of any use --- .../demo/Polygon_repair/Boolean_2.cpp | 320 ------------------ .../demo/Polygon_repair/Boolean_2.qrc | 6 - GraphicsView/demo/Polygon_repair/Boolean_2.ui | 257 -------------- .../demo/Polygon_repair/CMakeLists.txt | 35 -- .../demo/Polygon_repair/about_Boolean_2.html | 10 - .../Polygon_repair/icons/circumcenter.pdf | 57 ---- .../Polygon_repair/icons/circumcenter.png | Bin 3862 -> 0 bytes .../Polygon_repair/icons/conflict_zone.pdf | Bin 2939 -> 0 bytes .../Polygon_repair/icons/conflict_zone.png | Bin 7715 -> 0 bytes .../icons/constrained_triangulation.pdf | Bin 1857 -> 0 bytes .../icons/constrained_triangulation.png | Bin 6800 -> 0 bytes ...trained_triangulation_show_constraints.pdf | Bin 2182 -> 0 bytes ...trained_triangulation_show_constraints.png | Bin 8076 -> 0 bytes ...nstrained_triangulation_show_in_domain.pdf | Bin 1915 -> 0 bytes ...nstrained_triangulation_show_in_domain.png | Bin 6988 -> 0 bytes .../Polygon_repair/icons/moving_point.pdf | Bin 2956 -> 0 bytes .../Polygon_repair/icons/moving_point.png | Bin 8074 -> 0 bytes .../Polygon_repair/icons/triangulation.pdf | Bin 2905 -> 0 bytes .../Polygon_repair/icons/triangulation.png | Bin 7547 -> 0 bytes 19 files changed, 685 deletions(-) delete mode 100644 GraphicsView/demo/Polygon_repair/Boolean_2.cpp delete mode 100644 GraphicsView/demo/Polygon_repair/Boolean_2.qrc delete mode 100644 GraphicsView/demo/Polygon_repair/Boolean_2.ui delete mode 100644 GraphicsView/demo/Polygon_repair/CMakeLists.txt delete mode 100644 GraphicsView/demo/Polygon_repair/about_Boolean_2.html delete mode 100644 GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/circumcenter.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/conflict_zone.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/conflict_zone.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_constraints.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_constraints.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/moving_point.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/moving_point.png delete mode 100644 GraphicsView/demo/Polygon_repair/icons/triangulation.pdf delete mode 100644 GraphicsView/demo/Polygon_repair/icons/triangulation.png diff --git a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp b/GraphicsView/demo/Polygon_repair/Boolean_2.cpp deleted file mode 100644 index a370033ff24..00000000000 --- a/GraphicsView/demo/Polygon_repair/Boolean_2.cpp +++ /dev/null @@ -1,320 +0,0 @@ -#include -// CGAL headers -#include -#include -#include -#include -#include -#include -#include - -// Qt headers -#include -#include -#include -#include -#include - -// GraphicsView items and event filters (input classes) -#include -#include -#include -#include -#include -#include - -// the two base classes -#include "ui_Boolean_2.h" -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point_2; -typedef K::Segment_2 Segment_2; -typedef K::Line_2 Line_2; - -typedef CGAL::Polygon_2 Polygon2; -typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; -typedef CGAL::Multipolygon_with_holes_2 Multipolygon_with_holes_2; - -typedef std::shared_ptr PolygonPtr ; - -typedef std::vector PolygonPtr_vector ; - -class MainWindow : - public CGAL::Qt::DemosMainWindow, - public Ui::Polygon_2 -{ - Q_OBJECT - -private: - - bool add_2_A = true; - CGAL::Qt::Converter convert; - Polygon2 poly; - Polygon_with_holes_2 pwhA, pwhB; - Multipolygon_with_holes_2 mpwhA, mpwhB, mpwhC; - QGraphicsScene scene; - - CGAL::Qt::MultipolygonWithHolesGraphicsItem *mpwhAgi, *mpwhBgi, *mpwhCgi; - - CGAL::Qt::GraphicsViewPolygonWithHolesInput * pi; - - -public: - MainWindow(); - -public Q_SLOTS: - - void processInput(CGAL::Object o); - - void on_actionClear_triggered(); - - void on_actionLoadPolygon_triggered(); - void on_actionSavePolygon_triggered(); - - void on_actionRecenter_triggered(); - - void on_actionAdd_to_A_triggered(); - void on_actionAdd_to_B_triggered(); - - void on_actionCreateInputPolygon_toggled(bool); - - void clear(); - - virtual void open(QString); -Q_SIGNALS: - void changed(); -}; - - -MainWindow::MainWindow() - : DemosMainWindow() -{ - setupUi(this); - - this->graphicsView->setAcceptDrops(false); - - mpwhAgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhA); - mpwhAgi->setBrush(QBrush(::Qt::green)); - mpwhAgi->setZValue(3); - QObject::connect(this, SIGNAL(changed()), - mpwhAgi, SLOT(modelChanged())); - - scene.addItem(mpwhAgi); - - mpwhBgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhB); - mpwhBgi->setZValue(4); - mpwhBgi->setBrush(QBrush(QColor(255, 0, 0, 100))); - QObject::connect(this, SIGNAL(changed()), - mpwhBgi, SLOT(modelChanged())); - - scene.addItem(mpwhBgi); - - mpwhCgi = new CGAL::Qt::MultipolygonWithHolesGraphicsItem(&mpwhC); - mpwhCgi->setZValue(5); - mpwhCgi->setBrush(QBrush(QColor(211, 211, 211, 150))); - QObject::connect(this, SIGNAL(changed()), - mpwhCgi, SLOT(modelChanged())); - - scene.addItem(mpwhCgi); - - - // Setup input handlers. They get events before the scene gets them - // pi = new CGAL::Qt::GraphicsViewPolylineInput(this, &scene, 0, true); - pi = new CGAL::Qt::GraphicsViewPolygonWithHolesInput(this, &scene); - pi->setZValue(10); - - this->actionCreateInputPolygon->setChecked(true); - QObject::connect(pi, SIGNAL(generate(CGAL::Object)), - this, SLOT(processInput(CGAL::Object))); - - // - // Manual handling of actions - // - QObject::connect(this->actionQuit, SIGNAL(triggered()), - this, SLOT(close())); - - - // - // Setup the scene and the view - // - scene.setItemIndexMethod(QGraphicsScene::NoIndex); - scene.setSceneRect(-100, -100, 100, 100); - this->graphicsView->setScene(&scene); - this->graphicsView->setMouseTracking(true); - - // Turn the vertical axis upside down - this->graphicsView->scale(1, -1); - - // The navigation adds zooming and translation functionality to the - // QGraphicsView - this->addNavigation(this->graphicsView); - - this->setupStatusBar(); - this->setupOptionsMenu(); - this->addAboutDemo(":/cgal/help/about_Polygon_2.html"); - this->addAboutCGAL(); -#if QT_SVG_LIB - this->setupExportSVG(action_Export_SVG, graphicsView); -#endif - this->addRecentFiles(this->menuFile, this->actionQuit); - connect(this, SIGNAL(openRecentFile(QString)), - this, SLOT(open(QString))); -} - - -void -MainWindow::processInput(CGAL::Object o) -{ - if(add_2_A){ - if(assign(pwhA, o)){ - mpwhA.add_polygon_with_holes(pwhA); - } - }else{ - if(assign(pwhB, o)){ - mpwhB.add_polygon_with_holes(pwhB); - } - } - if((! mpwhA.is_empty()) && (! mpwhB.is_empty())){ - mpwhC = CGAL::Polygon_repair::join(mpwhA, mpwhB); - } - Q_EMIT( changed()); -} - -/* - * Qt Automatic Connections - * https://doc.qt.io/qt-5/designer-using-a-ui-file.html#automatic-connections - * - * setupUi(this) generates connections to the slots named - * "on__" - */ - -void -MainWindow::on_actionAdd_to_A_triggered() -{ - this->actionAdd_to_A->setEnabled(false); - this->actionAdd_to_B->setEnabled(true); - add_2_A = true; -} -void -MainWindow::on_actionAdd_to_B_triggered() -{ - this->actionAdd_to_B->setEnabled(false); - this->actionAdd_to_A->setEnabled(true); - add_2_A = false; -} - -void -MainWindow::on_actionClear_triggered() -{ - pwhA.clear(); - mpwhA.clear(); - pwhB.clear(); - mpwhB.clear(); - mpwhC.clear(); - clear(); - this->actionCreateInputPolygon->setChecked(true); - Q_EMIT( changed()); -} - - -void -MainWindow::on_actionLoadPolygon_triggered() -{ - QString fileName = QFileDialog::getOpenFileName(this, - tr("Open Polygon File"), - ".", - tr( "WKT files (*.wkt *.WKT);;" - "All file (*)")); - if(! fileName.isEmpty()){ - open(fileName); - } -} - -void -MainWindow::open(QString fileName) -{ - this->actionCreateInputPolygon->setChecked(false); - std::ifstream ifs(qPrintable(fileName)); - pwhA.clear(); - if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) - { - CGAL::IO::read_polygon_WKT(ifs, pwhA); - } - else - { - std::cout << "not supported" << std::endl; - } - clear(); - - this->addToRecentFiles(fileName); - Q_EMIT( changed()); -} - - -void -MainWindow::on_actionSavePolygon_triggered() -{ - QString fileName = QFileDialog::getSaveFileName(this, - tr("Save Polygon"), - ".", - tr( "WKT files (*.wkt *.WKT);;" - "All file (*)")); - if(! fileName.isEmpty()){ - std::ofstream ofs(qPrintable(fileName)); - if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) - { - CGAL::IO::write_polygon_WKT(ofs, pwhA); - } - else{ - std::cout << "not supported" << std::endl; - } - } -} - - -void -MainWindow::on_actionCreateInputPolygon_toggled(bool checked) -{ - // poly.clear(); - clear(); - if(checked){ - scene.installEventFilter(pi); - } else { - scene.removeEventFilter(pi); - } - Q_EMIT( changed()); -} - -void -MainWindow::on_actionRecenter_triggered() -{ - this->graphicsView->setSceneRect(mpwhAgi->boundingRect()); - this->graphicsView->fitInView(mpwhAgi->boundingRect(), Qt::KeepAspectRatio); -} - -void -MainWindow::clear() -{} - - -#include "Boolean_2.moc" -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - app.setOrganizationDomain("geometryfactory.com"); - app.setOrganizationName("GeometryFactory"); - app.setApplicationName("2D Boolean Operations"); - - // Import resources from libCGAL (Qt6). - // See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE - CGAL_QT_INIT_RESOURCES; - Q_INIT_RESOURCE(Boolean_2); - - MainWindow mainWindow; - mainWindow.show(); - return app.exec(); -} diff --git a/GraphicsView/demo/Polygon_repair/Boolean_2.qrc b/GraphicsView/demo/Polygon_repair/Boolean_2.qrc deleted file mode 100644 index 010beb6b83a..00000000000 --- a/GraphicsView/demo/Polygon_repair/Boolean_2.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - ../resources/about_CGAL.html - about_Boolean_2.html - - diff --git a/GraphicsView/demo/Polygon_repair/Boolean_2.ui b/GraphicsView/demo/Polygon_repair/Boolean_2.ui deleted file mode 100644 index e02fb69fd47..00000000000 --- a/GraphicsView/demo/Polygon_repair/Boolean_2.ui +++ /dev/null @@ -1,257 +0,0 @@ - - - GeometryFactory - Polygon_2 - - - - 0 - 0 - 568 - 325 - - - - CGAL 2D Polygon - - - - :/cgal/logos/cgal_icon:/cgal/logos/cgal_icon - - - - - - - Qt::Horizontal - - - - - 2 - 0 - - - - Qt::StrongFocus - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOn - - - QGraphicsView::NoAnchor - - - - - - - - - - File Tools - - - TopToolBarArea - - - false - - - - - - - - Visualization Tools - - - TopToolBarArea - - - false - - - - - - - 0 - 0 - 568 - 22 - - - - - &File - - - - - - - - - - - - &Algorithms - - - - - - - - - - - - &About - - - - - About &CGAL - - - - - &Quit - - - Ctrl+Q - - - - - - :/cgal/fileToolbar/fileNew.png:/cgal/fileToolbar/fileNew.png - - - &Clear - - - Ctrl+C - - - - - - :/cgal/fileToolbar/fileOpen.png:/cgal/fileToolbar/fileOpen.png - - - &Load Polygon - - - Ctrl+L - - - - - - :/cgal/fileToolbar/fileSave.png:/cgal/fileToolbar/fileSave.png - - - &Save Polygon - - - Ctrl+S - - - - - - :/cgal/Input/zoom-best-fit:/cgal/Input/zoom-best-fit - - - Re&center the viewport - - - Ctrl+R - - - - - Y-monotone Partition - - - - - true - - - Create Input Polygon - - - - - Minkowski sum with itself - - - - - Inner Skeleton - - - - - Outer Offset - - - - - Optimal Convex Partition - - - - - Approximate Convex Partition - - - - - Linear Least Squares Fitting of Points - - - - - Linear Least Squares Fitting of Segments - - - - - Maximum Area Triangle - - - - - &Export SVG... - - - - - Add to A - - - - - false - - - Add to B - - - - - - - - - - - diff --git a/GraphicsView/demo/Polygon_repair/CMakeLists.txt b/GraphicsView/demo/Polygon_repair/CMakeLists.txt deleted file mode 100644 index 82f4b3797de..00000000000 --- a/GraphicsView/demo/Polygon_repair/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - -cmake_minimum_required(VERSION 3.12...3.29) -project(Polygon_repair_Demo) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_INCLUDE_CURRENT_DIR TRUE) - -find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) -find_package(Qt6 QUIET COMPONENTS Widgets) - -if(NOT CGAL_Qt6_FOUND OR NOT Qt6_FOUND) - message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.") - return() -endif() - -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - - -qt_add_executable( - Boolean_2 Boolean_2.cpp - Boolean_2.ui Boolean_2.qrc) -target_link_libraries(Boolean_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 - Qt6::Widgets) - -add_to_cached_list(CGAL_EXECUTABLE_TARGETS Boolean_2) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) - -cgal_add_compilation_test(Boolean_2) - diff --git a/GraphicsView/demo/Polygon_repair/about_Boolean_2.html b/GraphicsView/demo/Polygon_repair/about_Boolean_2.html deleted file mode 100644 index b72bfadad22..00000000000 --- a/GraphicsView/demo/Polygon_repair/about_Boolean_2.html +++ /dev/null @@ -1,10 +0,0 @@ - - -

      2D Boolean Operations

      -

      Copyright © 2024 GeometryFactory

      -

      This application illustrates the 2D Boolean operations based on 2D triangulations - of CGAL

      -

      See also the online - manual.

      - - diff --git a/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf b/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf deleted file mode 100644 index 51a15a41082..00000000000 --- a/GraphicsView/demo/Polygon_repair/icons/circumcenter.pdf +++ /dev/null @@ -1,57 +0,0 @@ -%PDF-1.3 -3 0 obj << -/Length 385 /Filter /FlateDecode >> -stream -xÚ}SąN1 íç+RSDNścŇŇ Ńź° BPlĹďăřČ$ZQ7~‡ídÁ˝şŕľŽ»_Üďúěâ™}kÍý \üOS¤˙Ťpő‰ę„ÇůFÜŕCŤS-LÎťm8Ôŕ.mšśÓp¶\«â˘ĹĹůÓ=?o×HĐ|˘č]HÚ‚S¬Kč&„€«Q0TŠŔQ-›v`ć*ĘMÚ2m>ggFť­ąZm›¶MÎű@¨A ű@’¦0‹qJÝÇ2˘XL˛g­â¦ą†˘h†6,ÎşŞ‘+Ő˛iËäĽTř)¤ĐDZł4DűÓŘżf;QíMš‘J]TŠ'g¶©°™ź:O“¤˘]¨jô7µ~w‘ď¶Ŕw1ž¸ďC‰˙ĐřqËs]iSá‘ŰJă­„‡+ĹHÁý˝żP}M}lşCŕk°/őô żL”Ú> -/MediaBox [ 0 0 595 842] -/CropBox [204.765 238.4 261.6 291.541] -/ArtBox [204.765 238.4 261.6 291.541] -/Parent 2 0 R ->> endobj -1 0 obj << -/Type /Ipe -/Length 322 /Filter /FlateDecode >> -stream -xÚµ”Ín0 Çď<…• &|LĄ§]ö)„6j Q ěăég@]é†vŘZ倉˙ţŮŽ•lµS0(ßiŰ,Cä9Ň+Ů[_°rf!‚ójĐęČą ¶ş­í¬QUÁžź8bŽŠHÄ‚sŤ­t­×}ű˝}+Xé­#mćäAÁÁëŞÓŞ`Q6¦0ň]yheC;Ň¸Łś¤S “«»l,{=ܨéOłęKÔőŢžH´7˛<1p–ây©ź4Bŕ(Ýś¬©ŠÖúFµ6ć¦čΦ÷˛–ý5Ő*ó1žáŕq:Ă“řđT8ú3řŕíŮMcíŹßüş ]A,L°Ýڏ;PŻ3˙uÁąc­·Ôy÷ěţ'qł:.ŻŞ5VČb!­‹Íc SL©ó4Ěé_-Č㽿ôŔě‚OR P© -endstream endobj -2 0 obj << -/Type /Pages -/Count 1 -/Kids [ 4 0 R ] ->> endobj -5 0 obj << -/Type /Catalog -/Pages 2 0 R ->> endobj -6 0 obj << -/Creator (Ipe 6.0 preview 28) -/Producer (Ipe 6.0 preview 28) -/CreationDate (D:20080609193922) -/ModDate (D:20080609193922) ->> endobj -xref -0 7 -0000000000 00000 f -0000000671 00000 n -0000001076 00000 n -0000000009 00000 n -0000000466 00000 n -0000001135 00000 n -0000001184 00000 n -trailer -<< -/Size 7 -/Root 5 0 R -/Info 6 0 R ->> -startxref -1327 -%%EOF diff --git a/GraphicsView/demo/Polygon_repair/icons/circumcenter.png b/GraphicsView/demo/Polygon_repair/icons/circumcenter.png deleted file mode 100644 index f743b7a64cacc527a5562ce0ae76d641675ad423..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3862 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 diff --git a/GraphicsView/demo/Polygon_repair/icons/conflict_zone.png b/GraphicsView/demo/Polygon_repair/icons/conflict_zone.png deleted file mode 100644 index 5fd4d5b4ce6920cb7982cc7c6f564ca4f3105231..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7715 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 diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.pdf deleted file mode 100644 index 5138901d4978cd2987230d6a4715feba9ebafe46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1857 zcma)72~ZPf6xNDL77y;yI))zwBoLEqvLQrhG!SDsq9I5HEJs2%fI>ny8x5fGglGk; zgI2|g2q*{+h*Ho33ROfADGCUPQf~o8@TwPRH?&qpI@A8MGyCQp|Gf9j|9#IvED+9y zX)K5Z7(gXk20T0_L)m{=Ueh<~gUM+Io4N{#{^4^rb8Dvg7**OJq# zlt!@e#<#1XUd!`0ZL>rPp*wbM%KkQYal%jod)jPXN2`x^FkwQwC&&Dahb})p=l7g1 zIBh;5sjaDx^({3HcaN+ZT9SP{X~Dfp%{RR6x7u-mHKh@St=@XI$;4)V%2pqzB}v`k z;R_S=>09+J(A2_hQPuO6_15Iv(Ds>Ns?>k{7~acA`06uZA)9Y@nTG4XyIf*2=cU8A zqUXNUNy6m7FAsa1O0;_5bsnC}m)9OGXtQ6Wf9RNf+vfCQnso)4$1j#F97r}hTtEHp z4I?0bMMOLLs`BN{ORNTn!AEOCY)gRjV{uB&s%m z4~Q&G6&ZlyU@2h=gaCvRP6Bee2$jc3JylvFFq>ic*jzSnLztn&m6$4iID)v*5H^Pc zm<%qB2{QrALTGFjU~&-}i^C=|`56BH62(%CXc91od*tyx3F+1QL0td) z$+YgipzLIrru6F|&zDWty{-JG#L*Ly!=Q87ady|h1!Z$yzc|c`%WpoUFbVHA+oe+I zipu9dY`UsheYqt#+gR$z-_qD|py$|KGSAsh+<7wY)+xJJT2966Ui5h3ou|~-gX_#> zU)M{VH{Pf61JgghIOEli=6rNLnViude5^ae8oF@(<<(zwTIcDO52Egs?^#-bMYmcd zgb&6Cd+vNd?Mr_sj&nJBy{%7SQ|Df;Th^=Vj`gn?eAr}F78d8@KF`UKeH!_BugzTY zDw_=~T~BzAW!j7Fp_6L=sJs~17JDu9S(R0wb%511#ZojNednD6GW||WO)moHN>z|6<%ZKLpmWj5{%GZEo5s63b8&j2M z=~95Kr^-a!0>$@{$`hWcBtPzgd#TI~l!Kcn8%U86+atv0)Qm`BTCvw;>r=Mp)>gNX zl4y2?T{|z5hn$O3)+J9^5ReiOQJ`4sZO^{r=HqOmx1c&m=grF6`W%O*^-bRvM0#(_ zq6l>xUPK4)@4g?|IA!0*fu=hkx~+8lXQkZ!Bl!b5b`hV+IDB9 zp5zcD8YnW(vC9*9-nO^QU&J}ztfe~6%RIbk+8$H-GWm={o6Xmg#@dJmPOK2L^yAF& z_!2p(HY7Btv3OT*M6|6(J&uLU! z)t)2S4_3IT-;2xFR8;I8GOA%LuNkcf1~PpR*^i2#Hb{bo;2I3kePiTmg5L(|kPyWG z$UF9^QZFekja5ZK!>XblMO4=j1zv<$<0=d|5nKhXGzN&r&=oQ0O2BlZ5cQZ!u8AZ> z{@=sH#W5tH({6#|OPc^d0)Bpeg diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation.png deleted file mode 100644 index 3a49172fa17b5d09511f331faf39f6c6ab637ed5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6800 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 diff --git a/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png b/GraphicsView/demo/Polygon_repair/icons/constrained_triangulation_show_in_domain.png deleted file mode 100644 index cd4be89b1abfef93500bd95864a76997716c1792..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6988 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 It&9fabEP)fQi=HSuO9k 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 Date: Wed, 8 Jan 2025 11:46:23 +0100 Subject: [PATCH 182/332] Add CGAL::unordered_flat_map implementation ...and `refactor Polyline_constraint_hierarchy_2` to use it. `CGAL::unordered_flat_map` will be Boost `unordered_flat_map` if availlable, or the standard `std::unordered_map` otherwise. --- .../include/CGAL/unordered_flat_map.h | 60 +++++++++++++++++++ .../Polyline_constraint_hierarchy_2.h | 15 +---- 2 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 STL_Extension/include/CGAL/unordered_flat_map.h diff --git a/STL_Extension/include/CGAL/unordered_flat_map.h b/STL_Extension/include/CGAL/unordered_flat_map.h new file mode 100644 index 00000000000..45470c04d48 --- /dev/null +++ b/STL_Extension/include/CGAL/unordered_flat_map.h @@ -0,0 +1,60 @@ +// Copyright (c) 2025 GeometryFactory Sarl (France). +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_UNORDERED_FLAT_MAP_H +#define CGAL_UNORDERED_FLAT_MAP_H + +#include + +#include +#if BOOST_VERSION >= 108100 && !defined(CGAL_USE_BOOST_UNORDERED) +# define CGAL_USE_BOOST_UNORDERED 1 +#endif + +#if CGAL_USE_BARE_STD_MAP // to benchmark with the ordered std::map +# include +#elif CGAL_USE_BOOST_UNORDERED +# include +#else // Boost before 1.81.0, use the C++11 std::unordered_map +# include +#endif + +#if CGAL_USE_BARE_STD_MAP + #include +#endif + +#include + +namespace CGAL { + +template < + typename Key, + typename T, + typename Hash = std::hash, + typename KeyEqual = std::equal_to, + typename Allocator = std::allocator> + > +#if CGAL_USE_BARE_STD_MAP + + using unordered_flat_map = std::map, Allocator>; + +#elif CGAL_USE_BOOST_UNORDERED + + using unordered_flat_map = boost::unordered_flat_map; + +#else // use the C++11 std::unordered_map + + using unordered_flat_map = std::unordered_map; + +#endif + +} // end namespace CGAL + +#endif // CGAL_UNORDERED_FLAT_MAP_H diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index b96752e91fe..6be1e8dd401 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -22,14 +22,7 @@ #include #include -#include -#if BOOST_VERSION >= 108100 -# include -# define CGAL_USE_BOOST_UNORDERED 1 -#else // BOOST before 1.81.0 -# include -#endif - +#include #include #include @@ -162,11 +155,7 @@ public: typedef typename Context_list::iterator Context_iterator; typedef std::set Constraint_set; -#if CGAL_USE_BOOST_UNORDERED - typedef boost::unordered_flat_map> Sc_to_c_map; -#else - typedef std::unordered_map> Sc_to_c_map; -#endif + typedef CGAL::unordered_flat_map> Sc_to_c_map; typedef typename Constraint_set::iterator C_iterator; typedef typename Sc_to_c_map::const_iterator Sc_iterator; typedef Sc_iterator Subconstraint_iterator; From b12625f169854c671ce944804ba7b618b32f6c83 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jan 2025 21:13:43 +0100 Subject: [PATCH 183/332] fix an error detected by UBSAN --- .../CGAL/Delaunay_mesher_no_edge_refinement_2.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h index 1729fc795f6..fe316a611e6 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h @@ -63,7 +63,8 @@ private: Faces_level faces_level; Seeds seeds; - bool seeds_mark; + bool seeds_mark = false; + bool initialized = false; public: /** \name CONSTRUCTORS */ Delaunay_mesher_no_edge_refinement_2(Tr& tr_, const Criteria& criteria_ = Criteria()) @@ -72,20 +73,18 @@ public: null_level(), null_visitor(), edges_level(tr, null_level), - faces_level(tr, criteria, edges_level), - initialized(false) + faces_level(tr, criteria, edges_level) { } Delaunay_mesher_no_edge_refinement_2(Tr& tr_, Edges_level& edges_level_, - const Criteria& criteria_ = Criteria()) + const Criteria& criteria_ = Criteria()) : tr(tr_), criteria(criteria_), null_level(), null_visitor(), edges_level(edges_level_), - faces_level(tr, criteria, edges_level), - initialized(false) + faces_level(tr, criteria, edges_level) { } @@ -101,12 +100,6 @@ public: return seeds.end(); } -private: - /** \name INITIALIZED */ - - bool initialized; - -public: /** \name MARKING FUNCTIONS */ /** The value type of \a InputIterator should be `Point`, and represents From ea151ff987730356987964cf5f3616a83d2ee4dd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jan 2025 21:15:22 +0100 Subject: [PATCH 184/332] fix CGAL_USE_BARE_STD_MAP with Polyline_constraint_hierarchy_2 --- .../include/CGAL/unordered_flat_map.h | 7 ++--- .../Polyline_constraint_hierarchy_2.h | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/STL_Extension/include/CGAL/unordered_flat_map.h b/STL_Extension/include/CGAL/unordered_flat_map.h index 45470c04d48..8eb3203f87e 100644 --- a/STL_Extension/include/CGAL/unordered_flat_map.h +++ b/STL_Extension/include/CGAL/unordered_flat_map.h @@ -26,11 +26,8 @@ # include #endif -#if CGAL_USE_BARE_STD_MAP - #include -#endif - -#include +#include // for std::hash, std::equal_to +#include // for std::allocator namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 6be1e8dd401..037b2368a5c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -136,6 +136,24 @@ public: } }; + class Pair_compare { + Compare comp; + + public: + Pair_compare(const Compare& comp) : comp(comp) {} + + bool operator()(const Edge& e1, const Edge& e2) const { + if(comp(e1.first, e2.first)) { + return true; + } else if((! comp(e2.first, e1.first)) && // !less(e1,e2) && !less(e2,e1) == equal + comp(e1.second, e2.second)) { + return true; + } else { + return false; + } + } + }; + class Context { friend class Polyline_constraint_hierarchy_2; private: @@ -155,7 +173,12 @@ public: typedef typename Context_list::iterator Context_iterator; typedef std::set Constraint_set; +#if CGAL_USE_BARE_STD_MAP + typedef std::map Sc_to_c_map; +#else typedef CGAL::unordered_flat_map> Sc_to_c_map; +#endif typedef typename Constraint_set::iterator C_iterator; typedef typename Sc_to_c_map::const_iterator Sc_iterator; typedef Sc_iterator Subconstraint_iterator; @@ -169,7 +192,11 @@ private: public: Polyline_constraint_hierarchy_2(const Compare& comp) : comp(comp) +#if CGAL_USE_BARE_STD_MAP + , sc_to_c_map(Pair_compare(comp)) +#else , sc_to_c_map() +#endif { } Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch); Polyline_constraint_hierarchy_2(Polyline_constraint_hierarchy_2&&) = default; From bc8c1e659480986b4999c0a7eddaa5f00d0cef9f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jan 2025 21:53:44 +0100 Subject: [PATCH 185/332] new allocator type, that allocates randomly on purpose To debug non-determinism on Linux platforms. --- .clang-format | 33 +++ Mesh_2/test/Mesh_2/CMakeLists.txt | 4 + Mesh_2/test/Mesh_2/test_meshing.cpp | 5 + STL_Extension/include/CGAL/Random_allocator.h | 191 ++++++++++++++++++ 4 files changed, 233 insertions(+) create mode 100644 .clang-format create mode 100644 STL_Extension/include/CGAL/Random_allocator.h diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000000..ea7a2200d52 --- /dev/null +++ b/.clang-format @@ -0,0 +1,33 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -2 +BinPackParameters: false +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: MultiLine + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +ColumnLimit: 120 +# Force pointers to the type for C++. +DerivePointerAlignment: false +PointerAlignment: Left +# Control the spaces around conditionals +SpacesInConditionalStatement: false +SpaceBeforeParens: false +... diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 9ce291f819a..3501f20ea20 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -14,3 +14,7 @@ file( foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() + +if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + target_compile_features(test_meshing PRIVATE cxx_std_20) +endif() diff --git a/Mesh_2/test/Mesh_2/test_meshing.cpp b/Mesh_2/test/Mesh_2/test_meshing.cpp index 48d6ccffaf0..ed6801d28f1 100644 --- a/Mesh_2/test/Mesh_2/test_meshing.cpp +++ b/Mesh_2/test/Mesh_2/test_meshing.cpp @@ -1,5 +1,10 @@ // 154 515 565 #include +#if CGAL_CXX20 +# define CGAL_DEBUG_RANDOM_ALLOCATOR 1 +# include +# define CGAL_ALLOCATOR(T) CGAL::Random_allocator +#endif #include "test_dependencies.h" #include #if CGAL_USE_CORE || CGAL_USE_LEDA diff --git a/STL_Extension/include/CGAL/Random_allocator.h b/STL_Extension/include/CGAL/Random_allocator.h new file mode 100644 index 00000000000..51d36a901fd --- /dev/null +++ b/STL_Extension/include/CGAL/Random_allocator.h @@ -0,0 +1,191 @@ +// Copyright (c) 2025 GeometryFactory Sarl (France). +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_RANDOM_ALLOCATOR_H +#define CGAL_RANDOM_ALLOCATOR_H + +#include +#include +#include +#include + +// This header requires C++20 or later. +#include +#include +#include +#include + +namespace CGAL { + +// A random allocator that allocates blocks of memory and returns random +// locations. To use only for debugging purposes. That allocator is: +// - not efficient, +// - not thread-safe, +// - and increases memory-fragmentation and non-locality. +template > class Random_allocator +{ + constexpr static std::size_t minimal_block_size = 1024; + constexpr static std::size_t random_size = 64; + + struct Blocks + { + struct Block + { + T* data = nullptr; + boost::dynamic_bitset<> available; + std::size_t maximal_continuous_free_space = 0; + + auto size() const { return available.size(); } + }; + + Upstream_allocator alloc; + std::vector blocks; // List of allocated blocks + + void allocate_new_block(std::size_t block_size = minimal_block_size) + { + auto& block = blocks.emplace_back(nullptr, boost::dynamic_bitset<>(block_size)); + block.data = alloc.allocate(block_size); + block.available.set(); + block.maximal_continuous_free_space = block_size; + } + + Blocks(const Upstream_allocator& alloc) : alloc(alloc) { allocate_new_block(); } + + ~Blocks() + { + for(auto& block : blocks) { + alloc.deallocate(block.data, block.size()); + } + } + }; + using Block = typename Blocks::Block; + using Ptr = std::shared_ptr; + + Ptr ptr_; + std::mt19937 gen; + +public: + using value_type = T; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using pointer = T*; + using const_pointer = const T*; + using reference = T&; + using const_reference = const T&; + using allocator_type = Upstream_allocator; + + Random_allocator(const Upstream_allocator& alloc = {}) noexcept; + + pointer allocate(size_type n, const void* hint = 0); + void deallocate(pointer p, size_type n); + + template void construct(U* p, Args&&... args); + template void destroy(U* p); + + size_type max_size() const noexcept; + + template struct rebind + { + using other_upstream_allocator = std::allocator_traits::template rebind_alloc; + using other = Random_allocator; + }; + + bool operator==(const Random_allocator&) const noexcept; + bool operator!=(const Random_allocator&) const noexcept; +}; + +// Implementation of Random_allocator methods +template +Random_allocator::Random_allocator(const Upstream_allocator& alloc) noexcept + : ptr_(std::make_shared(alloc)), gen(std::random_device()()) +{ +} + +template +typename Random_allocator::pointer +Random_allocator::allocate(size_type n, const void* hint) +{ + boost::container::static_vector, random_size> found_spaces; + for(auto& block : ptr_->blocks | std::views::reverse) { + if(block.maximal_continuous_free_space < n) + continue; + auto& available = block.available; + const auto block_size = block.size(); + size_type found_max_free_space = 0; + auto index = available.find_first(); + while(index != boost::dynamic_bitset<>::npos) { + available.flip(); + const auto end_of_free_block = (std::min)(available.find_next(index), block_size); + available.flip(); + auto free_space = end_of_free_block - index; + found_max_free_space = (std::max)(found_max_free_space, free_space); + while(free_space > n && found_spaces.size() < found_spaces.capacity()) { + found_spaces.push_back({std::addressof(block), index}); + free_space -= n; + index += n; + } + index = block.available.find_next(end_of_free_block); + } + block.maximal_continuous_free_space = found_max_free_space; + if(found_spaces.size() == found_spaces.capacity()) + break; + } + if(!found_spaces.empty()) { + std::uniform_int_distribution<> dis(0, found_spaces.size() - 1); + auto i = dis(gen); + auto [block, index] = found_spaces[i]; + block->available.set(index, n, false); +#if CGAL_DEBUG_RANDOM_ALLOCATOR + std::clog << std::format("CGAL::Random_allocator debug info: n = {}, found_spaces.size() = {}, i = {}," + "block nb = {}, block size = {}, index = {}\n", + n, found_spaces.size(), i, block - ptr_->blocks.data(), block->size(), index); +#endif // CGAL_DEBUG_RANDOM_ALLOCATOR + return block->data + index; + } + size_type block_size = std::max(n * random_size, minimal_block_size); + ptr_->allocate_new_block(block_size); + return allocate(n, hint); +} + +template +void Random_allocator::deallocate(pointer p, size_type n) +{ + for(auto& block : ptr_->blocks) { + if(block.data <= p && p < block.data + block.size()) { + block.available.set(p - block.data, n, true); + return; + } + } +} + +template +template +void Random_allocator::construct(U* p, Args&&... args) +{ + ::new((void*)p) U(std::forward(args)...); +} + +template +template +void Random_allocator::destroy(U* p) +{ + p->~U(); +} + +template +typename Random_allocator::size_type +Random_allocator::max_size() const noexcept +{ + return std::numeric_limits::max() / sizeof(T); +} + +} // namespace CGAL + +#endif // CGAL_RANDOM_ALLOCATOR_H From 364ba1595c87d67ff40bb9d5da05b7d00931d077 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 8 Jan 2025 21:53:53 +0100 Subject: [PATCH 186/332] fix a missing #include --- .../Triangulation_2/internal/Polyline_constraint_hierarchy_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 037b2368a5c..0b59735b50e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -24,6 +24,7 @@ #include #include +#include #include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS From d7791980d17ff1a69a148f7adb630cbccd00d43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 11:40:10 +0100 Subject: [PATCH 187/332] Move separator --- .../include/CGAL/Polygon_mesh_processing/internal/curvature.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h index 94860c496d3..622e97e32ca 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h @@ -26,8 +26,6 @@ namespace CGAL { namespace Polygon_mesh_processing { -// Discrete Gaussian Curvature - /** * \ingroup PMP_vertex_angle_grp * @@ -102,6 +100,8 @@ angle_sum(typename boost::graph_traits::vertex_descriptor v, return angle_sum; } +// Discrete Gaussian Curvature + template #ifdef DOXYGEN_RUNNING From 6d68861f1e445fedf31413dffe0b3d319646ea59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 11:40:50 +0100 Subject: [PATCH 188/332] Move PMP/curvature.h outside of 'internal' --- .../CGAL/Polygon_mesh_processing/{internal => }/curvature.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/{internal => }/curvature.h (100%) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h similarity index 100% rename from Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/curvature.h rename to Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h From 26005e59f3f1cb5f0997e003dbae94da0e821eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 13:10:16 +0100 Subject: [PATCH 189/332] Fix compilation --- .../include/CGAL/Polygon_mesh_processing/curvature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h index 622e97e32ca..819d3c8a638 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h @@ -87,7 +87,7 @@ angle_sum(typename boost::graph_traits::vertex_descriptor v, CGAL_precondition(is_valid_vertex_descriptor(v, pmesh)); - typename Geom_traits::Construct_vector_3 approx_angle = gt.compute_approximate_angle_3_object(); + typename Geom_traits::Compute_approximate_angle_3 approx_angle = gt.compute_approximate_angle_3_object(); FT angle_sum = 0; for(auto h : halfedges_around_source(v, pmesh)) From db297d7eff6c059538f36344efd209a02f36a8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 13:10:33 +0100 Subject: [PATCH 190/332] Handle boundary vertices in angle_sum --- .../include/CGAL/Polygon_mesh_processing/curvature.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h index 819d3c8a638..288ea9ab3f7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h @@ -92,6 +92,9 @@ angle_sum(typename boost::graph_traits::vertex_descriptor v, FT angle_sum = 0; for(auto h : halfedges_around_source(v, pmesh)) { + if(is_border(h, pmesh)) + continue; + angle_sum += approx_angle(get(vpm, target(h, pmesh)), get(vpm, source(h, pmesh)), get(vpm, source(prev(h,pmesh), pmesh))); From c418aea7c25111436dedb873b1e085d34db4ff83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 13:11:21 +0100 Subject: [PATCH 191/332] Document PMP/curvature.h --- .../PackageDescription.txt | 8 +- .../Polygon_mesh_processing.txt | 11 + .../CGAL/Polygon_mesh_processing/curvature.h | 225 +++++++++++++++--- 3 files changed, 209 insertions(+), 35 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 6b74ce9696a..50f198e8317 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -25,7 +25,7 @@ /// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_measure_grp Geometric Measure Functions -/// Functions to compute lengths of edges and borders, areas of faces and patches, as well as volumes of closed meshes. +/// Functions to compute discrete curvatures, lengths of edges and borders, areas of faces and patches, volumes of closed meshes. /// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_orientation_grp Orientation Functions @@ -239,6 +239,11 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage. - `CGAL::Polygon_mesh_processing::sample_triangle_mesh()` \cgalCRPSection{Geometric Measure Functions} +- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::angle_sum()` \endlink +- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::discrete_Gaussian_curvatures()` \endlink +- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::discrete_Gaussian_curvature()` \endlink +- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::discrete_mean_curvature()` \endlink +- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::discrete_mean_curvatures()` \endlink - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::edge_length()` \endlink - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::squared_edge_length()` \endlink - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::face_area()` \endlink @@ -248,7 +253,6 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage. - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::face_border_length()` \endlink - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::longest_border()` \endlink - \link PMP_measure_grp `CGAL::Polygon_mesh_processing::centroid()` \endlink -- \link PMP_measure_grp `CGAL::Polygon_mesh_processing::match_faces()` \endlink \cgalCRPSection{Feature Detection Functions} - `CGAL::Polygon_mesh_processing::sharp_edges_segmentation()` diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 08d8d798f41..c4bf5a424fc 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1225,6 +1225,17 @@ compute the curvatures on a specific vertex. \cgalExample{Polygon_mesh_processing/interpolated_corrected_curvatures_vertex.cpp} +\subsection DCurvartures Discrete Curvatures + +The package also provides methods to compute the standard, non-interpolated discrete mean and Gaussian +curvatures on triangle meshes, based on the work of Meyer et al. \cgalCite{cgal:mdsb-ddgot-02}. +These curvatures are computed at each vertex of the mesh, and are based on the angles of the incident +triangles. The functions are: +- `CGAL::Polygon_mesh_processing::discrete_mean_curvature()` +- `CGAL::Polygon_mesh_processing::discrete_mean_curvatures()` +- `CGAL::Polygon_mesh_processing::discrete_Gaussian_curvature()` +- `CGAL::Polygon_mesh_processing::discrete_Gaussian_curvatures()` + **************************************** \section PMPSlicer Slicer diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h index 288ea9ab3f7..cdcf687d678 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h @@ -8,10 +8,11 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Mael Rouxel-LabbĂ© +// Author(s) : Andreas Fabri, +// Mael Rouxel-LabbĂ© -#ifndef CGAL_PMP_INTERNAL_CURVATURE_H -#define CGAL_PMP_INTERNAL_CURVATURE_H +#ifndef CGAL_PMP_CURVATURE_H +#define CGAL_PMP_CURVATURE_H #include @@ -27,10 +28,12 @@ namespace CGAL { namespace Polygon_mesh_processing { /** - * \ingroup PMP_vertex_angle_grp + * \ingroup PMP_measure_grp * * computes the sum of the angles around a vertex. * + * The angle sum is given in degrees. + * * @tparam PolygonMesh a model of `HalfedgeGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * @@ -60,7 +63,6 @@ namespace Polygon_mesh_processing { * or the geometric traits class deduced from the point property map of `pmesh`. * * \warning This function involves trigonometry. - * */ template @@ -105,6 +107,45 @@ angle_sum(typename boost::graph_traits::vertex_descriptor v, // Discrete Gaussian Curvature +/** + * \ingroup PMP_measure_grp + * + * computes the discrete Gaussian curvature at a vertex. + * + * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete Gaussian curvature. + * + * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param v the vertex whose discrete Gaussian curvature is being computed + * @param tmesh the triangle mesh to which `v` belongs + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `tmesh`} + * \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, tmesh)`} + * \cgalParamNEnd + * + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class} + * \cgalParamType{The traits class must be a model of `Kernel`.} + * \cgalParamDefault{a \cgal kernel deduced from the point type, using `CGAL::Kernel_traits`} + * \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * @return the discrete Gaussian curvature at `v`. The return type `FT` is a number type either deduced + * from the `geom_traits` \ref bgl_namedparameters "Named Parameters" if provided, + * or the geometric traits class deduced from the point property map of `tmesh`. + * + * \warning This function involves trigonometry. + * \warning The current formulation is not well defined for border vertices. + * + * \pre `tmesh` is a triangle mesh + */ template #ifdef DOXYGEN_RUNNING @@ -113,7 +154,7 @@ FT typename GetGeomTraits::type::FT #endif discrete_Gaussian_curvature(typename boost::graph_traits::vertex_descriptor v, - const TriangleMesh& tm, + const TriangleMesh& tmesh, const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; @@ -128,7 +169,7 @@ discrete_Gaussian_curvature(typename boost::graph_traits::vertex_d GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), - get_const_property_map(vertex_point, tm)); + get_const_property_map(vertex_point, tmesh)); typename GeomTraits::Construct_vector_3 vector = gt.construct_vector_3_object(); @@ -141,13 +182,13 @@ discrete_Gaussian_curvature(typename boost::graph_traits::vertex_d FT angle_sum = 0; - for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tmesh)) { - if(is_border(h, tm)) + if(is_border(h, tmesh)) continue; - const Vector_3 v0 = vector(get(vpm, v), get(vpm, target(next(h, tm), tm))); // p1p2 - const Vector_3 v1 = vector(get(vpm, v), get(vpm, source(h, tm))); // p1p0 + const Vector_3 v0 = vector(get(vpm, v), get(vpm, target(next(h, tmesh), tmesh))); // p1p2 + const Vector_3 v1 = vector(get(vpm, v), get(vpm, source(h, tmesh))); // p1p0 const FT dot = scalar_product(v0, v1); const Vector_3 cross = cross_product(v0, v1); @@ -172,28 +213,108 @@ discrete_Gaussian_curvature(typename boost::graph_traits::vertex_d } } - Weights::Secure_cotangent_weight_with_voronoi_area wc(tm, vpm, gt); + Weights::Secure_cotangent_weight_with_voronoi_area wc(tmesh, vpm, gt); const FT gaussian_curvature = (2 * CGAL_PI - angle_sum) / wc.voronoi(v); return gaussian_curvature; } +/** + * \ingroup PMP_measure_grp + * + * computes the discrete Gaussian curvatures at the vertices of a mesh. + * + * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete Gaussian curvature. + * + * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam VertexCurvatureMap must be a model of `WritablePropertyMap` with key type + * `boost::graph_traits::%vertex_descriptor` and value type `FT`, + * which is either `geom_traits::FT` if this named parameter is provided, + * or `kernel::FT` with the kernel deduced from from the point property map of `tmesh`. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param tmesh the triangle mesh to which `v` belongs + * @param vcm the property map that contains the computed discrete curvatures + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `tmesh`} + * \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, tmesh)`} + * \cgalParamNEnd + * + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class} + * \cgalParamType{The traits class must be a model of `Kernel`.} + * \cgalParamDefault{a \cgal kernel deduced from the point type, using `CGAL::Kernel_traits`} + * \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \warning This function involves trigonometry. + * \warning The current formulation is not well defined for border vertices. + * + * \pre `tmesh` is a triangle mesh + */ template -void discrete_Gaussian_curvatures(const TriangleMesh& tm, +void discrete_Gaussian_curvatures(const TriangleMesh& tmesh, VertexCurvatureMap vcm, const CGAL_NP_CLASS& np = parameters::default_values()) { using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; - for(vertex_descriptor v : vertices(tm)) - put(vcm, v, discrete_Gaussian_curvature(v, tm, np)); + for(vertex_descriptor v : vertices(tmesh)) + { + put(vcm, v, discrete_Gaussian_curvature(v, tmesh, np)); + // std::cout << "curvature: " << get(vcm, v) << std::endl; + } } // Discrete Mean Curvature +/** + * \ingroup PMP_measure_grp + * + * computes the discrete mean curvature at a vertex. + * + * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete mean curvature. + * + * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param v the vertex whose discrete mean curvature is being computed + * @param tmesh the triangle mesh to which `v` belongs + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `tmesh`} + * \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, tmesh)`} + * \cgalParamNEnd + * + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class} + * \cgalParamType{The traits class must be a model of `Kernel`.} + * \cgalParamDefault{a \cgal kernel deduced from the point type, using `CGAL::Kernel_traits`} + * \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * @return the discrete mean curvature at `v`. The return type `FT` is a number type either deduced + * from the `geom_traits` \ref bgl_namedparameters "Named Parameters" if provided, + * or the geometric traits class deduced from the point property map of `tmesh`. + * + * \warning The current formulation is not well defined for border vertices. + * + * \pre `tmesh` is a triangle mesh + */ template #ifdef DOXYGEN_RUNNING @@ -202,7 +323,7 @@ FT typename GetGeomTraits::type::FT #endif discrete_mean_curvature(typename boost::graph_traits::vertex_descriptor v, - const TriangleMesh& tm, + const TriangleMesh& tmesh, const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; @@ -220,7 +341,7 @@ discrete_mean_curvature(typename boost::graph_traits::vertex_descr GeomTraits gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); VertexPointMap vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), - get_const_property_map(vertex_point, tm)); + get_const_property_map(vertex_point, tmesh)); #if 0 typename GeomTraits::Compute_squared_distance_3 squared_distance = @@ -231,12 +352,12 @@ discrete_mean_curvature(typename boost::graph_traits::vertex_descr const FT two_pi = 2 * CGAL_PI; FT hi = 0; - for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tmesh)) { - const Point_3& p = get(vpm, source(h, tm)); - const Point_3& q = get(vpm, target(h, tm)); - const Point_3& r = get(vpm, target(next(h, tm), tm)); - const Point_3& s = get(vpm, target(next(opposite(h, tm), tm), tm)); + const Point_3& p = get(vpm, source(h, tmesh)); + const Point_3& q = get(vpm, target(h, tmesh)); + const Point_3& r = get(vpm, target(next(h, tmesh), tmesh)); + const Point_3& s = get(vpm, target(next(opposite(h, tmesh), tmesh), tmesh)); const FT l = squared_distance(p,q); FT phi = CGAL_PI * dihedral_angle(p, q, r, s) / FT(180); @@ -260,27 +381,27 @@ discrete_mean_curvature(typename boost::graph_traits::vertex_descr typename GeomTraits::Compute_squared_length_3 squared_length = gt.compute_squared_length_3_object(); - Weights::Secure_cotangent_weight_with_voronoi_area wc(tm, vpm, gt); + Weights::Secure_cotangent_weight_with_voronoi_area wc(tmesh, vpm, gt); Vector_3 kh = vector(CGAL::NULL_VECTOR); - for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tm)) + for(halfedge_descriptor h : CGAL::halfedges_around_target(v, tmesh)) { - const vertex_descriptor v1 = source(h, tm); + const vertex_descriptor v1 = source(h, tmesh); const Point_ref p0 = get(vpm, v); const Point_ref p1 = get(vpm, v1); FT local_c = 0; - if(!is_border(h, tm)) + if(!is_border(h, tmesh)) { - const vertex_descriptor v2 = target(next(h, tm), tm); + const vertex_descriptor v2 = target(next(h, tmesh), tmesh); const Point_ref p2 = get(vpm, v2); local_c += Weights::cotangent_3_clamped(p0, p2, p1, gt); } - if(!is_border(opposite(h, tm), tm)) + if(!is_border(opposite(h, tmesh), tmesh)) { - const vertex_descriptor v3 = target(next(opposite(h, tm), tm), tm); + const vertex_descriptor v3 = target(next(opposite(h, tmesh), tmesh), tmesh); const Point_ref p3 = get(vpm, v3); local_c += Weights::cotangent_3_clamped(p1, p3, p0, gt); } @@ -297,20 +418,58 @@ discrete_mean_curvature(typename boost::graph_traits::vertex_descr #endif } +/** + * \ingroup PMP_measure_grp + * + * computes the discrete mean curvatures at the vertices of a mesh. + * + * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete mean curvature. + * + * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam VertexCurvatureMap must be a model of `WritablePropertyMap` with key type + * `boost::graph_traits::%vertex_descriptor` and value type `FT`, + * which is either `geom_traits::FT` if this named parameter is provided, + * or `kernel::FT` with the kernel deduced from from the point property map of `tmesh`. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param tmesh the triangle mesh to which `v` belongs + * @param vcm the property map that contains the computed discrete curvatures + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{vertex_point_map} + * \cgalParamDescription{a property map associating points to the vertices of `tmesh`} + * \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` + * as key type and `%Point_3` as value type} + * \cgalParamDefault{`boost::get(CGAL::vertex_point, tmesh)`} + * \cgalParamNEnd + * + * \cgalParamNBegin{geom_traits} + * \cgalParamDescription{an instance of a geometric traits class} + * \cgalParamType{The traits class must be a model of `Kernel`.} + * \cgalParamDefault{a \cgal kernel deduced from the point type, using `CGAL::Kernel_traits`} + * \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \warning The current formulation is not well defined for border vertices. + * + * \pre `tmesh` is a triangle mesh + */ template -void discrete_mean_curvatures(const TriangleMesh& tm, +void discrete_mean_curvatures(const TriangleMesh& tmesh, VertexCurvatureMap vcm, const CGAL_NP_CLASS& np = parameters::default_values()) { using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; - for(vertex_descriptor v : vertices(tm)) - put(vcm, v, discrete_mean_curvature(v, tm, np)); + for(vertex_descriptor v : vertices(tmesh)) + put(vcm, v, discrete_mean_curvature(v, tmesh, np)); } } // namespace Polygon_mesh_processing } // namespace CGAL -#endif //CGAL_PMP_INTERNAL_CURVATURE_H +#endif //CGAL_PMP_CURVATURE_H From 8e3befc09a65135fb21b74b622028c5807f0d29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 13:11:37 +0100 Subject: [PATCH 192/332] Add tests for discrete curvatures --- .../Polygon_mesh_processing/CMakeLists.txt | 1 + .../test_discrete_curvatures.cpp | 146 ++++++++++++++++++ ...test_interpolated_corrected_curvatures.cpp | 5 +- 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/test_discrete_curvatures.cpp diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 0dd21ab22e1..e50408d7169 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -28,6 +28,7 @@ create_single_source_cgal_program("test_stitching.cpp") create_single_source_cgal_program("remeshing_test.cpp") create_single_source_cgal_program("remeshing_with_isolated_constraints_test.cpp" ) create_single_source_cgal_program("measures_test.cpp") +create_single_source_cgal_program("test_discrete_curvatures.cpp") create_single_source_cgal_program("triangulate_faces_test.cpp") create_single_source_cgal_program("triangulate_faces_hole_filling_dt3_test.cpp") create_single_source_cgal_program("triangulate_faces_hole_filling_all_search_test.cpp") diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_discrete_curvatures.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_discrete_curvatures.cpp new file mode 100644 index 00000000000..d37bf7471ad --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_discrete_curvatures.cpp @@ -0,0 +1,146 @@ +#include +#include +#include + +#include + +#include + +#include +#include + +#define ABS_ERROR 1e-6 + +namespace PMP = CGAL::Polygon_mesh_processing; + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::FT FT; +typedef CGAL::Surface_mesh SMesh; +typedef CGAL::Polyhedron_3 Polyhedron; + +struct Average_test_info +{ + FT mean_curvature_avg; + FT gaussian_curvature_avg; + FT tolerance = 0.9; + + Average_test_info(FT mean_curvature_avg, + FT gaussian_curvature_avg) + : mean_curvature_avg(mean_curvature_avg), + gaussian_curvature_avg(gaussian_curvature_avg) + { } +}; + +bool passes_comparison(FT result, FT expected, FT tolerance) +{ + std::cout << "result: " << result << std::endl; + std::cout << "expected: " << expected << std::endl; + + if(abs(expected) < ABS_ERROR && abs(result) < ABS_ERROR) + return true; // expected 0, got 0 + else if (abs(expected) < ABS_ERROR) + return false; // expected 0, got non-0 + + return (std::min)(result, expected) / (std::max)(result, expected) > tolerance; +} + +template +void test_curvatures(std::string mesh_path, + Average_test_info test_info) +{ + std::cout << "test discrete curvatures of " << mesh_path << std::endl; + std::cout << "mesh type: " << typeid(mesh_path).name() << std::endl; + + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + TriangleMesh tmesh; + const std::string filename = CGAL::data_file_path(mesh_path); + + if(!CGAL::IO::read_polygon_mesh(filename, tmesh) || faces(tmesh).size() == 0) + { + std::cerr << "Invalid input file." << std::endl; + std::exit(1); + } + + typename boost::property_map>::type + mean_curvature_map = get(CGAL::dynamic_vertex_property_t(), tmesh), + gaussian_curvature_map = get(CGAL::dynamic_vertex_property_t(), tmesh); + + PMP::discrete_mean_curvatures(tmesh, mean_curvature_map); + PMP::discrete_Gaussian_curvatures(tmesh, gaussian_curvature_map); + + FT mean_curvature_avg = 0, gaussian_curvature_avg = 0; + for(vertex_descriptor v : vertices(tmesh)) + { + mean_curvature_avg += get(mean_curvature_map, v); + gaussian_curvature_avg += get(gaussian_curvature_map, v); + } + + mean_curvature_avg /= vertices(tmesh).size(); + gaussian_curvature_avg /= vertices(tmesh).size(); + + std::cout << "checking mean curvature..." << std::endl; + assert(passes_comparison(mean_curvature_avg, test_info.mean_curvature_avg, test_info.tolerance)); + + std::cout << "checking Gaussian curvature..." << std::endl; + assert(passes_comparison(gaussian_curvature_avg, test_info.gaussian_curvature_avg, test_info.tolerance)); +} + +template +void test_angle_sums(const std::string mesh_path, + const std::vector& expected_values) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + PolygonMesh pmesh; + const std::string filename = CGAL::data_file_path(mesh_path); + + if(!CGAL::IO::read_polygon_mesh(filename, pmesh) || faces(pmesh).size() == 0) + { + std::cerr << "Invalid input file." << std::endl; + std::exit(1); + } + + std::size_t pos = 0; + for(vertex_descriptor v : vertices(pmesh)) + { + FT angle_sum = PMP::angle_sum(v, pmesh, + CGAL::parameters::geom_traits(K()) + .vertex_point_map(get(CGAL::vertex_point, pmesh))); + assert(passes_comparison(angle_sum, expected_values[pos++], 0.9)); + } +} + +int main(int, char**) +{ + // testing on a simple sphere(r = 0.5), on both Polyhedron & SurfaceMesh: + // Expected: Mean Curvature = 2, Gaussian Curvature = 4 + test_curvatures("meshes/sphere.off", Average_test_info(2, 4)); + test_curvatures("meshes/sphere.off", Average_test_info(2, 4)); + + // testing on a simple sphere(r = 10), on both Polyhedron & SurfaceMesh: + // Expected: Mean Curvature = 0.1, Gaussian Curvature = 0.01 + test_curvatures("meshes/sphere966.off", Average_test_info(0.1, 0.01)); + test_curvatures("meshes/sphere966.off", Average_test_info(0.1, 0.01)); + + // testing on a simple half cylinder(r = 1), on both Polyhedron & SurfaceMesh: + // Expected: Mean Curvature = 0.5, Gaussian Curvature = 0 + // To be tested once the discrete curvatures are well defined for boundary vertices + // test_curvatures("meshes/cylinder.off", Average_test_info(0.5, 0)); + // test_curvatures("meshes/cylinder.off", Average_test_info(0.5, 0)); + + test_angle_sums("meshes/quad.off", std::vector(4, 90)); + test_angle_sums("meshes/quad.off", std::vector(4, 90)); + + test_angle_sums("meshes/regular_tetrahedron.off", std::vector(4, 180)); + test_angle_sums("meshes/regular_tetrahedron.off", std::vector(4, 180)); + + test_angle_sums("meshes/cube_quad.off", std::vector(8, 270)); + test_angle_sums("meshes/cube_quad.off", std::vector(8, 270)); + + test_angle_sums("meshes/cube_poly.off", std::vector(8, 270)); + test_angle_sums("meshes/cube_poly.off", std::vector(8, 270)); + + std::cout << "Done." << std::endl; + return EXIT_SUCCESS; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_interpolated_corrected_curvatures.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_interpolated_corrected_curvatures.cpp index 412443a42c7..a15258b0fc9 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_interpolated_corrected_curvatures.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_interpolated_corrected_curvatures.cpp @@ -9,8 +9,9 @@ #include +#include #include -#include +#include #define ABS_ERROR 1e-6 @@ -181,7 +182,7 @@ void test_average_curvatures(std::string mesh_path, int main() { // testing on a simple sphere(r = 0.5), on both Polyhedron & SurfaceMesh: - // For this mesh, ina addition to the whole mesh functions, we also compare against the single vertex + // For this mesh, in addition to the whole mesh functions, we also compare against the single vertex // curvature functions to make sure the produce the same results // Expected: Mean Curvature = 2, Gaussian Curvature = 4, Principal Curvatures = 2 & 2 so 2 on avg. test_average_curvatures("meshes/sphere.off", Average_test_info(2, 4, 2), true); From 76e47d40ed03f7eda2edd6cee81db7146847cd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 10 Jan 2025 13:51:57 +0100 Subject: [PATCH 193/332] Fix header path --- Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp b/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp index 4156305559e..ae298d99940 100644 --- a/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Display/Display_property_plugin.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include From e5807ca048b57f6849537bff86ea5d4495463e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 10 Jan 2025 14:45:51 +0100 Subject: [PATCH 194/332] TWS --- Mesh_2/test/Mesh_2/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 3501f20ea20..877831c292e 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -15,6 +15,6 @@ foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() -if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) +if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) target_compile_features(test_meshing PRIVATE cxx_std_20) endif() From 56bb4191ed82c12aa1cd9fd9149450ed0fa34684 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 10 Jan 2025 22:01:18 +0100 Subject: [PATCH 195/332] cleanup existing code --- .clang-format | 10 +- Stream_support/include/CGAL/IO/io.h | 47 +- .../CGAL/Constrained_triangulation_plus_2.h | 66 +- .../Polyline_constraint_hierarchy_2.h | 617 +++++++++--------- .../CGAL/_test_cls_const_triang_plus_2.h | 5 +- 5 files changed, 379 insertions(+), 366 deletions(-) diff --git a/.clang-format b/.clang-format index ea7a2200d52..369aadbb15f 100644 --- a/.clang-format +++ b/.clang-format @@ -2,14 +2,16 @@ Language: Cpp BasedOnStyle: LLVM AccessModifierOffset: -2 +AllowShortFunctionsOnASingleLine: true BinPackParameters: false +BreakConstructorInitializers: BeforeComma BreakBeforeBraces: Custom BraceWrapping: AfterCaseLabel: false AfterClass: true AfterControlStatement: MultiLine AfterEnum: false - AfterFunction: true + AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: true @@ -20,9 +22,9 @@ BraceWrapping: BeforeLambdaBody: false BeforeWhile: false IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: true - SplitEmptyNamespace: true + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false ColumnLimit: 120 # Force pointers to the type for C++. DerivePointerAlignment: false diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 74f8dd34bab..3f8202d8325 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -1004,12 +1004,53 @@ namespace std { template struct formatter, CharT> : public std::formatter> { + using context = std::basic_format_parse_context; + using context_iterator = typename context::iterator; + + constexpr context_iterator parse_non_precision_chars(context_iterator it, context_iterator end) + { + constexpr std::array letters = {CharT('A'), CharT('B'), CharT('P')}; + constexpr std::array modes = {CGAL::IO::ASCII, CGAL::IO::BINARY, CGAL::IO::PRETTY}; + + if(it == end) + throw "it != end is a precondition of `parse_non_precision_chars(it, end)`"; + + if(*it == CharT('}')) + return it; + if(*it == CharT('.')) + return it; + + for(const auto& letter : letters) { + if(*it == letter) { + mode = modes[std::addressof(letter) - letters.data()]; + return ++it; + } + } + + throw std::format_error(R"( +formatter for CGAL::Output_rep only support stream mode and precision, like `{:X.6}` where X is + - `A` (or missing) for ASCII mode, + - `B` for BINARY mode, or + - `P` for PRETTY mode +)"); + } + constexpr auto parse(std::basic_format_parse_context& ctx) { auto it = ctx.begin(); const auto end = ctx.end(); - if(it == end) - return it; + + if(it == end) return it; + + { + auto next = it; + do { + next = parse_non_precision_chars(it, end); + } while(next != it && (it = next) != end); + } + + if(it == end) return it; + if(*it != CharT('.')) { if(*it == CharT('}')) return it; throw std::format_error("formatter for CGAL::Output_rep only support precision, like `{:.6}`"); @@ -1031,12 +1072,14 @@ struct formatter, CharT> : public std::formatter &rep, FormatContext& ctx) const { std::basic_stringstream ss; + CGAL::IO::set_mode(ss, mode); ss.precision(precision); ss << rep; return std::formatter>::format(ss.str(), ctx); } int precision = 17; + CGAL::IO::Mode mode = CGAL::IO::ASCII; }; } // namespace std diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 10cdecc984f..ac3889c5341 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -427,11 +427,11 @@ public: hierarchy.swap(cid, aux); remove_constraint(aux, std::back_inserter(fc)); - if(head.vl_ptr()){ + if(head != nullptr){ hierarchy.concatenate2(head, cid); } - if(tail.vl_ptr()){ + if(tail != nullptr){ hierarchy.concatenate(cid, tail); } fc.write_faces(out); @@ -514,7 +514,7 @@ public: pos = vertices_in_constraint_begin(aux2); concatenate(aux1, aux2); - if(head.vl_ptr()){ + if(head != nullptr){ //std::cout << "concatenate head" << std::endl; remove_constraint(cid, std::back_inserter(fc)); hierarchy.concatenate(head, aux1); @@ -524,7 +524,7 @@ public: head = cid; } - if(tail.vl_ptr()){ + if(tail != nullptr){ //std::cout << "concatenate tail" << std::endl; concatenate(head, tail); } @@ -559,10 +559,8 @@ public: insert_subconstraint(vertices[j], vertices[j+1], std::back_inserter(fc)); } } - for(Vertices_in_constraint_iterator vcit = vertices_in_constraint_begin(ca); - vcit != vertices_in_constraint_end(ca); - vcit++){ - insert_incident_faces(vcit, out); + for(auto vh : vertices_in_constraint(ca)) { + out = insert_incident_faces(vh, out); } //AF vertices_in_constraint_begin(ca)->fixed() = true; // Vertices_in_constraint_iterator end = std::prev(vertices_in_constraint_end(ca)); @@ -593,7 +591,7 @@ private: std::size_t n = vertices.size(); if(n == 1){ - return nullptr; + return Constraint_id{}; } CGAL_assertion(n >= 2); @@ -628,12 +626,12 @@ public: } } - for(Constraint_iterator cit = constraints_begin(); cit != constraints_end(); ++cit){ - os << (*cit).second->all_size(); - for(Vertex_handle vh : vertices_in_constraint(*cit)){ - os << " " << V[vh]; - } - os << std::endl; + for(const auto& cid : constraints()) { + os << cid.size(); + for(Vertex_handle vh : vertices_in_constraint(cid)) { + os << " " << V[vh]; + } + os << std::endl; } } @@ -672,16 +670,14 @@ public: { // protects against inserting a zero length constraint if(va == vb){ - return Constraint_id(nullptr); + return Constraint_id(); } // protects against inserting twice the same constraint Constraint_id cid = hierarchy.insert_constraint(va, vb); if (va != vb && (cid != nullptr) ) insert_subconstraint(va,vb,out); - for(Vertices_in_constraint_iterator vcit = vertices_in_constraint_begin(cid); - vcit != vertices_in_constraint_end(cid); - vcit++){ - insert_incident_faces(vcit, out); + for(auto vh : vertices_in_constraint(cid)) { + out = insert_incident_faces(vh, out); } return cid; } @@ -711,14 +707,11 @@ public: template void remove_constraint(Constraint_id cid, OutputIterator out) { - std::list vertices(hierarchy.vertices_in_constraint_begin(cid), - hierarchy.vertices_in_constraint_end(cid)); + std::vector vertices(hierarchy.vertices_in_constraint_begin(cid), + hierarchy.vertices_in_constraint_end(cid)); hierarchy.remove_constraint(cid); - for(typename std::list::iterator it = vertices.begin(), - succ = it; - ++succ != vertices.end(); - ++it){ + for(auto it = vertices.begin(), succ = it; ++succ != vertices.end(); ++it){ if(! is_subconstraint(*it, *succ)){ // this checks whether other constraints pass Face_handle fh; int i; @@ -833,29 +826,24 @@ public: protected: template - void insert_incident_faces(Vertices_in_constraint_iterator vcit, OutputItertator out) + OutputItertator insert_incident_faces(Vertex_handle vh, OutputItertator out) { - Vertex_handle vh = *vcit; Face_circulator fc = incident_faces(vh), done = fc; - Face_circulator null ; - if ( fc != null ) - { + if(fc != nullptr) { do { Face_handle fh = fc; - out = fh; - out++; - fc++; - }while(fc != done); + *out++ = fh; + } while(++fc != done); } + return out; } - void insert_subconstraint(Vertex_handle vaa, Vertex_handle vbb) - { - insert_subconstraint(vaa,vbb,Emptyset_iterator()); - } +{ + insert_subconstraint(vaa,vbb,Emptyset_iterator()); +} diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 0b59735b50e..761d7f75871 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -47,23 +47,27 @@ public: typedef std::pair Constraint; typedef std::pair Subconstraint; + using size_type = std::size_t; + private: class Node { public: explicit Node(Vertex_handle vh, bool input = false) - : vertex_(vh), point_(vertex_->point()), input(input) + : vertex_(vh), point_(vertex_->point()), input_(input) {} const Point& point() const { return point_; } Vertex_handle vertex() const { return vertex_; } + bool& input() { return input_; } + const bool& input() const { return input_; } private: Vertex_handle vertex_; Point point_; public: - bool input; + bool input_; }; typedef CGAL::Skiplist Vertex_list; - typedef std::list Constraint_list; + typedef Vertex_list* Vertex_list_ptr; public: // the base line is always @@ -91,51 +95,75 @@ public: , std::bidirectional_iterator_tag , Vertex_handle> { + typedef typename Vertex_list::skip_iterator Base_it; public: Vertex_it() : Vertex_it::iterator_adaptor_() {} - Vertex_it(typename Vertex_list::skip_iterator it) : Vertex_it::iterator_adaptor_(it) {} + Vertex_it(Base_it it) : Vertex_it::iterator_adaptor_(it) {} operator Point_it() const { return Point_it(this->base()); } - bool& input() { return this->base()->input; } + bool& input() { return this->base()->input(); } + const bool& input() const { return this->base()->input(); } + + friend bool operator==(const Vertex_it& a, const Base_it& it) { return a.base() == it; } + friend bool operator==(const Base_it& it, const Vertex_it& a) { return a.base() == it; } + friend bool operator!=(const Vertex_it& a, const Base_it& it) { return a.base() != it; } + friend bool operator!=(const Base_it& it, const Vertex_it& a) { return a.base() != it; } + private: friend class boost::iterator_core_access; Vertex_handle dereference() const { return this->base()->vertex(); } }; - typedef typename Constraint_list::iterator Constraint_it; + struct Constraint_id + { + Vertex_list_ptr vl = nullptr; + size_type id = std::numeric_limits::max(); - struct Constraint_id { - Vertex_list* second; + Constraint_id(std::nullptr_t = nullptr) {} + Constraint_id(Vertex_list_ptr vl, size_type id) : vl(vl), id(id) {} - Constraint_id(): second(nullptr) {} + Vertex_list_ptr vl_ptr() const { return vl; } - Constraint_id(Vertex_list* vl) - : second(vl) - {} + operator std::pair() const{ + Edge edge = vl == nullptr ? Edge() : Edge(vl->front().vertex(), vl->back().vertex()); + return std::make_pair(edge, vl); + } - Vertex_list* vl_ptr() const {return second;} + Constraint_id& operator=(std::nullptr_t) { + vl = nullptr; + id = std::numeric_limits::max(); + return *this; + } + bool operator==(std::nullptr_t n) const { return vl == n; } + bool operator!=(std::nullptr_t n) const { return vl != n; } - operator std::pair,Vertex_list*>() + bool operator==(const Constraint_id& other) const { - if (second!=nullptr){ - return std::make_pair(std::make_pair(second->front().vertex(), - second->back().vertex()),second); - } - return std::make_pair(std::make_pair(Vertex_handle(),Vertex_handle()),second); + CGAL_assertion((vl == other.vl) == (id == other.id)); + return vl == other.vl; } - bool operator == (const Constraint_id& other) const + bool operator!=(const Constraint_id& other) const { - return second == other.second; - } - bool operator != (const Constraint_id& other) const - { - return second != other.second; + CGAL_assertion((vl == other.vl) == (id == other.id)); + return vl != other.vl; } - bool operator<(const Constraint_id& other) const{ - return second < other.second; + bool operator<(const Constraint_id& other) const + { + CGAL_assertion((vl == other.vl) == (id == other.id)); + return id < other.id; } - }; + + // forward a new Vertex_list operations + decltype(auto) begin() const { return vl->skip_begin(); } + decltype(auto) end() const { return vl->skip_end(); } + decltype(auto) elements() const { return vl->skip_elements(); } + decltype(auto) clear() const { return vl->clear(); } + decltype(auto) size() const { return vl->skip_size(); } + decltype(auto) front() const { return vl->front(); } + decltype(auto) back() const { return vl->back(); } + + }; // end Constraint_id class Pair_compare { Compare comp; @@ -158,16 +186,16 @@ public: class Context { friend class Polyline_constraint_hierarchy_2; private: - Vertex_list* enclosing; - Vertex_it pos; + Constraint_id enclosing; + Vertex_it pos; public: Context() : enclosing(nullptr) {} - Vertex_it vertices_begin()const { return enclosing->skip_begin();} + Vertex_it vertices_begin()const { return enclosing.begin();} Vertex_it current()const {return pos;} - Vertex_it vertices_end()const {return enclosing->skip_end();} + Vertex_it vertices_end()const {return enclosing.end();} Constraint_id id()const { return enclosing; } - std::size_t number_of_vertices() const {return enclosing->skip_size(); } + size_type number_of_vertices() const {return enclosing.size(); } }; typedef std::list Context_list; @@ -212,9 +240,11 @@ public: bool is_constrained_vertex(T v) const; Vertex_it vertices_in_constraint_begin(Constraint_id cid) const - { return cid.vl_ptr()->skip_begin(); } + { return cid.begin(); } Vertex_it vertices_in_constraint_end(Constraint_id cid) const - { return cid.vl_ptr()->skip_end(); } + { return cid.end(); } + auto vertices_in_constraint(Constraint_id cid) const + { return Iterator_range(cid.begin(), cid.end()); } Point_it points_in_constraint_begin(Constraint_id cid) const @@ -224,23 +254,22 @@ public: bool enclosing_constraint(Edge he, Constraint& hc) const; bool enclosing_constraint(T vaa, T vbb, T& va, T& vb) const; - bool enclosing_constraints(T vaa, T vbb, Constraint_list& hcl) const; bool next_along_sc(T va, T vb, T& w) const; void oriented_end(T va, T vb, T& vc) const; Context context(T va, T vb); - std::size_t number_of_enclosing_constraints(T va, T vb) const; + size_type number_of_enclosing_constraints(T va, T vb) const; Context_iterator contexts_begin(T va, T vb) const; Context_iterator contexts_end(T va, T vb) const; Iterator_range contexts_range(T va, T vb) const; - std::size_t number_of_constraints() const { return constraint_set.size();} - std::size_t number_of_subconstraints()const {return sc_to_c_map.size();} + size_type number_of_constraints() const { return constraint_set.size();} + size_type number_of_subconstraints()const {return sc_to_c_map.size();} // insert/remove void add_Steiner(T va, T vb, T vx); - Vertex_list* insert_constraint_old_API(T va, T vb); - Vertex_list* insert_constraint(T va, T vb); + Constraint_id insert_constraint_old_API(T va, T vb); + Constraint_id insert_constraint(T va, T vb); void append_constraint(Constraint_id cid, T va, T vb); void swap(Constraint_id first, Constraint_id second); void remove_constraint(Constraint_id cid); @@ -251,8 +280,8 @@ public: Vertex_it v, Vertex_it w); - std::size_t remove_points_without_corresponding_vertex(Constraint_id); - std::size_t remove_points_without_corresponding_vertex(); + size_type remove_points_without_corresponding_vertex(Constraint_id); + size_type remove_points_without_corresponding_vertex(); Constraint_id concatenate(Constraint_id first, Constraint_id second); Constraint_id concatenate2(Constraint_id first, Constraint_id second); @@ -278,13 +307,23 @@ public: C_iterator c_begin() const{ return constraint_set.begin(); } C_iterator c_end() const{ return constraint_set.end(); } + // Ranges + auto constraints() const { return Iterator_range(c_begin(), c_end()); } + const auto & subconstraints() const { return sc_to_c_map; } + + // Helper functions void copy(const Polyline_constraint_hierarchy_2& ch); void copy(const Polyline_constraint_hierarchy_2& ch, std::map& vmap); void swap(Polyline_constraint_hierarchy_2& ch); private: + Constraint_id new_constraint_id() const { + auto id = number_of_constraints() == 0 ? 0 : constraint_set.rbegin()->id + 1; + return Constraint_id(new Vertex_list, id); + } Edge make_edge(T va, T vb) const; + Edge make_edge(Edge e) { const auto& [va, vb] = e; return make_edge(va, vb); } Vertex_it get_pos(T va, T vb) const; bool get_contexts(T va, T vb, Context_iterator& ctxt, @@ -317,63 +356,58 @@ operator=(const Polyline_constraint_hierarchy_2& ch){ template void Polyline_constraint_hierarchy_2:: -copy(const Polyline_constraint_hierarchy_2& ch1) +copy(const Polyline_constraint_hierarchy_2& other) { // create a identity transfer vertex map - std::map vmap; - C_iterator cit1 = ch1.c_begin(); - for( ; cit1 != ch1.c_end(); ++cit1) { - Vertex_it vit = cit1->second->begin(); - for( ; vit != cit1->second->end(); ++vit) { - vmap[*vit] = *vit; + std::map vmap; + for(const auto& cid : other.constraints()) { + for(const auto& node : cid.elements()) { + auto v = node.vertex(); + vmap[v] = v; } } - copy(ch1, vmap); + copy(other, vmap); } template void Polyline_constraint_hierarchy_2:: -copy(const Polyline_constraint_hierarchy_2& ch1, std::map& vmap) +copy(const Polyline_constraint_hierarchy_2& other, std::map& vmap) // copy with a transfer vertex map { - std::map vlmap; + std::map cstr_map; clear(); // copy constraint_set - C_iterator cit1 = ch1.c_begin(); - for( ; cit1 != ch1.c_end(); ++cit1) { - Vertex_list* hvl1 = cit1->vl_ptr(); - Vertex_list* hvl2 = new Vertex_list; - vlmap[hvl1] = hvl2; - Vertex_it vit = hvl1->skip_begin(), end = hvl1->skip_end(); - for( ; vit != end; ++vit) hvl2->push_back(Node(vmap[*vit], vit.input())); - constraint_set.insert(hvl2); + for(const auto& cid1: other.constraints()) { + Constraint_id cid2 = new_constraint_id(); + cstr_map[cid1] = cid2; + for(const auto& node : cid1.elements()) { + cid2.vl_ptr()->push_back(Node(vmap[node.vertex()], node.input())); + } + constraint_set.insert(cid2); } // copy sc_to_c_map - Sc_iterator scit1 = ch1.sc_begin(); - for( ; scit1 != ch1.sc_end(); ++scit1) { - //vertices of the subconstraints - Vertex_handle uu2 = vmap[scit1->first.first]; - Vertex_handle vv2 = vmap[scit1->first.second]; - Context_list* hcl1 = scit1->second; - Context_list* hcl2 = new Context_list; - Context_iterator cit1 = hcl1->begin(); - for( ; cit1 != hcl1->end(); ++cit1){ + for(const auto& [edge1, hcl1] : other.subconstraints()) { + Context_list* hcl2 = new Context_list; + Vertex_handle uu2 = vmap[edge1.first]; + Vertex_handle vv2 = vmap[edge1.second]; + Edge edge2 = make_edge(uu2, vv2); + sc_to_c_map[edge2] = hcl2; + for(const Context& ctxt1 : *hcl1) { // vertices of the enclosing constraints Context ctxt2; - ctxt2.enclosing = vlmap[cit1->enclosing]; - ctxt2.pos = ctxt2.enclosing->skip_begin(); - Vertex_it aux = cit1->enclosing->skip_begin(); - while( aux != cit1->pos) { + ctxt2.enclosing = cstr_map[ctxt1.enclosing]; + ctxt2.pos = ctxt2.enclosing.begin(); + Vertex_it aux = ctxt1.enclosing.begin(); + while(aux != ctxt1.pos) { ++aux; ++ctxt2.pos; } hcl2->push_back(ctxt2); } - sc_to_c_map[make_edge(uu2,vv2)] = hcl2; } - comp = ch1.comp; + comp = other.comp; return; } @@ -383,6 +417,8 @@ void Polyline_constraint_hierarchy_2:: swap(Polyline_constraint_hierarchy_2& ch) { + using std::swap; + swap(comp, ch.comp); constraint_set.swap(ch.constraint_set); sc_to_c_map.swap(ch.sc_to_c_map); } @@ -412,7 +448,7 @@ enclosing_constraint(Edge he, Constraint& hc) const { Context_iterator hcit, past; if ( !get_contexts(he.first,he.second, hcit ,past)) return false; - hc = make_edge(hcit->enclosing->front(), hcit->enclosing->back()); + hc = make_edge(hcit->enclosing.front(), hcit->enclosing.back()); return true; } @@ -424,9 +460,9 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const { Context_iterator hcit, past; if ( !get_contexts(vaa,vbb, hcit ,past)) return false; - // va = hcit->enclosing->front().vertex(); - // vb = hcit->enclosing->back().vertex(); - // Vertex_list* vl = hcit->enclosing; + // va = hcit->enclosing.front().vertex(); + // vb = hcit->enclosing.back().vertex(); + // Vertex_list_ptr vl = hcit->enclosing; Vertex_it pos = hcit->pos; if(vaa != *pos){ std::swap(vaa,vbb); @@ -445,20 +481,6 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const return true; } -// af: obsolete -template -bool Polyline_constraint_hierarchy_2:: -enclosing_constraints(T vaa, T vbb , Constraint_list& hcl) const -{ - Context_iterator hcit, past; - if ( !get_contexts(vaa,vbb, hcit ,past)) return false; - for (; hcit!=past; hcit++) { - hcl.push_back(make_edge(hcit->enclosing->front(), - hcit->enclosing->back())); - } - return true; -} - template typename Polyline_constraint_hierarchy_2::Context Polyline_constraint_hierarchy_2:: @@ -470,7 +492,7 @@ context(T va, T vb) } template -std::size_t +typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) const { @@ -512,59 +534,34 @@ contexts_range(T va, T vb) const -> Iterator_range { template void Polyline_constraint_hierarchy_2:: -swap(Constraint_id first, Constraint_id second){ +swap(Constraint_id constr_a, Constraint_id constr_b) { + auto substitute_enclosing_in_vertex_list = [this](Vertex_list_ptr vl, Constraint_id old_id, Constraint_id new_id) { // We have to look at all subconstraints - for(Vertex_it it = first.vl_ptr()->skip_begin(), succ = it, end = first.vl_ptr()->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { + typename Sc_to_c_map::iterator scit = this->sc_to_c_map.find(make_edge(*it, *succ)); + CGAL_assertion(scit != this->sc_to_c_map.end()); + Context_list* hcl = scit->second; - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == first.vl_ptr()){ - ctit->enclosing = nullptr; - break; + // and replace the context of the constraint + for(Context_iterator ctit = hcl->begin(); ctit != hcl->end(); ctit++) { + if(ctit->enclosing == old_id) { + ctit->enclosing = new_id; + break; + } } } - } - // We have to look at all subconstraints - for(Vertex_it it = second.vl_ptr()->skip_begin(), succ = it, end = second.vl_ptr()->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + }; - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == second.vl_ptr()){ - ctit->enclosing = first.vl_ptr(); - break; - } - } - } - // We have to look at all subconstraints - for(Vertex_it it = first.vl_ptr()->skip_begin(), succ = it, end = first.vl_ptr()->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); + Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == nullptr){ - ctit->enclosing = second.vl_ptr(); - break; - } - } - } - first.vl_ptr()->swap(*second.vl_ptr()); + substitute_enclosing_in_vertex_list(constr_a_vl, constr_a, nullptr); + substitute_enclosing_in_vertex_list(constr_b_vl, constr_b, constr_a); + substitute_enclosing_in_vertex_list(constr_a_vl, nullptr, constr_b); + + constr_a_vl->swap(*constr_b_vl); } - template void Polyline_constraint_hierarchy_2:: @@ -572,7 +569,7 @@ remove_constraint(Constraint_id cid){ constraint_set.erase(cid); // We have to look at all subconstraints - for(Vertex_it it = cid.vl_ptr()->skip_begin(), succ = it, end = cid.vl_ptr()->skip_end(); + for(Vertex_it it = cid.begin(), succ = it, end = cid.end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -581,7 +578,7 @@ remove_constraint(Constraint_id cid){ // and remove the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == cid.vl_ptr()){ + if(ctit->enclosing == cid){ hcl->erase(ctit); break; } @@ -631,7 +628,7 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, it = uv_hcl->erase(it); }else{ // Remove the list item which points to v - Vertex_list* vertex_list = it->id().vl_ptr(); + Vertex_list_ptr vertex_list = it->id().vl_ptr(); Vertex_it vc_in_context = it->current(); vc_in_context = std::next(vc_in_context); vertex_list->skip(vc_in_context.base()); @@ -644,7 +641,7 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, it = vw_hcl->erase(it); }else{ // Remove the list item which points to v - Vertex_list* vertex_list = it->id().vl_ptr(); + Vertex_list_ptr vertex_list = it->id().vl_ptr(); Vertex_it vc_in_context = it->current(); vc_in_context = std::next(vc_in_context); vertex_list->skip(vc_in_context.base()); @@ -664,10 +661,10 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, template -std::size_t +typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2::remove_points_without_corresponding_vertex(Constraint_id cid) { - std::size_t n = 0; + size_type n = 0; for(Point_it it = points_in_constraint_begin(cid); it != points_in_constraint_end(cid);) { if(cid.vl_ptr()->is_skipped(it.base())) { @@ -681,10 +678,10 @@ Polyline_constraint_hierarchy_2::remove_points_without_correspo } template -std::size_t +typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2::remove_points_without_corresponding_vertex() { - std::size_t n = 0; + size_type n = 0; for(C_iterator it = constraint_set.begin(); it!= constraint_set.end(); ++it){ n+= remove_points_without_corresponding_vertex(*it); } @@ -694,12 +691,15 @@ Polyline_constraint_hierarchy_2::remove_points_without_correspo template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::concatenate(Constraint_id first, Constraint_id second) +Polyline_constraint_hierarchy_2::concatenate(Constraint_id constr_a, Constraint_id constr_b) { - constraint_set.erase(first); - constraint_set.erase(second); + // std::cerr << std::format("concatenate({}, {}) ", constr_a.id, constr_b.id) << std::endl; + Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); + Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); + constraint_set.erase(constr_a); + constraint_set.erase(constr_b); // We have to look at all subconstraints - for(Vertex_it it = second.vl_ptr()->skip_begin(), succ = it, end = second.vl_ptr()->skip_end(); + for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = constr_b_vl->skip_end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -708,23 +708,23 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs // and replace the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == second.vl_ptr()){ - ctit->enclosing = first.vl_ptr(); + if(ctit->enclosing == constr_b){ + ctit->enclosing = constr_a; break; } } } // now we really concatenate the vertex lists - // Note that all iterators pointing into second remain valid. + // Note that all iterators pointing into constr_a remain valid. // This concerns user code, as well as the data member "pos" of the Context class - first.vl_ptr()->pop_back(); // because it is the same as second.front() - Vertex_it back_it = first.vl_ptr()->skip_end(); + constr_a_vl->pop_back(); // because it is the same as constr_b_vl.front() + Vertex_it back_it = constr_a_vl->skip_end(); --back_it; - first.vl_ptr()->splice(first.vl_ptr()->skip_end(), *(second.vl_ptr()), second.vl_ptr()->skip_begin(), second.vl_ptr()->skip_end()); + constr_a_vl->splice(constr_a_vl->skip_end(), *(constr_b_vl), constr_b_vl->skip_begin(), constr_b_vl->skip_end()); - // Note that for VC8 with iterator debugging the iterators pointing into second + // Note that for VC8 with iterator debugging the iterators pointing into constr_b // are NOT valid So we have to update them - for(Vertex_it it = back_it, succ = it, end = first.vl_ptr()->skip_end(); + for(Vertex_it it = back_it, succ = it, end = constr_a_vl->skip_end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -733,26 +733,28 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs // and update pos in the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == first.vl_ptr()){ + if(ctit->enclosing == constr_a){ ctit->pos = it; break; } } - } - constraint_set.insert(first); + } + constraint_set.insert(constr_a); - delete second.vl_ptr(); - return first; + delete constr_b_vl; + return constr_a; } template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::concatenate2(Constraint_id first, Constraint_id second) +Polyline_constraint_hierarchy_2::concatenate2(Constraint_id constr_a, Constraint_id constr_b) { - constraint_set.erase(first); - constraint_set.erase(second); + Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); + Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); + constraint_set.erase(constr_a); + constraint_set.erase(constr_b); // We have to look at all subconstraints - for(Vertex_it it = first.vl_ptr()->skip_begin(), succ = it, end = first.vl_ptr()->skip_end(); + for(Vertex_it it = constr_a_vl->skip_begin(), succ = it, end = constr_a_vl->skip_end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -761,22 +763,22 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir // and replace the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == first.vl_ptr()){ - ctit->enclosing = second.vl_ptr(); + if(ctit->enclosing == constr_a){ + ctit->enclosing = constr_b; break; } } } // now we really concatenate the vertex lists - // Note that all iterators pointing into second remain valid. - first.vl_ptr()->pop_back(); // because it is the same as second.front() - Vertex_it back_it = second.vl_ptr()->skip_begin(); + // Note that all iterators pointing into constr_b remain valid. + constr_a_vl->pop_back(); // because it is the same as constr_b_vl.front() + Vertex_it back_it = constr_b_vl->skip_begin(); - second.vl_ptr()->splice(second.vl_ptr()->skip_begin(), *(first.vl_ptr()), first.vl_ptr()->skip_begin(), first.vl_ptr()->skip_end()); + constr_b_vl->splice(constr_b_vl->skip_begin(), *(constr_a_vl), constr_a_vl->skip_begin(), constr_a_vl->skip_end()); - // Note that for VC8 with iterator debugging the iterators pointing into second + // Note that for VC8 with iterator debugging the iterators pointing into constr_a // are NOT valid So we have to update them - for(Vertex_it it = second.vl_ptr()->skip_begin(), succ = it, end = back_it; + for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = back_it; ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -785,16 +787,16 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir // and update pos in the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == second.vl_ptr()){ + if(ctit->enclosing == constr_b){ ctit->pos = it; break; } } } - constraint_set.insert(second); + constraint_set.insert(constr_b); - delete first.vl_ptr(); - return second.vl_ptr(); + delete constr_a_vl; + return constr_b; } @@ -803,21 +805,23 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir // returns the new constraint template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::split(Constraint_id first, Vertex_it vcit) +Polyline_constraint_hierarchy_2::split(Constraint_id constr, Vertex_it vcit) { - constraint_set.erase(first); - Vertex_list* second = new Vertex_list; - second->splice(second->skip_end(), *(first.vl_ptr()), vcit.base(), first.vl_ptr()->skip_end()); - first.vl_ptr()->push_back(second->front()); // Duplicate the common vertex - Vertex_it vit = second->skip_begin(); + Constraint_id new_constr = new_constraint_id(); + constraint_set.erase(constr); + Vertex_list_ptr new_vl = new_constr.vl_ptr(); + Vertex_list_ptr constr_vl = constr.vl_ptr(); + new_vl->splice(new_vl->skip_end(), *(constr_vl), vcit.base(), constr_vl->skip_end()); + constr_vl->push_back(new_vl->front()); // Duplicate the common vertex + Vertex_it vit = new_vl->skip_begin(); vit.input() = true; - vit = first.vl_ptr()->skip_end(); + vit = constr_vl->skip_end(); --vit; vit.input() = true; - constraint_set.insert(first); - constraint_set.insert(second); + constraint_set.insert(constr); + constraint_set.insert(new_constr); // We have to look at all subconstraints - for(Vertex_it it = second->skip_begin(), succ = it, end = second->skip_end(); + for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -826,32 +830,34 @@ Polyline_constraint_hierarchy_2::split(Constraint_id first, Ver // and replace the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == first.vl_ptr()){ - ctit->enclosing = second; + if(ctit->enclosing == constr){ + ctit->enclosing = new_constr; break; } } } - return second; + return new_constr; } template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::split2(Constraint_id first, Vertex_it vcit) +Polyline_constraint_hierarchy_2::split2(Constraint_id constr, Vertex_it vcit) { - constraint_set.erase(first); - Vertex_list* second = new Vertex_list; - second->splice(second->skip_end(), *first.vl_ptr(), first.vl_ptr()->skip_begin(), vcit.base()); - second->push_back(first.vl_ptr()->front()); // Duplicate the common vertex - Vertex_it vit = second->skip_end(); + Constraint_id new_constr = new_constraint_id(); + constraint_set.erase(constr); + Vertex_list_ptr new_vl = new_constr.vl_ptr(); + Vertex_list_ptr constr_vl = constr.vl_ptr(); + new_vl->splice(new_vl->skip_end(), *constr_vl, constr_vl->skip_begin(), vcit.base()); + new_vl->push_back(constr_vl->front()); // Duplicate the common vertex + Vertex_it vit = new_vl->skip_end(); --vit; vit.input() = true; - vit = first.vl_ptr()->skip_begin(); + vit = constr_vl->skip_begin(); vit.input() = true; - constraint_set.insert(first); - constraint_set.insert(second); + constraint_set.insert(constr); + constraint_set.insert(new_constr); // We have to look at all subconstraints - for(Vertex_it it = second->skip_begin(), succ = it, end = second->skip_end(); + for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); @@ -860,13 +866,13 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id first, Ve // and replace the context of the constraint for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == first.vl_ptr()){ - ctit->enclosing = second; + if(ctit->enclosing == constr){ + ctit->enclosing = new_constr; break; } } } - return second; + return new_constr; } @@ -875,71 +881,40 @@ when a constraint is inserted, it is, at first, both a constraint and a subconstraint */ template -typename Polyline_constraint_hierarchy_2::Vertex_list* +typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2:: insert_constraint(T va, T vb){ - Edge he = make_edge(va, vb); - Vertex_list* children = new Vertex_list; - Context_list* fathers; - #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level << "C_hierachy.insert_constraint( " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); - if(scit == sc_to_c_map.end()){ + Edge he = make_edge(va, vb); + Constraint_id cid = new_constraint_id(); + auto children = cid.vl_ptr(); + auto& fathers = sc_to_c_map[he]; + if(fathers == nullptr){ fathers = new Context_list; - sc_to_c_map.insert(std::make_pair(he,fathers)); - } else { - fathers = scit->second; } children->push_front(Node(va, true)); // was he.first children->push_back(Node(vb, true)); // was he.second - constraint_set.insert(children); + constraint_set.insert(cid); Context ctxt; - ctxt.enclosing = children; - ctxt.pos = children->skip_begin(); + ctxt.enclosing = cid; + ctxt.pos = children->skip_begin(); fathers->push_front(ctxt); - return children; + return cid; } template -typename Polyline_constraint_hierarchy_2::Vertex_list* +typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2:: insert_constraint_old_API(T va, T vb){ - Edge he = make_edge(va, vb); - - Vertex_list* children = new Vertex_list; - Context_list* fathers; - -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS - using CGAL::IO::oformat; - std::cerr << CGAL::internal::cdt_2_indent_level - << "C_hierachy.insert_constraint_old_API( " - << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); - if(scit == sc_to_c_map.end()){ - fathers = new Context_list; - sc_to_c_map.insert(std::make_pair(he,fathers)); - } else { - fathers = scit->second; - } - - children->push_front(Node(va, true)); // was he.first - children->push_back(Node(vb, true)); // was he.second - constraint_set.insert(children); - Context ctxt; - ctxt.enclosing = children; - ctxt.pos = children->skip_begin(); - fathers->push_front(ctxt); - - return children; + return insert_constraint(va, vb); } @@ -947,29 +922,24 @@ template void Polyline_constraint_hierarchy_2:: append_constraint(Constraint_id cid, T va, T vb){ - Edge he = make_edge(va, vb); - Context_list* fathers; - #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level << "C_hierachy.append_constraint( ..., " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); - if(scit == sc_to_c_map.end()){ + Edge he = make_edge(va, vb); + auto& fathers = sc_to_c_map[he]; + if(fathers == nullptr){ fathers = new Context_list; - sc_to_c_map.insert(std::make_pair(he,fathers)); - } else { - fathers = scit->second; } - typename Vertex_list::skip_iterator bit = cid.vl_ptr()->skip_end(); - --bit; + typename Vertex_list::skip_iterator last_pos = std::prev(cid.end()); + CGAL_assertion(last_pos->vertex() == va); cid.vl_ptr()->push_back(Node(vb, true)); Context ctxt; - ctxt.enclosing = cid.vl_ptr(); - ctxt.pos = bit; + ctxt.enclosing = cid; + ctxt.pos = last_pos; fathers->push_front(ctxt); } @@ -978,17 +948,15 @@ template void Polyline_constraint_hierarchy_2:: clear() { - C_iterator cit; - Sc_iterator scit; // clean and delete vertices lists - for(cit=constraint_set.begin(); cit != constraint_set.end(); cit++){ - cit->vl_ptr()->clear(); - delete cit->vl_ptr(); + for(auto cid : constraints()) { + cid.clear(); + delete cid.vl_ptr(); } // clean and delete context lists - for(scit=sc_to_c_map.begin(); scit != sc_to_c_map.end(); scit++){ - (*scit).second->clear(); - delete (*scit).second; + for(auto& [_, cl_ptr] : sc_to_c_map) { + cl_ptr->clear(); + delete cl_ptr; } sc_to_c_map.clear(); constraint_set.clear(); @@ -1004,15 +972,21 @@ next_along_sc(T va, T vb, T& w) const Context_iterator ctxtit, past; if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); - Vertex_it pos; - for( ; ctxtit != past; ctxtit++){ - pos = ctxtit->pos; - if((*pos)==va) { - ++pos; ++pos; - if (pos != ctxtit->enclosing->end()) { w=(*pos); return true;} - } - else { - if (pos != ctxtit->enclosing->begin()) {--pos; w=(*pos); return true;} + for(; ctxtit != past; ctxtit++) { + Vertex_it pos = ctxtit->pos; + if((*pos) == va) { + ++pos; + ++pos; + if(pos != ctxtit->enclosing.end()) { + w = *pos; + return true; + } + } else { + if(pos != ctxtit->enclosing.begin()) { + --pos; + w = *pos; + return true; + } } } return false; @@ -1040,14 +1014,14 @@ remove_Steiner(T v, T va, T vb) for(Context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ pos = ctit->pos; if((*pos)==va) pos++; - pos = ctit->enclosing->erase(pos); + pos = ctit->enclosing.vl_ptr()->erase(pos); ctit->pos = --pos; } sc_to_c_map.erase(make_edge(va,v)); sc_to_c_map.erase(make_edge(v,vb)); delete hcl2; - sc_to_c_map.insert(std::make_pair(make_edge(va,vb),hcl1)); + sc_to_c_map.emplace(make_edge(va,vb),hcl1); } @@ -1091,7 +1065,7 @@ add_Steiner(T va, T vb, T vc){ // insert vc in enclosing constraint pos = ctit->current(); ++pos; - pos = ctit->enclosing->insert(pos.base(), Node(vc)); + pos = ctit->enclosing.vl_ptr()->insert(pos.base(), Node(vc)); --pos; // set ctxt to the context of (vc,vb) @@ -1114,14 +1088,14 @@ add_Steiner(T va, T vb, T vc){ hcl3->splice(hcl3->end(), *hcl); delete hcl; } - else sc_to_c_map.insert(std::make_pair(make_edge(va,vc), hcl)); + else sc_to_c_map.emplace(make_edge(va,vc), hcl); if (get_contexts(vc,vb,hcl3)) {// (vc,vb) is already a subconstraint hcl3->splice(hcl3->end(),*hcl2); delete hcl2; } - else sc_to_c_map.insert(std::make_pair(make_edge(vc,vb), hcl2)); + else sc_to_c_map.emplace(make_edge(vc,vb), hcl2); sc_to_c_map.erase(make_edge(va,vb)); @@ -1146,7 +1120,7 @@ get_contexts(T va, T vb, Context_list* & hcl) const { Sc_iterator sc_iter = sc_to_c_map.find(make_edge(va,vb)); if( sc_iter == sc_to_c_map.end() ) return(false); - hcl = (*sc_iter).second; + hcl = sc_iter->second; return true; } @@ -1185,9 +1159,9 @@ oriented_end(T va, T vb, T& vc) const Context_iterator ctxt, past; if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); if(*(ctxt->pos) == va) - vc = ctxt->enclosing->back(); + vc = ctxt->enclosing.back(); else - vc = ctxt->enclosing->front(); + vc = ctxt->enclosing.front(); } @@ -1196,17 +1170,26 @@ void Polyline_constraint_hierarchy_2:: print() const { - C_iterator hcit; - std::map vertex_num; + std::map vertex_num_map; int num = 0; - for(hcit = c_begin(); hcit != c_end(); hcit++) { - Constraint_id cid = (*hcit); - Vertex_it vit =cid.vl_ptr()->skip_begin(), end = cid.vl_ptr()->skip_end(); - for (;vit != end; vit++){ - num ++; - vertex_num.insert(std::make_pair((*vit), num)); + for(const auto& cid : constraints()) { + for (const auto& node : cid.elements()){ + vertex_num_map.emplace(node.vertex(), ++num); } } + + struct Vertex_num { + std::map& vertex_num_map; + int operator[](T v) const { +#ifndef CGAL_CDT_2_DEBUG_INTERSECTIONS + auto it = vertex_num_map.find(v); + if(it == vertex_num_map.end()) return -1; + return it->second; +#else + return v->time_stamp(); +#endif + } + } vertex_num{vertex_num_map}; // typename std::map::iterator vnit = vertex_num.begin(); // for(; vnit != vertex_num.end(); vnit++) { // vnit->second = ++num; @@ -1214,41 +1197,35 @@ print() const // << std::endl; // } - C_iterator cit=c_begin(); - Sc_iterator scit=sc_begin(); - - for(; cit != c_end(); cit++){ - std::cout << std::endl ; - std::cout << "constraint " ; - std::cout << cit->vl_ptr(); - std::cout << " subconstraints " ; - Vertex_it vit = (*cit).vl_ptr()->skip_begin(), end = (*cit).vl_ptr()->skip_end(); - for(; vit != end; vit++){ - std::cout << vertex_num[*vit] <<" "; + for(const auto& cid : constraints()) { + std::cout << std::endl; + std::cout << "constraint(" << cid.id << ") "; + std::cout << cid.vl_ptr(); + std::cout << " subconstraints "; + for(const auto& node : cid.elements()) { + std::cout << vertex_num[node.vertex()] << " "; } - vit = (*cit).vl_ptr()->skip_begin(), end = (*cit).vl_ptr()->skip_end(); - for(; vit != end; vit++){ - std::cout << (*vit)->point() <<" "; + std::cout << ": "; + for(const auto& node : cid.elements()) { + std::cout << node.point() << " "; } } - std::cout << std::endl ; - for(;scit != sc_end(); scit++){ - std::cout << "subconstraint " ; - std::cout << vertex_num[scit->first.first] << " " - << vertex_num[scit->first.second]; + std::cout << std::endl; + for(const auto& [edge, _] : subconstraints()) { + std::cout << "subconstraint "; + std::cout << vertex_num[edge.first] << " " << vertex_num[edge.second]; Context_iterator cb, ce; - get_contexts(scit->first.first, scit->first.second, cb, ce); + get_contexts(edge.first, edge.second, cb, ce); - std::cout << " enclosing " ; + std::cout << " enclosing "; for(; cb != ce; cb++) { - std::cout << cb->id().vl_ptr(); - std::cout << " " ; + std::cout << "(" << cb->id().id << ") " << cb->id().vl_ptr(); + std::cout << " "; } - std::cout << std::endl ; + std::cout << std::endl; } return; } - } //namespace CGAL #endif // CGAL_POLYLINE_CONSTRAINT_HIERARCHY_2_H diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_const_triang_plus_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_const_triang_plus_2.h index e2cc92ba8b7..a571a364395 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_const_triang_plus_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_const_triang_plus_2.h @@ -81,6 +81,9 @@ _test_cls_const_triang_plus_2( const TrP & ) assert( (*currentin2 == va && *++currentin2 == vb) || (*currentin2 == vb && *++currentin2 == va)); + //test copy of the hierarchy + auto hierarchy = trp.hierarchy_ref(); + //test copy and swap std::cout << "test copy and swap" << std::endl; TrP trp2(trp); @@ -151,7 +154,7 @@ _test_cls_const_triang_plus_2( const TrP & ) std::size_t n = 0; for(Constraint_iterator cit = trp.constraints_begin(); cit != trp.constraints_end(); ++cit){ Constraint_id cid = *cit; - n += cid.second->all_size(); + n += cid.vl_ptr()->all_size(); } assert( n == 9); } From e03ba91f5491522e21edeb25d6dc92abccdb281f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 10 Jan 2025 22:11:53 +0100 Subject: [PATCH 196/332] Boost >= 1.74 is now required --- .../doc/Documentation/Third_party.txt | 3 +-- .../advanced/Configuration_variables.txt | 21 ------------------- Installation/CHANGES.md | 3 +++ .../cmake/modules/CGAL_SetupBoost.cmake | 5 +++-- .../CGAL_SetupCGAL_CoreDependencies.cmake | 2 +- 5 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index 7875c5791d3..5739b44d85e 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -54,7 +54,7 @@ or `h The \stl comes with the compiler, and as such no installation is required. \subsection thirdpartyBoost Boost -Version 1.72 or later +Version 1.74 or later The \boost libraries are a set of portable C++ source libraries. Most of \boost libraries are header-only, but a few of them need to be compiled or @@ -86,7 +86,6 @@ 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. diff --git a/Documentation/doc/Documentation/advanced/Configuration_variables.txt b/Documentation/doc/Documentation/advanced/Configuration_variables.txt index d4ac891a30f..399d3e3ea73 100644 --- a/Documentation/doc/Documentation/advanced/Configuration_variables.txt +++ b/Documentation/doc/Documentation/advanced/Configuration_variables.txt @@ -103,21 +103,11 @@ other but never both. \subsection installation_boost Boost Libraries -\subsubsection inst_boost_1_72_plus Version 1.72 and Later Starting from \boost 1.72, the cmake config mode can be used for configuring the \boost version to use by setting the environment variable `Boost_DIR` to the path containing the file `BoostConfig.cmake`. For example if you manually installed \boost 1.77 with `--prefix=`, then you should set `Boost_DIR=/lib/cmake/Boost-1.77.0`. -\subsubsection inst_boost_up_2_1_69 Version 1.69 and Earlier - -\warning If you have a version of Boost greater than 1.69 already installed on your system, and you want to configure and compile with an earlier version of Boost, then you will need to set the CMake variable `Boost_NO_BOOST_CMAKE` to `ON` (otherwise the `FindBoost.cmake` module of CMake will start searching for `BoostConfig.cmake`, and ignore the `BOOST_ROOT` variable). - -In most cases, if \boost is not automatically found, setting the `BOOST_ROOT` -variable is enough. If it is not, you can specify the header and library -directories individually. You can also provide the full pathname to a specific compiled library -if it cannot be found in the library directory or its name is non-standard. - By default, when \boost binary libraries are needed, the shared versions are used if present. You can set the variable `CGAL_Boost_USE_STATIC_LIBS` to `ON` if you want to link @@ -128,17 +118,6 @@ the `.dll` files are found by the dynamic linker, at run time. For example, you can add the path to the \boost `.dll` to the `PATH` environment variable. -| Variable | Description | Type | -| :- | :- | :- | -| `BOOST_ROOT`\cgalFootnote{The environment variable can be spelled either \cgalFootnoteCode{BOOST_ROOT} or \cgalFootnoteCode{BOOSTROOT}} | Root directory of your \boost installation | Either CMake or Environment | -| `Boost_INCLUDE_DIR` | Directory containing the `boost/version.hpp` file | CMake | -| `BOOST_INCLUDEDIR` | Idem | Environment | -| `Boost_LIBRARY_DIRS` | Directory containing the compiled \boost libraries | CMake | -| `BOOST_LIBRARYDIR` | Idem | Environment | -| `Boost_(xyz)_LIBRARY_RELEASE` | Full pathname to a release build of the compiled 'xyz' \boost library | CMake | -| `Boost_(xyz)_LIBRARY_DEBUG` | Full pathname to a debug build of the compiled 'xyz' \boost library | CMake | - - \subsection installation_gmp GMP and MPFR Libraries Under Windows, auto-linking is used, so only the directory diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..291dc13ae41 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -3,6 +3,9 @@ ## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +### General Changes +- The minimal supported version of Boost is now 1.74.0. + ### [Algebraic Kernel](https://doc.cgal.org/6.1/Manual/packages.html#PkgAlgebraicKernelD) - **Breaking change**: Classes based on the RS Library are no longer provided. diff --git a/Installation/cmake/modules/CGAL_SetupBoost.cmake b/Installation/cmake/modules/CGAL_SetupBoost.cmake index ee561027370..bd8a6dfe6f4 100644 --- a/Installation/cmake/modules/CGAL_SetupBoost.cmake +++ b/Installation/cmake/modules/CGAL_SetupBoost.cmake @@ -17,9 +17,10 @@ set ( CGAL_Boost_Setup TRUE ) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake) -find_package( Boost 1.72 REQUIRED ) +cmake_policy(VERSION 3.12...3.30) +find_package( Boost 1.74 REQUIRED ) -if(Boost_FOUND AND Boost_VERSION VERSION_LESS 1.72) +if(Boost_FOUND AND Boost_VERSION VERSION_LESS 1.74) if(DEFINED Boost_DIR AND NOT Boost_DIR) # Unset that cache variable that is set in the cache by FindBoost # (while it was searching for boost-cmake). diff --git a/Installation/cmake/modules/CGAL_SetupCGAL_CoreDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGAL_CoreDependencies.cmake index 94d2d839375..710a5d7e579 100644 --- a/Installation/cmake/modules/CGAL_SetupCGAL_CoreDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGAL_CoreDependencies.cmake @@ -48,7 +48,7 @@ set_property(GLOBAL PROPERTY CGAL_Core_FOUND TRUE) # function(CGAL_setup_CGAL_Core_dependencies target) - find_package( Boost 1.72 REQUIRED ) + find_package( Boost 1.74 REQUIRED ) if (NOT CGAL_DISABLE_GMP AND GMP_FOUND) use_CGAL_GMP_support(CGAL_Core INTERFACE) endif() From 93ac1845fa7d2d8be71a7aaef1a1db9ef30ff5d1 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 10 Jan 2025 22:13:58 +0100 Subject: [PATCH 197/332] CDT_plus_2 hierarchy: add Edge_iterator, that is deterministic That uses Boost.STLInterfaces from Boost >= 1.74. --- Mesh_2/include/CGAL/Mesh_2/Refine_edges.h | 22 +-- .../Polyline_constraint_hierarchy_2.h | 125 ++++++++++++++++++ 2 files changed, 126 insertions(+), 21 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index b2bb3b50b3d..055ae0d7a21 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -344,27 +344,7 @@ protected: void scan_triangulation_impl(Tag_true) { - // with constraint hierarchy - - // create a vector of pairs of vertex handles, from the subconstraints - // and sort it to ensure the determinism - std::vector> subconstraints_vector(tr.number_of_subconstraints()); - std::transform(tr.subconstraints_begin(), tr.subconstraints_end(), subconstraints_vector.begin(), - [](const auto& sc) { - return std::array{sc.first.first, sc.first.second}; - }); - - auto comp_vh = [&] (Vertex_handle va, Vertex_handle vb) { - return tr.compare_xy(va->point(), vb->point()) == SMALLER; - }; - auto comp_pair_vh = [&] (const auto& e1, const auto& e2) { - return comp_vh(e1[0], e2[0]) || - (!comp_vh(e2[0], e1[0]) && comp_vh(e1[1], e2[1])); - }; - - std::sort(subconstraints_vector.begin(), subconstraints_vector.end(), comp_pair_vh); - - for(const auto& [v1, v2] : subconstraints_vector) + for(const auto& [v1, v2] : tr.hierarchy_ref().edges()) { if(!is_locally_conform(tr, v1, v2) ){ add_constrained_edge_to_be_conformed(v1, v2); diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 761d7f75871..5033898200c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -22,6 +22,8 @@ #include #include +#include + #include #include #include @@ -212,6 +214,115 @@ public: typedef typename Sc_to_c_map::const_iterator Sc_iterator; typedef Sc_iterator Subconstraint_iterator; + class Edge_iterator : public boost::stl_interfaces::proxy_iterator_interface< +#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Edge_iterator, +#endif + std::bidirectional_iterator_tag, + Edge> + { + using base_type = boost::stl_interfaces::proxy_iterator_interface< +#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Edge_iterator, +#endif + std::bidirectional_iterator_tag, + Edge>; + + const Constraint_set* constraint_set = nullptr; + C_iterator constraint_it{}; + Vertex_it vertex_it{}; + + public: + // - The object is singular if and only if `constraint_set==nullptr`. + // + // - The end value is when `constraint_it` is the end iterator of `constraint_set`. + // In that case `vertex_it` must be singular. + // + // - Otherwise all members must be valid pointers or dereferencable iterators. + + bool equal(const Edge_iterator& other) const { + return constraint_set == other.constraint_set && + (constraint_set == nullptr || (constraint_it == other.constraint_it && vertex_it == other.vertex_it)); + } + + Vertex_it first_vertex_it(C_iterator constraint_it) const { + if(constraint_it == constraint_set->end()) { + return Vertex_it(); + } + return constraint_it->begin(); + } + + public: + Edge_iterator() = default; + + // Constructors for begin and end. The constructors are public, but only the + // hierarchy can create an iterator of this class, through its friendship of + // the nested class `Construction_access`: Construction_access::begin_tag() and + // Construction_access::end_tag(). + class Construction_access + { + private: + friend class Edge_iterator; + friend class Polyline_constraint_hierarchy_2; + + static auto begin_tag() { return Begin_tag(); } + static auto end_tag() { return End_tag(); } + + struct Begin_tag + {}; + struct End_tag + {}; + }; + // + // constructor for the begin iterator + explicit Edge_iterator(Construction_access::Begin_tag, const Constraint_set* constraint_set) + : constraint_set(constraint_set) + , constraint_it(constraint_set->begin()) + , vertex_it(first_vertex_it(constraint_set->begin())) {} + // + // constructor for the end iterator + explicit Edge_iterator(Construction_access::End_tag, const Constraint_set* constraint_set) + : constraint_set(constraint_set) + , constraint_it(constraint_set->end()) + , vertex_it() {} + + Edge operator*() const { + CGAL_precondition(constraint_set != nullptr && constraint_it != constraint_set->end()); + CGAL_assertion(vertex_it != constraint_it->end()); + CGAL_assertion(std::next(vertex_it) != constraint_it->end()); + return Edge(*vertex_it, *std::next(vertex_it)); + } + + friend bool operator==(const Edge_iterator& lhs, const Edge_iterator& rhs) { return lhs.equal(rhs); } + + using base_type::operator++; + Edge_iterator& operator++() { + CGAL_precondition(constraint_set != nullptr && constraint_it != constraint_set->end()); + + ++vertex_it; + CGAL_assertion(vertex_it != constraint_it->end()); + + if(std::next(vertex_it) == constraint_it->end()) { + ++constraint_it; + vertex_it = first_vertex_it(constraint_it); + } + return *this; + } + + using base_type::operator--; + Edge_iterator& operator--() { + CGAL_precondition(constraint_set != nullptr); + CGAL_precondition(constraint_it != constraint_set->begin() || vertex_it != constraint_it->begin()); + if(constraint_it == constraint_set->end() || vertex_it == constraint_it->begin()) { + --constraint_it; + vertex_it = std::prev(constraint_it->end(), 2); + } else { + --vertex_it; + } + return *this; + } + }; // end class Edge_iterator + private: // data for the 1d hierarchy Compare comp; @@ -302,6 +413,20 @@ public: return sc_to_c_map.end(); } + Edge_iterator edges_begin() const { + BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Edge_iterator, std::bidirectional_iterator); + BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Edge_iterator, std::bidirectional_iterator_tag, + std::bidirectional_iterator, Edge, Edge, + typename Edge_iterator::pointer, std::ptrdiff_t); + return Edge_iterator(Edge_iterator::Construction_access::begin_tag(), &constraint_set); + } + + Edge_iterator edges_end() const { + return Edge_iterator(Edge_iterator::Construction_access::end_tag(), &constraint_set); + } + + auto edges() const { return Iterator_range(edges_begin(), edges_end()); } + Sc_iterator sc_begin() const{ return sc_to_c_map.begin(); } Sc_iterator sc_end() const{ return sc_to_c_map.end(); } C_iterator c_begin() const{ return constraint_set.begin(); } From d46896266336138d5bf55de9664d09565f311b43 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 13 Jan 2025 10:32:42 +0100 Subject: [PATCH 198/332] hierarchy: remove `remove_Steiner(T v, T va, T vb)` That code was never used nor tested, and cannot compile anyway. --- .../Polyline_constraint_hierarchy_2.h | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 5033898200c..4580c1f3248 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -399,8 +399,6 @@ public: Constraint_id split(Constraint_id first, Vertex_it vcit); Constraint_id split2(Constraint_id first, Vertex_it vcit); - void remove_Steiner(T v, T va, T vb); - // iterators Subconstraint_iterator subconstraint_begin() const @@ -1118,39 +1116,6 @@ next_along_sc(T va, T vb, T& w) const } - -/* - Attention, le point v DOIT etre un point de Steiner, - et les segments va,v et v,vb sont des sous contraintes. -*/ -template -void Polyline_constraint_hierarchy_2:: -remove_Steiner(T v, T va, T vb) -{ - // remove a Steiner point - CGAL_precondition(!is_constrained_vertex(v)); - - Context_list* hcl1; - Context_list* hcl2; - if(!get_contexts(va,v,hcl1)) CGAL_assertion(false); - if(!get_contexts(v,vb,hcl2)) CGAL_assertion(false); - - Vertex_it pos; - for(Context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ - pos = ctit->pos; - if((*pos)==va) pos++; - pos = ctit->enclosing.vl_ptr()->erase(pos); - ctit->pos = --pos; - } - - sc_to_c_map.erase(make_edge(va,v)); - sc_to_c_map.erase(make_edge(v,vb)); - delete hcl2; - sc_to_c_map.emplace(make_edge(va,vb),hcl1); -} - - - /* same as add_Steiner precondition : va,vb est une souscontrainte. From 926bb0cf89d02e7d7cfe61237d62c2b822833be0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 13 Jan 2025 10:36:02 +0100 Subject: [PATCH 199/332] hierarchy: remove two undefined member functions --- .../Triangulation_2/internal/Polyline_constraint_hierarchy_2.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 4580c1f3248..81d45f4d89e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -347,8 +347,6 @@ public: // Query bool is_subconstrained_edge(T va, T vb) const; - bool is_constrained_edge(T va, T vb) const; - bool is_constrained_vertex(T v) const; Vertex_it vertices_in_constraint_begin(Constraint_id cid) const { return cid.begin(); } From eafa97a862a38318e34a150e131db8db894aa1a0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 13 Jan 2025 17:06:58 +0100 Subject: [PATCH 200/332] major cleanup of Polyline_constraint_hierarchy_2 - remove all mentions of `Edge` and `Constraint` - `Subconstraint_iterator` is renamed `Subconstraint_and_contexts_iterator` (because of its value type) - a new `Subconstraint_iterator`, with value type `Subconstraint` - a few unused/untested and uncompilable functions are removed from the code - a lot of internal renamings == Breaking changes == For `Constrained_triangulation_plus_2`, there are a few breaking changes... - The value type of `subconstraints_begin()`, `subconstraints_end()`, of the range `subconstraints()` has changed to `Subconstraint` (a simple `std::pair` of vertex handles). That is actually a kind of bug-fix, because it was documented as such in the user manual. - The new member functions `subconstraints_and_contexts_begin()`, `subconstraints_and_contexts_end()`, `subconstraints_and_contexts()` are created get the old value type (`std::pair*>`). - A few range types have changed from `CGAL::Iterator_range` to `unspecified_type`, for efficiency reasons. - Doc fixes. == Determinism == Even if it was not documented, the range `subconstraints()` is deterministic (used by Mesh_2), and `subconstraints_and_contexts()` is not. --- Mesh_2/include/CGAL/Mesh_2/Clusters.h | 7 +- Mesh_2/include/CGAL/Mesh_2/Refine_edges.h | 2 +- Mesh_2/test/Mesh_2/conform_plus.cpp | 19 +- .../CGAL/Constrained_triangulation_plus_2.h | 46 ++- .../constrained_hierarchy_plus.cpp | 10 +- .../polylines_triangulation.cpp | 7 +- .../CGAL/Constrained_triangulation_plus_2.h | 83 ++++- .../internal/CTP2_subconstraint_graph.h | 101 +++--- .../Polyline_constraint_hierarchy_2.h | 294 +++++++++--------- 9 files changed, 299 insertions(+), 270 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Clusters.h b/Mesh_2/include/CGAL/Mesh_2/Clusters.h index f52dcb16d20..13533041f46 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Clusters.h @@ -160,15 +160,14 @@ public: void create_clusters(Tag_true) { cluster_map.clear(); Unique_hash_map created(false); - for(typename Tr::Subconstraint_iterator it = tr.subconstraints_begin(); - it != tr.subconstraints_end(); ++it) { - Vertex_handle vh = it->first.first; + for(const auto& sc : tr.subconstraints()) { + Vertex_handle vh = sc.first; if(!created[vh]){ created[vh] = true; create_clusters_of_vertex(vh); } - vh = it->first.second; + vh = sc.second; if(!created[vh]){ created[vh] = true; create_clusters_of_vertex(vh); diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 055ae0d7a21..2208f28fc45 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -344,7 +344,7 @@ protected: void scan_triangulation_impl(Tag_true) { - for(const auto& [v1, v2] : tr.hierarchy_ref().edges()) + for(const auto& [v1, v2] : tr.subconstraints()) { if(!is_locally_conform(tr, v1, v2) ){ add_constrained_edge_to_be_conformed(v1, v2); diff --git a/Mesh_2/test/Mesh_2/conform_plus.cpp b/Mesh_2/test/Mesh_2/conform_plus.cpp index 83978e3d9ef..6e4128dd68e 100644 --- a/Mesh_2/test/Mesh_2/conform_plus.cpp +++ b/Mesh_2/test/Mesh_2/conform_plus.cpp @@ -18,15 +18,7 @@ int main() std::pair p; - for(CDT::Subconstraint_iterator sit = cdt.subconstraints_begin(); - sit != cdt.subconstraints_end(); - ++sit){ - - p = (*sit).first; - - Vertex_handle vh1 = p.first; - Vertex_handle vh2 = p.second; - + for(const auto& [vh1, vh2] : cdt.subconstraints()) { std::cerr << "subconstraint: " << vh1->point() << " -- " << vh2->point() << std::endl; } @@ -36,15 +28,8 @@ int main() int counter = 0; - for(CDT::Subconstraint_iterator sit = cdt.subconstraints_begin(); - sit != cdt.subconstraints_end(); - ++sit){ + for(const auto& [vh1, vh2] : cdt.subconstraints()) { ++counter; - p = (*sit).first; - - Vertex_handle vh1 = p.first; - Vertex_handle vh2 = p.second; - std::cerr << "subconstraint: " << vh1->point() << " -- " << vh2->point() << std::endl; } diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h index 29d2b48d745..1a5d4b691f0 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h @@ -84,9 +84,10 @@ The value type of this iterator is `Constraint_id`. typedef unspecified_type Constraint_iterator; /*! -A range type for iterating over all constraints. +A range type for iterating over all constraints. The iterator type of +the range is `Constraint_iterator`. */ -typedef Iterator_range Constraints; +typedef unspecified_type Constraints; /*! @@ -95,19 +96,30 @@ A subconstraint is a pair of vertices that correspond to an `Edge`. typedef std::pair Subconstraint; /*! -An iterator -to visit all the subconstraints of the triangulation. +An iterator to visit all the subconstraints of the triangulation. The order of visit is undefined. -The value type of this iterator is `std::pair*>` -corresponding to the vertices of the -subconstraint. +The value type of this iterator is `Subconstraint`. */ typedef unspecified_type Subconstraint_iterator; /*! -A range type for iterating over all subconstraints. +A range type for iterating over all subconstraints. The iterator type of +the range is `Subconstraint_iterator`. */ -typedef Iterator_range Subconstraints; +typedef unspecified_type Subconstraints; + +/*! +An iterator to visit all the subconstraints of the triangulation and the +contexts of their enclosing constraints. The order of visit is undefined. +The value type of this iterator is `std::pair*>`. +*/ +typedef unspecified_type Subconstraint_and_contexts_iterator; + +/*! +A range type for iterating over all subconstraints. The iterator type of +the range is `Subconstraint_and_contexts_iterator`. +*/ +typedef unspecified_type Subconstraints_and_contexts; /*! An iterator on the @@ -381,6 +393,22 @@ returns a range of subconstraints. */ Subconstraints subconstraints() const; +/*! +returns a `Subconstraint_and_contexts_iterator` pointing at the first +subconstraint of the triangulation. +*/ +Subconstraint_and_contexts_iterator subconstraints_and_contexts_begin() const; + +/*! +returns the past-the-end iterator of the subconstraints of the triangulation. +*/ +Subconstraint_and_contexts_iterator subconstraints_and_contexts_end() const; + +/*! +returns a range of subconstraints with the contexts of their enclosing constraints. +*/ +Subconstraints_and_contexts subconstraints_and_contexts() const; + /*! returns the number of constraints enclosing the subconstraint `(va,vb)`. diff --git a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp index 950cb022632..b243e152693 100644 --- a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp +++ b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp @@ -30,15 +30,15 @@ main( ) cdt.insert_constraint( Point(j,0), Point(j,6)); int count = 0; - for (Triangulation::Subconstraint_iterator scit = cdt.subconstraints_begin(); - scit != cdt.subconstraints_end(); - ++scit) ++count; + for (const Triangulation::Subconstraint& sc : cdt.subconstraints()) { + ++count; + } std::cout << "The number of resulting constrained edges is "; std::cout << count << std::endl; //verbose mode of is_valid ; shows the number of vertices at each level std::cout << "The number of vertices at successive levels" << std::endl; - assert(cdt.is_valid(true)); + bool valid = cdt.is_valid(true); - return 0; + return valid ? 0 : 1; } diff --git a/Triangulation_2/examples/Triangulation_2/polylines_triangulation.cpp b/Triangulation_2/examples/Triangulation_2/polylines_triangulation.cpp index bc00e7071ba..b2b38e93765 100644 --- a/Triangulation_2/examples/Triangulation_2/polylines_triangulation.cpp +++ b/Triangulation_2/examples/Triangulation_2/polylines_triangulation.cpp @@ -28,13 +28,14 @@ print(const CDTP& cdtp, Cid cid) void contexts(const CDTP& cdtp) { - for(auto sc : cdtp.subconstraints()){ - Vertex_handle vp = sc.first.first, vq = sc.first.second; + for(const auto& sc_and_contexts : cdtp.subconstraints_and_contexts()) { + const auto& [subconstraint, contexts_list_ptr] = sc_and_contexts; + Vertex_handle vp = subconstraint.first, vq = subconstraint.second; if(cdtp.number_of_enclosing_constraints(vp, vq) == 2){ std::cout << "subconstraint " << vp->point() << " " << vq->point() << " is on constraints starting at:\n"; - for(const CDTP::Context& c : cdtp.contexts(vp,vq)){ + for(const CDTP::Context& c : *contexts_list_ptr) { std::cout << (*(c.vertices_begin()))->point() << std::endl; } } diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index ac3889c5341..1d4cd0dcbfb 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -165,11 +165,14 @@ public: typedef typename Constraint_hierarchy::Context_iterator Context_iterator; typedef Iterator_range Contexts; - typedef typename Constraint_hierarchy::C_iterator Constraint_iterator; - typedef Iterator_range Constraints; + typedef typename Constraint_hierarchy::Constraint_iterator Constraint_iterator; + typedef typename Constraint_hierarchy::Constraints Constraints; - typedef typename Constraint_hierarchy::Subconstraint_iterator Subconstraint_iterator; - typedef Iterator_range Subconstraints; + typedef typename Constraint_hierarchy::Subconstraint_iterator Subconstraint_iterator; + typedef typename Constraint_hierarchy::Subconstraints Subconstraints; + + typedef typename Constraint_hierarchy::Subconstraint_and_contexts_iterator Subconstraint_and_contexts_iterator; + typedef typename Constraint_hierarchy::Subconstraints_and_contexts Subconstraints_and_contexts; typedef typename Constraint_hierarchy::Constraint_id Constraint_id; @@ -768,18 +771,15 @@ public: // Query of the constraint hierarchy Constraint_iterator constraints_begin() const; Constraint_iterator constraints_end() const; - Constraints constraints() const - { - return Constraints(constraints_begin(),constraints_end()); - } + Constraints constraints() const; Subconstraint_iterator subconstraints_begin() const; Subconstraint_iterator subconstraints_end() const; + Subconstraints subconstraints() const; - Subconstraints subconstraints() const - { - return Subconstraints(subconstraints_begin(),subconstraints_end()); - } + Subconstraint_and_contexts_iterator subconstraints_and_contexts_begin() const; + Subconstraint_and_contexts_iterator subconstraints_and_contexts_end() const; + Subconstraints_and_contexts subconstraints_and_contexts() const; Context context(Vertex_handle va, Vertex_handle vb); //AF: const; @@ -1266,7 +1266,7 @@ Constrained_triangulation_plus_2::Constraint_iterator Constrained_triangulation_plus_2:: constraints_begin() const { - return hierarchy.c_begin(); + return hierarchy.constraints_begin(); } template @@ -1276,7 +1276,17 @@ Constrained_triangulation_plus_2::Constraint_iterator Constrained_triangulation_plus_2:: constraints_end() const { - return hierarchy.c_end(); + return hierarchy.constraints_end(); +} + +template +inline +typename +Constrained_triangulation_plus_2::Constraints +Constrained_triangulation_plus_2:: +constraints() const +{ + return hierarchy.constraints(); } template @@ -1286,7 +1296,7 @@ Constrained_triangulation_plus_2::Subconstraint_iterator Constrained_triangulation_plus_2:: subconstraints_begin() const { - return hierarchy.subconstraint_begin(); + return hierarchy.subconstraints_begin(); } template @@ -1296,9 +1306,48 @@ Constrained_triangulation_plus_2::Subconstraint_iterator Constrained_triangulation_plus_2:: subconstraints_end() const { - return hierarchy.subconstraint_end(); + return hierarchy.subconstraints_end(); } +template +inline +typename +Constrained_triangulation_plus_2::Subconstraints +Constrained_triangulation_plus_2:: +subconstraints() const +{ + return hierarchy.subconstraints(); +} + +template +inline +typename +Constrained_triangulation_plus_2::Subconstraint_and_contexts_iterator +Constrained_triangulation_plus_2:: +subconstraints_and_contexts_begin() const +{ + return hierarchy.subconstraints_and_contexts_begin(); +} + +template +inline +typename +Constrained_triangulation_plus_2::Subconstraint_and_contexts_iterator +Constrained_triangulation_plus_2:: +subconstraints_and_contexts_end() const +{ + return hierarchy.subconstraints_and_contexts_end(); +} + +template +inline +typename +Constrained_triangulation_plus_2::Subconstraints_and_contexts +Constrained_triangulation_plus_2:: +subconstraints_and_contexts() const +{ + return hierarchy.subconstraints_and_contexts(); +} template inline @@ -1325,7 +1374,7 @@ inline bool Constrained_triangulation_plus_2:: is_subconstraint(Vertex_handle va, Vertex_handle vb) { - return hierarchy.is_subconstrained_edge(va,vb); + return hierarchy.is_subconstraint(va,vb); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h index 5eab13d4c1e..e85eb22fa19 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h @@ -1,4 +1,4 @@ -// Copyright (c) 2020 GeometryFactory (France). All rights reserved. +// Copyright (c) 2020,2025 GeometryFactory (France). All rights reserved. // // This file is part of CGAL (www.cgal.org) // @@ -17,8 +17,6 @@ #include #include -#include - namespace CGAL { @@ -30,90 +28,71 @@ class CTP2_subconstraint_graph { CTP2& ctp2; public: + using vertex_descriptor = typename CTP2::Vertex_handle; + using edge_descriptor = typename CTP2::Subconstraint; + using directed_category = boost::undirected_tag; + using edge_parallel_category = boost::disallow_parallel_edge_tag; + struct CTP2_graph_traversal_category : public virtual boost::bidirectional_graph_tag, + public virtual boost::adjacency_graph_tag, + public virtual boost::edge_list_graph_tag, + public virtual boost::vertex_list_graph_tag + {}; + using traversal_category = CTP2_graph_traversal_category; + using vertex_iterator = + internal::Dereference_to_handle_enforcer; - typedef typename CTP2::Vertex_handle vertex_descriptor; - typedef typename CTP2::Subconstraint edge_descriptor; - typedef boost::undirected_tag directed_category; - typedef boost::disallow_parallel_edge_tag edge_parallel_category; - struct CTP2_graph_traversal_category : - public virtual boost::bidirectional_graph_tag, - public virtual boost::adjacency_graph_tag, - public virtual boost::edge_list_graph_tag, - public virtual boost::vertex_list_graph_tag - { }; - typedef CTP2_graph_traversal_category traversal_category; - typedef internal::Dereference_to_handle_enforcer< - CTP2, - typename CTP2::Finite_vertices_iterator, - vertex_descriptor> vertex_iterator; + using edge_iterator = typename CTP2::Subconstraint_iterator; - typedef typename CTP2::Subconstraint_iterator::value_type Subconstr_it_v_t; - typedef First_of_pair_property_map Subconstr_map; - typedef Property_map_to_unary_function Subconstr_uf; - typedef boost::transform_iterator edge_iterator; + CTP2_subconstraint_graph(CTP2& ctp2) + : ctp2(ctp2) {} - CTP2_subconstraint_graph (CTP2& ctp2) : ctp2(ctp2) { } - - friend Iterator_range vertices (const CTP2_subconstraint_graph& g) - { - return make_range (vertex_iterator(g.ctp2.finite_vertices_begin()), - vertex_iterator(g.ctp2.finite_vertices_end())); + friend Iterator_range vertices(const CTP2_subconstraint_graph& g) { + return make_range(vertex_iterator(g.ctp2.finite_vertices_begin()), vertex_iterator(g.ctp2.finite_vertices_end())); } - friend Iterator_range edges (const CTP2_subconstraint_graph& g) - { - return make_range (boost::make_transform_iterator(g.ctp2.subconstraints_begin(), Subconstr_uf(Subconstr_map())), - boost::make_transform_iterator(g.ctp2.subconstraints_end(), Subconstr_uf(Subconstr_map()))); + friend Iterator_range edges(const CTP2_subconstraint_graph& g) { + return g.ctp2.subconstraints(); } - friend vertex_descriptor source (edge_descriptor ed, const CTP2_subconstraint_graph&) - { - return ed.first; - } + friend vertex_descriptor source(edge_descriptor ed, const CTP2_subconstraint_graph&) { return ed.first; } - friend vertex_descriptor target (edge_descriptor ed, const CTP2_subconstraint_graph&) - { - return ed.second; - } + friend vertex_descriptor target(edge_descriptor ed, const CTP2_subconstraint_graph&) { return ed.second; } }; - template class CTP2_graph_visitor { private: + using Constraint_id = typename CTP2::Constraint_id; + using Vertex_handle = typename CTP2::Vertex_handle; CTP2& ctp2; - std::vector to_remove; - typename CTP2::Constraint_id current; - typename CTP2::Vertex_handle latest_vertex; + std::vector to_remove; + Constraint_id current{}; + Vertex_handle latest_vertex{}; public: + CTP2_graph_visitor(CTP2& ctp2) + : ctp2(ctp2) {} - CTP2_graph_visitor (CTP2& ctp2) : ctp2 (ctp2) { } - - void start_new_polyline() - { - latest_vertex = typename CTP2::Vertex_handle(); - current = typename CTP2::Constraint_id(); + void start_new_polyline() { + latest_vertex = Vertex_handle(); + current = Constraint_id(); } - void add_node (typename CTP2::Vertex_handle vh) - { - if (latest_vertex != typename CTP2::Vertex_handle()) - { - to_remove.push_back (ctp2.context(latest_vertex, vh).id()); - typename CTP2::Constraint_id cid = ctp2.insert_constraint(latest_vertex, vh); - if (current == typename CTP2::Constraint_id()) + void add_node(Vertex_handle vh) { + if(latest_vertex != Vertex_handle()) { + to_remove.push_back(ctp2.context(latest_vertex, vh).id()); + Constraint_id cid = ctp2.insert_constraint(latest_vertex, vh); + if(current == Constraint_id()) current = cid; else - current = ctp2.concatenate (current, cid); + current = ctp2.concatenate(current, cid); } latest_vertex = vh; } - void end_polyline() - { - for (typename CTP2::Constraint_id id : to_remove) + void end_polyline() { + for(Constraint_id id : to_remove) ctp2.remove_constraint(id); to_remove.clear(); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 81d45f4d89e..8a6f32ba81f 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -45,8 +45,6 @@ class Polyline_constraint_hierarchy_2 { public: typedef T Vertex_handle; - typedef std::pair Edge; - typedef std::pair Constraint; typedef std::pair Subconstraint; using size_type = std::size_t; @@ -125,9 +123,10 @@ public: Vertex_list_ptr vl_ptr() const { return vl; } - operator std::pair() const{ - Edge edge = vl == nullptr ? Edge() : Edge(vl->front().vertex(), vl->back().vertex()); - return std::make_pair(edge, vl); + operator std::pair() const { + Subconstraint subconstraint = + vl == nullptr ? Subconstraint() : Subconstraint(vl->front().vertex(), vl->back().vertex()); + return { subconstraint, vl }; } Constraint_id& operator=(std::nullptr_t) { @@ -173,11 +172,11 @@ public: public: Pair_compare(const Compare& comp) : comp(comp) {} - bool operator()(const Edge& e1, const Edge& e2) const { - if(comp(e1.first, e2.first)) { + bool operator()(const Subconstraint& sc1, const Subconstraint& sc2) const { + if(comp(sc1.first, sc2.first)) { return true; - } else if((! comp(e2.first, e1.first)) && // !less(e1,e2) && !less(e2,e1) == equal - comp(e1.second, e2.second)) { + } else if((! comp(sc2.first, sc1.first)) && // !less(sc1,sc2) && !less(sc2,sc1) == equal + comp(sc1.second, sc2.second)) { return true; } else { return false; @@ -203,57 +202,61 @@ public: typedef std::list Context_list; typedef typename Context_list::iterator Context_iterator; - typedef std::set Constraint_set; + typedef std::set Constraints_set; #if CGAL_USE_BARE_STD_MAP - typedef std::map Sc_to_c_map; #else - typedef CGAL::unordered_flat_map> Sc_to_c_map; + typedef CGAL::unordered_flat_map> Sc_to_c_map; #endif - typedef typename Constraint_set::iterator C_iterator; + typedef typename Constraints_set::iterator Constraint_iterator; + typedef const Constraints_set& Constraints; typedef typename Sc_to_c_map::const_iterator Sc_iterator; - typedef Sc_iterator Subconstraint_iterator; + typedef Sc_iterator Subconstraint_and_contexts_iterator; + typedef const Sc_to_c_map& Subconstraints_and_contexts; - class Edge_iterator : public boost::stl_interfaces::proxy_iterator_interface< + class Subconstraint_iterator : public boost::stl_interfaces::proxy_iterator_interface< #if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS - Edge_iterator, + Subconstraint_iterator, #endif std::bidirectional_iterator_tag, - Edge> + Subconstraint> { using base_type = boost::stl_interfaces::proxy_iterator_interface< #if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS - Edge_iterator, + Subconstraint_iterator, #endif std::bidirectional_iterator_tag, - Edge>; + Subconstraint>; - const Constraint_set* constraint_set = nullptr; - C_iterator constraint_it{}; + const Constraints_set* constraints_set = nullptr; + Constraint_iterator constraint_it{}; Vertex_it vertex_it{}; public: - // - The object is singular if and only if `constraint_set==nullptr`. + // - The object is singular if and only if `constraints_set==nullptr`. // - // - The end value is when `constraint_it` is the end iterator of `constraint_set`. + // - The end value is when `constraint_it` is the end iterator of `constraints_set`. // In that case `vertex_it` must be singular. // // - Otherwise all members must be valid pointers or dereferencable iterators. - bool equal(const Edge_iterator& other) const { - return constraint_set == other.constraint_set && - (constraint_set == nullptr || (constraint_it == other.constraint_it && vertex_it == other.vertex_it)); + bool equal(const Subconstraint_iterator& other) const { + return constraints_set == other.constraints_set && + (constraints_set == nullptr || (constraint_it == other.constraint_it && + vertex_it == other.vertex_it)); } - Vertex_it first_vertex_it(C_iterator constraint_it) const { - if(constraint_it == constraint_set->end()) { + Vertex_it begin_or_null(Constraint_iterator constraint_it) const { + if(constraint_it == constraints_set->end()) { return Vertex_it(); } return constraint_it->begin(); } public: - Edge_iterator() = default; + Subconstraint_iterator() = default; // Constructors for begin and end. The constructors are public, but only the // hierarchy can create an iterator of this class, through its friendship of @@ -262,7 +265,7 @@ public: class Construction_access { private: - friend class Edge_iterator; + friend class Subconstraint_iterator; friend class Polyline_constraint_hierarchy_2; static auto begin_tag() { return Begin_tag(); } @@ -275,45 +278,49 @@ public: }; // // constructor for the begin iterator - explicit Edge_iterator(Construction_access::Begin_tag, const Constraint_set* constraint_set) - : constraint_set(constraint_set) - , constraint_it(constraint_set->begin()) - , vertex_it(first_vertex_it(constraint_set->begin())) {} + explicit Subconstraint_iterator(typename Construction_access::Begin_tag, + const Constraints_set* constraints_set) + : constraints_set(constraints_set) + , constraint_it(constraints_set->begin()) + , vertex_it(begin_or_null(constraints_set->begin())) {} // // constructor for the end iterator - explicit Edge_iterator(Construction_access::End_tag, const Constraint_set* constraint_set) - : constraint_set(constraint_set) - , constraint_it(constraint_set->end()) + explicit Subconstraint_iterator(typename Construction_access::End_tag, + const Constraints_set* constraints_set) + : constraints_set(constraints_set) + , constraint_it(constraints_set->end()) , vertex_it() {} - Edge operator*() const { - CGAL_precondition(constraint_set != nullptr && constraint_it != constraint_set->end()); + Subconstraint operator*() const { + CGAL_precondition(constraints_set != nullptr && constraint_it != constraints_set->end()); CGAL_assertion(vertex_it != constraint_it->end()); CGAL_assertion(std::next(vertex_it) != constraint_it->end()); - return Edge(*vertex_it, *std::next(vertex_it)); + return Subconstraint(*vertex_it, *std::next(vertex_it)); } - friend bool operator==(const Edge_iterator& lhs, const Edge_iterator& rhs) { return lhs.equal(rhs); } + friend bool operator==(const Subconstraint_iterator& lhs, const Subconstraint_iterator& rhs) { + return lhs.equal(rhs); + } using base_type::operator++; - Edge_iterator& operator++() { - CGAL_precondition(constraint_set != nullptr && constraint_it != constraint_set->end()); + Subconstraint_iterator& operator++() { + CGAL_precondition(constraints_set != nullptr && constraint_it != constraints_set->end()); ++vertex_it; CGAL_assertion(vertex_it != constraint_it->end()); if(std::next(vertex_it) == constraint_it->end()) { ++constraint_it; - vertex_it = first_vertex_it(constraint_it); + vertex_it = begin_or_null(constraint_it); } return *this; } using base_type::operator--; - Edge_iterator& operator--() { - CGAL_precondition(constraint_set != nullptr); - CGAL_precondition(constraint_it != constraint_set->begin() || vertex_it != constraint_it->begin()); - if(constraint_it == constraint_set->end() || vertex_it == constraint_it->begin()) { + Subconstraint_iterator& operator--() { + CGAL_precondition(constraints_set != nullptr); + CGAL_precondition(constraint_it != constraints_set->begin() || vertex_it != constraint_it->begin()); + if(constraint_it == constraints_set->end() || vertex_it == constraint_it->begin()) { --constraint_it; vertex_it = std::prev(constraint_it->end(), 2); } else { @@ -321,12 +328,12 @@ public: } return *this; } - }; // end class Edge_iterator + }; // end class Subconstraint_iterator + typedef Iterator_range Subconstraints; private: - // data for the 1d hierarchy Compare comp; - Constraint_set constraint_set; + Constraints_set constraints_set; Sc_to_c_map sc_to_c_map; public: @@ -346,7 +353,7 @@ public: Polyline_constraint_hierarchy_2& operator=(Polyline_constraint_hierarchy_2&& ch) = default; // Query - bool is_subconstrained_edge(T va, T vb) const; + bool is_subconstraint(T va, T vb) const; Vertex_it vertices_in_constraint_begin(Constraint_id cid) const { return cid.begin(); } @@ -361,7 +368,6 @@ public: Point_it points_in_constraint_end(Constraint_id cid) const { return cid.vl_ptr()->all_end(); } - bool enclosing_constraint(Edge he, Constraint& hc) const; bool enclosing_constraint(T vaa, T vbb, T& va, T& vb) const; bool next_along_sc(T va, T vb, T& w) const; void oriented_end(T va, T vb, T& vc) const; @@ -371,7 +377,7 @@ public: Context_iterator contexts_begin(T va, T vb) const; Context_iterator contexts_end(T va, T vb) const; Iterator_range contexts_range(T va, T vb) const; - size_type number_of_constraints() const { return constraint_set.size();} + size_type number_of_constraints() const { return constraints_set.size();} size_type number_of_subconstraints()const {return sc_to_c_map.size();} @@ -399,39 +405,41 @@ public: // iterators - Subconstraint_iterator subconstraint_begin() const + Subconstraint_and_contexts_iterator subconstraints_and_contexts_begin() const { return sc_to_c_map.begin(); } - Subconstraint_iterator subconstraint_end() const + Subconstraint_and_contexts_iterator subconstraints_and_contexts_end() const { return sc_to_c_map.end(); } - Edge_iterator edges_begin() const { - BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Edge_iterator, std::bidirectional_iterator); - BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Edge_iterator, std::bidirectional_iterator_tag, - std::bidirectional_iterator, Edge, Edge, - typename Edge_iterator::pointer, std::ptrdiff_t); - return Edge_iterator(Edge_iterator::Construction_access::begin_tag(), &constraint_set); + Subconstraint_iterator subconstraints_begin() const { + BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Subconstraint_iterator, std::bidirectional_iterator); + BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS( + Subconstraint_iterator, std::bidirectional_iterator_tag, std::bidirectional_iterator, + Subconstraint, Subconstraint, typename Subconstraint_iterator::pointer, std::ptrdiff_t); + return Subconstraint_iterator(Subconstraint_iterator::Construction_access::begin_tag(), + &constraints_set); } - Edge_iterator edges_end() const { - return Edge_iterator(Edge_iterator::Construction_access::end_tag(), &constraint_set); + Subconstraint_iterator subconstraints_end() const { + return Subconstraint_iterator(Subconstraint_iterator::Construction_access::end_tag(), + &constraints_set); } - auto edges() const { return Iterator_range(edges_begin(), edges_end()); } - Sc_iterator sc_begin() const{ return sc_to_c_map.begin(); } Sc_iterator sc_end() const{ return sc_to_c_map.end(); } - C_iterator c_begin() const{ return constraint_set.begin(); } - C_iterator c_end() const{ return constraint_set.end(); } + Constraint_iterator constraints_begin() const{ return constraints_set.begin(); } + Constraint_iterator constraints_end() const{ return constraints_set.end(); } // Ranges - auto constraints() const { return Iterator_range(c_begin(), c_end()); } - const auto & subconstraints() const { return sc_to_c_map; } - + const auto& constraints() const { return constraints_set; } + const auto& subconstraints_and_contexts() const { return sc_to_c_map; } + auto subconstraints() const { + return Iterator_range(subconstraints_begin(), subconstraints_end()); + } // Helper functions void copy(const Polyline_constraint_hierarchy_2& ch); @@ -440,11 +448,13 @@ public: private: Constraint_id new_constraint_id() const { - auto id = number_of_constraints() == 0 ? 0 : constraint_set.rbegin()->id + 1; + auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; return Constraint_id(new Vertex_list, id); } - Edge make_edge(T va, T vb) const; - Edge make_edge(Edge e) { const auto& [va, vb] = e; return make_edge(va, vb); } + Subconstraint sorted_pair(T va, T vb) const; + Subconstraint sorted_pair(Subconstraint sc) { + const auto& [va, vb] = sc; return sorted_pair(va, vb); + } Vertex_it get_pos(T va, T vb) const; bool get_contexts(T va, T vb, Context_iterator& ctxt, @@ -498,22 +508,22 @@ copy(const Polyline_constraint_hierarchy_2& other, std::map cstr_map; clear(); - // copy constraint_set + // copy constraints_set for(const auto& cid1: other.constraints()) { Constraint_id cid2 = new_constraint_id(); cstr_map[cid1] = cid2; for(const auto& node : cid1.elements()) { cid2.vl_ptr()->push_back(Node(vmap[node.vertex()], node.input())); } - constraint_set.insert(cid2); + constraints_set.insert(cid2); } // copy sc_to_c_map - for(const auto& [edge1, hcl1] : other.subconstraints()) { + for(const auto& [sc1, hcl1] : other.subconstraints_and_contexts()) { Context_list* hcl2 = new Context_list; - Vertex_handle uu2 = vmap[edge1.first]; - Vertex_handle vv2 = vmap[edge1.second]; - Edge edge2 = make_edge(uu2, vv2); - sc_to_c_map[edge2] = hcl2; + Vertex_handle uu2 = vmap[sc1.first]; + Vertex_handle vv2 = vmap[sc1.second]; + Subconstraint sc2 = sorted_pair(uu2, vv2); + sc_to_c_map[sc2] = hcl2; for(const Context& ctxt1 : *hcl1) { // vertices of the enclosing constraints Context ctxt2; @@ -540,37 +550,16 @@ swap(Polyline_constraint_hierarchy_2& ch) { using std::swap; swap(comp, ch.comp); - constraint_set.swap(ch.constraint_set); + constraints_set.swap(ch.constraints_set); sc_to_c_map.swap(ch.sc_to_c_map); } -/* template bool Polyline_constraint_hierarchy_2:: -is_constrained_edge(T va, T vb) const +is_subconstraint(T va, T vb) const { - return( c_to_sc_map.find(make_edge(va, vb)) != c_to_sc_map.end() ); -} -*/ - -template -bool Polyline_constraint_hierarchy_2:: -is_subconstrained_edge(T va, T vb) const -{ - return( sc_to_c_map.find(make_edge(va, vb)) != sc_to_c_map.end() ); -} - - -// af: obsolete -template -bool Polyline_constraint_hierarchy_2:: -enclosing_constraint(Edge he, Constraint& hc) const -{ - Context_iterator hcit, past; - if ( !get_contexts(he.first,he.second, hcit ,past)) return false; - hc = make_edge(hcit->enclosing.front(), hcit->enclosing.back()); - return true; + return( sc_to_c_map.find(sorted_pair(va, vb)) != sc_to_c_map.end() ); } @@ -659,7 +648,7 @@ swap(Constraint_id constr_a, Constraint_id constr_b) { auto substitute_enclosing_in_vertex_list = [this](Vertex_list_ptr vl, Constraint_id old_id, Constraint_id new_id) { // We have to look at all subconstraints for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { - typename Sc_to_c_map::iterator scit = this->sc_to_c_map.find(make_edge(*it, *succ)); + typename Sc_to_c_map::iterator scit = this->sc_to_c_map.find(sorted_pair(*it, *succ)); CGAL_assertion(scit != this->sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -687,13 +676,13 @@ template void Polyline_constraint_hierarchy_2:: remove_constraint(Constraint_id cid){ - constraint_set.erase(cid); + constraints_set.erase(cid); // We have to look at all subconstraints for(Vertex_it it = cid.begin(), succ = it, end = cid.end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -722,14 +711,13 @@ remove_constraint(Constraint_id cid){ // and for the case that the constrained edge u,w has no intersections template void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, - Vertex_it vc, - Vertex_it wc) - + Vertex_it vc, + Vertex_it wc) { // TODO: How do we (want to) deal with u == w ??? Vertex_handle u = *uc, v = *vc, w = *wc; - typename Sc_to_c_map::iterator uv_sc_iter = sc_to_c_map.find(make_edge(u, v)); - typename Sc_to_c_map::iterator vw_sc_iter = sc_to_c_map.find(make_edge(v, w)); + typename Sc_to_c_map::iterator uv_sc_iter = sc_to_c_map.find(sorted_pair(u, v)); + typename Sc_to_c_map::iterator vw_sc_iter = sc_to_c_map.find(sorted_pair(v, w)); Context_list* uv_hcl = uv_sc_iter->second; Context_list* vw_hcl = vw_sc_iter->second; // AF: what is input() about??? @@ -777,7 +765,7 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, sc_to_c_map.erase(vw_sc_iter); // reuse other context list - sc_to_c_map[make_edge(u,w)] = uv_hcl; + sc_to_c_map[sorted_pair(u,w)] = uv_hcl; } @@ -803,8 +791,8 @@ typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2::remove_points_without_corresponding_vertex() { size_type n = 0; - for(C_iterator it = constraint_set.begin(); it!= constraint_set.end(); ++it){ - n+= remove_points_without_corresponding_vertex(*it); + for(const auto& cid : constraints_set){ + n+= remove_points_without_corresponding_vertex(cid); } return n; } @@ -817,13 +805,13 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons // std::cerr << std::format("concatenate({}, {}) ", constr_a.id, constr_b.id) << std::endl; Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraint_set.erase(constr_a); - constraint_set.erase(constr_b); + constraints_set.erase(constr_a); + constraints_set.erase(constr_b); // We have to look at all subconstraints for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = constr_b_vl->skip_end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -848,7 +836,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons for(Vertex_it it = back_it, succ = it, end = constr_a_vl->skip_end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -860,7 +848,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons } } } - constraint_set.insert(constr_a); + constraints_set.insert(constr_a); delete constr_b_vl; return constr_a; @@ -872,13 +860,13 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con { Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraint_set.erase(constr_a); - constraint_set.erase(constr_b); + constraints_set.erase(constr_a); + constraints_set.erase(constr_b); // We have to look at all subconstraints for(Vertex_it it = constr_a_vl->skip_begin(), succ = it, end = constr_a_vl->skip_end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -902,7 +890,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = back_it; ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -914,7 +902,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con } } } - constraint_set.insert(constr_b); + constraints_set.insert(constr_b); delete constr_a_vl; return constr_b; @@ -929,7 +917,7 @@ typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::split(Constraint_id constr, Vertex_it vcit) { Constraint_id new_constr = new_constraint_id(); - constraint_set.erase(constr); + constraints_set.erase(constr); Vertex_list_ptr new_vl = new_constr.vl_ptr(); Vertex_list_ptr constr_vl = constr.vl_ptr(); new_vl->splice(new_vl->skip_end(), *(constr_vl), vcit.base(), constr_vl->skip_end()); @@ -939,13 +927,13 @@ Polyline_constraint_hierarchy_2::split(Constraint_id constr, Ve vit = constr_vl->skip_end(); --vit; vit.input() = true; - constraint_set.insert(constr); - constraint_set.insert(new_constr); + constraints_set.insert(constr); + constraints_set.insert(new_constr); // We have to look at all subconstraints for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -965,7 +953,7 @@ typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::split2(Constraint_id constr, Vertex_it vcit) { Constraint_id new_constr = new_constraint_id(); - constraint_set.erase(constr); + constraints_set.erase(constr); Vertex_list_ptr new_vl = new_constr.vl_ptr(); Vertex_list_ptr constr_vl = constr.vl_ptr(); new_vl->splice(new_vl->skip_end(), *constr_vl, constr_vl->skip_begin(), vcit.base()); @@ -975,13 +963,13 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id constr, V vit.input() = true; vit = constr_vl->skip_begin(); vit.input() = true; - constraint_set.insert(constr); - constraint_set.insert(new_constr); + constraints_set.insert(constr); + constraints_set.insert(new_constr); // We have to look at all subconstraints for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); ++succ != end; ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); + typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; @@ -1011,17 +999,17 @@ insert_constraint(T va, T vb){ << "C_hierachy.insert_constraint( " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - Edge he = make_edge(va, vb); + Subconstraint sc = sorted_pair(va, vb); Constraint_id cid = new_constraint_id(); auto children = cid.vl_ptr(); - auto& fathers = sc_to_c_map[he]; + auto& fathers = sc_to_c_map[sc]; if(fathers == nullptr){ fathers = new Context_list; } - children->push_front(Node(va, true)); // was he.first - children->push_back(Node(vb, true)); // was he.second - constraint_set.insert(cid); + children->push_front(Node(va, true)); // was sc.first + children->push_back(Node(vb, true)); // was sc.second + constraints_set.insert(cid); Context ctxt; ctxt.enclosing = cid; ctxt.pos = children->skip_begin(); @@ -1049,8 +1037,8 @@ append_constraint(Constraint_id cid, T va, T vb){ << "C_hierachy.append_constraint( ..., " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - Edge he = make_edge(va, vb); - auto& fathers = sc_to_c_map[he]; + Subconstraint sc = sorted_pair(va, vb); + auto& fathers = sc_to_c_map[sc]; if(fathers == nullptr){ fathers = new Context_list; } @@ -1080,7 +1068,7 @@ clear() delete cl_ptr; } sc_to_c_map.clear(); - constraint_set.clear(); + constraints_set.clear(); } @@ -1176,28 +1164,28 @@ add_Steiner(T va, T vb, T vc){ hcl3->splice(hcl3->end(), *hcl); delete hcl; } - else sc_to_c_map.emplace(make_edge(va,vc), hcl); + else sc_to_c_map.emplace(sorted_pair(va,vc), hcl); if (get_contexts(vc,vb,hcl3)) {// (vc,vb) is already a subconstraint hcl3->splice(hcl3->end(),*hcl2); delete hcl2; } - else sc_to_c_map.emplace(make_edge(vc,vb), hcl2); + else sc_to_c_map.emplace(sorted_pair(vc,vb), hcl2); - sc_to_c_map.erase(make_edge(va,vb)); + sc_to_c_map.erase(sorted_pair(va,vb)); return; } template inline -typename Polyline_constraint_hierarchy_2::Edge +typename Polyline_constraint_hierarchy_2::Subconstraint Polyline_constraint_hierarchy_2:: -make_edge(T va, T vb) const +sorted_pair(T va, T vb) const { - return comp(va, vb) ? Edge(va,vb) : Edge(vb,va); + return comp(va, vb) ? Subconstraint(va,vb) : Subconstraint(vb,va); } template @@ -1206,7 +1194,7 @@ bool Polyline_constraint_hierarchy_2:: get_contexts(T va, T vb, Context_list* & hcl) const { - Sc_iterator sc_iter = sc_to_c_map.find(make_edge(va,vb)); + Sc_iterator sc_iter = sc_to_c_map.find(sorted_pair(va,vb)); if( sc_iter == sc_to_c_map.end() ) return(false); hcl = sc_iter->second; return true; @@ -1236,7 +1224,7 @@ Polyline_constraint_hierarchy_2:: get_pos(T va, T vb) const //return pos in the first context { - return (*sc_to_c_map.find(make_edge(va,vb))).second->begin().pos; + return (*sc_to_c_map.find(sorted_pair(va,vb))).second->begin().pos; } template @@ -1299,11 +1287,11 @@ print() const } } std::cout << std::endl; - for(const auto& [edge, _] : subconstraints()) { + for(const auto& subconstraint : subconstraints()) { std::cout << "subconstraint "; - std::cout << vertex_num[edge.first] << " " << vertex_num[edge.second]; + std::cout << vertex_num[subconstraint.first] << " " << vertex_num[subconstraint.second]; Context_iterator cb, ce; - get_contexts(edge.first, edge.second, cb, ce); + get_contexts(subconstraint.first, subconstraint.second, cb, ce); std::cout << " enclosing "; for(; cb != ce; cb++) { From 766040a0a859fe315a86736507ed13d6eee8e1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 00:09:26 +0100 Subject: [PATCH 201/332] Fix wrong tparam name How was there no doxygen warning?... --- .../doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h index 9b69d3cc9f7..f1976687e3c 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_builder_2.h @@ -190,7 +190,7 @@ Straight_skeleton_builder_2& enter_contour( InputPointIterator aBegin, InputPoin /*! defines the weights of the contour last entered through `enter_contour()`. -\tparam InputPointIterator must be a model `InputIterator` whose `value_type` is `FT`. +\tparam WeightIterator must be a model `InputIterator` whose `value_type` is `FT`. \pre `std::distance(aBegin,aEnd)` must be equal to the number of vertices of the contour last entered. \pre Weights are (strictly) positive. From 2805eec7bf5bae1addc6d3e736e688d7a1458140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 00:12:39 +0100 Subject: [PATCH 202/332] Add missing backticks --- .../doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h | 4 ++-- .../CGAL/create_weighted_offset_polygons_2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h index 18362fb362a..abd35bb9b53 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h @@ -97,7 +97,7 @@ the skeleton only once, and then call `create_offset_polygons_2()` for each dist \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. \pre `offset` is positive -\pre poly` is weakly simple, counterclockwise polygon. +\pre `poly` is weakly simple, counterclockwise polygon. \sa `CGAL::create_exterior_skeleton_and_offset_polygons_2()` \sa `CGAL::create_interior_skeleton_and_offset_polygons_with_holes_2()` @@ -138,7 +138,7 @@ therefore, to construct offsets at more than one single distance, use the separa \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. \pre `offset` is positive -\pre poly` is weakly simple, counterclockwise polygon. +\pre `poly` is weakly simple, counterclockwise polygon. \sa `CGAL::create_interior_skeleton_and_offset_polygons_2()` \sa `CGAL::create_exterior_skeleton_and_offset_polygons_with_holes_2()` diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h index 5627709d22b..33d893eec1a 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h @@ -123,7 +123,7 @@ therefore, to construct offsets at more than one single distance, use the separa \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. \pre `offset` is positive -\pre poly` is weakly simple, counterclockwise polygon. +\pre `poly` is weakly simple, counterclockwise polygon. \sa `CGAL::create_interior_skeleton_and_offset_polygons_2()` \sa `CGAL::create_exterior_skeleton_and_offset_polygons_with_holes_2()` From dd86cd1f60ce38e7ab9a2bdacbde90d5d530dd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 00:13:59 +0100 Subject: [PATCH 203/332] Fix doc group --- ...reate_weighted_offset_polygons_from_polygon_with_holes_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index 3f68ff59b7e..db63f594a76 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgStraightSkeleton2OffsetFunctions +\ingroup PkgStraightSkeleton2WeightedOffsetFunctions \brief returns a container with all the inner offset polygons with holes at distance `offset` of the 2D polygon with holes `poly_with_holes`. @@ -35,7 +35,7 @@ create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT offset, // ---------------------------------------------- EXTERIOR ----------------------------------------- /*! -\ingroup PkgStraightSkeleton2OffsetFunctions +\ingroup PkgStraightSkeleton2WeightedOffsetFunctions \brief returns a container with all the outer offset polygons with holes at distance `offset` of the 2D polygon `poly_with_holes`. Note that the From aac8c49956d4f8f6096fc5d5e170abbd98b09d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 00:14:53 +0100 Subject: [PATCH 204/332] Remove extra parentheses --- .../CGAL/create_offset_polygons_from_polygon_with_holes_2.h | 2 +- .../create_weighted_offset_polygons_from_polygon_with_holes_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index cdba6f53874..bb0a918b5a0 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -42,7 +42,7 @@ at distance `offset` of the 2D polygon `poly_with_holes`. Note that the offset of the outer frame is ignored. This is equivalent to a call to `CGAL::arrange_offset_polygons_2()` on the -output of \link CGAL::create_exterior_skeleton_and_offset_polygons_2() `create_exterior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))` \endlink +output of \link CGAL::create_exterior_skeleton_and_offset_polygons_2() `create_exterior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk)` \endlink after having filtered out the polygon corresponding to the offset of the outer frame and having reversed the orientation of all other polygons. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index db63f594a76..9e1fd1cf0b9 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -42,7 +42,7 @@ at distance `offset` of the 2D polygon `poly_with_holes`. Note that the offset of the outer frame is ignored. This is equivalent to a call to `CGAL::arrange_offset_polygons_2()` on the -output of \link CGAL::create_exterior_weighted_skeleton_and_offset_polygons_2() `create_exterior_weighted_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))` \endlink +output of \link CGAL::create_exterior_weighted_skeleton_and_offset_polygons_2() `create_exterior_weighted_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk)` \endlink after having filtered out the polygon corresponding to the offset of the outer frame and having reversed the orientation of all other polygons. From b76596a450d0d369d1447004f10516ca8bb57115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 00:15:08 +0100 Subject: [PATCH 205/332] Fix wrong parameter order in documentation --- .../CGAL/create_weighted_offset_polygons_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h index 33d893eec1a..5612c69c6b9 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h @@ -45,9 +45,9 @@ template > create_interior_weighted_skeleton_and_offset_polygons_2(FT offset, const InKPolygon& outer_boundary, - const InKWeights& outer_boundary_weights, HoleIterator holes_begin, HoleIterator holes_end, + const InKWeights& outer_boundary_weights, HoleWeightsIterator holes_weights_begin, HoleWeightsIterator holes_weights_end, OfK ofk = CGAL::Exact_predicates_inexact_constructions_kernel, From 1f70e59210cf5cd463dbfaeaf6dd4e32edc4dc42 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 14 Jan 2025 14:11:08 +0100 Subject: [PATCH 206/332] doc bug-fix --- .../doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h index 1a5d4b691f0..34aee28ad9c 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h @@ -111,7 +111,7 @@ typedef unspecified_type Subconstraints; /*! An iterator to visit all the subconstraints of the triangulation and the contexts of their enclosing constraints. The order of visit is undefined. -The value type of this iterator is `std::pair*>`. +The value type of this iterator is `const std::pair*>`. */ typedef unspecified_type Subconstraint_and_contexts_iterator; From 0ed7e3041b11f54d776e9dbe0b18624a1f8e644f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:02:00 +0100 Subject: [PATCH 207/332] Various fixes in the documentation of template parameters --- .../CGAL/create_offset_polygons_2.h | 38 ++++++++--------- ...ffset_polygons_from_polygon_with_holes_2.h | 21 +++++----- .../CGAL/create_weighted_offset_polygons_2.h | 42 +++++++++---------- ...ffset_polygons_from_polygon_with_holes_2.h | 26 +++++++----- .../create_weighted_straight_skeleton_2.h | 6 +-- 5 files changed, 69 insertions(+), 64 deletions(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h index abd35bb9b53..5d540adc617 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_2.h @@ -9,11 +9,11 @@ If `ss` is the interior skeleton of a polygon with holes, the offset polygons wi in its interior. If `ss` is the outer skeleton of a polygon with holes, the offset polygons will be generated in its exterior. -\tparam OfK must be a model of `Kernel`. It is used to instantiate - `Polygon_offset_builder_traits_2` for constructing the offset polygons. +\tparam OfKPolygon is a polygon without holes type determined from `OfK`, see Section \ref SLSOffsetPolygonReturnType. \tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT`. \tparam StraightSkeleton is an object of type `CGAL::Straight_skeleton_2`. -\tparam OfKPolygon is a polygon without holes type determined from `OfK`, see Section \ref SLSOffsetPolygonReturnType. +\tparam OfK must be a model of `Kernel`. It is used to instantiate + `Polygon_offset_builder_traits_2` for constructing the offset polygons. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -44,16 +44,16 @@ The construction of this skeleton is the most expensive operation, therefore, to at more than one single distance, it is advised to use `create_interior_straight_skeleton_2()` to create the skeleton only once, and then call `create_offset_polygons_2()` for each distance. -\tparam OfK must be a model of `Kernel`. It is used to instantiate - `Polygon_offset_builder_traits_2` for constructing the offset polygons. -\tparam SsK must be a model of `Kernel`. It is used to instantiate - `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. +\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. \tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. \tparam HoleIterator must be a model of `InputIterator` with value type being a model of `ConstRange` with value type `SsK::Point_2`. \tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`). -\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. +\tparam OfK must be a model of `Kernel`. It is used to instantiate + `Polygon_offset_builder_traits_2` for constructing the offset polygons. +\tparam SsK must be a model of `Kernel`. It is used to instantiate + `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -84,15 +84,15 @@ The construction of this skeleton is the most expensive operation, therefore, to at more than one single distance, it is advised to use `create_interior_straight_skeleton_2()` to create the skeleton only once, and then call `create_offset_polygons_2()` for each distance +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -125,15 +125,15 @@ to obtain the offsets. The construction of this skeleton is the most expensive o therefore, to construct offsets at more than one single distance, use the separate functions `create_exterior_straight_skeleton_2()` and `create_offset_polygons_2()` instead. +\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index bb0a918b5a0..76ee56c2bf4 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -8,15 +8,16 @@ of the 2D polygon with holes `poly_with_holes`. This is equivalent to `arrange_offset_polygons_2(create_interior_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))`. +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. + \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -46,15 +47,15 @@ output of \link CGAL::create_exterior_skeleton_and_offset_polygons_2() `create_e after having filtered out the polygon corresponding to the offset of the outer frame and having reversed the orientation of all other polygons. +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h index 5612c69c6b9..0514b380322 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_2.h @@ -20,19 +20,19 @@ The construction of this skeleton is the most expensive operation, therefore, to at more than one single distance, it is advised to use the separate functions `create_interior_straight_skeleton_2()` and `create_offset_polygons_2()` instead. +\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`). +\tparam HoleIterator must be a model of `InputIterator` with value type being a model of `ConstRange` + with value type `SsK::Point_2`. +\tparam InKWeights must be a model of `SequenceContainer` whose value type is `InK::FT`. +\tparam HoleWeightsIterator must be a model of `InputIterator` with value type being a model of `SequenceContainer` + with value type `InK::FT`. \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`). -\tparam InKWeights must be a model of `Range` with value type `InK::FT`. -\tparam HoleIterator must be a model of `InputIterator` with value type being a model of `ConstRange` - with value type `SsK::Point_2`. -\tparam HoleWeightsIterator must be a model of `InputIterator` with value type being a model of `ConstRange` - with value type `InK::FT`. -\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -66,16 +66,16 @@ The construction of this skeleton is the most expensive operation, therefore, to at more than one single distance, use the separate functions `create_interior_straight_skeleton_2()` and `create_offset_polygons_2()` instead. +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam InKWeights must be a model of `Range` with value type `InK::FT`. -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -109,16 +109,16 @@ to obtain the offsets. The construction of this skeleton is the most expensive o therefore, to construct offsets at more than one single distance, use the separate functions `create_exterior_straight_skeleton_2()` and `create_offset_polygons_2()` instead. +\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam InKWeights must be a model of `Range` with value type `InK::FT`. -\tparam OfKPolygon is a polygon without holes type determined from `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed straight skeleton is converted to `CGAL::Straight_skeleton_2`. diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index 9e1fd1cf0b9..57aaf455e4a 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -8,15 +8,16 @@ of the 2D polygon with holes `poly_with_holes`. This is equivalent to `arrange_offset_polygons_2(create_interior_weighted_skeleton_and_offset_polygons_2(offset, poly_with_holes, ofk, ssk))`. +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the weighted straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed weighted straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -46,15 +47,16 @@ output of \link CGAL::create_exterior_weighted_skeleton_and_offset_polygons_2() after having filtered out the polygon corresponding to the offset of the outer frame and having reversed the orientation of all other polygons. +\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, + see Section \ref SLSOffsetPolygonReturnType. +\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. +\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \tparam OfK must be a model of `Kernel`. It is used to instantiate `Polygon_offset_builder_traits_2` for constructing the offset polygons. \tparam SsK must be a model of `Kernel`. It is used to instantiate `Straight_skeleton_builder_traits_2` for constructing the straight skeleton. -\tparam FT must be a model of `FieldNumberType` convertible to `OfK::FT` and `SsK::FT`. -\tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam OfKPolygon is a polygon without holes type determined by `OfK` and `InKPolygon`, - see Section \ref SLSOffsetPolygonReturnType. \note If `SsK != OfK` the constructed weighted straight skeleton is converted to `CGAL::Straight_skeleton_2`. @@ -65,7 +67,9 @@ having reversed the orientation of all other polygons. template std::vector > create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT offset, - const InKPolygon& poly_with_holes, + const InKPolygon& + poly_with_holes, + const InKWeights& weights, OfK ofk = Exact_predicates_inexact_constructions_kernel(), SsK ssk = Exact_predicates_inexact_constructions_kernel()); diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_straight_skeleton_2.h index ca9c472deeb..736f07ae8fd 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/create_weighted_straight_skeleton_2.h @@ -87,14 +87,14 @@ create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertice \brief creates a weighted straight skeleton in the interior of a 2D polygon, possibly with holes. -Range of weights `weights` must be provided in the same order as the contours (i.e., first +Weights must be provided in the same order as the contours (i.e., first the weights of the outer boundary, and then the weights of the holes, if there are any). Within each range of weights, the weights must be given in the same order as the vertices of the contour: the `i`-th weight in the range is associated to the contour edge between the `i-1`-th and `i`-th vertices. \tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`), or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam InKWeights must be a model of `Range` whose value type is itself a model of `Range` with value type `InK::FT`. +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \tparam SsK must be a model of `Kernel`. \note `Cartesian_converter` and `NT_converter` are used to convert objects from `InK` to `SsK`, @@ -177,7 +177,7 @@ is associated to the contour edge between the `i-1`-th and `i`-th vertices. \tparam FT must be a model of `FieldNumberType` convertible to `SsK::FT`. \tparam InKPolygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). -\tparam InKWeights must be a model of `Range` whose value type is itself a model of `Range` with value type `InK::FT`. +\tparam InKWeights must be a model of `SequenceContainer` whose value type is itself a model of `SequenceContainer` with value type `InK::FT`. \note `Cartesian_converter` and `NT_converter` are used to convert objects from `InK` to `SsK`, if they differ. From 59e1ca53ac00142767cc207a90074b065e216754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:02:28 +0100 Subject: [PATCH 208/332] Clarify comment --- .../CGAL/Straight_skeleton_2/Straight_skeleton_aux.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h index 8e5bdfdd6d2..d1bb004700e 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h @@ -197,8 +197,8 @@ struct Default_return_polygon_type // Polygon type supports holes typename Kernel_traits::type>::Kernel, OfK>::value, - typename Polygon::Polygon_2, // correct kernel - CGAL::Polygon_2 /*incorrect kernel*/ >::type type; + typename Polygon::Polygon_2, // same kernel + CGAL::Polygon_2 /*different kernel*/ >::type type; }; template @@ -207,8 +207,8 @@ struct Default_return_polygon_type // Polygon type does NOT typedef typename std::conditional::type>::Kernel, OfK>::value, - Polygon, // correct kernel - CGAL::Polygon_2 /*incorrect kernel*/ >::type type; + Polygon, // same kernel + CGAL::Polygon_2 /*different kernel*/ >::type type; }; // The return type of create_interior/exterior_skeleton_and_offset_polygons_with_holes_2: From 56c0696476d36b28b8012c052ca58ef1ba8a0d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:03:18 +0100 Subject: [PATCH 209/332] Add an alias for deduced (or not) return types --- .../CGAL/Straight_skeleton_2/Straight_skeleton_aux.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h index d1bb004700e..606f8f27d0d 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include @@ -211,6 +213,10 @@ struct Default_return_polygon_type // Polygon type does NOT CGAL::Polygon_2 /*different kernel*/ >::type type; }; +template +using Polygon_return_type = typename CGAL::Default::Get::type>::type; + // The return type of create_interior/exterior_skeleton_and_offset_polygons_with_holes_2: // - if polygon input is a model of 'GeneralPolygonWithHoles_2', the return type should be the same // - if polygon input is just a sequence container of points (e.g. Polygon_2), then use @@ -238,6 +244,10 @@ struct Default_return_polygon_with_holes_type // Polygon ty CGAL::Polygon_with_holes_2 /*incorrect kernel*/ >::type type; }; +template +using Polygon_with_holes_return_type = typename CGAL::Default::Get::type>::type; + } // namespace CGAL_SS_i } // namespace CGAL From 60e5e1570c2a44efb49c0e41784b0e2d5b01ea0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:04:01 +0100 Subject: [PATCH 210/332] Fix compilation --- .../include/CGAL/Straight_skeleton_builder_2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h index d6177f02e4c..bcc7d2b65f4 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h @@ -1457,10 +1457,10 @@ public: CGAL_assertion(fit != mSSkel->SSkel::Base::faces_end()); Halfedge_handle lBorder = fit->halfedge(); - FT lWeight = *aWeightsBegin; CGAL_assertion(lBorder->opposite()->is_border()); - CGAL_STSKEL_BUILDER_TRACE(4, "Assign " << lWeight << " cvt to " << cvt(lWeight) << " to E" << lBorder->id()); - lBorder->set_weight(cvt(lWeight)); + FT lWeight = cvt(*aWeightsBegin); + CGAL_STSKEL_BUILDER_TRACE(4, "Assign " << *aWeightsBegin << " (converted to " << cvt(lWeight) << ") to E" << lBorder->id()); + lBorder->set_weight(lWeight); } return *this; From 06e970d8866ec73e4b4a969546b57bced4c4a948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:07:02 +0100 Subject: [PATCH 211/332] Move towards honoring the concepts --- .../include/CGAL/arrange_offset_polygons_2.h | 15 ++++++++++----- ...te_offset_polygons_from_polygon_with_holes_2.h | 9 +++++++-- ...ed_offset_polygons_from_polygon_with_holes_2.h | 9 +++++++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index da2b6560fea..12a8b1e27eb 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -48,7 +49,9 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin { typedef typename std::iterator_traits::difference_type difference_type ; typedef typename std::iterator_traits::value_type PolygonPtr ; + typedef typename Kernel_traits::type>::Kernel OfK; + typedef typename PolygonWithHoles::Polygon_2 Inner_polygon; typedef boost::shared_ptr PolygonWithHolesPtr ; difference_type lSize = std::distance(aBegin,aEnd); @@ -61,14 +64,16 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin const PolygonPtr lPoly = *it ; - Orientation lOrient = CGAL::Polygon::internal::orientation_2_no_precondition(lPoly->vertices().begin(), - lPoly->vertices().end(), - lPoly->traits_member()); + Orientation lOrient = CGAL::Polygon::internal::orientation_2_no_precondition( + CGAL_SS_i::vertices_begin(lPoly), CGAL_SS_i::vertices_end(lPoly), + OfK() /*lPoly->traits_member()*/); // It's an outer boundary if ( lOrient == COUNTERCLOCKWISE ) { - PolygonWithHolesPtr lOuter( new PolygonWithHoles(*lPoly) ); + PolygonWithHolesPtr lOuter = boost::make_shared( + Inner_polygon(CGAL_SS_i::vertices_begin(lPoly), + CGAL_SS_i::vertices_end(lPoly))); *rOut ++ = lOuter ; lTable[lIdx] = lOuter ; } @@ -100,7 +105,7 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin if (lParent == nullptr) return false; - lParent->add_hole(*lPoly); + lParent->add_hole(Inner_polygon(CGAL_SS_i::vertices_begin(lPoly), CGAL_SS_i::vertices_begin(lPoly))); } } diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index 09e77e732d5..d2c81e4ceed 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -117,8 +117,13 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, std::swap(raw_output[0], raw_output.back()); raw_output.pop_back(); - for (boost::shared_ptr ptr : raw_output) - ptr->reverse_orientation(); + for (boost::shared_ptr ptr : raw_output) { + if (ptr->size() > 1) { + // keep the first in place is just to get the same behavior as for Polygon_2 + auto first = std::next(ptr->begin()); + std::reverse(first, ptr->end()); + } + } return arrange_offset_polygons_2(raw_output); } diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index 24420366e9b..e8addd76ef3 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -124,8 +124,13 @@ create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOf std::swap(raw_output[0], raw_output.back()); raw_output.pop_back(); - for(boost::shared_ptr ptr : raw_output) - ptr->reverse_orientation(); + for (boost::shared_ptr ptr : raw_output) { + if (ptr->size() > 1) { + // keep the first in place is just to get the same behavior as for Polygon_2 + auto first = std::next(ptr->begin()); + std::reverse(first, ptr->end()); + } + } return arrange_offset_polygons_2(raw_output); } From 2f7db1db7453b7eac94e0967e53afae4b653f38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:10:23 +0100 Subject: [PATCH 212/332] Consistency between doc & code, use OutPolygon if provided, factorize code --- .../include/CGAL/create_offset_polygons_2.h | 139 +++++------------ ...ffset_polygons_from_polygon_with_holes_2.h | 132 ++++++---------- .../include/CGAL/create_straight_skeleton_2.h | 96 +++--------- .../CGAL/create_weighted_offset_polygons_2.h | 132 +++++----------- ...ffset_polygons_from_polygon_with_holes_2.h | 146 +++++++----------- .../create_weighted_straight_skeleton_2.h | 111 ++----------- ...aight_skeleton_from_polygon_with_holes_2.h | 4 +- 7 files changed, 216 insertions(+), 544 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index 5e1401c12c8..fd6f6570b0a 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -24,9 +24,8 @@ #include #include +#include #include -#include -#include #include #include @@ -142,6 +141,8 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Tag_false ) { + static_assert(!std::is_same_v); + typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; @@ -166,6 +167,8 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k*/, Tag_true ) { + static_assert(!std::is_same_v); + typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; @@ -190,43 +193,39 @@ Skeleton const& dereference ( boost::shared_ptr const& ss ) } // namespace CGAL_SS_i -template +template std::vector< boost::shared_ptr > inline create_offset_polygons_2(const FT& aOffset, const Skeleton& aSs, - const K& k) + const K& k = K()) { typename CGAL_SS_i::Is_same_type::type same_kernel; return CGAL_SS_i::create_offset_polygons_2(aOffset, aSs, k, same_kernel); } -template, - class FT, class Skeleton> -std::vector< boost::shared_ptr > -inline -create_offset_polygons_2(const FT& aOffset, - const Skeleton& aSs) -{ - return create_offset_polygons_2(aOffset, aSs, Exact_predicates_inexact_constructions_kernel()); -} - //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// /// INTERIOR -template::type> -std::vector< boost::shared_ptr > +template +std::vector< boost::shared_ptr > > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aOuterBoundary, HoleIterator aHolesBegin, HoleIterator aHolesEnd, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), + std::enable_if_t::value>* = 0) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + return create_offset_polygons_2( aOffset, CGAL_SS_i::dereference( @@ -240,63 +239,26 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, ofk); } -template::type> -std::vector< boost::shared_ptr > -inline -create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aOuterBoundary, - HoleIterator aHolesBegin, - HoleIterator aHolesEnd, - const OfK& ofk) -{ - return create_interior_skeleton_and_offset_polygons_2(aOffset, aOuterBoundary, - aHolesBegin, aHolesEnd, - ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -// Overload where Polygon actually is a simple polygon (no holes) -template::type> -std::vector< boost::shared_ptr > +// Overload where APolygon is a simple polygon (no holes) +template +std::vector< boost::shared_ptr > > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< ! CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + std::vector no_holes; - return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, - no_holes.begin(), no_holes.end(), - ofk, ssk); -} - -// Overloads common to both polygons with and without holes, a simple polygon is returned in any case -template::type> -std::vector > -inline -create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const OfK& ofk) -{ - return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly) -{ - return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, - Exact_predicates_inexact_constructions_kernel()); + return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, + no_holes.begin(), no_holes.end(), + ofk, ssk); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -307,17 +269,21 @@ create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, /*! create_exterior_skeleton_and_offset_polygons_2 (no sorting of the result) */ // Overload where Polygon actually is a simple polygon (no holes) -template::type> -std::vector< boost::shared_ptr > +template +std::vector< boost::shared_ptr > > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< ! CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + return create_offset_polygons_2( aOffset, CGAL_SS_i::dereference( @@ -329,31 +295,6 @@ create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, ofk); } -// Overloads common to both polygons with and without holes, a simple polygons is returned in any case -template::type> -std::vector< boost::shared_ptr > -inline -create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const OfK& ofk) -{ - return create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector< boost::shared_ptr > -inline -create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly) -{ - return create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, - Exact_predicates_inexact_constructions_kernel()); -} - } // namespace CGAL #endif // CGAL_CREATE_OFFSET_POLYGONS_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index d2c81e4ceed..2037a42fa80 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -14,10 +14,9 @@ #include +#include #include #include -#include -#include #include @@ -36,60 +35,45 @@ namespace CGAL { /*! create_interior_skeleton_and_offset_polygons_2 (no sorting of the result) */ // overload where PolygonWithHoles actually is a type of Polygon that supports holes -template::type> // Hole-less polygon type -std::vector > +template +std::vector > > inline create_interior_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { - return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), - aPoly.holes_begin(), aPoly.holes_end(), - ofk, ssk); + using OutPolygon = CGAL_SS_i::Polygon_return_type; + + return create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), + aPoly.holes_begin(), aPoly.holes_end(), + ofk, ssk); } /*! create_interior_skeleton_and_offset_polygons_with_holes_2 (orders the resulting polygons) */ -// Polygon might be a Polygon with holes or not, but it returns a Polygon with holes -template::type> -std::vector > +// 'Polygon' might be a polygon with holes or not, but it returns a polygon with holes +template +std::vector > > inline create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK()) { + using OutPolygon = typename CGAL_SS_i::Default_return_polygon_type::type; + using OutPolygonWithHoles = CGAL_SS_i::Polygon_with_holes_return_type; + return arrange_offset_polygons_2( - create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk)); -} - -template::type> -std::vector > -inline -create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const OfK& ofk) -{ - return create_interior_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly) -{ - return create_interior_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, - Exact_predicates_inexact_constructions_kernel()); + create_interior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk)); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -100,18 +84,22 @@ create_interior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, /*! create_exterior_skeleton_and_offset_polygons_with_holes_2 (orders the resulting polygons) */ // Polygon might be a Polygon with holes or not, but it returns a Polygon with holes -template::type> -std::vector > +template +std::vector > > inline create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK()) { - typedef typename CGAL_SS_i::Default_return_polygon_type::type Polygon_; - std::vector > raw_output = - create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk); + using OutPolygon = typename CGAL_SS_i::Default_return_polygon_type::type; + using OutPolygonWithHoles = CGAL_SS_i::Polygon_with_holes_return_type; + + std::vector > raw_output = + create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk); // filter offset of the outer frame std::swap(raw_output[0], raw_output.back()); @@ -131,58 +119,38 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, /*! create_interior_skeleton_and_offset_polygons_2 with a polygon with holes */ // overload where PolygonWithHoles actually is a type of Polygon that supports holes -template::type> -std::vector > +template +std::vector > > inline create_exterior_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + std::vector > polygons = - create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), ofk, ssk); + create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), ofk, ssk); for (typename PolygonWithHoles::Hole_const_iterator hit=aPoly.holes_begin(); hit!=aPoly.holes_end(); ++hit) { typename PolygonWithHoles::Polygon_2 hole = *hit; hole.reverse_orientation(); std::vector > hole_polygons = - create_interior_skeleton_and_offset_polygons_2(aOffset, - hole, - ofk,ssk); + create_interior_skeleton_and_offset_polygons_2(aOffset, + hole, + ofk, ssk); polygons.insert(polygons.end(), hole_polygons.begin(), hole_polygons.end()); } return polygons; } -template::type> -std::vector > -inline -create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const OfK& ofk) -{ - return create_exterior_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly) -{ - return create_exterior_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, - Exact_predicates_inexact_constructions_kernel()); -} - } // namespace CGAL #endif // CGAL_CREATE_OFFSET_POLYGONS_FROM_POLYGON_WITH_HOLES_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h index 8ef95ed7564..611cb7117e2 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h @@ -32,14 +32,14 @@ namespace CGAL { -template +template boost::shared_ptr< Straight_skeleton_2 > create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd , HoleIterator aHolesBegin , HoleIterator aHolesEnd - , K const& - ) + , const K& = K()) { typedef Straight_skeleton_2 Ss ; @@ -62,30 +62,13 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin return ssb.construct_skeleton(); } -template -boost::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > -inline -create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin - , PointIterator aOuterContour_VerticesEnd - , HoleIterator aHolesBegin - , HoleIterator aHolesEnd - ) -{ - return create_interior_straight_skeleton_2(aOuterContour_VerticesBegin - ,aOuterContour_VerticesEnd - ,aHolesBegin - ,aHolesEnd - ,Exact_predicates_inexact_constructions_kernel() - ); -} - -template +template boost::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin , PointIterator aOuterContour_VerticesEnd - , K const& k - ) + , const K& k = K()) { typedef typename std::iterator_traits::value_type InputPoint ; typedef typename Kernel_traits::Kernel InputKernel ; @@ -99,24 +82,12 @@ create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin ); } -template -boost::shared_ptr< Straight_skeleton_2 > -inline -create_interior_straight_skeleton_2 ( PointIterator aOuterContour_VerticesBegin - , PointIterator aOuterContour_VerticesEnd - ) -{ - return create_interior_straight_skeleton_2(aOuterContour_VerticesBegin - ,aOuterContour_VerticesEnd - ,Exact_predicates_inexact_constructions_kernel() - ); -} - -template +template boost::shared_ptr< Straight_skeleton_2 > inline -create_interior_straight_skeleton_2 ( Polygon const& aOutContour, - K const& k, +create_interior_straight_skeleton_2 ( const Polygon& aOutContour, + const K& k = K(), std::enable_if_t< ! CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { @@ -126,26 +97,18 @@ create_interior_straight_skeleton_2 ( Polygon const& aOutContour, ); } -template -boost::shared_ptr< Straight_skeleton_2< Exact_predicates_inexact_constructions_kernel > > -inline -create_interior_straight_skeleton_2 ( Polygon const& aOutContour ) -{ - return create_interior_straight_skeleton_2(aOutContour, Exact_predicates_inexact_constructions_kernel() ); -} - //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// /// EXTERIOR -template +template boost::shared_ptr< Straight_skeleton_2 > create_exterior_straight_skeleton_2 ( FT const& aMaxOffset , PointIterator aVerticesBegin , PointIterator aVerticesEnd - , K const& k - ) + , const K& k = K()) { CGAL_precondition( aMaxOffset > 0 ) ; @@ -195,25 +158,13 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset return rSkeleton ; } -template -boost::shared_ptr< Straight_skeleton_2 > -inline -create_exterior_straight_skeleton_2 ( FT const& aMaxOffset - , PointIterator aVerticesBegin - , PointIterator aVerticesEnd - ) -{ - return create_exterior_straight_skeleton_2(aMaxOffset - ,aVerticesBegin - ,aVerticesEnd - ,Exact_predicates_inexact_constructions_kernel() - ); -} - -template +template boost::shared_ptr< Straight_skeleton_2 > inline -create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly, K const& k ) +create_exterior_straight_skeleton_2(const FT& aMaxOffset, + const Polygon& aPoly, + const K& k = K()) { return create_exterior_straight_skeleton_2(aMaxOffset ,CGAL_SS_i::vertices_begin(aPoly) @@ -222,17 +173,6 @@ create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly ); } -template -boost::shared_ptr< Straight_skeleton_2 > -inline -create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly ) -{ - return create_exterior_straight_skeleton_2(aMaxOffset - ,aPoly - ,Exact_predicates_inexact_constructions_kernel() - ); -} - } // namespace CGAL #endif // CGAL_CREATE_STRAIGHT_SKELETON_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h index 19852c88904..97d4d68b561 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include #include @@ -202,10 +200,11 @@ create_partial_exterior_weighted_straight_skeleton_2(const FT& aMaxOffset, //////////////////////////////////////////////////////////////////////////////////////////////////// /// INTERIOR -template::type> -std::vector< boost::shared_ptr > +template +std::vector< boost::shared_ptr > > inline create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aOuterBoundary, @@ -214,9 +213,11 @@ create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const Weights& aWeights, HoleWeightsIterator aHoles_WeightsBegin, HoleWeightsIterator aHoles_WeightsEnd, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK()) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + if(aHolesBegin == aHolesEnd) // see @partial_wsls_pwh { return create_offset_polygons_2( @@ -254,69 +255,33 @@ create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, } } -template::type> -std::vector< boost::shared_ptr > -inline -create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aOuterBoundary, - HoleIterator aHolesBegin, - HoleIterator aHolesEnd, - const Weights& aWeights, - const OfK& ofk) -{ - return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aOuterBoundary, - aHolesBegin, aHolesEnd, - aWeights, - ofk, - Exact_predicates_inexact_constructions_kernel()); -} - // Overload where Polygon actually is a simple polygon (no holes) -template::type> -std::vector< boost::shared_ptr > +template +std::vector< boost::shared_ptr > > inline create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< ! CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + + using IFT = typename boost::range_value::type>::type; + std::vector no_holes; - return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, - no_holes.begin(), no_holes.end(), - aWeights, - ofk, ssk); -} + std::vector > no_hole_weights; -// Overloads common to both polygons with and without holes, a simple polygon is returned in any case -template::type> -std::vector > -inline -create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const Weights& aWeights, - const OfK& ofk) -{ - return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const Weights& aWeights) -{ - return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, - Exact_predicates_inexact_constructions_kernel()); + return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, + no_holes.begin(), no_holes.end(), + aWeights[0], + no_hole_weights.begin(), no_hole_weights.end(), + ofk, ssk); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -327,18 +292,22 @@ create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, /*! create_exterior_skeleton_and_offset_polygons_2 (no sorting of the result) */ // Overload where Polygon actually is a simple polygon (no holes) -template::type> -std::vector< boost::shared_ptr > +template +std::vector > > inline create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const APolygon& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< ! CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + return create_offset_polygons_2( aOffset, CGAL_SS_i::dereference( @@ -346,39 +315,12 @@ create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, aOffset, CGAL_SS_i::vertices_begin(aPoly), CGAL_SS_i::vertices_end (aPoly), - aWeights[0].begin(), - aWeights[0].end(), + std::begin(aWeights[0]), + std::end(aWeights[0]), ssk)), ofk); } -// Overloads common to both polygons with and without holes, a simple polygons is returned in any case -template::type> -std::vector< boost::shared_ptr > -inline -create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const Weights& aWeights, - const OfK& ofk) -{ - return create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector< boost::shared_ptr > -inline -create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, - const APolygon& aPoly, - const Weights& aWeights) -{ - return create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, - Exact_predicates_inexact_constructions_kernel()); -} - } // namespace CGAL #endif // CGAL_CREATE_WEIGHTED_OFFSET_POLYGONS_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index e8addd76ef3..71ee51dc612 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -14,10 +14,9 @@ #include +#include #include -#include -#include -#include +#include #include @@ -36,67 +35,50 @@ namespace CGAL { /*! create_interior_skeleton_and_offset_polygons_2 (no sorting of the result) */ // overload where PolygonWithHoles actually is a type of Polygon that supports holes -template::type> // Hole-less polygon type -std::vector > +template +std::vector > > inline create_interior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { - return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), - aPoly.holes_begin(), aPoly.holes_end(), - aWeights[0], - std::next(std::begin(aWeights)), - std::end(aWeights), - ofk, ssk); + using OutPolygon = CGAL_SS_i::Polygon_return_type; + + return create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), + aPoly.holes_begin(), aPoly.holes_end(), + aWeights[0], + std::next(std::begin(aWeights)), + std::end(aWeights), + ofk, ssk); } /*! create_interior_weighted_skeleton_and_offset_polygons_with_holes_2 (orders the resulting polygons) */ // Polygon might be a Polygon with holes or not, but it returns a Polygon with holes -template::type> -std::vector > +template +std::vector > > inline create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK()) { + using OutPolygon = typename CGAL_SS_i::Default_return_polygon_type::type; + using OutPolygonWithHoles = CGAL_SS_i::Polygon_with_holes_return_type; + return arrange_offset_polygons_2( - create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, ssk)); -} - -template::type> -std::vector > -inline -create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const Weights& aWeights, - const OfK& ofk) -{ - return create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, aWeights, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const Weights& aWeights) -{ - return create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, aWeights, - Exact_predicates_inexact_constructions_kernel()); + create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, ssk)); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -104,21 +86,25 @@ create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOf //////////////////////////////////////////////////////////////////////////////////////////////////// /// EXTERIOR -/*! create_exterior_skeleton_and_offset_polygons_with_holes_2 (orders the resulting polygons) */ +/*! create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2 (orders the resulting polygons) */ // Polygon might be a Polygon with holes or not, but it returns a Polygon with holes -template::type> -std::vector > +template +std::vector > > create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, const Polygon& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk) + const OfK& ofk = OfK(), + const SsK& ssk = SsK()) { - typedef typename CGAL_SS_i::Default_return_polygon_type::type Polygon_; - std::vector > raw_output = - create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, ssk); + using OutPolygon = typename CGAL_SS_i::Default_return_polygon_type::type; + using OutPolygonWithHoles = CGAL_SS_i::Polygon_with_holes_return_type; + + std::vector > raw_output = + create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, ssk); // filter offset of the outer frame std::swap(raw_output[0], raw_output.back()); @@ -138,22 +124,26 @@ create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOf /*! create_interior_skeleton_and_offset_polygons_2 with a polygon with holes */ // overload where PolygonWithHoles actually is a type of Polygon that supports holes -template::type> -std::vector > +template +std::vector > > inline create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, const PolygonWithHoles& aPoly, const Weights& aWeights, - const OfK& ofk, - const SsK& ssk, + const OfK& ofk = OfK(), + const SsK& ssk = SsK(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { + using OutPolygon = CGAL_SS_i::Polygon_return_type; + CGAL_precondition(aWeights.size() == aPoly.number_of_holes() + 1); std::vector > polygons = - create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), {aWeights[0]}, ofk, ssk); + create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly.outer_boundary(), aWeights, ofk, ssk); std::size_t weight_pos = 1; for(typename PolygonWithHoles::Hole_const_iterator hit=aPoly.holes_begin(); hit!=aPoly.holes_end(); ++hit, ++weight_pos) @@ -161,42 +151,16 @@ create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, typename PolygonWithHoles::Polygon_2 hole = *hit; hole.reverse_orientation(); std::vector > hole_polygons = - create_interior_skeleton_and_offset_polygons_2(aOffset, - hole, - {aWeights[weight_pos]}, - ofk, ssk); + create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, + hole, + {aWeights[weight_pos]}, + ofk, ssk); polygons.insert(polygons.end(), hole_polygons.begin(), hole_polygons.end()); } return polygons; } -template::type> -std::vector > -inline -create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const Weights& aWeights, - const OfK& ofk) -{ - return create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, aWeights, ofk, - Exact_predicates_inexact_constructions_kernel()); -} - -template::type> -std::vector > -inline -create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, - const Polygon& aPoly, - const Weights& aWeights) -{ - return create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(aOffset, aPoly, aWeights, - Exact_predicates_inexact_constructions_kernel()); -} - } // namespace CGAL #endif // CGAL_CREATE_WEIGHTED_OFFSET_POLYGONS_FROM_POLYGON_WITH_HOLES_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h index 660cb8cb317..4181cf19741 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h @@ -33,7 +33,7 @@ namespace CGAL { template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr > create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, @@ -43,7 +43,7 @@ create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertice WeightIterator outer_contour_weights_end, HoleWeightsIterator holes_weights_begin, HoleWeightsIterator holes_weights_end, - const K&) + const K& = K()) { using Skeleton = Straight_skeleton_2; @@ -77,37 +77,16 @@ create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertice return ssb.construct_skeleton(); } -template -boost::shared_ptr > -inline -create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertices_begin, - PointIterator outer_contour_vertices_end, - HoleIterator holes_begin, - HoleIterator holes_end, - WeightIterator outer_contour_weights_begin, - WeightIterator outer_contour_weights_end, - HoleWeightsIterator holes_weights_begin, - HoleWeightsIterator holes_weights_end) -{ - return create_interior_weighted_straight_skeleton_2(outer_contour_vertices_begin, outer_contour_vertices_end, - holes_begin, holes_end, - outer_contour_weights_begin, outer_contour_weights_end, - holes_weights_begin, holes_weights_end, - Exact_predicates_inexact_constructions_kernel()); -} - template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr > inline create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, WeightIterator outer_contour_weights_begin, WeightIterator outer_contour_weights_end, - const K& k) + const K& k = K()) { using InputPoint = typename std::iterator_traits::value_type; using InputKernel = typename Kernel_traits::Kernel; @@ -127,51 +106,23 @@ create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertice k); } -template -boost::shared_ptr > -inline -create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertices_begin, - PointIterator outer_contour_vertices_end, - WeightIterator outer_contour_weights_begin, - WeightIterator outer_contour_weights_end) -{ - return create_interior_weighted_straight_skeleton_2(outer_contour_vertices_begin, - outer_contour_vertices_end, - outer_contour_weights_begin, - outer_contour_weights_end, - Exact_predicates_inexact_constructions_kernel()); -} - template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr > inline create_interior_weighted_straight_skeleton_2(const Polygon& out_contour, const Weights& weights, - const K& k, + const K& k = K(), std::enable_if_t::value>* = nullptr) { return create_interior_weighted_straight_skeleton_2(CGAL_SS_i::vertices_begin(out_contour), CGAL_SS_i::vertices_end(out_contour), - weights.begin(), - weights.end(), + weights[0].begin(), + weights[0].end(), k); } -template -boost::shared_ptr > -inline -create_interior_weighted_straight_skeleton_2(const Polygon& out_contour, - const Weights& weights) -{ - return create_interior_weighted_straight_skeleton_2(out_contour, - weights, - Exact_predicates_inexact_constructions_kernel()); -} - //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -180,14 +131,14 @@ create_interior_weighted_straight_skeleton_2(const Polygon& out_contour, template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr > create_exterior_weighted_straight_skeleton_2(const FT& max_offset, PointIterator vertices_begin, PointIterator vertices_end, WeightIterator weights_begin, WeightIterator weights_end, - const K& k) + const K& k = K()) { CGAL_precondition(max_offset > 0); CGAL_precondition(std::distance(weights_begin, weights_end) == std::distance(vertices_begin, vertices_end)); @@ -259,59 +210,25 @@ create_exterior_weighted_straight_skeleton_2(const FT& max_offset, return skeleton; } -template -boost::shared_ptr > -inline -create_exterior_weighted_straight_skeleton_2(const FT& max_offset, - PointIterator vertices_begin, - PointIterator vertices_end, - WeightIterator weights_begin, - WeightIterator weights_end) -{ - return create_exterior_weighted_straight_skeleton_2(max_offset, - vertices_begin, - vertices_end, - weights_begin, - weights_end, - Exact_predicates_inexact_constructions_kernel()); -} - template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr > inline create_exterior_weighted_straight_skeleton_2(const FT& max_offset, const Polygon& aPoly, Weights& weights, - const K& k) + const K& k = K()) { return create_exterior_weighted_straight_skeleton_2(max_offset, CGAL_SS_i::vertices_begin(aPoly), CGAL_SS_i::vertices_end(aPoly), - weights.begin(), - weights.end(), + weights[0].begin(), + weights[0].end(), k); } -template -boost::shared_ptr > -inline -create_exterior_weighted_straight_skeleton_2(const FT& max_offset, - Weights& weights, - const Polygon& aPoly) -{ - return create_exterior_weighted_straight_skeleton_2(max_offset, - aPoly, - weights, - Exact_predicates_inexact_constructions_kernel()); -} - } // namespace CGAL #endif // CGAL_CREATE_WEIGHTED_STRAIGHT_SKELETON_2_H diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_from_polygon_with_holes_2.h index e6a2fea13b1..f9496b31de3 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_from_polygon_with_holes_2.h @@ -28,12 +28,12 @@ namespace CGAL { template + typename K = Exact_predicates_inexact_constructions_kernel> boost::shared_ptr< Straight_skeleton_2 > inline create_interior_weighted_straight_skeleton_2(const Polygon& poly_with_holes, const Weights& weights, - const K& k, + const K& k = K(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { From 595ad9f883fa2322ff189bed5733de317bd6d113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:11:32 +0100 Subject: [PATCH 213/332] Fix using wrong types when converting the offset value --- .../include/CGAL/create_offset_polygons_2.h | 8 +++++--- .../include/CGAL/create_weighted_offset_polygons_2.h | 8 +++++--- .../include/CGAL/create_weighted_straight_skeleton_2.h | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index fd6f6570b0a..cd63eec71b7 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -175,10 +175,12 @@ create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k* typedef Polygon_offset_builder_traits_2 OffsetBuilderTraits; typedef Polygon_offset_builder_2 OffsetBuilder; - OutPolygonPtrVector rR ; - OffsetBuilder ob(aSs); - ob.construct_offset_contours(aOffset, std::back_inserter(rR) ) ; + typename K::FT lOffset = aOffset; + + + OutPolygonPtrVector rR ; + ob.construct_offset_contours(lOffset, std::back_inserter(rR) ) ; return rR ; } diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h index 97d4d68b561..bfc112a5e5f 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h @@ -127,6 +127,8 @@ create_partial_exterior_weighted_straight_skeleton_2(const FT& aMaxOffset, typedef typename Kernel_traits::Kernel IK; typedef typename IK::FT IFT; + static_assert(std::is_same_v::value_type, IFT>); + boost::shared_ptr > rSkeleton; // That's because we might not have FT == IK::FT (e.g. `double` and `Core`) @@ -169,11 +171,11 @@ create_partial_exterior_weighted_straight_skeleton_2(const FT& aMaxOffset, holes.push_back(lPoly) ; // put a weight large enough such that frame edges are not relevant - const FT frame_weight = FT(10) * *(std::max_element(aWeightsBegin, aWeightsEnd)); + const IFT frame_weight = FT(10) * *(std::max_element(aWeightsBegin, aWeightsEnd)); CGAL_STSKEL_BUILDER_TRACE(4, "Frame weight = " << frame_weight); - std::vector lFrameWeights(4, frame_weight); - std::vector > lHoleWeights; + std::vector lFrameWeights(4, frame_weight); + std::vector > lHoleWeights; lHoleWeights.emplace_back(aWeightsBegin, aWeightsEnd); // If w[0] pointed to v_0, then when we reverse the polygon, the last polygon is pointing to v_{n-1} diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h index 4181cf19741..b4eec6b8c21 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h @@ -147,6 +147,8 @@ create_exterior_weighted_straight_skeleton_2(const FT& max_offset, using IK = typename Kernel_traits::Kernel; using IFT = typename IK::FT; + static_assert(std::is_same_v::value_type, IFT>); + boost::shared_ptr > skeleton; // That's because we might not have FT == IK::FT (e.g. `double` and `Core`) @@ -188,11 +190,11 @@ create_exterior_weighted_straight_skeleton_2(const FT& max_offset, holes.push_back(poly); // put a weight large enough such that frame edges are not relevant - const FT frame_weight = FT(10) * *(std::max_element(weights_begin, weights_end)); + const IFT frame_weight = IFT(10) * *(std::max_element(weights_begin, weights_end)); CGAL_STSKEL_BUILDER_TRACE(4, "Frame weight = " << frame_weight); - std::vector lFrameWeights(4, frame_weight); - std::vector > lHoleWeights; + std::vector lFrameWeights(4, frame_weight); + std::vector > lHoleWeights; lHoleWeights.emplace_back(weights_begin, weights_end); // If w[0] pointed to v_0, then when we reverse the polygon, the last polygon is pointing to v_{n-1} From 4d62746395268e7d7b1e02ae5373ac0ef1cbacc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:12:50 +0100 Subject: [PATCH 214/332] Fix typo --- Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index 12a8b1e27eb..540406ef239 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -105,7 +105,7 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin if (lParent == nullptr) return false; - lParent->add_hole(Inner_polygon(CGAL_SS_i::vertices_begin(lPoly), CGAL_SS_i::vertices_begin(lPoly))); + lParent->add_hole(Inner_polygon(CGAL_SS_i::vertices_begin(lPoly), CGAL_SS_i::vertices_end(lPoly))); } } From 97bde2a8b324073c86f3b81cbee60f3327b9cfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:31:38 +0100 Subject: [PATCH 215/332] Clarify type --- .../create_weighted_offset_polygons_from_polygon_with_holes_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index 71ee51dc612..ae1c57f2ab5 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -153,7 +153,7 @@ create_exterior_weighted_skeleton_and_offset_polygons_2(const FT& aOffset, std::vector > hole_polygons = create_interior_weighted_skeleton_and_offset_polygons_2(aOffset, hole, - {aWeights[weight_pos]}, + Weights{aWeights[weight_pos]}, ofk, ssk); polygons.insert(polygons.end(), hole_polygons.begin(), hole_polygons.end()); } From 13e8428caeeb5e4f2e162d7a38626d2a1ec367e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 14 Jan 2025 15:32:04 +0100 Subject: [PATCH 216/332] Add a lot of API tests for non-weighted skeletons --- .../Straight_skeleton_2/test_sls_offset.cpp | 231 +++++++++++++++--- 1 file changed, 193 insertions(+), 38 deletions(-) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index 48f92c02c14..4eb0dfa6bdc 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -32,90 +32,247 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqrt; +namespace CGAL { + +template +class Test_polygon_2 : public CGAL::Polygon_2 { + typedef CGAL::Polygon_2 Base; + Test_polygon_2(const Base&); +public: + using Base::Base; +}; + +template +class Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { + typedef CGAL::Polygon_with_holes_2 Base; + Test_polygon_with_holes_2(const Base&); +public: + using Base::Base; +}; + +} // namespace CGAL + +using namespace CGAL; + template void test_API() { + typedef typename K::FT FT; + typedef typename K::Point_2 Point_2; + typedef CGAL::Polygon_2 Polygon_2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Polygon_2 Polygon_2_EPICK; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2_EPICK; + typedef CGAL::Test_polygon_2 Test_Polygon_2; + typedef CGAL::Test_polygon_with_holes_2 Test_Polygon_with_holes_2; + + typedef CGAL::Test_polygon_2 Test_Polygon_2_EPICK; + typedef CGAL::Test_polygon_with_holes_2 Test_Polygon_with_holes_2_EPICK; + + std::vector v; Polygon_2 p; Polygon_with_holes_2 pwh; std::vector< boost::shared_ptr > res; std::vector< boost::shared_ptr > res_EPICK; - std::vector< boost::shared_ptr > res_w; - std::vector< boost::shared_ptr > res_w_EPICK; + std::vector< boost::shared_ptr > res_wh; + std::vector< boost::shared_ptr > res_wh_EPICK; + + std::vector< boost::shared_ptr > res_test; + std::vector< boost::shared_ptr > res_test_EPICK; + std::vector< boost::shared_ptr > res_wh_test; + std::vector< boost::shared_ptr > res_wh_test_EPICK; // First kernel is the offset construction (and thus output kernel), second kernel is the skeleton construction // simple interior, no holes res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p) ; res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK()) ; - res_EPICK = create_interior_skeleton_and_offset_polygons_2(0, p, EPICK(), K()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; res = create_interior_skeleton_and_offset_polygons_2(0.1, p, K()) ; - res = create_interior_skeleton_and_offset_polygons_2(0, p, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, p, K(), EPICK()) ; res = create_interior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, p, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, v, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, v, EPICK(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(0.1, v, K(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(FT(0.1), v, K(), K()) ; // simple interior, holes res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh) ; res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK()) ; - res_EPICK = create_interior_skeleton_and_offset_polygons_2(0, pwh, EPICK(), K()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; res = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K()) ; - res = create_interior_skeleton_and_offset_polygons_2(0, pwh, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K(), EPICK()) ; res = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), EPICK()) ; + res = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res = create_interior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; + + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res_test = create_interior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; // simple exterior, no holes res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p) ; res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK()) ; - res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0, p, EPICK(), K()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; res = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K()) ; - res = create_exterior_skeleton_and_offset_polygons_2(0, p, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K(), EPICK()) ; res = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, p, EPICK(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(0.1, p, K(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), p, K(), K()) ; + + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, v, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, v, EPICK(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(0.1, v, K(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), v, K(), K()) ; // simple exterior, holes res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh) ; res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK()) ; - res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0, pwh, EPICK(), K()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; res = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K()) ; - res = create_exterior_skeleton_and_offset_polygons_2(0, pwh, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K(), EPICK()) ; res = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), EPICK()) ; + res = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; + + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, EPICK(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(0.1, pwh, K(), K()) ; + res_test = create_exterior_skeleton_and_offset_polygons_2(FT(0.1), pwh, K(), K()) ; // Same, but the result has holes -------------------- // arranged interior, no holes - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p) ; - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK()) ; - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0, p, EPICK(), K()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0, p, K(), EPICK()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), K()) ; + + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), K()) ; + + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, v, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, v, EPICK(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, v, K(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), v, K(), K()) ; // arranged interior, holes - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh) ; - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK()) ; - res_w_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0, pwh, EPICK(), K()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0, pwh, K(), EPICK()) ; - res_w = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), EPICK()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), K()) ; + + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh_test = create_interior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), K()) ; // arranged exterior, no holes - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p) ; - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK()) ; - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0, p, EPICK(), K()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0, p, K(), EPICK()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), EPICK()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), EPICK()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), EPICK()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), K()) ; + + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, EPICK(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, p, K(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, K(), K()) ; + + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, v, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, v, EPICK(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, v, K(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), v, K(), K()) ; // arranged exterior, holes - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh) ; - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK()) ; - res_w_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0, pwh, EPICK(), K()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0, pwh, K(), EPICK()) ; - res_w = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), EPICK()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), EPICK()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), K()) ; + + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, EPICK(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, K(), K()) ; + res_wh_test = create_exterior_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, K(), K()) ; } template @@ -207,7 +364,7 @@ void test_offset_four_square_holes() outer.push_back(Point( 0, 0)); outer.push_back(Point(10, 0)); outer.push_back(Point(10, 10)); - outer.push_back(Point(0, 10)); + outer.push_back(Point( 0, 10)); hole1.push_back(Point(1, 1)); hole1.push_back(Point(1, 4.5)); @@ -964,9 +1121,7 @@ void test_kernel() std::cout.precision(17); std::cerr.precision(17); -#ifndef CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE - // test_API(); -#endif + void (*dummy_ptr)() = &test_API; // Artificial data test_offset_square(); From d4e6ffddf4733df0b5f1c32c4454da20f4b07bdd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 14 Jan 2025 16:12:34 +0100 Subject: [PATCH 217/332] fix protection against min/max macros The regular expression I used was: ``` ((?!(?:^.*(\/\/|\/\*).*|^ *\* .*|^[^"]*"(?:"[^"]*"|[^"])*))^(?:.*[ ,\(]|))(\b(?:(?:[A-Za-z]+::)*)(?:max|min))\b *\( ``` --- .../Alpha_wrap_3/Quality/quality_benchmark.cpp | 10 +++++----- .../GUI_country_pick_handler.cpp | 2 +- .../Arrangement_on_surface_2_earth/Main_widget.cpp | 2 +- CGAL_Core/include/CGAL/CORE/poly/Curves.tcc | 2 +- .../internal_functions_on_circular_arc_2.h | 2 +- .../include/CGAL/Distance_3/Triangle_3_Triangle_3.h | 2 +- Lab/demo/Lab/MainWindow.cpp | 8 ++++++-- ...erpolated_corrected_principal_curvatures_plugin.cpp | 3 ++- .../test/Matrix_search/sorted_matrix_search_test.cpp | 2 +- Number_types/include/CGAL/leda_bigfloat_interval.h | 4 ++-- STL_Extension/include/CGAL/Random_allocator.h | 4 ++-- .../benchmark/Spatial_searching/include/nanoflann.hpp | 6 +++--- .../path_homotopy_with_schema.cpp | 8 ++++---- .../internal/Polyline_constraint_hierarchy_2.h | 4 ++-- 14 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Alpha_wrap_3/benchmark/Alpha_wrap_3/Quality/quality_benchmark.cpp b/Alpha_wrap_3/benchmark/Alpha_wrap_3/Quality/quality_benchmark.cpp index f8e54c488a4..12fa0690c9d 100644 --- a/Alpha_wrap_3/benchmark/Alpha_wrap_3/Quality/quality_benchmark.cpp +++ b/Alpha_wrap_3/benchmark/Alpha_wrap_3/Quality/quality_benchmark.cpp @@ -75,7 +75,7 @@ double mean_min_angle(const Mesh& mesh) const Triangle_3 tr = surface_mesh_face_to_triangle(f, mesh); std::array angles = triangle_angles(tr); - FT min_angle = std::min({angles[0], angles[1], angles[2]}); + FT min_angle = (std::min)({angles[0], angles[1], angles[2]}); min_angle = min_angle * (180.0 / CGAL_PI); mean_min_angle += min_angle; @@ -93,7 +93,7 @@ double mean_max_angle(const Mesh& mesh) const Triangle_3 tr = surface_mesh_face_to_triangle(f, mesh); std::array angles = triangle_angles(tr); - FT max_angle = std::max({angles[0], angles[1], angles[2]}); + FT max_angle = (std::max)({angles[0], angles[1], angles[2]}); max_angle = max_angle * (180.0 / CGAL_PI); mean_max_angle += max_angle; @@ -151,8 +151,8 @@ double mean_edge_ratio(const Mesh& mesh, FT a = std::sqrt(CGAL::squared_distance(tr[0], tr[1])); FT b = std::sqrt(CGAL::squared_distance(tr[1], tr[2])); FT c = std::sqrt(CGAL::squared_distance(tr[2], tr[0])); - FT min_edge = std::min({a, b, c}); - FT max_edge = std::max({a, b, c}); + FT min_edge = (std::min)({a, b, c}); + FT max_edge = (std::max)({a, b, c}); FT edge_ratio = max_edge / min_edge; mean_edge_ratio += edge_ratio; @@ -181,7 +181,7 @@ double mean_aspect_ratio(const Mesh& mesh, FT c = std::sqrt(CGAL::squared_distance(tr[2], tr[0])); FT s = 0.5 * (a + b + c); FT inscribed_radius = std::sqrt((s * (s - a) * (s - b) * (s - c)) / s); - FT max_edge = std::max({a, b, c}); + FT max_edge = (std::max)({a, b, c}); FT aspect_ratio = max_edge / inscribed_radius; aspect_ratio /= (2. * std::sqrt(3.)); // normalized mean_aspect_ratio += aspect_ratio; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/GUI_country_pick_handler.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/GUI_country_pick_handler.cpp index 58bc34f3ca2..53f7aba4972 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/GUI_country_pick_handler.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/GUI_country_pick_handler.cpp @@ -62,7 +62,7 @@ void GUI_country_pick_handler::mouse_press_event(QMouseEvent* e) { auto sd = sqrt(d); auto t1 = (-b - sd) / (2 * a); auto t2 = (-b + sd) / (2 * a); - if (t1 > 0 && t2 > 0) ti = std::min(t1, t2); + if (t1 > 0 && t2 > 0) ti = (std::min)(t1, t2); else if (t1 > 0) ti = t1; else ti = t2; } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Main_widget.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Main_widget.cpp index f99c6c7e55b..decff54e3d5 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Main_widget.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Main_widget.cpp @@ -140,7 +140,7 @@ void Main_widget::initializeGL() { for (auto& [country_name, triangle_points] : country_triangles_map) { auto country_triangles = std::make_unique(triangle_points); auto color = QVector4D(rndm(), rndm(), rndm(), 1); - auto m = std::max(color.x(), std::max(color.y(), color.z())); + auto m = (std::max)(color.x(), (std::max)(color.y(), color.z())); color /= m; color *= m_dimming_factor; color.setW(1); diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc index 3f53e34da44..b287edaecc7 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc @@ -544,7 +544,7 @@ template int BiPoly::getXdegree(){ int deg=-1; for(int i=0; i <=ydeg; i++) - deg = max(deg, coeffX[i].getTrueDegree()); + deg = (max)(deg, coeffX[i].getTrueDegree()); return deg; } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h index b5830954ec7..0bfc65d0a55 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h @@ -1565,7 +1565,7 @@ advanced_make_xy_monotone( const typename CK::Circular_arc_2 &a, double ymax = (is_on_upper) ? to_interval ( CircularFunctors::y_extremal_point(a.supporting_circle(),false).y() ).second : - CGAL::max(left_bb.ymax(),right_bb.ymax()); + (CGAL::max)(left_bb.ymax(),right_bb.ymax()); */ return Bbox_2(left_bb.xmin(),ymin,right_bb.xmax(),ymax); } diff --git a/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h b/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h index 73f4b0eb69c..f6bf77fd39b 100644 --- a/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h +++ b/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h @@ -207,7 +207,7 @@ squared_distance(const typename K::Triangle_3& tr1, FT sqd_q2 = CGAL::squared_distance(vertex(tr2, 1), tr1); FT sqd_r2 = CGAL::squared_distance(vertex(tr2, 2), tr1); - const FT m = std::min({sqd_p1, sqd_q1, sqd_r1, sqd_p2, sqd_q2, sqd_r2}); + const FT m = (std::min)({sqd_p1, sqd_q1, sqd_r1, sqd_p2, sqd_q2, sqd_r2}); return m; #endif diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index dd133dbf44f..60b75d24fe4 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -2396,8 +2396,12 @@ void MainWindow::viewerShowObject() } if(item) { const Scene::Bbox bbox = item->bbox(); - CGAL::qglviewer::Vec min(static_cast(bbox.xmin())+viewer->offset().x, static_cast(bbox.ymin())+viewer->offset().y, static_cast(bbox.zmin())+viewer->offset().z), - max(static_cast(bbox.xmax())+viewer->offset().x, static_cast(bbox.ymax())+viewer->offset().y, static_cast(bbox.zmax())+viewer->offset().z); + CGAL::qglviewer::Vec min{static_cast(bbox.xmin()) + viewer->offset().x, + static_cast(bbox.ymin()) + viewer->offset().y, + static_cast(bbox.zmin()) + viewer->offset().z}; + CGAL::qglviewer::Vec max{static_cast(bbox.xmax()) + viewer->offset().x, + static_cast(bbox.ymax()) + viewer->offset().y, + static_cast(bbox.zmax()) + viewer->offset().z}; viewer->setSceneBoundingBox(min, max); viewerShow(static_cast(min.x), static_cast(min.y), static_cast(min.z), static_cast(max.x), static_cast(max.y), static_cast(max.z)); 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 dbe630ad09f..489b5baca5f 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 @@ -84,7 +84,8 @@ void compute(SMesh* sMesh, for (Vertex_descriptor v : vertices(*sMesh)) { const PMP::Principal_curvatures_and_directions pc = principal_curvatures_and_directions_map[v]; - max_curvature_magnitude_on_mesh = std::max(max_curvature_magnitude_on_mesh, std::max(abs(pc.min_curvature), abs(pc.max_curvature))); + max_curvature_magnitude_on_mesh = + (std::max)(max_curvature_magnitude_on_mesh, (std::max)(abs(pc.min_curvature), abs(pc.max_curvature))); } for(Vertex_descriptor v : vertices(*sMesh)) diff --git a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp index 22b2e16b82d..e5088183176 100644 --- a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp +++ b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp @@ -148,7 +148,7 @@ main( int argc, char* argv[]) */ // evt. update max_entry: - max_entry = max( a[dim - 1] + b[dim - 1], max_entry); + max_entry = (max)( a[dim - 1] + b[dim - 1], max_entry); // keep both vectors: vectors.push_back( a); diff --git a/Number_types/include/CGAL/leda_bigfloat_interval.h b/Number_types/include/CGAL/leda_bigfloat_interval.h index 25b0e2d8c66..8e347812b9d 100644 --- a/Number_types/include/CGAL/leda_bigfloat_interval.h +++ b/Number_types/include/CGAL/leda_bigfloat_interval.h @@ -202,8 +202,8 @@ public: std::pair lower_I(CGAL::to_interval(x.lower())); std::pair upper_I(CGAL::to_interval(x.upper())); return std::pair< double, double >( - CGAL::min(lower_I.first , upper_I.first ), - CGAL::max(lower_I.second, upper_I.second)); + (CGAL::min)(lower_I.first , upper_I.first ), + (CGAL::max)(lower_I.second, upper_I.second)); } }; }; diff --git a/STL_Extension/include/CGAL/Random_allocator.h b/STL_Extension/include/CGAL/Random_allocator.h index 51d36a901fd..69bde52db9b 100644 --- a/STL_Extension/include/CGAL/Random_allocator.h +++ b/STL_Extension/include/CGAL/Random_allocator.h @@ -149,7 +149,7 @@ Random_allocator::allocate(size_type n, const void* hint) #endif // CGAL_DEBUG_RANDOM_ALLOCATOR return block->data + index; } - size_type block_size = std::max(n * random_size, minimal_block_size); + size_type block_size = (std::max)(n * random_size, minimal_block_size); ptr_->allocate_new_block(block_size); return allocate(n, hint); } @@ -183,7 +183,7 @@ template typename Random_allocator::size_type Random_allocator::max_size() const noexcept { - return std::numeric_limits::max() / sizeof(T); + return (std::numeric_limits::max)() / sizeof(T); } } // namespace CGAL diff --git a/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp b/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp index 3dd0b399892..a9972641131 100644 --- a/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp +++ b/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp @@ -1002,7 +1002,7 @@ namespace nanoflann if(node->child1 == NULL && node->child2 == NULL) return 1; else{ - return std::max(depth(node->child1)+1,depth(node->child2)+1); + return (std::max)(depth(node->child1)+1,depth(node->child2)+1); } } @@ -1130,8 +1130,8 @@ namespace nanoflann node->sub.divhigh = right_bbox[cutfeat].low; for (int i=0; i<(DIM>0 ? DIM : dim); ++i) { - bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low); - bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high); + bbox[i].low = (std::min)(left_bbox[i].low, right_bbox[i].low); + bbox[i].high = (std::max)(left_bbox[i].high, right_bbox[i].high); } } diff --git a/Surface_mesh_topology/benchmark/Surface_mesh_topology/path_homotopy_with_schema.cpp b/Surface_mesh_topology/benchmark/Surface_mesh_topology/path_homotopy_with_schema.cpp index 9a5f36d352b..e6d3b3d7104 100644 --- a/Surface_mesh_topology/benchmark/Surface_mesh_topology/path_homotopy_with_schema.cpp +++ b/Surface_mesh_topology/benchmark/Surface_mesh_topology/path_homotopy_with_schema.cpp @@ -118,13 +118,13 @@ int main(int argc, char** argv) if (!withE) { E=static_cast(random.get_int - (10, std::max(std::size_t(11), - cm.number_of_darts()/10))); } + (10, (std::max)(std::size_t(11), + cm.number_of_darts()/10))); } if (!withD) { D=static_cast(random.get_int - (10, std::max(std::size_t(11), - cm.number_of_darts()/10))); } + (10, (std::max)(std::size_t(11), + cm.number_of_darts()/10))); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 8a6f32ba81f..43925c10b52 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -116,7 +116,7 @@ public: struct Constraint_id { Vertex_list_ptr vl = nullptr; - size_type id = std::numeric_limits::max(); + size_type id = (std::numeric_limits::max)(); Constraint_id(std::nullptr_t = nullptr) {} Constraint_id(Vertex_list_ptr vl, size_type id) : vl(vl), id(id) {} @@ -131,7 +131,7 @@ public: Constraint_id& operator=(std::nullptr_t) { vl = nullptr; - id = std::numeric_limits::max(); + id = (std::numeric_limits::max)(); return *this; } bool operator==(std::nullptr_t n) const { return vl == n; } From 46ab7efe83b0ff59440771b15b79191d504ddbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 15 Jan 2025 01:02:25 +0100 Subject: [PATCH 218/332] Add missing default --- .../create_straight_skeleton_from_polygon_with_holes_2.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h index 490ca07788a..21e3dfe7cbb 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_from_polygon_with_holes_2.h @@ -26,11 +26,12 @@ namespace CGAL { -template +template boost::shared_ptr< Straight_skeleton_2 > inline -create_interior_straight_skeleton_2 ( Polygon const& aPolyWithHoles, - K const& k, +create_interior_straight_skeleton_2 ( const Polygon& aPolyWithHoles, + const K& k = K(), std::enable_if_t< CGAL_SS_i::has_Hole_const_iterator::value>* = nullptr) { From 56a6053b94f118989921bade1bdd7d4cbec49c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 15 Jan 2025 01:02:37 +0100 Subject: [PATCH 219/332] Don't use C++17 yet --- .../include/CGAL/create_weighted_offset_polygons_2.h | 2 +- .../include/CGAL/create_weighted_straight_skeleton_2.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h index bfc112a5e5f..96783aaa244 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h @@ -127,7 +127,7 @@ create_partial_exterior_weighted_straight_skeleton_2(const FT& aMaxOffset, typedef typename Kernel_traits::Kernel IK; typedef typename IK::FT IFT; - static_assert(std::is_same_v::value_type, IFT>); + static_assert((std::is_same::value_type, IFT>::value)); boost::shared_ptr > rSkeleton; diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h index b4eec6b8c21..5dfe7354467 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace CGAL { @@ -147,7 +148,7 @@ create_exterior_weighted_straight_skeleton_2(const FT& max_offset, using IK = typename Kernel_traits::Kernel; using IFT = typename IK::FT; - static_assert(std::is_same_v::value_type, IFT>); + static_assert((std::is_same::value_type, IFT>::value)); boost::shared_ptr > skeleton; From baeed4a77f30d59c59f0890480c9dc797be0d103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 15 Jan 2025 11:55:07 +0100 Subject: [PATCH 220/332] Add more tests --- .../test/Straight_skeleton_2/CMakeLists.txt | 2 + .../Straight_skeleton_2/test_sls_simple.cpp | 4 +- .../test_sls_weighted_offset.cpp | 288 ++++++++++++++++++ .../test_sls_weighted_polygons.cpp | 145 +++++++++ .../test_sls_weighted_polygons_with_holes.cpp | 89 +++--- 5 files changed, 485 insertions(+), 43 deletions(-) create mode 100644 Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp create mode 100644 Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index 44aab260541..893695a495c 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -23,5 +23,7 @@ if(CGAL_Qt5_FOUND) target_link_libraries(issue7284 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(test_sls_previous_issues PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(test_sls_offset PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_offset PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_polygons PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(test_sls_weighted_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) endif() diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp index c6ed9f99dc2..47071dc36a9 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp @@ -221,9 +221,7 @@ void test_kernel() { // CGAL_STSKEL_TRAITS_ENABLE_TRACE -#ifndef CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE - // test_API(); -#endif + void (*dummy_ptr)() = &test_API; test_skeleton("data/pseudo_split_0.poly", 13, 40, 8); test_skeleton("data/pseudo_split_1.poly", 21, 68, 12); diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp new file mode 100644 index 00000000000..d8d99a7f3df --- /dev/null +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp @@ -0,0 +1,288 @@ +#define CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE +#define CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; +typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; +typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqrt; + +namespace CGAL { + +template +class Test_polygon_2 : public CGAL::Polygon_2 { + typedef CGAL::Polygon_2 Base; + Test_polygon_2(const Base&); +public: + using Base::Base; +}; + +template +class Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { + typedef CGAL::Polygon_with_holes_2 Base; + Test_polygon_with_holes_2(const Base&); +public: + using Base::Base; +}; + +} // namespace CGAL + +using namespace CGAL; + +template +void test_API() +{ + typedef typename K::FT FT; + typedef typename K::Point_2 Point_2; + + typedef CGAL::Polygon_2 Polygon_2; + typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; + + typedef CGAL::Polygon_2 Polygon_2_EPICK; + typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2_EPICK; + + typedef CGAL::Test_polygon_2 Test_Polygon_2; + typedef CGAL::Test_polygon_with_holes_2 Test_Polygon_with_holes_2; + + typedef CGAL::Test_polygon_2 Test_Polygon_2_EPICK; + typedef CGAL::Test_polygon_with_holes_2 Test_Polygon_with_holes_2_EPICK; + + std::vector v; + Polygon_2 p; + Polygon_with_holes_2 pwh; + std::vector > weights; + + std::vector< boost::shared_ptr > res; + std::vector< boost::shared_ptr > res_EPICK; + std::vector< boost::shared_ptr > res_wh; + std::vector< boost::shared_ptr > res_wh_EPICK; + + std::vector< boost::shared_ptr > res_test; + std::vector< boost::shared_ptr > res_test_EPICK; + std::vector< boost::shared_ptr > res_wh_test; + std::vector< boost::shared_ptr > res_wh_test_EPICK; + + // First kernel is the offset construction (and thus output kernel), second kernel is the skeleton construction + + // simple interior, no holes + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, EPICK(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, K(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), v, weights, K(), K()) ; + + // simple interior, holes + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), EPICK()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res_test = create_interior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + + // simple exterior, no holes + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, EPICK(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, p, weights, K(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), p, weights, K(), K()) ; + + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, EPICK(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, v, weights, K(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), v, weights, K(), K()) ; + + // simple exterior, holes + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), EPICK()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, EPICK(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(0.1, pwh, weights, K(), K()) ; + res_test = create_exterior_weighted_skeleton_and_offset_polygons_2(FT(0.1), pwh, weights, K(), K()) ; + + // Same, but the result has holes -------------------- + + // arranged interior, no holes + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), K()) ; + + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), K()) ; + + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, EPICK(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, K(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), v, weights, K(), K()) ; + + // arranged interior, holes + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), EPICK()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), K()) ; + res_wh = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), K()) ; + + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), K()) ; + res_wh_test = create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), K()) ; + + // arranged exterior, no holes + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), EPICK()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), EPICK()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), EPICK()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), K()) ; + + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, EPICK(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, p, weights, K(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), p, weights, K(), K()) ; + + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, EPICK(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, v, weights, K(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), v, weights, K(), K()) ; + + // arranged exterior, holes + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), EPICK()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), EPICK()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), K()) ; + res_wh = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), K()) ; + + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), EPICK()) ; + res_wh_test_EPICK = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, EPICK(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(0.1, pwh, weights, K(), K()) ; + res_wh_test = create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights, K(), K()) ; +} + +template +void test_kernel() +{ + void (*dummy_ptr)() = &test_API; +} + +int main(int, char**) +{ + std::cout.precision(17); + std::cerr.precision(17); + + test_kernel(); + test_kernel(); + test_kernel(); + + std::cout << "Done!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp new file mode 100644 index 00000000000..c9b33805b1b --- /dev/null +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp @@ -0,0 +1,145 @@ +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +namespace SS = CGAL::CGAL_SS_i; + +typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; +typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; +typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqrt; + +template +void test_API() +{ + typedef typename K::FT FT; + + typedef CGAL::Polygon_2 Polygon_2; + typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; + + typedef CGAL::Straight_skeleton_2 Straight_skeleton_EPICK; + typedef boost::shared_ptr Straight_skeleton_Ptr_EPICK; + + typedef CGAL::Straight_skeleton_2 Straight_skeleton; + typedef boost::shared_ptr Straight_skeleton_Ptr; + + std::vector > weights; + + Polygon_2 p; + Straight_skeleton_Ptr_EPICK ss_epick = CGAL::create_interior_weighted_straight_skeleton_2(p, weights); + Straight_skeleton_Ptr ss = CGAL::create_interior_weighted_straight_skeleton_2(p, weights, K()); + ss_epick = CGAL::create_exterior_weighted_straight_skeleton_2(double(1.01), p, weights); + ss = CGAL::create_exterior_weighted_straight_skeleton_2(int(2), p, weights, K()); + + Polygon_with_holes_2 pwh; + ss_epick = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights); + ss = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights, K()); + ss_epick = CGAL::create_exterior_weighted_straight_skeleton_2(double(1.01), p, weights); + ss = CGAL::create_exterior_weighted_straight_skeleton_2(int(2), p, weights, K()); +} + +template +void test_kernel(const int polygon_nv, CGAL::Random& rnd) +{ + using FT = typename K::FT; + using Point_2 = typename K::Point_2; + using Vector_2 = typename K::Vector_2; + using Point_3 = typename K::Point_3; + + using Polygon_2 = CGAL::Polygon_2; + + using Straight_skeleton_2 = CGAL::Straight_skeleton_2; + using Straight_skeleton_2_ptr = boost::shared_ptr; + + using Mesh = CGAL::Surface_mesh; + + void (*dummy_ptr)() = &test_API; + + typedef CGAL::Random_points_in_square_2 Point_generator; + Polygon_2 pol; + CGAL::random_polygon_2(polygon_nv, std::back_inserter(pol), Point_generator(0.25, rnd)); + + std::vector > weights(1); + for(int i=0; i& ws : weights) + { + for(FT w : ws) + std::cout << w << " "; + std::cout << std::endl; + } + + CGAL::draw(pol); + + auto ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pol, weights); + assert(ss_ptr); + if(!ss_ptr) + { + std::cerr << "Error: failed to create straight skeleton" << std::endl; + return; + } + + CGAL::draw(*ss_ptr); + + ss_ptr = CGAL::create_exterior_weighted_straight_skeleton_2(0.1, pol, weights); + assert(ss_ptr); + if(!ss_ptr) + { + std::cerr << "Error: failed to create straight skeleton" << std::endl; + return; + } + + CGAL::draw(*ss_ptr); + + Mesh sm; + bool success = extrude_skeleton(pol, sm, CGAL::parameters::weights(weights)); + assert(success); + if(!success) + { + std::cerr << "Error: failed to extrude skeleton" << std::endl; + return; + } + + std::cout << num_vertices(sm) << " vertices and " << num_faces(sm) << " faces" << std::endl; + + CGAL::draw(sm); +} + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cerr.precision(17); + + const int polygon_nv = (argc > 1) ? std::atoi(argv[1]) : 10; + const int seed = (argc > 2) ? std::atoi(argv[2]) : std::time(nullptr); + + CGAL::Random rnd(seed); + std::cout << "Seed is " << rnd.get_seed() << std::endl; + + test_kernel(polygon_nv, rnd); + test_kernel(polygon_nv, rnd); + test_kernel(polygon_nv, rnd); + + return EXIT_SUCCESS; +} diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp index 30fda42afd3..2bd4df182e1 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp @@ -1,6 +1,7 @@ #include #include #include + #include #include @@ -24,44 +25,34 @@ namespace SS = CGAL::CGAL_SS_i; -using K = CGAL::Exact_predicates_inexact_constructions_kernel; -using FT = K::FT; -using Point_2 = K::Point_2; -using Vector_2 = K::Vector_2; -using Point_3 = K::Point_3; +typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; +typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; +typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqrt; -using Polygon_2 = CGAL::Polygon_2; -using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; - -using Straight_skeleton_2 = CGAL::Straight_skeleton_2; -using Straight_skeleton_2_ptr = boost::shared_ptr; - -using Mesh = CGAL::Surface_mesh; - -Polygon_2 generate_random_polygon(CGAL::Random& rnd) +template +void test_kernel(const int hole_n, const int hole_nv, CGAL::Random& rnd) { - typedef CGAL::Random_points_in_square_2 Point_generator; + using FT = typename K::FT; + using Point_2 = typename K::Point_2; + using Vector_2 = typename K::Vector_2; + using Point_3 = typename K::Point_3; - Polygon_2 poly; - CGAL::random_polygon_2(10, std::back_inserter(poly), Point_generator(0.25, rnd)); - return poly; -} + using Polygon_2 = CGAL::Polygon_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; -int main(int argc, char** argv) -{ - std::cout.precision(17); - std::cerr.precision(17); + using Straight_skeleton_2 = CGAL::Straight_skeleton_2; + using Straight_skeleton_2_ptr = boost::shared_ptr; - int hole_n = (argc > 1) ? std::atoi(argv[1]) : 2; - int hole_nv = (argc > 2) ? std::atoi(argv[2]) : 10; - int seed = (argc > 3) ? std::atoi(argv[3]) : std::time(nullptr); + using Mesh = CGAL::Surface_mesh; - CGAL::Random rnd(seed); + auto generate_random_polygon = [&](CGAL::Random& rnd) -> Polygon_2 + { + typedef CGAL::Random_points_in_square_2 Point_generator; - std::cout << "Seed is " << rnd.get_seed() << std::endl; - std::cout << 2*hole_n << " holes of size " << hole_nv << std::endl; - - std::vector > weights(1); + Polygon_2 poly; + CGAL::random_polygon_2(10, std::back_inserter(poly), Point_generator(0.25, rnd)); + return poly; + }; // each hole is in a square of size 1 std::vector ob = { Point_2(-hole_n-1, -0.5), @@ -73,6 +64,8 @@ int main(int argc, char** argv) std::cout << "pwh.outer_boundary() = " << pwh.outer_boundary() << std::endl; + std::vector > weights(1); + // tiny weight (far-reaching) for vertical sides weights[0].push_back(rnd.get_double(0.05, 0.5)); weights[0].push_back(rnd.get_double(1, 10)); @@ -120,33 +113,49 @@ int main(int argc, char** argv) std::cout << std::endl; } -// CGAL::draw(pwh); // @tmp remove draw() calls - - auto ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights, K()); +// CGAL::draw(pwh); + auto ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights); + assert(ss_ptr); if(!ss_ptr) { std::cerr << "Error: failed to create straight skeleton" << std::endl; - return EXIT_FAILURE; + return; } // CGAL::draw(*ss_ptr); - auto offsets = CGAL::create_interior_weighted_skeleton_and_offset_polygons_with_holes_2(FT(0.1), pwh, weights); - CGAL_USE(offsets); - Mesh sm; bool success = extrude_skeleton(pwh, sm, CGAL::parameters::weights(weights)); - + assert(success); if(!success) { std::cerr << "Error: failed to extrude skeleton" << std::endl; - return EXIT_FAILURE; + return; } std::cout << num_vertices(sm) << " vertices and " << num_faces(sm) << " faces" << std::endl; // CGAL::draw(sm); +} + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cerr.precision(17); + + int hole_n = (argc > 1) ? std::atoi(argv[1]) : 2; + int hole_nv = (argc > 2) ? std::atoi(argv[2]) : 10; + int seed = (argc > 3) ? std::atoi(argv[3]) : std::time(nullptr); + + CGAL::Random rnd(seed); + + std::cout << "Seed is " << rnd.get_seed() << std::endl; + std::cout << 2*hole_n << " holes of size " << hole_nv << std::endl; + + test_kernel(hole_n, hole_nv, rnd); + test_kernel(hole_n, hole_nv, rnd); + test_kernel(hole_n, hole_nv, rnd); return EXIT_SUCCESS; } From 92e31b78597cc2ef3b637ddc493f9ae1b0b6fa28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 15 Jan 2025 11:55:50 +0100 Subject: [PATCH 221/332] Misc tiny fixes --- Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index cd63eec71b7..0283ced78aa 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -128,7 +128,7 @@ create_partial_exterior_straight_skeleton_2 ( FT const& aMaxOffset std::vector holes ; holes.push_back(lPoly) ; - rSkeleton = create_partial_interior_straight_skeleton_2(aMaxOffset,frame, frame+4, holes.begin(), holes.end(), k ) ; + rSkeleton = create_partial_interior_straight_skeleton_2(aMaxOffset, frame, frame+4, holes.begin(), holes.end(), k ) ; } return rSkeleton ; @@ -177,8 +177,6 @@ create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k* OffsetBuilder ob(aSs); typename K::FT lOffset = aOffset; - - OutPolygonPtrVector rR ; ob.construct_offset_contours(lOffset, std::back_inserter(rR) ) ; From 22dd382e26bc7f98f80e9c465836a9eaa06c4b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 15 Jan 2025 12:31:25 +0100 Subject: [PATCH 222/332] Do not use c++17 in 5.6.x --- Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index 0283ced78aa..2a2a481dab0 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -141,7 +141,7 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Tag_false ) { - static_assert(!std::is_same_v); + static_assert(!(std::is_same::value)); typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; @@ -167,7 +167,7 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k*/, Tag_true ) { - static_assert(!std::is_same_v); + static_assert(!(std::is_same::value)); typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; From 2869ad810baca7f9055879cf627cb20c4af96875 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 15 Jan 2025 19:08:01 +0100 Subject: [PATCH 223/332] fix compilation errors with C++<20 --- Mesh_2/test/Mesh_2/CMakeLists.txt | 2 +- Mesh_2/test/Mesh_2/test_mesh_terrain.cpp | 13 ++++++++ Mesh_2/test/Mesh_2/test_meshing.cpp | 6 ---- STL_Extension/include/CGAL/Random_allocator.h | 32 ++++++++++++------- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 877831c292e..1553aae3ce4 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -16,5 +16,5 @@ foreach(cppfile ${cppfiles}) endforeach() if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) - target_compile_features(test_meshing PRIVATE cxx_std_20) + target_compile_features(test_mesh_terrain PRIVATE cxx_std_20) endif() diff --git a/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp b/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp index 4ac052fab12..2fe8c8058de 100644 --- a/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp +++ b/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp @@ -1,3 +1,13 @@ +// Test also CGAL::Random_allocator +#if __has_include() +# include +# if __cpp_lib_format >= 201907L +# define CGAL_DEBUG_RANDOM_ALLOCATOR 1 +# endif +#endif +#include +#define CGAL_ALLOCATOR(T) CGAL::Random_allocator + #include #include #include @@ -21,6 +31,9 @@ typedef K::Point_3 Point; int main() { +#if CGAL_DEBUG_RANDOM_ALLOCATOR + std::clog << "CGAL::Random_allocator debug mode is enabled..." << std::endl; +#endif Delaunay dt; typedef Delaunay::Vertex_handle Vertex_handle; Vertex_handle va = dt.insert(Point(-4,0, 0)); diff --git a/Mesh_2/test/Mesh_2/test_meshing.cpp b/Mesh_2/test/Mesh_2/test_meshing.cpp index ed6801d28f1..db91f5a0c08 100644 --- a/Mesh_2/test/Mesh_2/test_meshing.cpp +++ b/Mesh_2/test/Mesh_2/test_meshing.cpp @@ -1,10 +1,4 @@ // 154 515 565 -#include -#if CGAL_CXX20 -# define CGAL_DEBUG_RANDOM_ALLOCATOR 1 -# include -# define CGAL_ALLOCATOR(T) CGAL::Random_allocator -#endif #include "test_dependencies.h" #include #if CGAL_USE_CORE || CGAL_USE_LEDA diff --git a/STL_Extension/include/CGAL/Random_allocator.h b/STL_Extension/include/CGAL/Random_allocator.h index 69bde52db9b..6c8b9dd49cf 100644 --- a/STL_Extension/include/CGAL/Random_allocator.h +++ b/STL_Extension/include/CGAL/Random_allocator.h @@ -15,12 +15,20 @@ #include #include #include - -// This header requires C++20 or later. -#include #include -#include -#include + +#if CGAL_DEBUG_RANDOM_ALLOCATOR +# if __has_include() +# include +# include +# if __cpp_lib_format >= 201907L +# define CGAL_DEBUG_RANDOM_ALLOCATOR_OKAY 1 +# endif +# endif +# if ! CGAL_DEBUG_RANDOM_ALLOCATOR_OKAY +# error "CGAL_DEBUG_RANDOM_ALLOCATOR requires and C++20 std::format" +# endif +#endif namespace CGAL { @@ -50,9 +58,9 @@ template > class Ran void allocate_new_block(std::size_t block_size = minimal_block_size) { - auto& block = blocks.emplace_back(nullptr, boost::dynamic_bitset<>(block_size)); + auto& block = blocks.emplace_back(); block.data = alloc.allocate(block_size); - block.available.set(); + block.available.resize(block_size, true); block.maximal_continuous_free_space = block_size; } @@ -93,7 +101,8 @@ public: template struct rebind { - using other_upstream_allocator = std::allocator_traits::template rebind_alloc; + using upstream_traits = std::allocator_traits; + using other_upstream_allocator = typename upstream_traits::template rebind_alloc; using other = Random_allocator; }; @@ -113,7 +122,8 @@ typename Random_allocator::pointer Random_allocator::allocate(size_type n, const void* hint) { boost::container::static_vector, random_size> found_spaces; - for(auto& block : ptr_->blocks | std::views::reverse) { + for(auto it = ptr_->blocks.rbegin(), end = ptr_->blocks.rend(); it != end; ++it) { + auto& block = *it; if(block.maximal_continuous_free_space < n) continue; auto& available = block.available; @@ -127,7 +137,7 @@ Random_allocator::allocate(size_type n, const void* hint) auto free_space = end_of_free_block - index; found_max_free_space = (std::max)(found_max_free_space, free_space); while(free_space > n && found_spaces.size() < found_spaces.capacity()) { - found_spaces.push_back({std::addressof(block), index}); + found_spaces.emplace_back(std::addressof(block), index); free_space -= n; index += n; } @@ -144,7 +154,7 @@ Random_allocator::allocate(size_type n, const void* hint) block->available.set(index, n, false); #if CGAL_DEBUG_RANDOM_ALLOCATOR std::clog << std::format("CGAL::Random_allocator debug info: n = {}, found_spaces.size() = {}, i = {}," - "block nb = {}, block size = {}, index = {}\n", + " block id = {}, block size = {}, index = {}\n", n, found_spaces.size(), i, block - ptr_->blocks.data(), block->size(), index); #endif // CGAL_DEBUG_RANDOM_ALLOCATOR return block->data + index; From cf50ad8b13222989225881e9ad39fce2d0487560 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 16 Jan 2025 13:47:33 +0100 Subject: [PATCH 224/332] document the breakng change --- Installation/CHANGES.md | 6 ++++++ .../Triangulation_2/CGAL/Constrained_triangulation_plus_2.h | 5 +++++ .../examples/Triangulation_2/constrained_hierarchy_plus.cpp | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 291dc13ae41..1a59d0c3b39 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -14,6 +14,12 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. +### [2D Triangulations](https://doc.cgal.org/6.1/Manual/packages.html#PkgTriangulation2) + +- **Breaking change**: In the class template `Constrained_triangulation_plus_2`, the value type of the range returned + by `subconstraints()` has changed from `const std::pair*>` to `Subconstraint`. + The old range type is now returned by a new function named `subconstraints_and_contexts()`. + ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) ### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h index 34aee28ad9c..edd6655527f 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h @@ -360,6 +360,11 @@ void remove_constraint(Constraint_id cid); /// \name Access /// @{ +/// +/// \note +/// Since CGAL-6.1, the value type of the range returned by `subconstraints()` has changed from +/// `const std::pair*>` to `Subconstraint`. +/// The old range type is now returned by the function `subconstraints_and_contexts()`. /*! returns a `Constraint_iterator` that points at the first diff --git a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp index b243e152693..b67d5a5a507 100644 --- a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp +++ b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp @@ -30,7 +30,8 @@ main( ) cdt.insert_constraint( Point(j,0), Point(j,6)); int count = 0; - for (const Triangulation::Subconstraint& sc : cdt.subconstraints()) { + using Sc = Triangulation::Subconstraint; + for ([[maybe_unused]] const Sc& sc : cdt.subconstraints()) { ++count; } std::cout << "The number of resulting constrained edges is "; From cf815b823f21b9bba00d60b772faa8b3798e90af Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 16 Jan 2025 14:14:38 +0100 Subject: [PATCH 225/332] doc fix: add that iterators are all bidirectional --- .../CGAL/Constrained_triangulation_plus_2.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h index edd6655527f..f9786d793f3 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h @@ -77,7 +77,7 @@ A default constructed `Constraint_id` is a singular value that can not be the ID typedef unspecified_type Constraint_id; /*! -An iterator to visit +A bidirectional iterator to visit all the input constraints. The order of visit is undefined. The value type of this iterator is `Constraint_id`. */ @@ -96,7 +96,7 @@ A subconstraint is a pair of vertices that correspond to an `Edge`. typedef std::pair Subconstraint; /*! -An iterator to visit all the subconstraints of the triangulation. +A bidirectional iterator to visit all the subconstraints of the triangulation. The order of visit is undefined. The value type of this iterator is `Subconstraint`. */ @@ -109,7 +109,7 @@ the range is `Subconstraint_iterator`. typedef unspecified_type Subconstraints; /*! -An iterator to visit all the subconstraints of the triangulation and the +A bidirectional iterator to visit all the subconstraints of the triangulation and the contexts of their enclosing constraints. The order of visit is undefined. The value type of this iterator is `const std::pair*>`. */ @@ -122,7 +122,7 @@ the range is `Subconstraint_and_contexts_iterator`. typedef unspecified_type Subconstraints_and_contexts; /*! -An iterator on the +A bidirectional iterator on the vertices of the chain of subconstraints representing a constraint. The value type of this iterator is `Vertex_handle`. */ @@ -164,10 +164,8 @@ through a subconstraint. }; /*! -An iterator on -constraints enclosing a given subconstraint. The value type of this -iterator -is `Context`. +A bidirectional iterator on constraints enclosing a given subconstraint. +The value type of this iterator is `Context`. */ typedef unspecified_type Context_iterator; From 7cf6793117696dc2aa8049744668d77f9043da26 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 17 Jan 2025 10:31:54 +0100 Subject: [PATCH 226/332] issue #8689 Regression documentation build - compare doxygen version with the available directories on disk and (try to) use the most appropriate one - give a warning when there are more directories than expected (already present), though `FATAL` should probably be `FATAL_ERROR` though the latest will give problems when adding a new version to the directory list for testing. Changed the message to a `WARNING` --- Documentation/doc/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index b251731cafc..ecef25071c2 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -299,8 +299,8 @@ file(GLOB CGAL_DOXYGEN_RESOURCES_DIRS list(SORT CGAL_DOXYGEN_RESOURCES_DIRS COMPARE NATURAL) if(NOT CGAL_DOXYGEN_RESOURCES_DIRS STREQUAL CGAL_DOXYGEN_RESOURCES_VERSIONS) - message(FATAL "The directories in ${CGAL_DOC_RESOURCE_PREFIX_DIR} do not match the -expected versions: [${CGAL_DOXYGEN_RESOURCES_VERSIONS}] vs [${CGAL_DOXYGEN_RESOURCES_DIRS}]") + message(WARNING "The directories in ${CGAL_DOC_RESOURCE_PREFIX_DIR} do not match the expected versions:\n" + " [${CGAL_DOXYGEN_RESOURCES_DIRS}] vs [${CGAL_DOXYGEN_RESOURCES_VERSIONS}]") endif() function(CGAL_insert_in_sorted_list list_name value) @@ -312,14 +312,15 @@ function(CGAL_insert_in_sorted_list list_name value) set(${list_name} ${list} PARENT_SCOPE) endfunction() -if(DOXYGEN_VERSION IN_LIST CGAL_DOXYGEN_RESOURCES_VERSIONS) - list(FIND CGAL_DOXYGEN_RESOURCES_VERSIONS "${DOXYGEN_VERSION}" DOXYGEN_VERSION_INDEX) +if(DOXYGEN_VERSION IN_LIST CGAL_DOXYGEN_RESOURCES_DIRS) + list(FIND CGAL_DOXYGEN_RESOURCES_DIRS "${DOXYGEN_VERSION}" DOXYGEN_VERSION_INDEX) else() - CGAL_insert_in_sorted_list(CGAL_DOXYGEN_RESOURCES_VERSIONS ${DOXYGEN_VERSION}) - list(FIND CGAL_DOXYGEN_RESOURCES_VERSIONS ${DOXYGEN_VERSION} DOXYGEN_VERSION_INDEX) + CGAL_insert_in_sorted_list(CGAL_DOXYGEN_RESOURCES_DIRS ${DOXYGEN_VERSION}) + list(FIND CGAL_DOXYGEN_RESOURCES_DIRS ${DOXYGEN_VERSION} DOXYGEN_VERSION_INDEX) math(EXPR DOXYGEN_VERSION_INDEX "${DOXYGEN_VERSION_INDEX} - 1") endif() list(GET CGAL_DOXYGEN_RESOURCES_DIRS "${DOXYGEN_VERSION_INDEX}" CGAL_DOC_RESOURCE_DIR) + set(CGAL_DOC_RESOURCE_DIR "${CGAL_DOC_RESOURCE_PREFIX_DIR}/${CGAL_DOC_RESOURCE_DIR}") if(NOT EXISTS "${CGAL_DOC_RESOURCE_DIR}") message(FATAL_ERROR "Doxygen resources for version ${DOXYGEN_VERSION} not found") From bc64faaab31fd059deb6d45ba797138720ec1a1c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 17 Jan 2025 16:22:24 +0100 Subject: [PATCH 227/332] Laurent's review --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 2 +- Mesh_3/doc/Mesh_3/Mesh_3.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 3a834536db6..018449f3585 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -457,7 +457,7 @@ unspecified_type perturb(const Named_function_parameters& np = parameters::defau * The function `parameters::initial_points_generator()` enables the user to specify a functor that follows * the `InitialPointsGenerator_3` concept to the mesh generation function `make_mesh_3()`. This functor is called * for the initialization of the meshing process, by inserting well-distributed surface vertices. - * If this parameter is specified without arguments, the default behavior + * If this parameter is not specified, the default behavior * is executed, which calls the domain's `construct_initial_points_object()` for the initialization of the meshing process. * * Initialization is considered to be complete if the triangulation is a 3D triangulation diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 73fc0b179f2..77afe7fd7ea 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -757,8 +757,9 @@ First, the functor `construct_intersection` is created: then the `%Mesh_domain::Intersection` object (a `%tuple` with three elements) is constructed using a call to the functor `construct_intersection` \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h use construct intersection -and eventually `%index` is the element \#1 of `%intersect`. -\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection +and eventually `%intersect_index` is the element \#1 of `%intersect`. +\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection. +The dimension of the underlying simplex is stored as the element \#2 of `%intersect``. The result of the custom initialization can be seen in \cgalFigureRef{mesh3custominitimage3D}. The generated 3D image contains a From c161fc1ccf10e78b378b6e6770056d05d95e7c52 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 20 Jan 2025 09:48:53 +0100 Subject: [PATCH 228/332] with the point, snippet can't be found --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 77afe7fd7ea..f78d9a28a3f 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -758,7 +758,8 @@ then the `%Mesh_domain::Intersection` object (a `%tuple` with three elements) is constructed using a call to the functor `construct_intersection` \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h use construct intersection and eventually `%intersect_index` is the element \#1 of `%intersect`. -\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection. +\snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection +. The dimension of the underlying simplex is stored as the element \#2 of `%intersect``. The result of the custom initialization can be seen in From 79d6f4c4d4a2214c82d51f8e9bc1d9799e7c9b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 20 Jan 2025 10:43:45 +0100 Subject: [PATCH 229/332] Fix warnings --- .../test/Straight_skeleton_2/test_sls_offset.cpp | 3 +++ .../test/Straight_skeleton_2/test_sls_simple.cpp | 3 +++ .../test/Straight_skeleton_2/test_sls_weighted_offset.cpp | 3 +++ .../Straight_skeleton_2/test_sls_weighted_polygons.cpp | 8 +++++--- .../test_sls_weighted_polygons_with_holes.cpp | 4 ++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index 4eb0dfa6bdc..bc024d9c8d3 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -21,6 +21,8 @@ #include #include +#include + #include #include @@ -1122,6 +1124,7 @@ void test_kernel() std::cerr.precision(17); void (*dummy_ptr)() = &test_API; + CGAL_USE(dummy_ptr); // Artificial data test_offset_square(); diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp index 47071dc36a9..889f2968e64 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp @@ -34,6 +34,8 @@ void Straight_skeleton_traits_external_trace(std::string m) #include #include +#include + #include #include @@ -222,6 +224,7 @@ void test_kernel() // CGAL_STSKEL_TRAITS_ENABLE_TRACE void (*dummy_ptr)() = &test_API; + CGAL_USE(dummy_ptr); test_skeleton("data/pseudo_split_0.poly", 13, 40, 8); test_skeleton("data/pseudo_split_1.poly", 21, 68, 12); diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp index d8d99a7f3df..40fd4aede6f 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include #include @@ -271,6 +273,7 @@ template void test_kernel() { void (*dummy_ptr)() = &test_API; + CGAL_USE(dummy_ptr); } int main(int, char**) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp index c9b33805b1b..eff1304512a 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons.cpp @@ -18,6 +18,8 @@ #include #include +#include + #include #include @@ -62,7 +64,6 @@ void test_kernel(const int polygon_nv, CGAL::Random& rnd) { using FT = typename K::FT; using Point_2 = typename K::Point_2; - using Vector_2 = typename K::Vector_2; using Point_3 = typename K::Point_3; using Polygon_2 = CGAL::Polygon_2; @@ -73,6 +74,7 @@ void test_kernel(const int polygon_nv, CGAL::Random& rnd) using Mesh = CGAL::Surface_mesh; void (*dummy_ptr)() = &test_API; + CGAL_USE(dummy_ptr); typedef CGAL::Random_points_in_square_2 Point_generator; Polygon_2 pol; @@ -92,7 +94,7 @@ void test_kernel(const int polygon_nv, CGAL::Random& rnd) CGAL::draw(pol); - auto ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pol, weights); + Straight_skeleton_2_ptr ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pol, weights, K()); assert(ss_ptr); if(!ss_ptr) { @@ -102,7 +104,7 @@ void test_kernel(const int polygon_nv, CGAL::Random& rnd) CGAL::draw(*ss_ptr); - ss_ptr = CGAL::create_exterior_weighted_straight_skeleton_2(0.1, pol, weights); + ss_ptr = CGAL::create_exterior_weighted_straight_skeleton_2(0.1, pol, weights, K()); assert(ss_ptr); if(!ss_ptr) { diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp index 2bd4df182e1..c924877abc1 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp @@ -50,7 +50,7 @@ void test_kernel(const int hole_n, const int hole_nv, CGAL::Random& rnd) typedef CGAL::Random_points_in_square_2 Point_generator; Polygon_2 poly; - CGAL::random_polygon_2(10, std::back_inserter(poly), Point_generator(0.25, rnd)); + CGAL::random_polygon_2(hole_nv, std::back_inserter(poly), Point_generator(0.25, rnd)); return poly; }; @@ -115,7 +115,7 @@ void test_kernel(const int hole_n, const int hole_nv, CGAL::Random& rnd) // CGAL::draw(pwh); - auto ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights); + Straight_skeleton_2_ptr ss_ptr = CGAL::create_interior_weighted_straight_skeleton_2(pwh, weights, K()); assert(ss_ptr); if(!ss_ptr) { From 19502356539ec7d35541244683934286d7e7dee2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 20 Jan 2025 16:28:36 +0100 Subject: [PATCH 230/332] remove extra point --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index f78d9a28a3f..5365c9143a9 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -759,7 +759,6 @@ elements) is constructed using a call to the functor `construct_intersection` \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h use construct intersection and eventually `%intersect_index` is the element \#1 of `%intersect`. \snippet CGAL/Mesh_3/Construct_initial_points_labeled_image.h get construct intersection -. The dimension of the underlying simplex is stored as the element \#2 of `%intersect``. The result of the custom initialization can be seen in From 1d6e3056b76946f584259c86690f27586ddcbafb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 20 Jan 2025 16:56:58 +0100 Subject: [PATCH 231/332] typo --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 5365c9143a9..7de626783d4 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -801,7 +801,7 @@ a custom functor that initializes the triangulation. A struct `Custom_Initial_points_generator` that places 1D-feature points alongside a line is created. -Finally, the exemple \ref Mesh_3/mesh_3D_image_with_initial_points.cpp features +Finally, the example \ref Mesh_3/mesh_3D_image_with_initial_points.cpp features a point container that initializes the triangulation using the meshing parameter `parameters::initial_points()`. From 74cab200c11c7fb7b7b0865b4658b7419ee99bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 21 Jan 2025 08:59:26 +0100 Subject: [PATCH 232/332] Fix warning --- .../test_sls_weighted_polygons_with_holes.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp index c924877abc1..ffa31c47d5b 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_polygons_with_holes.cpp @@ -34,7 +34,6 @@ void test_kernel(const int hole_n, const int hole_nv, CGAL::Random& rnd) { using FT = typename K::FT; using Point_2 = typename K::Point_2; - using Vector_2 = typename K::Vector_2; using Point_3 = typename K::Point_3; using Polygon_2 = CGAL::Polygon_2; From 1ce108778fbc16fab8cd731e206ceeed4af3ab14 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 15:10:10 +0100 Subject: [PATCH 233/332] rewrite/refactor a lot of the code --- STL_Extension/include/CGAL/Has_timestamp.h | 3 + Stream_support/include/CGAL/IO/io.h | 13 + Stream_support/include/CGAL/IO/io_tags.h | 2 +- .../CGAL/Constrained_triangulation_plus_2.h | 146 +++---- .../Polyline_constraint_hierarchy_2.h | 390 +++++++++--------- .../test/Triangulation_2/issue_4025.cpp | 143 ++++--- 6 files changed, 363 insertions(+), 334 deletions(-) diff --git a/STL_Extension/include/CGAL/Has_timestamp.h b/STL_Extension/include/CGAL/Has_timestamp.h index ad608a4f6b6..3fe442576cc 100644 --- a/STL_Extension/include/CGAL/Has_timestamp.h +++ b/STL_Extension/include/CGAL/Has_timestamp.h @@ -36,6 +36,9 @@ namespace internal { // when T does not have a Has_timestamp tag {}; + template + constexpr bool has_timestamp_v = Has_timestamp::value; + } // end namespace internal } // end namespace CGAL diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 3f8202d8325..631dfb6e5b7 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -216,6 +216,19 @@ public: } }; +template +class Output_rep +{ + Func f; + +public: + Output_rep(Func f) : f(f) {} + std::ostream& operator()(std::ostream& os) const + { + return f(os); + } +}; + /*! \relates Output_rep \brief stream output of the \c Output_rep calls its \c operator(). diff --git a/Stream_support/include/CGAL/IO/io_tags.h b/Stream_support/include/CGAL/IO/io_tags.h index 0d9f53a4ef7..2be29669531 100644 --- a/Stream_support/include/CGAL/IO/io_tags.h +++ b/Stream_support/include/CGAL/IO/io_tags.h @@ -51,7 +51,7 @@ template<> struct Io_traits { typedef io_Read_write Io_tag; }; template<> struct Io_traits { typedef io_Read_write Io_tag; }; template<> struct Io_traits { typedef io_Read_write Io_tag; }; - +struct IO_manip_tag{}; } //namespace CGAL diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 1d4cd0dcbfb..043320f6689 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -378,57 +378,69 @@ public: } + + // Removes pos from the constraint cid. + // Returns the iterator to vertex that was just after pos (or end()) + // Writes the modified faces to out template Vertices_in_constraint_iterator remove_vertex_from_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos, OutputIterator out) { if(pos == vertices_in_constraint_begin(cid)){ - ++pos; - Constraint_id aux = hierarchy.split2(cid,pos); + // cid is [P, A, ..., B] -> split to aux=[P, A] and cid=[A...B] + Constraint_id aux = hierarchy.split2(cid, std::next(pos)); remove_constraint(aux, out); - return pos; + return vertices_in_constraint_begin(cid); } - Vertices_in_constraint_iterator it = vertices_in_constraint_end(cid); - it--; - if(pos == it){ - --pos; - Constraint_id aux = hierarchy.split(cid, pos); + if(pos == std::prev(vertices_in_constraint_end(cid))){ + // cid is [A, ..., B, P] -> split to cid=[A...B] and aux=[B,P] + Constraint_id aux = hierarchy.split(cid, std::prev(pos)); remove_constraint(aux, out); return vertices_in_constraint_end(cid); } - Vertices_in_constraint_iterator pp = pos; - --pp; - Vertex_handle a = *pp; - pp = pos; - ++pp; - Vertex_handle b = *pp; - --it; - Vertices_in_constraint_iterator beg = vertices_in_constraint_begin(cid); - ++beg; - Face_container fc(*this); + const auto second_vertex_of_cid = std::next(vertices_in_constraint_begin(cid)); + const auto next_to_last_vertex_of_cid = std::prev(vertices_in_constraint_end(cid), 2); Constraint_id head = nullptr, tail = nullptr; - if(pos != beg){ + if(pos != second_vertex_of_cid){ + // cid is [A, ..., B, P, C, ..., D] + // split to: + // head = [A...B] and, + // cid = [B, P, C...D] // split off head - --pos; - head = hierarchy.split2(cid, pos); - ++pos; + head = hierarchy.split2(cid, std::prev(pos)); } - if(pos != it){ + if(pos != next_to_last_vertex_of_cid){ + // cid is now [B, P, C, ..., D] + // split to: + // cid = [B, P, C] and, + // tail = [C...D] // split off tail - ++pos; - tail = hierarchy.split(cid,pos); + tail = hierarchy.split(cid,std::next(pos)); } - Constraint_id aux = insert_constraint(a, b, std::back_inserter(fc)); - pos = vertices_in_constraint_end(aux); - --pos; - --pos; // this is not necessarily == vertices_in_constraint_begin(aux); + // now: + // cid is [B, P, C] + // head is null or [A...B] + // tail is null or [C...D] + // Let create insert [C,D] and conditionnaly concatenate head and tail, + // and return the iterator to C + + Vertex_handle b = *std::prev(pos); + Vertex_handle c = *std::next(pos); + + Face_container fc(*this); + Constraint_id aux = insert_constraint(b, c, std::back_inserter(fc)); + + auto pos_before_c = std::prev(vertices_in_constraint_end(aux), 2); + // `pos_before_c` is not necessarily == vertices_in_constraint_begin(aux) + // there might have been intersecting constraints + hierarchy.swap(cid, aux); - remove_constraint(aux, std::back_inserter(fc)); + remove_constraint(aux, std::back_inserter(fc)); // removes [B, P, C] if(head != nullptr){ hierarchy.concatenate2(head, cid); @@ -438,8 +450,9 @@ public: hierarchy.concatenate(cid, tail); } fc.write_faces(out); - ++pos; // we went one too far back because the last vertex gets removed by concatenate - return pos; + + // we went one too far back because the last vertex `c` gets removed by concatenate + return std::next(pos_before_c); } // Inserts vh before pos @@ -461,61 +474,56 @@ public: // Insertion after the last vertex if(pos == vertices_in_constraint_end(cid)){ //std::cout << "insertion after last vertex" << std::endl; - pos--; - Constraint_id tail = insert_constraint(*pos, vh, out); - pos = vertices_in_constraint_end(tail); - --pos; + Constraint_id tail = insert_constraint(*std::prev(pos), vh, out); + auto returned_pos = std::prev(vertices_in_constraint_end(tail)); hierarchy.concatenate(cid, tail); - return pos; + return returned_pos; } + Vertices_in_constraint_iterator pred = std::prev(pos); + Vertices_in_constraint_iterator last = std::prev(vertices_in_constraint_end(cid)); + Vertex_handle a = *pred; Vertex_handle b = *pos; - --pos; - Vertex_handle a = *pos; - ++pos; + + // cid is [..., A, B, ...] and M=*vh will be inserted between A and B + Face_container fc(*this); - Vertices_in_constraint_iterator beg = vertices_in_constraint_begin(cid), vcit; - ++beg; - vcit = beg; - ++beg; + Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc)); + Constraint_id aux2 = insert_constraint(vh, b, std::back_inserter(fc)); + auto returned_pos = vertices_in_constraint_begin(aux2); + concatenate(aux1, aux2); + // here: + // aux1 is [A, M, B] + // aux2 is empty + // and returned_pos is the iterator to M + + const auto second_vertex_of_cid = std::next(vertices_in_constraint_begin(cid)); // If the constraint consists only of a segment, and we want to insert - // in the middle - if((pos == vcit) && (beg == vertices_in_constraint_end(cid))){ + // in the middle: cid is just the segment [A, B] + if((pos == second_vertex_of_cid) && (second_vertex_of_cid == last)){ //std::cout << "insertion in constraint which is a segment" << std::endl; - Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc)); - Constraint_id aux2 = insert_constraint(vh, b, std::back_inserter(fc)); - pos = vertices_in_constraint_begin(aux2); - concatenate(aux1, aux2); hierarchy.swap(cid, aux1); remove_constraint(aux1, std::back_inserter(fc)); fc.write_faces(out); - return pos; - + return returned_pos; } + Constraint_id head = nullptr, tail = nullptr; - Vertices_in_constraint_iterator bit = vertices_in_constraint_begin(cid); - Vertices_in_constraint_iterator pred = pos; - --pred; - ++bit; - if(pos != bit){ + if(pos != second_vertex_of_cid){ //std::cout << "split head" << std::endl; head = split(cid, pred); std::swap(head,cid); // split2 does the job pred = vertices_in_constraint_begin(cid); - pos = pred; - ++pos; + pos = std::next(pred); } - Vertices_in_constraint_iterator eit = vertices_in_constraint_end(cid); - --eit; - if(pos != eit){ + // head is now [..., A] or null + // cid is now [A, B, ...] + if(pos != last){ //std::cout << "split tail" << std::endl; tail = split(cid, pos); } - - // make the new constraint - Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc)); - Constraint_id aux2 = insert_constraint(vh, b, std::back_inserter(fc)); - pos = vertices_in_constraint_begin(aux2); - concatenate(aux1, aux2); + // head is now [..., A] or null + // cid is now [A, B] + // tail is now [B, ...] or null if(head != nullptr){ //std::cout << "concatenate head" << std::endl; @@ -988,7 +996,7 @@ insert_subconstraint(Vertex_handle vaa, //to debug public: - void print_hierarchy() { hierarchy.print(); } + void print_hierarchy(std::ostream& os = std::cout) { hierarchy.print(os); } //template member functions public: diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 43925c10b52..1f8d85b04ee 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -28,6 +28,8 @@ #include #include #include +#include +#include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS # include @@ -62,7 +64,6 @@ private: private: Vertex_handle vertex_; Point point_; - public: bool input_; }; @@ -213,6 +214,7 @@ public: typedef typename Constraints_set::iterator Constraint_iterator; typedef const Constraints_set& Constraints; typedef typename Sc_to_c_map::const_iterator Sc_iterator; + typedef typename Sc_to_c_map::iterator Sc_it; typedef Sc_iterator Subconstraint_and_contexts_iterator; typedef const Sc_to_c_map& Subconstraints_and_contexts; @@ -447,7 +449,53 @@ public: void swap(Polyline_constraint_hierarchy_2& ch); private: + template + void for_context_lists_of_all_subconstraints(Constraint_id cid, const F& f) + { + auto vl = cid.vl_ptr(); + for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { + auto scit = sc_to_c_map.find(sorted_pair(*it, *succ)); + CGAL_assertion(scit != sc_to_c_map.end()); + Context_list* hcl = scit->second; + f(hcl, it, scit); + } + } + + static void replace_first_in_context_list(Context_list* hcl, Constraint_id old_id, Constraint_id new_id) + { + // std::find_if is a sort of std::for_each with a break + [[maybe_unused]] auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { + if(ctxt.enclosing == old_id) { + ctxt.enclosing = new_id; + return true; + } + return false; + }); + } + + static void update_first_context_position(Context_list* hcl, Constraint_id id, Vertex_it new_pos) + { + [[maybe_unused]] auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { + if(ctxt.enclosing == id) { + ctxt.pos = new_pos; + return true; + } + return false; + }); + } + + static void remove_first_in_context_list(Context_list* hcl, Constraint_id id) + { + auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { + return ctxt.enclosing == id; + }); + if(it != hcl->end()) { + hcl->erase(it); + } + } + Constraint_id new_constraint_id() const { + // TODO: handle ids auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; return Constraint_id(new Vertex_list, id); } @@ -464,7 +512,7 @@ private: //to_debug public: - void print() const; + void print(std::ostream& os = std::cout) const; }; template @@ -645,29 +693,18 @@ template void Polyline_constraint_hierarchy_2:: swap(Constraint_id constr_a, Constraint_id constr_b) { - auto substitute_enclosing_in_vertex_list = [this](Vertex_list_ptr vl, Constraint_id old_id, Constraint_id new_id) { - // We have to look at all subconstraints - for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { - typename Sc_to_c_map::iterator scit = this->sc_to_c_map.find(sorted_pair(*it, *succ)); - CGAL_assertion(scit != this->sc_to_c_map.end()); - Context_list* hcl = scit->second; - - // and replace the context of the constraint - for(Context_iterator ctit = hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == old_id) { - ctit->enclosing = new_id; - break; - } - } - } + auto substitute_enclosing_in_vertex_list = [this](Constraint_id cid, Constraint_id old_id, Constraint_id new_id) { + for_context_lists_of_all_subconstraints(cid, [&](Context_list* hcl, Vertex_it, Sc_it) { + replace_first_in_context_list(hcl, old_id, new_id); + }); }; Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - substitute_enclosing_in_vertex_list(constr_a_vl, constr_a, nullptr); - substitute_enclosing_in_vertex_list(constr_b_vl, constr_b, constr_a); - substitute_enclosing_in_vertex_list(constr_a_vl, nullptr, constr_b); + substitute_enclosing_in_vertex_list(constr_a, constr_a, nullptr); + substitute_enclosing_in_vertex_list(constr_b, constr_b, constr_a); + substitute_enclosing_in_vertex_list(constr_a, nullptr, constr_b); constr_a_vl->swap(*constr_b_vl); } @@ -675,33 +712,22 @@ swap(Constraint_id constr_a, Constraint_id constr_b) { template void Polyline_constraint_hierarchy_2:: -remove_constraint(Constraint_id cid){ +remove_constraint(Constraint_id cid) +{ constraints_set.erase(cid); - // We have to look at all subconstraints - for(Vertex_it it = cid.begin(), succ = it, end = cid.end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + for_context_lists_of_all_subconstraints(cid, [&](Context_list* hcl, Vertex_it, Sc_it scit) { + remove_first_in_context_list(hcl, cid); - // and remove the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == cid){ - hcl->erase(ctit); - break; - } - } // If the constraint passes several times through the same subconstraint, - // the above loop maybe removes them in the wrong order + // the above call to `remove_first_in_context_list` may remove them in the wrong order. // If this was the only context in the list, delete the context list - if(hcl->empty()){ + if(hcl->empty()) { sc_to_c_map.erase(scit); delete hcl; } - } + }); delete cid.vl_ptr(); } @@ -802,53 +828,31 @@ template typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::concatenate(Constraint_id constr_a, Constraint_id constr_b) { + // constr_a is [A, ..., M] + // constr_b is [M, ..., B] + // we want: + // constr_a = [A, ..., M, ..., B] + // constr_b = [] + // std::cerr << std::format("concatenate({}, {}) ", constr_a.id, constr_b.id) << std::endl; Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraints_set.erase(constr_a); constraints_set.erase(constr_b); - // We have to look at all subconstraints - for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = constr_b_vl->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr_b){ - ctit->enclosing = constr_a; - break; - } - } - } + for_context_lists_of_all_subconstraints(constr_b, [&](Context_list* hcl, Vertex_it, Sc_it) { + replace_first_in_context_list(hcl, constr_b, constr_a); + }); + // now we really concatenate the vertex lists // Note that all iterators pointing into constr_a remain valid. // This concerns user code, as well as the data member "pos" of the Context class + CGAL_assertion(constr_a_vl->back().vertex() == constr_b_vl->front().vertex()); constr_a_vl->pop_back(); // because it is the same as constr_b_vl.front() - Vertex_it back_it = constr_a_vl->skip_end(); - --back_it; - constr_a_vl->splice(constr_a_vl->skip_end(), *(constr_b_vl), constr_b_vl->skip_begin(), constr_b_vl->skip_end()); + constr_a_vl->splice(constr_a_vl->skip_end(), *constr_b_vl, constr_b_vl->skip_begin(), constr_b_vl->skip_end()); - // Note that for VC8 with iterator debugging the iterators pointing into constr_b - // are NOT valid So we have to update them - for(Vertex_it it = back_it, succ = it, end = constr_a_vl->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; - - // and update pos in the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr_a){ - ctit->pos = it; - break; - } - } - } - constraints_set.insert(constr_a); + for_context_lists_of_all_subconstraints(constr_a, [&](Context_list* hcl, Vertex_it it, Sc_it) { + update_first_context_position(hcl, constr_a, it); + }); delete constr_b_vl; return constr_a; @@ -858,54 +862,34 @@ template typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::concatenate2(Constraint_id constr_a, Constraint_id constr_b) { + // constr_a is [A, ..., M] + // constr_b is [M, ..., B] + // we want: + // constr_a = + // constr_b = [A, ..., M, ..., B] + Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraints_set.erase(constr_a); - constraints_set.erase(constr_b); - // We have to look at all subconstraints - for(Vertex_it it = constr_a_vl->skip_begin(), succ = it, end = constr_a_vl->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + constraints_set.erase(constr_a); // DIFF + + for_context_lists_of_all_subconstraints(constr_a, [&](Context_list* hcl, Vertex_it, Sc_it) { // DIFF + replace_first_in_context_list(hcl, constr_a, constr_b); // DIFF + }); - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr_a){ - ctit->enclosing = constr_b; - break; - } - } - } // now we really concatenate the vertex lists // Note that all iterators pointing into constr_b remain valid. + CGAL_assertion(constr_a_vl->back().vertex() == constr_b_vl->front().vertex()); constr_a_vl->pop_back(); // because it is the same as constr_b_vl.front() - Vertex_it back_it = constr_b_vl->skip_begin(); - - constr_b_vl->splice(constr_b_vl->skip_begin(), *(constr_a_vl), constr_a_vl->skip_begin(), constr_a_vl->skip_end()); + constr_b_vl->splice(constr_b_vl->skip_begin(), *constr_a_vl, constr_a_vl->skip_begin(), constr_a_vl->skip_end()); // DIFF // Note that for VC8 with iterator debugging the iterators pointing into constr_a // are NOT valid So we have to update them - for(Vertex_it it = constr_b_vl->skip_begin(), succ = it, end = back_it; - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + for_context_lists_of_all_subconstraints(constr_b /*DIFF*/, [&](Context_list* hcl, Vertex_it it, Sc_it) { + update_first_context_position(hcl, constr_b, it); // DIFF + }); - // and update pos in the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr_b){ - ctit->pos = it; - break; - } - } - } - constraints_set.insert(constr_b); - - delete constr_a_vl; - return constr_b; + delete constr_a_vl; // DIFF + return constr_b; // DIFF } @@ -916,35 +900,35 @@ template typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::split(Constraint_id constr, Vertex_it vcit) { - Constraint_id new_constr = new_constraint_id(); - constraints_set.erase(constr); - Vertex_list_ptr new_vl = new_constr.vl_ptr(); - Vertex_list_ptr constr_vl = constr.vl_ptr(); - new_vl->splice(new_vl->skip_end(), *(constr_vl), vcit.base(), constr_vl->skip_end()); - constr_vl->push_back(new_vl->front()); // Duplicate the common vertex - Vertex_it vit = new_vl->skip_begin(); - vit.input() = true; - vit = constr_vl->skip_end(); - --vit; - vit.input() = true; - constraints_set.insert(constr); - constraints_set.insert(new_constr); - // We have to look at all subconstraints - for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + // constr is [A, ..., B], vcit points to M in [A, ..., B] + + Constraint_id new_constr = new_constraint_id(); + constraints_set.insert(new_constr); + + Vertex_list_ptr constr_vl = constr.vl_ptr(); + Vertex_list_ptr new_vl = new_constr.vl_ptr(); + + vcit.input() = true; + auto middle_node = Node(*vcit, true); + + // Let's split, that way: + // constr = [A, ..., M] + // new_constr = [M, ..., B] + + // The splice does: + // constr = [A, ..., M[ (without M) + // new_constr = [M, ..., B] + new_vl->splice(new_vl->skip_end(), *constr_vl, vcit.base(), constr_vl->skip_end()); + constr_vl->push_back(middle_node); // add M to the end of constr + + CGAL_assertion(vcit.base() == new_vl->skip_begin()); + CGAL_assertion(new_vl->front().input() == true); + CGAL_assertion(constr_vl->back().input() == true); + + for_context_lists_of_all_subconstraints(new_constr, [&](Context_list* hcl, Vertex_it, Sc_it) { + replace_first_in_context_list(hcl, constr, new_constr); + }); - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr){ - ctit->enclosing = new_constr; - break; - } - } - } return new_constr; } @@ -952,35 +936,35 @@ template typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2::split2(Constraint_id constr, Vertex_it vcit) { - Constraint_id new_constr = new_constraint_id(); - constraints_set.erase(constr); - Vertex_list_ptr new_vl = new_constr.vl_ptr(); - Vertex_list_ptr constr_vl = constr.vl_ptr(); - new_vl->splice(new_vl->skip_end(), *constr_vl, constr_vl->skip_begin(), vcit.base()); - new_vl->push_back(constr_vl->front()); // Duplicate the common vertex - Vertex_it vit = new_vl->skip_end(); - --vit; - vit.input() = true; - vit = constr_vl->skip_begin(); - vit.input() = true; - constraints_set.insert(constr); - constraints_set.insert(new_constr); - // We have to look at all subconstraints - for(Vertex_it it = new_vl->skip_begin(), succ = it, end = new_vl->skip_end(); - ++succ != end; - ++it){ - typename Sc_to_c_map::iterator scit = sc_to_c_map.find(sorted_pair(*it,*succ)); - CGAL_assertion(scit != sc_to_c_map.end()); - Context_list* hcl = scit->second; + // constr is [A, ..., B], vcit points to M in [A, ..., B] + + Constraint_id new_constr = new_constraint_id(); + constraints_set.insert(new_constr); + + Vertex_list_ptr constr_vl = constr.vl_ptr(); + Vertex_list_ptr new_vl = new_constr.vl_ptr(); + + vcit.input() = true; + auto middle_node = Node(*vcit, true); + + // Let's split, that way: + // constr = [M, ..., B] + // new_constr = [A, ..., M] + + // The splice does: + // constr = [M, ..., B] + // new_constr = [A, ..., M[ (without M) + new_vl->splice(new_vl->skip_end(), *constr_vl, constr_vl->skip_begin(), vcit.base()); + new_vl->push_back(middle_node); // add M to the end of new_constr + + CGAL_assertion(vcit.base() == constr_vl->skip_begin()); + CGAL_assertion(constr_vl->front().input() == true); + CGAL_assertion(new_vl->back().input() == true); + + for_context_lists_of_all_subconstraints(new_constr, [&](Context_list* hcl, Vertex_it, Sc_it) { + replace_first_in_context_list(hcl, constr, new_constr); + }); - // and replace the context of the constraint - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - if(ctit->enclosing == constr){ - ctit->enclosing = new_constr; - break; - } - } - } return new_constr; } @@ -1244,9 +1228,9 @@ oriented_end(T va, T vb, T& vc) const template void Polyline_constraint_hierarchy_2:: -print() const +print(std::ostream& os) const { - std::map vertex_num_map; + std::map vertex_num_map; int num = 0; for(const auto& cid : constraints()) { for (const auto& node : cid.elements()){ @@ -1254,51 +1238,51 @@ print() const } } - struct Vertex_num { - std::map& vertex_num_map; - int operator[](T v) const { -#ifndef CGAL_CDT_2_DEBUG_INTERSECTIONS - auto it = vertex_num_map.find(v); - if(it == vertex_num_map.end()) return -1; - return it->second; -#else - return v->time_stamp(); -#endif - } - } vertex_num{vertex_num_map}; -// typename std::map::iterator vnit = vertex_num.begin(); -// for(; vnit != vertex_num.end(); vnit++) { -// vnit->second = ++num; -// std::cerr << "vertex num " << num << " " << vnit->first->point() -// << std::endl; -// } + auto disp_vertex = [&vertex_num_map](Vertex_handle v) { + return CGAL::IO::oformat( + [v, &vertex_num_map](auto& os) -> decltype(os)& { + constexpr bool star_v_has_timestamp = + internal::has_timestamp_v>; + if constexpr(star_v_has_timestamp) { + return os << '#' << v->time_stamp(); + } else { + auto it = vertex_num_map.find(v); + auto n = (it == vertex_num_map.end()) ? -1 : it->second; + return os << n; + } + }, + IO_manip_tag{}); + }; + os << "# number of constraints: " << number_of_constraints() << std::endl; for(const auto& cid : constraints()) { - std::cout << std::endl; - std::cout << "constraint(" << cid.id << ") "; - std::cout << cid.vl_ptr(); - std::cout << " subconstraints "; + os << "constraint(" << cid.id << ") "; + os << cid.vl_ptr(); + os << "\n vertex list "; for(const auto& node : cid.elements()) { - std::cout << vertex_num[node.vertex()] << " "; + os << disp_vertex(node.vertex()) << " "; } - std::cout << ": "; + os << "\n corresponding points: "; for(const auto& node : cid.elements()) { - std::cout << node.point() << " "; + os << node.point() << " "; } + os << std::endl; } - std::cout << std::endl; + os << std::endl; + os << "# number of subconstraints: " << sc_to_c_map.size() << std::endl; for(const auto& subconstraint : subconstraints()) { - std::cout << "subconstraint "; - std::cout << vertex_num[subconstraint.first] << " " << vertex_num[subconstraint.second]; + os << "subconstraint ("; + os << disp_vertex(subconstraint.first) << ", " + << disp_vertex(subconstraint.second) << ")"; Context_iterator cb, ce; get_contexts(subconstraint.first, subconstraint.second, cb, ce); - std::cout << " enclosing "; + os << " enclosing: "; for(; cb != ce; cb++) { - std::cout << "(" << cb->id().id << ") " << cb->id().vl_ptr(); - std::cout << " "; + os << "(cid " << cb->id().id << ") " << cb->id().vl_ptr(); + os << ", pos: " << std::distance(cb->vertices_begin(), cb->pos) << " "; } - std::cout << std::endl; + os << std::endl; } return; } diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp index b56894bd16c..41a39a4a142 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4025.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -1,89 +1,110 @@ -#include -#include +// This code was first submitted in an issue: +// https://github.com/CGAL/cgal/issues/4025 +// and then rewrote a lot, keeping the observed behavior. + +#include #include #include +#include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Polygon_2 Polygon_2; -typedef CGAL::Exact_intersections_tag Itag_; -typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; -typedef CGAL::Constrained_triangulation_plus_2 CDTP; +#include +#include +#include -typedef CDTP::Point Point; -typedef CDTP::Constraint_id Cid; -typedef CDTP::Vertex_handle Vertex_handle; -typedef CDTP::Constraint_id Constraint_id; -typedef CDTP::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; +using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using Polygon_2 = CGAL::Polygon_2; +using Itag_ = CGAL::Exact_intersections_tag; +using Vb = CGAL::Base_with_time_stamp>; +using Cb = CGAL::Base_with_time_stamp>; +using Tds = CGAL::Triangulation_data_structure_2; +using CDT = CGAL::Constrained_Delaunay_triangulation_2; +using CDTP = CGAL::Constrained_triangulation_plus_2; -int countVertex(CDTP &cdtp, CDTP::Constraint_id id) +using Point = CDTP::Point; +using Vertex_handle = CDTP::Vertex_handle; +using Constraint_id = CDTP::Constraint_id; +using Vertices_in_constraint_iterator = CDTP::Vertices_in_constraint_iterator; + +auto nb_of_vertices(CDTP &cdtp, Constraint_id id) { - Vertices_in_constraint_iterator v=cdtp.vertices_in_constraint_begin(id); - - int count=0; - while(v!=cdtp.vertices_in_constraint_end(id)) - { - count++; - v++; - } - - return count; + return static_cast(std::distance(cdtp.vertices_in_constraint_begin(id), + cdtp.vertices_in_constraint_end(id))); } +auto value_check_expected = + [](auto&& value, [[maybe_unused]] const auto& expected) -> decltype(auto) + { + assert(value == expected); + return std::forward(value); + }; + +auto oformat = + [](Vertex_handle vh) + { + return CGAL::IO::oformat(vh, CGAL::With_point_tag{}); + }; int main() { CDTP cdtp; - std::list pointsListCollinear; + auto print_cdtp = [&cdtp](std::string_view msg) + { + std::cout << msg << std::endl; + cdtp.print_hierarchy(std::cout); + }; - pointsListCollinear.push_back(Point(0,0)); - pointsListCollinear.push_back(Point(0,1)); - pointsListCollinear.push_back(Point(0,2)); - pointsListCollinear.push_back(Point(0,3)); - pointsListCollinear.push_back(Point(0,4)); - pointsListCollinear.push_back(Point(0,5)); + const std::array collinear_points = { + Point(0,0), Point(0,1), Point(0,2), Point(0,3), Point(0,4), Point(0,5) + }; - std::list pointsListNoCollinear; + const std::array non_collinear_points = { + Point(1,0), Point(2,1), Point(4,2), Point(2,3), Point(4,4), Point(1,5) + }; - pointsListNoCollinear.push_back(Point(1,0)); - pointsListNoCollinear.push_back(Point(2,1)); - pointsListNoCollinear.push_back(Point(4,2)); - pointsListNoCollinear.push_back(Point(2,3)); - pointsListNoCollinear.push_back(Point(4,4)); - pointsListNoCollinear.push_back(Point(1,5)); + Constraint_id collinear_cid = cdtp.insert_constraint(collinear_points.begin(), collinear_points.end()); + Constraint_id non_collinear_cid = cdtp.insert_constraint(non_collinear_points.begin(), non_collinear_points.end()); + print_cdtp("Initial state"); - Constraint_id ctIdCollinear=cdtp.insert_constraint(pointsListCollinear.begin(),pointsListCollinear.end()); - Constraint_id ctIdNoCollinear=cdtp.insert_constraint(pointsListNoCollinear.begin(),pointsListNoCollinear.end()); + Vertices_in_constraint_iterator vertex_it = std::next(cdtp.vertices_in_constraint_begin(collinear_cid), 2); + [[maybe_unused]] auto next_it = std::next(vertex_it); + std::cout << "\n-> attempt to remove vertex " << oformat(*vertex_it) << std::endl; + vertex_it = cdtp.remove_vertex_from_constraint(collinear_cid, vertex_it); + std::cout << " cdtp.remove_vertex_from_constraint(collinear_cid, vertex_it) returned the vertex " + << oformat(*vertex_it) << std::endl; + assert(vertex_it == next_it); + print_cdtp("\nAfter removing third vertex from the collinear constraint"); - //******************************* attempt with the collinear constraint - Vertices_in_constraint_iterator vertexToRemoveCollinear=cdtp.vertices_in_constraint_begin(ctIdCollinear); - vertexToRemoveCollinear++; - vertexToRemoveCollinear++; + // The first constraint (ID `collinear_cid`) is collinear. `cdtp.remove_vertex_from_constraint` + // cannot remove the third vertex from it, because it is collinear with the triangulation vertex + // with the point (0, 2). + std::cout << "\nnumber of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 10U) << std::endl; + std::cout << "number of constraints: " + << value_check_expected(cdtp.number_of_constraints(), 2U) << std::endl; + std::cout << "number of vertex in collinear constraint: " + << value_check_expected(nb_of_vertices(cdtp, collinear_cid), 6U) << std::endl; - std::cout<<"attempt to remove vertex "<<(*vertexToRemoveCollinear)->point().x()<<" , "<<(*vertexToRemoveCollinear)->point().y() < attempt to remove vertex " << oformat(*vertex_it) << std::endl; + vertex_it = cdtp.remove_vertex_from_constraint(non_collinear_cid, vertex_it); + std::cout << " cdtp.remove_vertex_from_constraint(non_collinear_cid, vertex_it) returned the vertex " + << oformat(*vertex_it) << std::endl; + assert(vertex_it == next_it); - std::cout<<"number of subconstraints "< 5, expected 4 - std::cout<<"number of constraints "< 1 - std::cout<<"number of vertex in constraint "< 6, expected 5 + print_cdtp("\nAfter removing third vertex from the non-collinear constraint"); - - //******************************* attempt with the collinear constraint - Vertices_in_constraint_iterator vertexToRemoveNoCollinear=cdtp.vertices_in_constraint_begin(ctIdNoCollinear); - vertexToRemoveNoCollinear++; - vertexToRemoveNoCollinear++; - - std::cout<<"attempt to remove vertex "<<(*vertexToRemoveNoCollinear)->point().x()<<" , "<<(*vertexToRemoveNoCollinear)->point().y() << std::endl; - cdtp.remove_vertex_from_constraint(ctIdNoCollinear,vertexToRemoveNoCollinear); - - std::cout<<"number of subconstraints "< 4, ok - std::cout<<"number of constraints "< 1 - std::cout<<"number of vertex in constraint "< 5, ok + std::cout << "number of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 9U) << std::endl; + std::cout << "number of constraints: " + << value_check_expected(cdtp.number_of_constraints(), 2U) << std::endl; + std::cout << "number of vertex in collinear constraint: " + << value_check_expected(nb_of_vertices(cdtp, non_collinear_cid), 5U) << std::endl; return 0; - } From 2db72789228adba5e85dd7fd3fd460ba037926d8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 16:04:32 +0100 Subject: [PATCH 234/332] add failing tests (for now) --- .../doc/GraphicsView/fig_src/uml-design.pdf | 2 +- .../test/Triangulation_2/issue_4025.cpp | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/GraphicsView/doc/GraphicsView/fig_src/uml-design.pdf b/GraphicsView/doc/GraphicsView/fig_src/uml-design.pdf index 9a27c4e4f65..15cbfc98f09 100644 --- a/GraphicsView/doc/GraphicsView/fig_src/uml-design.pdf +++ b/GraphicsView/doc/GraphicsView/fig_src/uml-design.pdf @@ -1,5 +1,5 @@ %PDF-1.4 -%âăĎÓ +%âãÏÓ 1 0 obj << diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp index 41a39a4a142..37f016fe98a 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4025.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -106,5 +106,66 @@ int main() std::cout << "number of vertex in collinear constraint: " << value_check_expected(nb_of_vertices(cdtp, non_collinear_cid), 5U) << std::endl; + + // NOW test another scenario, that has nothing to do with the issue #4025 + cdtp.clear(); + print_cdtp("\nAfter clearing the constrained triangulation"); + + + // Let's insert a constraint with a loop + // (1,1) + // /| + // / | + // (0,0) X->(1,0) + // / + // / + // X (-1,-1) + const std::array looping_cid = { + Point(0,0), Point(1,0), Point(1,1), Point(-1,-1) + }; + + cdtp.insert_constraint(looping_cid.begin(), looping_cid.end()); + print_cdtp("\nAfter inserting a looping constraint"); + std::cout << "\nnumber of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 4U) << std::endl; + + // NOW test another scenario + // Let's insert a constraint with identical sub-constraints + // (1,1) + // /| + // / | + // (0,0) X->(1,0)--->X(3,0) + cdtp.clear(); + print_cdtp("\nAfter clearing the constrained triangulation"); + + const std::array overlaping_cid = { + Point(0,0), Point(1,0), Point(1,1), Point(0,0), Point(3, 0) + }; + cdtp.insert_constraint(overlaping_cid.begin(), overlaping_cid.end()); + print_cdtp("\nAfter inserting a constraint with overlapping subconstraints"); + std::cout << "\nnumber of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 4U) + << "\ncdtp.subconstraints.size(): " + << value_check_expected(cdtp.subconstraints().size(), 4U) << std::endl; + + // NOW test another scenario + cdtp.clear(); + print_cdtp("\nAfter clearing the constrained triangulation"); + + // Let's insert two constraints with four points each and one common segment in the middle + const std::array first_cid = { + Point(0,0), Point(1,0), Point(2,0), Point(3,0) + }; + const std::array second_cid = { + Point(3,0), Point(1,0), Point(2,0), Point(2,2) + }; + cdtp.insert_constraint(first_cid.begin(), first_cid.end()); + cdtp.insert_constraint(second_cid.begin(), second_cid.end()); + print_cdtp("\nAfter inserting two constraints with a common segment in the middle"); + std::cout << "\nnumber of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 5U) + << "\ncdtp.subconstraints.size(): " + << value_check_expected(cdtp.subconstraints().size(), 5U) << std::endl; + return 0; } From 7808c6f93d11ada3b21c6252b5c5429911f1c506 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 22:25:49 +0100 Subject: [PATCH 235/332] fix the failing test --- .../segment_soup_to_polylines.cpp | 9 +- .../CGAL/Constrained_triangulation_2.h | 4 +- .../Polyline_constraint_hierarchy_2.h | 371 ++++++++++++------ .../test/Triangulation_2/issue_4025.cpp | 64 ++- 4 files changed, 294 insertions(+), 154 deletions(-) diff --git a/Triangulation_2/examples/Triangulation_2/segment_soup_to_polylines.cpp b/Triangulation_2/examples/Triangulation_2/segment_soup_to_polylines.cpp index 5eadd29090f..80ef763b404 100644 --- a/Triangulation_2/examples/Triangulation_2/segment_soup_to_polylines.cpp +++ b/Triangulation_2/examples/Triangulation_2/segment_soup_to_polylines.cpp @@ -31,7 +31,8 @@ int main() cdtp.insert_constraint(Point(100,100), Point(200,200)); // Segment soup of 8 segments as input - std::cout << "Input CDT+ has " << cdtp.number_of_constraints() << " constraints/subconstraints" << std::endl; + std::cout << "Input CDT+ has " << cdtp.number_of_constraints() + << " constraints/subconstraints" << std::endl; std::cout << "Splitting subconstraints graph into constraints" << std::endl; cdtp.split_subconstraint_graph_into_constraints(); @@ -47,5 +48,11 @@ int main() std::cout << std::endl; } + if(cdtp.number_of_constraints() != 5) + { + std::cerr << "Error: expected 5 constraints/subconstraints" << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; } diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 91d01e3e042..bebc96c3c0e 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -51,7 +51,7 @@ struct CGAL_DEPRECATED No_intersection_tag : namespace internal { -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +#if defined(CGAL_CDT_2_DEBUG_INTERSECTIONS) || defined(CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2) struct Indentation_level { int n; Indentation_level() : n(0) {} @@ -68,7 +68,7 @@ namespace internal { }; Exit_guard open_new_scope() { return Exit_guard(*this); } } cdt_2_indent_level; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS || CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 template struct Itag { diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 1f8d85b04ee..a35525696f3 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -32,6 +32,9 @@ #include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +# define CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif +#ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 # include # include # include @@ -114,56 +117,80 @@ public: Vertex_handle dereference() const { return this->base()->vertex(); } }; + struct Vertex_list_with_info { + const Polyline_constraint_hierarchy_2* hierarchy_ptr = nullptr; + Vertex_list vl{}; + bool may_share_subconstraint_with_others = false; + }; + struct Constraint_id { - Vertex_list_ptr vl = nullptr; + Vertex_list_with_info* vl_with_info_ptr = nullptr; size_type id = (std::numeric_limits::max)(); Constraint_id(std::nullptr_t = nullptr) {} - Constraint_id(Vertex_list_ptr vl, size_type id) : vl(vl), id(id) {} + Constraint_id(Vertex_list_with_info* ptr, size_type id) : vl_with_info_ptr(ptr), id(id) {} - Vertex_list_ptr vl_ptr() const { return vl; } + void destroy() { + if(vl_with_info_ptr != nullptr) { + delete vl_with_info_ptr; + (*this) = nullptr; + } + } + + Vertex_list_ptr vl_ptr() const { + return vl_with_info_ptr == nullptr ? nullptr : std::addressof(vl_with_info_ptr->vl); + } operator std::pair() const { - Subconstraint subconstraint = - vl == nullptr ? Subconstraint() : Subconstraint(vl->front().vertex(), vl->back().vertex()); - return { subconstraint, vl }; + Subconstraint subconstraint = vl_with_info_ptr == nullptr + ? Subconstraint() + : Subconstraint(vl_ptr()->front().vertex(), vl_ptr()->back().vertex()); + return {subconstraint, vl_ptr()}; + } + + bool same_hierarchy(const Constraint_id& other) const { + return vl_with_info_ptr == nullptr || other.vl_with_info_ptr == nullptr || + vl_with_info_ptr->hierarchy_ptr == other.vl_with_info_ptr->hierarchy_ptr; } Constraint_id& operator=(std::nullptr_t) { - vl = nullptr; + vl_with_info_ptr = nullptr; id = (std::numeric_limits::max)(); return *this; } - bool operator==(std::nullptr_t n) const { return vl == n; } - bool operator!=(std::nullptr_t n) const { return vl != n; } + bool operator==(std::nullptr_t n) const { return vl_with_info_ptr == n; } + bool operator!=(std::nullptr_t n) const { return vl_with_info_ptr != n; } bool operator==(const Constraint_id& other) const { - CGAL_assertion((vl == other.vl) == (id == other.id)); - return vl == other.vl; + CGAL_assertion(same_hierarchy(other)); + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); + return vl_ptr() == other.vl_ptr(); } bool operator!=(const Constraint_id& other) const { - CGAL_assertion((vl == other.vl) == (id == other.id)); - return vl != other.vl; + CGAL_assertion(same_hierarchy(other)); + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); + return vl_ptr() != other.vl_ptr(); } bool operator<(const Constraint_id& other) const { - CGAL_assertion((vl == other.vl) == (id == other.id)); + CGAL_assertion(same_hierarchy(other)); + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); return id < other.id; } // forward a new Vertex_list operations - decltype(auto) begin() const { return vl->skip_begin(); } - decltype(auto) end() const { return vl->skip_end(); } - decltype(auto) elements() const { return vl->skip_elements(); } - decltype(auto) clear() const { return vl->clear(); } - decltype(auto) size() const { return vl->skip_size(); } - decltype(auto) front() const { return vl->front(); } - decltype(auto) back() const { return vl->back(); } + decltype(auto) begin() const { return vl_ptr()->skip_begin(); } + decltype(auto) end() const { return vl_ptr()->skip_end(); } + decltype(auto) elements() const { return vl_ptr()->skip_elements(); } + decltype(auto) clear() const { return vl_ptr()->clear(); } + decltype(auto) size() const { return vl_ptr()->skip_size(); } + decltype(auto) front() const { return vl_ptr()->front(); } + decltype(auto) back() const { return vl_ptr()->back(); } }; // end Constraint_id @@ -203,6 +230,15 @@ public: typedef std::list Context_list; typedef typename Context_list::iterator Context_iterator; + static void fix_contexts(Context_list& context_list) { + const bool multiple_contexts = context_list.size() > 1; + if(false == multiple_contexts) return; + for(auto& context : context_list) { + CGAL_assertion(context.enclosing != nullptr); + context.enclosing.vl_with_info_ptr->may_share_subconstraint_with_others = true; + } + } + typedef std::set Constraints_set; #if CGAL_USE_BARE_STD_MAP typedef std::map; - const Constraints_set* constraints_set = nullptr; + const Polyline_constraint_hierarchy_2* hierarchy = nullptr; Constraint_iterator constraint_it{}; Vertex_it vertex_it{}; public: - // - The object is singular if and only if `constraints_set==nullptr`. + // - The object is singular if and only if `hierarchy==nullptr`. // // - The end value is when `constraint_it` is the end iterator of `constraints_set`. // In that case `vertex_it` must be singular. // // - Otherwise all members must be valid pointers or dereferencable iterators. + bool is_singular() const { + CGAL_assertion((hierarchy == nullptr) == (constraint_it == Constraint_iterator{})); + CGAL_assertion((hierarchy != nullptr) || (vertex_it == Vertex_it{})); + return hierarchy == nullptr; + } + + bool is_valid() const { + if(hierarchy == nullptr) { + CGAL_assertion(is_singular()); + return false; + } + if(constraint_it == Constraint_iterator{}) { + return false; + } + if(constraint_it == hierarchy->constraints_set.end()) { + return vertex_it == Vertex_it{}; + } + if(vertex_it == Vertex_it{}) { + return false; + } + return true; + } + + bool is_end() const { + return constraint_it == hierarchy->constraints_set.end(); + } + + bool is_begin() const { + return constraint_it == hierarchy->constraints_set.begin() && + vertex_it == begin_or_null(constraint_it); + } + + bool is_dereferenceable() const { + return is_valid() && + constraint_it != hierarchy->constraints_set.end() && + vertex_it != constraint_it->end() && + std::next(vertex_it) != constraint_it->end(); + } + bool equal(const Subconstraint_iterator& other) const { - return constraints_set == other.constraints_set && - (constraints_set == nullptr || (constraint_it == other.constraint_it && - vertex_it == other.vertex_it)); + if(hierarchy != other.hierarchy) return false; + if(is_singular()) return true; + return (constraint_it == other.constraint_it && + vertex_it == other.vertex_it); } Vertex_it begin_or_null(Constraint_iterator constraint_it) const { - if(constraint_it == constraints_set->end()) { + if(constraint_it == hierarchy->constraints_set.end()) { return Vertex_it(); } return constraint_it->begin(); } + bool already_seen() const { + if(is_end()) { + return false; + } + if(false == constraint_it->vl_with_info_ptr->may_share_subconstraint_with_others) { + return false; + } + auto [va, vb] = this->operator*(); + auto it = hierarchy->sc_to_c_map.find(hierarchy->sorted_pair(va, vb)); + CGAL_assertion(it != hierarchy->sc_to_c_map.end()); + + const Context_list& ctx_list = *it->second; + + const Context& ctx = ctx_list.front(); + // if this context does not correspond to *this, return true + + if(ctx.enclosing != *constraint_it) { + return true; + } + + return (ctx.pos != vertex_it && ctx.pos != std::next(vertex_it)); + } + + static auto non_null(const Polyline_constraint_hierarchy_2* hierarchy) { + CGAL_precondition(hierarchy != nullptr); + return hierarchy; + } + public: Subconstraint_iterator() = default; @@ -281,22 +385,25 @@ public: // // constructor for the begin iterator explicit Subconstraint_iterator(typename Construction_access::Begin_tag, - const Constraints_set* constraints_set) - : constraints_set(constraints_set) - , constraint_it(constraints_set->begin()) - , vertex_it(begin_or_null(constraints_set->begin())) {} + const Polyline_constraint_hierarchy_2* hierarchy) + : hierarchy(non_null(hierarchy)) + , constraint_it(hierarchy->constraints_set.begin()) + , vertex_it(begin_or_null(hierarchy->constraints_set.begin())) + { + if(already_seen()) { + ++(*this); + } + } // // constructor for the end iterator explicit Subconstraint_iterator(typename Construction_access::End_tag, - const Constraints_set* constraints_set) - : constraints_set(constraints_set) - , constraint_it(constraints_set->end()) + const Polyline_constraint_hierarchy_2* hierarchy) + : hierarchy(non_null(hierarchy)) + , constraint_it(hierarchy->constraints_set.end()) , vertex_it() {} Subconstraint operator*() const { - CGAL_precondition(constraints_set != nullptr && constraint_it != constraints_set->end()); - CGAL_assertion(vertex_it != constraint_it->end()); - CGAL_assertion(std::next(vertex_it) != constraint_it->end()); + CGAL_precondition(is_dereferenceable()); return Subconstraint(*vertex_it, *std::next(vertex_it)); } @@ -306,28 +413,32 @@ public: using base_type::operator++; Subconstraint_iterator& operator++() { - CGAL_precondition(constraints_set != nullptr && constraint_it != constraints_set->end()); + CGAL_precondition(is_valid() && false == is_end()); - ++vertex_it; - CGAL_assertion(vertex_it != constraint_it->end()); + do { + ++vertex_it; + CGAL_assertion(vertex_it != constraint_it->end()); - if(std::next(vertex_it) == constraint_it->end()) { - ++constraint_it; - vertex_it = begin_or_null(constraint_it); - } + if(std::next(vertex_it) == constraint_it->end()) { + ++constraint_it; + vertex_it = begin_or_null(constraint_it); + } + } while(already_seen()); return *this; } using base_type::operator--; Subconstraint_iterator& operator--() { - CGAL_precondition(constraints_set != nullptr); - CGAL_precondition(constraint_it != constraints_set->begin() || vertex_it != constraint_it->begin()); - if(constraint_it == constraints_set->end() || vertex_it == constraint_it->begin()) { - --constraint_it; - vertex_it = std::prev(constraint_it->end(), 2); - } else { - --vertex_it; - } + CGAL_precondition(is_valid() && false == is_begin()); + + do { + if(constraint_it == hierarchy->constraints_set.end() || vertex_it == constraint_it->begin()) { + --constraint_it; + vertex_it = std::prev(constraint_it->end(), 2); + } else { + --vertex_it; + } + } while(already_seen()); return *this; } }; // end class Subconstraint_iterator @@ -384,7 +495,7 @@ public: // insert/remove - void add_Steiner(T va, T vb, T vx); + void add_Steiner(const T va, const T vb, const T vx); Constraint_id insert_constraint_old_API(T va, T vb); Constraint_id insert_constraint(T va, T vb); void append_constraint(Constraint_id cid, T va, T vb); @@ -423,12 +534,12 @@ public: Subconstraint_iterator, std::bidirectional_iterator_tag, std::bidirectional_iterator, Subconstraint, Subconstraint, typename Subconstraint_iterator::pointer, std::ptrdiff_t); return Subconstraint_iterator(Subconstraint_iterator::Construction_access::begin_tag(), - &constraints_set); + this); } Subconstraint_iterator subconstraints_end() const { return Subconstraint_iterator(Subconstraint_iterator::Construction_access::end_tag(), - &constraints_set); + this); } Sc_iterator sc_begin() const{ return sc_to_c_map.begin(); } @@ -497,7 +608,7 @@ private: Constraint_id new_constraint_id() const { // TODO: handle ids auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; - return Constraint_id(new Vertex_list, id); + return Constraint_id(new Vertex_list_with_info{this}, id); } Subconstraint sorted_pair(T va, T vb) const; Subconstraint sorted_pair(Subconstraint sc) { @@ -508,7 +619,7 @@ private: Context_iterator& ctxt, Context_iterator& past) const; - bool get_contexts(T va, T vb, Context_list*&) const; + Context_list* get_context_list(T va, T vb) const; //to_debug public: @@ -563,6 +674,8 @@ copy(const Polyline_constraint_hierarchy_2& other, std::mappush_back(Node(vmap[node.vertex()], node.input())); } + cid2.vl_with_info_ptr->may_share_subconstraint_with_others = + cid1.vl_with_info_ptr->may_share_subconstraint_with_others; constraints_set.insert(cid2); } // copy sc_to_c_map @@ -654,9 +767,8 @@ typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) const { - Context_list* hcl = nullptr; - CGAL_assertion_code( bool found = ) get_contexts(va,vb,hcl); - CGAL_assertion(found); + Context_list* hcl = get_context_list(va,vb); + CGAL_assertion(nullptr != hcl); return hcl->size(); } @@ -707,6 +819,8 @@ swap(Constraint_id constr_a, Constraint_id constr_b) { substitute_enclosing_in_vertex_list(constr_a, nullptr, constr_b); constr_a_vl->swap(*constr_b_vl); + std::swap(constr_a.vl_with_info_ptr->may_share_subconstraint_with_others, + constr_b.vl_with_info_ptr->may_share_subconstraint_with_others); } template @@ -728,7 +842,7 @@ remove_constraint(Constraint_id cid) delete hcl; } }); - delete cid.vl_ptr(); + cid.destroy(); } @@ -854,7 +968,10 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons update_first_context_position(hcl, constr_a, it); }); - delete constr_b_vl; + if(constr_b.vl_with_info_ptr->may_share_subconstraint_with_others) { + constr_a.vl_with_info_ptr->may_share_subconstraint_with_others = true; + } + constr_b.destroy(); return constr_a; } @@ -888,7 +1005,10 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con update_first_context_position(hcl, constr_b, it); // DIFF }); - delete constr_a_vl; // DIFF + if(constr_a.vl_with_info_ptr->may_share_subconstraint_with_others) { + constr_b.vl_with_info_ptr->may_share_subconstraint_with_others = true; + } + constr_a.destroy(); // DIFF return constr_b; // DIFF } @@ -929,6 +1049,8 @@ Polyline_constraint_hierarchy_2::split(Constraint_id constr, Ve replace_first_in_context_list(hcl, constr, new_constr); }); + new_constr.vl_with_info_ptr->may_share_subconstraint_with_others = + constr.vl_with_info_ptr->may_share_subconstraint_with_others; return new_constr; } @@ -965,6 +1087,8 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id constr, V replace_first_in_context_list(hcl, constr, new_constr); }); + new_constr.vl_with_info_ptr->may_share_subconstraint_with_others = + constr.vl_with_info_ptr->may_share_subconstraint_with_others; return new_constr; } @@ -977,12 +1101,12 @@ template typename Polyline_constraint_hierarchy_2::Constraint_id Polyline_constraint_hierarchy_2:: insert_constraint(T va, T vb){ -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +#ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level << "C_hierachy.insert_constraint( " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 Subconstraint sc = sorted_pair(va, vb); Constraint_id cid = new_constraint_id(); auto children = cid.vl_ptr(); @@ -998,6 +1122,7 @@ insert_constraint(T va, T vb){ ctxt.enclosing = cid; ctxt.pos = children->skip_begin(); fathers->push_front(ctxt); + fix_contexts(*fathers); return cid; } @@ -1015,12 +1140,12 @@ template void Polyline_constraint_hierarchy_2:: append_constraint(Constraint_id cid, T va, T vb){ -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +#ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level << "C_hierachy.append_constraint( ..., " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 Subconstraint sc = sorted_pair(va, vb); auto& fathers = sc_to_c_map[sc]; if(fathers == nullptr){ @@ -1034,6 +1159,7 @@ append_constraint(Constraint_id cid, T va, T vb){ ctxt.enclosing = cid; ctxt.pos = last_pos; fathers->push_front(ctxt); + fix_contexts(*fathers); } @@ -1044,7 +1170,7 @@ clear() // clean and delete vertices lists for(auto cid : constraints()) { cid.clear(); - delete cid.vl_ptr(); + cid.destroy(); } // clean and delete context lists for(auto& [_, cl_ptr] : sc_to_c_map) { @@ -1100,66 +1226,73 @@ split_constraint(T va, T vb, T vc){ template void Polyline_constraint_hierarchy_2:: -add_Steiner(T va, T vb, T vc){ -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +add_Steiner(const T va, const T vb, const T vc){ +#ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level << "C_hierachy.add_Steinter( " << IO::oformat(va) << ", " << IO::oformat(vb) << ", " << IO::oformat(vc) << ")\n"; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - Context_list* hcl=nullptr; - if(!get_contexts(va,vb,hcl)) { -#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 + Sc_iterator sc_iter_va_vb = sc_to_c_map.find(sorted_pair(va, vb)); + if(sc_iter_va_vb == sc_to_c_map.end()) { +#ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 std::cerr << CGAL::internal::cdt_2_indent_level << " -> the constraint is already split\n"; -#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS +#endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 return; } - Context_list* hcl2 = new Context_list; + Context_list* va_vb_cl = sc_iter_va_vb->second; + sc_to_c_map.erase(sc_iter_va_vb); + Context_list* va_vc_cl = get_context_list(va,vc); + Context_list* vc_vb_cl = get_context_list(vc,vb); - Vertex_it pos; - Context ctxt; - for(Context_iterator ctit=hcl->begin(); ctit != hcl->end(); ctit++) { - // insert vc in enclosing constraint - pos = ctit->current(); - ++pos; - pos = ctit->enclosing.vl_ptr()->insert(pos.base(), Node(vc)); - --pos; + bool vc_vb_was_already_a_subconstraint = vc_vb_cl != nullptr; - // set ctxt to the context of (vc,vb) - // change *ctit in hcl to the context of (va,vc) - // add ctxt to hcl2 list - ctxt.enclosing = ctit->enclosing; - if(*pos == va) { - ctit->pos = pos; - ctxt.pos = ++pos; + if(vc_vb_cl == nullptr) { + vc_vb_cl = new Context_list; + } + + for(Context& ctxt : *va_vb_cl) { + Vertex_it pos = ctxt.current(); + Vertex_it next_pos = std::next(pos); + + // [pos, next_pos] is the subconstraint (va,vb) or (vb,va) + CGAL_assertion( (va == *pos && vb == *next_pos) || (vb == *pos && va == *next_pos) ); + // insert vc in enclosing constraint, just before `next_pos` + Vertex_it pos_vc = ctxt.enclosing.vl_ptr()->insert(next_pos.base(), Node(vc)); + pos = std::prev(pos_vc); + + // now (pos, pos_vc, next_pos) is (va,vc,vb) or (vb,vc,va) + + // change ctxt in va_vb_cl to the context of (va,vc) + Context& va_vc_ctxt = ctxt; + Context vc_vb_ctxt{ctxt}; + if(*pos == va) { // (pos, pos_vc, next_pos) is (va,vc,vb) + va_vc_ctxt.pos = pos; + vc_vb_ctxt.pos = pos_vc; } - else { //(*pos)==vb - ctxt.pos = pos; - ctit->pos = ++pos; + else { // (pos, pos_vc, next_pos) is (vb,vc,va) + vc_vb_ctxt.pos = pos; + va_vc_ctxt.pos = pos_vc; } - hcl2->push_back(ctxt); + vc_vb_cl->push_back(vc_vb_ctxt); } - Context_list* hcl3; - if (get_contexts(va,vc,hcl3)) { // (va,vc) is already a subconstraint - hcl3->splice(hcl3->end(), *hcl); - delete hcl; + if (va_vc_cl != nullptr) { // (va,vc) was already a subconstraint + va_vc_cl->splice(va_vc_cl->end(), *va_vb_cl); + delete va_vb_cl; + } else { + va_vc_cl = va_vb_cl; + sc_to_c_map.emplace(sorted_pair(va,vc), va_vc_cl); } - else sc_to_c_map.emplace(sorted_pair(va,vc), hcl); - if (get_contexts(vc,vb,hcl3)) {// (vc,vb) is already a subconstraint - hcl3->splice(hcl3->end(),*hcl2); - - delete hcl2; + if (false == vc_vb_was_already_a_subconstraint) { + sc_to_c_map.emplace(sorted_pair(vc,vb), vc_vb_cl); } - else sc_to_c_map.emplace(sorted_pair(vc,vb), hcl2); - - - sc_to_c_map.erase(sorted_pair(va,vb)); - return; + fix_contexts(*va_vc_cl); + fix_contexts(*vc_vb_cl); } @@ -1174,14 +1307,15 @@ sorted_pair(T va, T vb) const template inline -bool +typename Polyline_constraint_hierarchy_2::Context_list* Polyline_constraint_hierarchy_2:: -get_contexts(T va, T vb, Context_list* & hcl) const +get_context_list(T va, T vb) const { - Sc_iterator sc_iter = sc_to_c_map.find(sorted_pair(va,vb)); - if( sc_iter == sc_to_c_map.end() ) return(false); - hcl = sc_iter->second; - return true; + Sc_iterator sc_iter = sc_to_c_map.find(sorted_pair(va, vb)); + if(sc_iter == sc_to_c_map.end()) + return nullptr; + else + return sc_iter->second; } template @@ -1192,8 +1326,8 @@ get_contexts(T va, T vb, Context_iterator& ctxt, Context_iterator& past) const { - Context_list* hcl; - if (!get_contexts(va,vb,hcl)) return false; + Context_list* hcl = get_context_list(va,vb); + if (nullptr == hcl) return false; ctxt = hcl->begin(); past = hcl->end(); return true; @@ -1266,6 +1400,9 @@ print(std::ostream& os) const for(const auto& node : cid.elements()) { os << node.point() << " "; } + if(cid.vl_with_info_ptr->may_share_subconstraint_with_others) { + os << "\n (may have non-simple context lists)"; + } os << std::endl; } os << std::endl; diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp index 37f016fe98a..35768f975c6 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4025.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -32,18 +32,17 @@ auto nb_of_vertices(CDTP &cdtp, Constraint_id id) cdtp.vertices_in_constraint_end(id))); } -auto value_check_expected = - [](auto&& value, [[maybe_unused]] const auto& expected) -> decltype(auto) - { - assert(value == expected); - return std::forward(value); - }; +template +decltype(auto) value_check_expected(V&& value, [[maybe_unused]] const E& expected) +{ + assert(value == expected); + return std::forward(value); +}; -auto oformat = - [](Vertex_handle vh) - { - return CGAL::IO::oformat(vh, CGAL::With_point_tag{}); - }; +auto oformat(Vertex_handle vh) +{ + return CGAL::IO::oformat(vh, CGAL::With_point_tag{}); +}; int main() { @@ -113,13 +112,13 @@ int main() // Let's insert a constraint with a loop - // (1,1) - // /| - // / | - // (0,0) X->(1,0) - // / - // / - // X (-1,-1) + // (1,1) + // / | + // / | + // start-->(0,0) X-->(1,0) + // / + // / + // (-1,-1) const std::array looping_cid = { Point(0,0), Point(1,0), Point(1,1), Point(-1,-1) }; @@ -130,17 +129,15 @@ int main() << value_check_expected(cdtp.number_of_subconstraints(), 4U) << std::endl; // NOW test another scenario - // Let's insert a constraint with identical sub-constraints - // (1,1) - // /| - // / | - // (0,0) X->(1,0)--->X(3,0) cdtp.clear(); print_cdtp("\nAfter clearing the constrained triangulation"); - - const std::array overlaping_cid = { - Point(0,0), Point(1,0), Point(1,1), Point(0,0), Point(3, 0) - }; + // Let's insert a constraint with identical sub-constraints + // (1,1) + // / | + // / | + // start-->(0,0)-->(1,0)--->(3,0) + const std::array overlaping_cid = {Point(0, 0), Point(1, 0), Point(1, 1), + Point(0, 0), Point(3, 0)}; cdtp.insert_constraint(overlaping_cid.begin(), overlaping_cid.end()); print_cdtp("\nAfter inserting a constraint with overlapping subconstraints"); std::cout << "\nnumber of subconstraints: " @@ -151,14 +148,13 @@ int main() // NOW test another scenario cdtp.clear(); print_cdtp("\nAfter clearing the constrained triangulation"); - // Let's insert two constraints with four points each and one common segment in the middle - const std::array first_cid = { - Point(0,0), Point(1,0), Point(2,0), Point(3,0) - }; - const std::array second_cid = { - Point(3,0), Point(1,0), Point(2,0), Point(2,2) - }; + // start-->(0,1) (3,1) + // \ / + // \ / + // start-->(0,0)--->(1,0)===>(2,0)--->(3,0) + const std::array first_cid = {Point(0, 0), Point(1, 0), Point(2, 0), Point(3, 0)}; + const std::array second_cid = {Point(0, 1), Point(1, 0), Point(2, 0), Point(3, 1)}; cdtp.insert_constraint(first_cid.begin(), first_cid.end()); cdtp.insert_constraint(second_cid.begin(), second_cid.end()); print_cdtp("\nAfter inserting two constraints with a common segment in the middle"); From 9ddc5294fa3a487faf790c938147f92e7619c89c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 22:37:21 +0100 Subject: [PATCH 236/332] cleanup in CGAL/Iterator_range.h ... and add a default constructor to create an empty range (with singular iterators). --- STL_Extension/include/CGAL/Iterator_range.h | 106 +++++++------------- 1 file changed, 37 insertions(+), 69 deletions(-) diff --git a/STL_Extension/include/CGAL/Iterator_range.h b/STL_Extension/include/CGAL/Iterator_range.h index e42441e9858..2c41f38266a 100644 --- a/STL_Extension/include/CGAL/Iterator_range.h +++ b/STL_Extension/include/CGAL/Iterator_range.h @@ -18,56 +18,36 @@ namespace CGAL { - /*! -\ingroup PkgSTLExtensionRef - /// `CGAL::Iterator_range` is a... - */ - template - class Iterator_range - : public std::pair{ +/*! + \ingroup PkgSTLExtensionRef + `CGAL::Iterator_range` encapsulates two iterators so they fulfill the `ForwardRange` concept. + The class is essentially a clone of `boost::iterator_range`, + and it additionally is derived from `std::pair`, so that one can apply `boost::tie`. +*/ +template +class Iterator_range : public std::pair +{ + typedef std::pair Base; - typedef std::pair Base; +public: + typedef I iterator; + typedef I const_iterator; - public: + Iterator_range() = default; + Iterator_range(I b, I e) + : Base(b, e) {} + Iterator_range(const std::pair& ip) + : Base(ip) {} - typedef I iterator; - typedef I const_iterator; - - Iterator_range(I b, I e) - : Base(b,e) - {} - - - // Iterator_range(const Iterator_range& ip) - // : Base(ip) - // {} - - Iterator_range(const std::pair& ip) - : Base(ip) - {} - - I begin() const - { - return this->first; - } - - I end() const - { - return this->second; - } + I begin() const { return this->first; } + I end() const { return this->second; } /// returns `std::distance(begin(), end())` - std::size_t - size() const - { - return static_cast(std::distance(begin(), end())); - } + std::size_t size() const { return static_cast(std::distance(begin(), end())); } /// returns `std::distance(begin(), end())==0` - bool empty() const - { - return begin()==end(); - } + bool empty() const { return begin() == end(); } operator std::tuple() { @@ -87,37 +67,25 @@ namespace CGAL { } }; - template - Iterator_range - make_range(const T& b, const T&e) - { - return Iterator_range(b,e); - } +template +Iterator_range +make_range(const T& b, const T&e) +{ + return Iterator_range(b,e); +} - template - Iterator_range - make_range(const std::pair& p) - { - return Iterator_range(p.first,p.second); - } +template +Iterator_range +make_range(const std::pair& p) +{ + return Iterator_range(p.first,p.second); +} } // namespace CGAL -// At global scope... - +namespace boost::foreach { template -inline boost::mpl::true_ * - boost_foreach_is_lightweight_proxy( CGAL::Iterator_range *&, boost::foreach::tag ) -{ - return 0; + struct is_lightweight_proxy> : boost::mpl::true_ {}; } -namespace boost { namespace foreach -{ - template - struct is_lightweight_proxy< CGAL::Iterator_range > - : mpl::true_ - { - }; -}} #endif // CGAL_ITERATOR_RANGE_H From 0b4dfa89525aa114bfbaf2defb8ae365a1fbfe19 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 23:20:20 +0100 Subject: [PATCH 237/332] Polyline_constraint_hierarchy_2: get_contexts -> context --- .../CGAL/Constrained_triangulation_plus_2.h | 2 +- .../Polyline_constraint_hierarchy_2.h | 91 +++++++------------ 2 files changed, 36 insertions(+), 57 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 043320f6689..eccc6e1f8a7 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -802,7 +802,7 @@ public: Contexts contexts(Vertex_handle va, Vertex_handle vb) const { - return Contexts(contexts_begin(va,vb),contexts_end(va,vb)); + return hierarchy.contexts(va, vb); } Vertices_in_constraint_iterator vertices_in_constraint_begin(Constraint_id cid) const; diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index a35525696f3..7e5cb1c2238 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -490,6 +490,9 @@ public: Context_iterator contexts_begin(T va, T vb) const; Context_iterator contexts_end(T va, T vb) const; Iterator_range contexts_range(T va, T vb) const; + Iterator_range contexts(T va, T vb) const; // alias to contexts_range + Context_list* get_context_list(T va, T vb) const; + size_type number_of_constraints() const { return constraints_set.size();} size_type number_of_subconstraints()const {return sc_to_c_map.size();} @@ -615,11 +618,6 @@ private: const auto& [va, vb] = sc; return sorted_pair(va, vb); } Vertex_it get_pos(T va, T vb) const; - bool get_contexts(T va, T vb, - Context_iterator& ctxt, - Context_iterator& past) const; - - Context_list* get_context_list(T va, T vb) const; //to_debug public: @@ -729,8 +727,8 @@ template bool Polyline_constraint_hierarchy_2:: enclosing_constraint(T vaa, T vbb, T& va, T& vb) const { - Context_iterator hcit, past; - if ( !get_contexts(vaa,vbb, hcit ,past)) return false; + auto [hcit, past] = contexts(vaa, vbb); + if (hcit == past) return false; // va = hcit->enclosing.front().vertex(); // vb = hcit->enclosing.back().vertex(); // Vertex_list_ptr vl = hcit->enclosing; @@ -753,19 +751,17 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const } template -typename Polyline_constraint_hierarchy_2::Context -Polyline_constraint_hierarchy_2:: -context(T va, T vb) +auto Polyline_constraint_hierarchy_2:: +context(T va, T vb) -> Context { - Context_iterator hcit, past; - if(!get_contexts(va,vb, hcit ,past)) CGAL_assertion(false); + auto [hcit, past] = contexts(va, vb); + CGAL_assertion(hcit != past); CGAL_USE(past); return *hcit; } template -typename Polyline_constraint_hierarchy_2::size_type -Polyline_constraint_hierarchy_2:: -number_of_enclosing_constraints(T va, T vb) const +auto Polyline_constraint_hierarchy_2:: +number_of_enclosing_constraints(T va, T vb) const -> size_type { Context_list* hcl = get_context_list(va,vb); CGAL_assertion(nullptr != hcl); @@ -773,32 +769,23 @@ number_of_enclosing_constraints(T va, T vb) const } template -typename Polyline_constraint_hierarchy_2::Context_iterator -Polyline_constraint_hierarchy_2:: -contexts_begin(T va, T vb) const +auto Polyline_constraint_hierarchy_2:: +contexts_begin(T va, T vb) const -> Context_iterator { - Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); - return first; + return contexts(vb, vb).begin(); } template -typename Polyline_constraint_hierarchy_2::Context_iterator -Polyline_constraint_hierarchy_2:: -contexts_end(T va, T vb) const +auto Polyline_constraint_hierarchy_2:: +contexts_end(T va, T vb) const -> Context_iterator { - Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); - return last; + return contexts(vb, vb).end(); } template -auto -Polyline_constraint_hierarchy_2:: +auto Polyline_constraint_hierarchy_2:: contexts_range(T va, T vb) const -> Iterator_range { - Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) return { first, first }; - else return { first, last }; + return contexts(va, vb); } template @@ -1188,20 +1175,19 @@ next_along_sc(T va, T vb, T& w) const { // find the next vertex after vb along any enclosing constrained // return false if there is no .... - Context_iterator ctxtit, past; - if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); - - for(; ctxtit != past; ctxtit++) { - Vertex_it pos = ctxtit->pos; + const auto& ctxts = contexts(va, vb); + CGAL_assertion(ctxts.empty() == false); + for(const auto& ctxt : ctxts) { + Vertex_it pos = ctxt.pos; if((*pos) == va) { ++pos; ++pos; - if(pos != ctxtit->enclosing.end()) { + if(pos != ctxt.enclosing.end()) { w = *pos; return true; } } else { - if(pos != ctxtit->enclosing.begin()) { + if(pos != ctxt.enclosing.begin()) { --pos; w = *pos; return true; @@ -1320,17 +1306,12 @@ get_context_list(T va, T vb) const template inline -bool -Polyline_constraint_hierarchy_2:: -get_contexts(T va, T vb, - Context_iterator& ctxt, - Context_iterator& past) const +auto Polyline_constraint_hierarchy_2:: +contexts(T va, T vb) const -> Iterator_range { Context_list* hcl = get_context_list(va,vb); - if (nullptr == hcl) return false; - ctxt = hcl->begin(); - past = hcl->end(); - return true; + if (nullptr == hcl) return {}; + else return {hcl->begin(), hcl->end()}; } @@ -1350,8 +1331,8 @@ void Polyline_constraint_hierarchy_2:: oriented_end(T va, T vb, T& vc) const { - Context_iterator ctxt, past; - if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); + auto [ctxt, past] = contexts(va, vb); + CGAL_assertion(ctxt != past); CGAL_USE(past); if(*(ctxt->pos) == va) vc = ctxt->enclosing.back(); else @@ -1410,14 +1391,12 @@ print(std::ostream& os) const for(const auto& subconstraint : subconstraints()) { os << "subconstraint ("; os << disp_vertex(subconstraint.first) << ", " - << disp_vertex(subconstraint.second) << ")"; - Context_iterator cb, ce; - get_contexts(subconstraint.first, subconstraint.second, cb, ce); + << disp_vertex(subconstraint.second) << ")"; os << " enclosing: "; - for(; cb != ce; cb++) { - os << "(cid " << cb->id().id << ") " << cb->id().vl_ptr(); - os << ", pos: " << std::distance(cb->vertices_begin(), cb->pos) << " "; + for(const auto& ctxt : contexts(subconstraint.first, subconstraint.second)) { + os << "(cid " << ctxt.id().id << ") " << ctxt.id().vl_ptr(); + os << ", pos: " << std::distance(ctxt.vertices_begin(), ctxt.pos) << " "; } os << std::endl; } From 58c739c61f051e5b376603d7a7e7af314f186055 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 22 Jan 2025 23:25:47 +0100 Subject: [PATCH 238/332] clearnup: remove undocumnted/unused member functions --- .../Polyline_constraint_hierarchy_2.h | 54 +------------------ 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 7e5cb1c2238..6f56bd9caff 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -482,15 +482,12 @@ public: { return cid.vl_ptr()->all_end(); } bool enclosing_constraint(T vaa, T vbb, T& va, T& vb) const; - bool next_along_sc(T va, T vb, T& w) const; - void oriented_end(T va, T vb, T& vc) const; Context context(T va, T vb); size_type number_of_enclosing_constraints(T va, T vb) const; Context_iterator contexts_begin(T va, T vb) const; Context_iterator contexts_end(T va, T vb) const; - Iterator_range contexts_range(T va, T vb) const; - Iterator_range contexts(T va, T vb) const; // alias to contexts_range + Iterator_range contexts(T va, T vb) const; Context_list* get_context_list(T va, T vb) const; size_type number_of_constraints() const { return constraints_set.size();} @@ -782,12 +779,6 @@ contexts_end(T va, T vb) const -> Context_iterator return contexts(vb, vb).end(); } -template -auto Polyline_constraint_hierarchy_2:: -contexts_range(T va, T vb) const -> Iterator_range { - return contexts(va, vb); -} - template void Polyline_constraint_hierarchy_2:: @@ -1169,35 +1160,6 @@ clear() } -template -bool Polyline_constraint_hierarchy_2:: -next_along_sc(T va, T vb, T& w) const -{ - // find the next vertex after vb along any enclosing constrained - // return false if there is no .... - const auto& ctxts = contexts(va, vb); - CGAL_assertion(ctxts.empty() == false); - for(const auto& ctxt : ctxts) { - Vertex_it pos = ctxt.pos; - if((*pos) == va) { - ++pos; - ++pos; - if(pos != ctxt.enclosing.end()) { - w = *pos; - return true; - } - } else { - if(pos != ctxt.enclosing.begin()) { - --pos; - w = *pos; - return true; - } - } - } - return false; -} - - /* same as add_Steiner precondition : va,vb est une souscontrainte. @@ -1326,20 +1288,6 @@ get_pos(T va, T vb) const return (*sc_to_c_map.find(sorted_pair(va,vb))).second->begin().pos; } -template -void -Polyline_constraint_hierarchy_2:: -oriented_end(T va, T vb, T& vc) const -{ - auto [ctxt, past] = contexts(va, vb); - CGAL_assertion(ctxt != past); CGAL_USE(past); - if(*(ctxt->pos) == va) - vc = ctxt->enclosing.back(); - else - vc = ctxt->enclosing.front(); -} - - template void Polyline_constraint_hierarchy_2:: From f95027a5c589a5c889b3ce4dc81342c2cd2aa20d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 00:57:02 +0100 Subject: [PATCH 239/332] Polyline_constraint_hierarchy_2: more refactoring - refactor the member function `enclosing_constraint` - refactor things around `sc_to_sc_map`, using new member functions to encapsulate the logic - remove unused/undocuments functions --- .../CGAL/Constrained_triangulation_plus_2.h | 16 +- .../Polyline_constraint_hierarchy_2.h | 167 ++++++++---------- 2 files changed, 81 insertions(+), 102 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index eccc6e1f8a7..4c4a1e3929d 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -1146,16 +1146,12 @@ intersect(Face_handle f, int i, // (the constraint edge (f,i) will be split in hierarchy by insert) // and return the Vertex_handle of the new Vertex { - Vertex_handle vc, vd, va, vb; - Vertex_handle vcc, vdd; - vcc = f->vertex(cw(i)); - vdd = f->vertex(ccw(i)); - CGAL_assertion_code( bool b1 = ) - hierarchy.enclosing_constraint(vcc,vdd,vc,vd); - CGAL_assertion_code( bool b2 = ) - hierarchy.enclosing_constraint(vaa,vbb,va,vb); - CGAL_assertion(b1); - CGAL_assertion(b2); + const Vertex_handle vcc = f->vertex(cw(i)); + const Vertex_handle vdd = f->vertex(ccw(i)); + const auto [vc, vd] = hierarchy.enclosing_constraint(vcc, vdd); + const auto [va, vb] = hierarchy.enclosing_constraint(vaa, vbb); + CGAL_assertion(vc != vd); + CGAL_assertion(va != vb); const Point& pa = va->point(); const Point& pb = vb->point(); diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 6f56bd9caff..4961d16ca3a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -215,10 +216,12 @@ public: class Context { friend class Polyline_constraint_hierarchy_2; private: - Constraint_id enclosing; - Vertex_it pos; + Constraint_id enclosing = nullptr; + Vertex_it pos{}; public: - Context() : enclosing(nullptr) {} + Context() = default; + Context(Constraint_id enclosing, Vertex_it pos) : enclosing(enclosing), pos(pos) {} + Context(Constraint_id enclosing, typename Vertex_list::skip_iterator pos) : enclosing(enclosing), pos(pos) {} Vertex_it vertices_begin()const { return enclosing.begin();} Vertex_it current()const {return pos;} @@ -341,8 +344,8 @@ public: return false; } auto [va, vb] = this->operator*(); - auto it = hierarchy->sc_to_c_map.find(hierarchy->sorted_pair(va, vb)); - CGAL_assertion(it != hierarchy->sc_to_c_map.end()); + auto it = hierarchy->find_contexts(va, vb); + CGAL_assertion(it != hierarchy->contexts_end()); const Context_list& ctx_list = *it->second; @@ -481,7 +484,7 @@ public: Point_it points_in_constraint_end(Constraint_id cid) const { return cid.vl_ptr()->all_end(); } - bool enclosing_constraint(T vaa, T vbb, T& va, T& vb) const; + std::array enclosing_constraint(T vaa, T vbb) const; Context context(T va, T vb); size_type number_of_enclosing_constraints(T va, T vb) const; @@ -542,8 +545,6 @@ public: this); } - Sc_iterator sc_begin() const{ return sc_to_c_map.begin(); } - Sc_iterator sc_end() const{ return sc_to_c_map.end(); } Constraint_iterator constraints_begin() const{ return constraints_set.begin(); } Constraint_iterator constraints_end() const{ return constraints_set.end(); } @@ -560,13 +561,28 @@ public: void swap(Polyline_constraint_hierarchy_2& ch); private: + auto find_contexts(Vertex_handle va, Vertex_handle vb) { + return sc_to_c_map.find(sorted_pair(va, vb)); + } + auto find_contexts(Vertex_handle va, Vertex_handle vb) const { + return sc_to_c_map.find(sorted_pair(va, vb)); + } + auto contexts_end() { return sc_to_c_map.end(); } + auto contexts_end() const { return sc_to_c_map.end(); } + void erase_context(Sc_iterator it) { + sc_to_c_map.erase(it); + } + + auto& contexts_of(Vertex_handle va, Vertex_handle vb) { + return sc_to_c_map[sorted_pair(va, vb)]; + } template void for_context_lists_of_all_subconstraints(Constraint_id cid, const F& f) { auto vl = cid.vl_ptr(); for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { - auto scit = sc_to_c_map.find(sorted_pair(*it, *succ)); - CGAL_assertion(scit != sc_to_c_map.end()); + auto scit = find_contexts(*it, *succ); + CGAL_assertion(scit != contexts_end()); Context_list* hcl = scit->second; f(hcl, it, scit); } @@ -610,11 +626,12 @@ private: auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; return Constraint_id(new Vertex_list_with_info{this}, id); } - Subconstraint sorted_pair(T va, T vb) const; + Subconstraint sorted_pair(T va, T vb) const { + return comp(va, vb) ? Subconstraint(va,vb) : Subconstraint(vb,va); + } Subconstraint sorted_pair(Subconstraint sc) { const auto& [va, vb] = sc; return sorted_pair(va, vb); } - Vertex_it get_pos(T va, T vb) const; //to_debug public: @@ -675,22 +692,16 @@ copy(const Polyline_constraint_hierarchy_2& other, std::mappush_back(ctxt2); + Constraint_id cid2 = cstr_map[cid1]; + auto pos2 = std::next(Vertex_it(cid2.begin()), + std::distance(Vertex_it(cid1.begin()), pos1)); + hcl2->emplace_back(cid2, pos2); } } @@ -715,17 +726,18 @@ template bool Polyline_constraint_hierarchy_2:: is_subconstraint(T va, T vb) const { - return( sc_to_c_map.find(sorted_pair(va, vb)) != sc_to_c_map.end() ); + return( find_contexts(va, vb) != contexts_end() ); } // used by Constrained_triangulation_plus_2::intersect with Exact_intersection_tag template -bool Polyline_constraint_hierarchy_2:: -enclosing_constraint(T vaa, T vbb, T& va, T& vb) const +auto Polyline_constraint_hierarchy_2:: +enclosing_constraint(T vaa, T vbb) const -> std::array { + std::array result; auto [hcit, past] = contexts(vaa, vbb); - if (hcit == past) return false; + if (hcit == past) return result; // va = hcit->enclosing.front().vertex(); // vb = hcit->enclosing.back().vertex(); // Vertex_list_ptr vl = hcit->enclosing; @@ -736,15 +748,14 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const while(!pos.input()){ --pos; } - va = *pos; - pos = hcit->pos; - ++pos; + result[0] = *pos; + pos = std::next(hcit->pos); CGAL_assertion(vbb == *pos); while(!pos.input()){ ++pos; } - vb = *pos; - return true; + result[1] = *pos; + return result; } template @@ -769,14 +780,14 @@ template auto Polyline_constraint_hierarchy_2:: contexts_begin(T va, T vb) const -> Context_iterator { - return contexts(vb, vb).begin(); + return contexts(va, vb).begin(); } template auto Polyline_constraint_hierarchy_2:: contexts_end(T va, T vb) const -> Context_iterator { - return contexts(vb, vb).end(); + return contexts(va, vb).end(); } template @@ -816,7 +827,7 @@ remove_constraint(Constraint_id cid) // If this was the only context in the list, delete the context list if(hcl->empty()) { - sc_to_c_map.erase(scit); + erase_context(scit); delete hcl; } }); @@ -834,8 +845,8 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, { // TODO: How do we (want to) deal with u == w ??? Vertex_handle u = *uc, v = *vc, w = *wc; - typename Sc_to_c_map::iterator uv_sc_iter = sc_to_c_map.find(sorted_pair(u, v)); - typename Sc_to_c_map::iterator vw_sc_iter = sc_to_c_map.find(sorted_pair(v, w)); + typename Sc_to_c_map::iterator uv_sc_iter = find_contexts(u, v); + typename Sc_to_c_map::iterator vw_sc_iter = find_contexts(v, w); Context_list* uv_hcl = uv_sc_iter->second; Context_list* vw_hcl = vw_sc_iter->second; // AF: what is input() about??? @@ -879,11 +890,11 @@ void Polyline_constraint_hierarchy_2::simplify(Vertex_it uc, uv_hcl->splice(uv_hcl->end(),*vw_hcl); delete vw_hcl; - sc_to_c_map.erase(uv_sc_iter); - sc_to_c_map.erase(vw_sc_iter); + erase_context(uv_sc_iter); + erase_context(vw_sc_iter); // reuse other context list - sc_to_c_map[sorted_pair(u,w)] = uv_hcl; + contexts_of(u,w) = uv_hcl; } @@ -1085,22 +1096,18 @@ insert_constraint(T va, T vb){ << "C_hierachy.insert_constraint( " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 - Subconstraint sc = sorted_pair(va, vb); Constraint_id cid = new_constraint_id(); - auto children = cid.vl_ptr(); - auto& fathers = sc_to_c_map[sc]; - if(fathers == nullptr){ - fathers = new Context_list; + auto& context_list_ptr = contexts_of(va, vb); + if(context_list_ptr == nullptr){ + context_list_ptr = new Context_list; } - children->push_front(Node(va, true)); // was sc.first - children->push_back(Node(vb, true)); // was sc.second + auto children = cid.vl_ptr(); + children->push_front(Node(va, true)); + children->push_back(Node(vb, true)); constraints_set.insert(cid); - Context ctxt; - ctxt.enclosing = cid; - ctxt.pos = children->skip_begin(); - fathers->push_front(ctxt); - fix_contexts(*fathers); + context_list_ptr->emplace_front(cid, cid.begin()); + fix_contexts(*context_list_ptr); return cid; } @@ -1124,20 +1131,16 @@ append_constraint(Constraint_id cid, T va, T vb){ << "C_hierachy.append_constraint( ..., " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 - Subconstraint sc = sorted_pair(va, vb); - auto& fathers = sc_to_c_map[sc]; - if(fathers == nullptr){ - fathers = new Context_list; + auto& context_list_ptr = contexts_of(va, vb); + if(context_list_ptr == nullptr){ + context_list_ptr = new Context_list; } - typename Vertex_list::skip_iterator last_pos = std::prev(cid.end()); - CGAL_assertion(last_pos->vertex() == va); + auto pos_va = std::prev(cid.end()); + CGAL_assertion(pos_va->vertex() == va); cid.vl_ptr()->push_back(Node(vb, true)); - Context ctxt; - ctxt.enclosing = cid; - ctxt.pos = last_pos; - fathers->push_front(ctxt); - fix_contexts(*fathers); + context_list_ptr->emplace_front(cid, pos_va); + fix_contexts(*context_list_ptr); } @@ -1182,8 +1185,8 @@ add_Steiner(const T va, const T vb, const T vc){ << IO::oformat(va) << ", " << IO::oformat(vb) << ", " << IO::oformat(vc) << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 - Sc_iterator sc_iter_va_vb = sc_to_c_map.find(sorted_pair(va, vb)); - if(sc_iter_va_vb == sc_to_c_map.end()) { + Sc_iterator sc_iter_va_vb = find_contexts(va, vb); + if(sc_iter_va_vb == contexts_end()) { #ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 std::cerr << CGAL::internal::cdt_2_indent_level << " -> the constraint is already split\n"; @@ -1192,7 +1195,7 @@ add_Steiner(const T va, const T vb, const T vc){ } Context_list* va_vb_cl = sc_iter_va_vb->second; - sc_to_c_map.erase(sc_iter_va_vb); + erase_context(sc_iter_va_vb); Context_list* va_vc_cl = get_context_list(va,vc); Context_list* vc_vb_cl = get_context_list(vc,vb); @@ -1233,34 +1236,25 @@ add_Steiner(const T va, const T vb, const T vc){ delete va_vb_cl; } else { va_vc_cl = va_vb_cl; - sc_to_c_map.emplace(sorted_pair(va,vc), va_vc_cl); + contexts_of(va,vc) = va_vc_cl; } if (false == vc_vb_was_already_a_subconstraint) { - sc_to_c_map.emplace(sorted_pair(vc,vb), vc_vb_cl); + contexts_of(vc,vb) = vc_vb_cl; } fix_contexts(*va_vc_cl); fix_contexts(*vc_vb_cl); } -template -inline -typename Polyline_constraint_hierarchy_2::Subconstraint -Polyline_constraint_hierarchy_2:: -sorted_pair(T va, T vb) const -{ - return comp(va, vb) ? Subconstraint(va,vb) : Subconstraint(vb,va); -} - template inline typename Polyline_constraint_hierarchy_2::Context_list* Polyline_constraint_hierarchy_2:: get_context_list(T va, T vb) const { - Sc_iterator sc_iter = sc_to_c_map.find(sorted_pair(va, vb)); - if(sc_iter == sc_to_c_map.end()) + Sc_iterator sc_iter = find_contexts(va, vb); + if(sc_iter == contexts_end()) return nullptr; else return sc_iter->second; @@ -1277,17 +1271,6 @@ contexts(T va, T vb) const -> Iterator_range } - -template -inline -typename Polyline_constraint_hierarchy_2::Vertex_it -Polyline_constraint_hierarchy_2:: -get_pos(T va, T vb) const - //return pos in the first context -{ - return (*sc_to_c_map.find(sorted_pair(va,vb))).second->begin().pos; -} - template void Polyline_constraint_hierarchy_2:: From 0bb274d16995a73527c1aa08fca9d8612bf25c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 23 Jan 2025 11:45:06 +0100 Subject: [PATCH 240/332] fix warnings --- BGL/test/BGL/test_OpenMesh.cpp | 22 ++++++++++++++++--- .../test/SMDS_3/test_c3t3_with_features.cpp | 2 +- .../test_Concurrent_compact_container.cpp | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/BGL/test/BGL/test_OpenMesh.cpp b/BGL/test/BGL/test_OpenMesh.cpp index 0dede3e68ed..e5c5206223d 100644 --- a/BGL/test/BGL/test_OpenMesh.cpp +++ b/BGL/test/BGL/test_OpenMesh.cpp @@ -10,13 +10,29 @@ typedef Traits::edge_descriptor edge_descriptor; typedef Traits::halfedge_descriptor halfedge_descriptor; typedef Traits::vertex_descriptor vertex_descriptor; typedef Traits::face_descriptor face_descriptor; -//typedef Kernel::Point_3 Point_3; int main() { Om om; - for (Om::EdgeHandle ed : edges(om)) { - std::cout << "edge" << std::endl; + for (Om::EdgeHandle ed : edges(om)) + { + CGAL_USE(ed); + } + for (edge_descriptor ed : edges(om)) + { + CGAL_USE(ed); + } + for (halfedge_descriptor hd : edges(om)) + { + CGAL_USE(hd); + } + for (face_descriptor fd : faces(om)) + { + CGAL_USE(fd); + } + for (vertex_descriptor vd : vertices(om)) + { + CGAL_USE(vd); } return 0; } diff --git a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp index 4373da1fdc0..337807b0e6e 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp @@ -346,7 +346,7 @@ struct Tester // Test vertex iterators //------------------------------------------------------- std::cout << "Test vertex iterators\n"; - const Vertex_handle& vertex_to_modify = c3t3.vertices_in_complex_begin(); + Vertex_handle vertex_to_modify = c3t3.vertices_in_complex_begin(); Vertex_handle vertex_to_modify_copy = vertex_to_modify; c3t3.remove_from_complex(vertex_to_modify); diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index a42676f8f7f..379cfcfb3b2 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -45,7 +45,7 @@ struct Node_1 void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_; + std::size_t time_stamp_ = 0; }; class Node_2 From 9f5bee7abddbf4ae039b78cc06bb8341ddfb3d05 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 16:24:33 +0100 Subject: [PATCH 241/332] rename contexts_end to contexts_not_found because that name is already used in the class --- .../internal/Polyline_constraint_hierarchy_2.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 4961d16ca3a..c13dbe4025f 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -345,7 +345,7 @@ public: } auto [va, vb] = this->operator*(); auto it = hierarchy->find_contexts(va, vb); - CGAL_assertion(it != hierarchy->contexts_end()); + CGAL_assertion(it != hierarchy->contexts_not_found()); const Context_list& ctx_list = *it->second; @@ -567,8 +567,8 @@ private: auto find_contexts(Vertex_handle va, Vertex_handle vb) const { return sc_to_c_map.find(sorted_pair(va, vb)); } - auto contexts_end() { return sc_to_c_map.end(); } - auto contexts_end() const { return sc_to_c_map.end(); } + auto contexts_not_found() { return sc_to_c_map.end(); } + auto contexts_not_found() const { return sc_to_c_map.end(); } void erase_context(Sc_iterator it) { sc_to_c_map.erase(it); } @@ -582,7 +582,7 @@ private: auto vl = cid.vl_ptr(); for(Vertex_it it = vl->skip_begin(), succ = it, end = vl->skip_end(); ++succ != end; ++it) { auto scit = find_contexts(*it, *succ); - CGAL_assertion(scit != contexts_end()); + CGAL_assertion(scit != contexts_not_found()); Context_list* hcl = scit->second; f(hcl, it, scit); } @@ -726,7 +726,7 @@ template bool Polyline_constraint_hierarchy_2:: is_subconstraint(T va, T vb) const { - return( find_contexts(va, vb) != contexts_end() ); + return( find_contexts(va, vb) != contexts_not_found() ); } @@ -1186,7 +1186,7 @@ add_Steiner(const T va, const T vb, const T vc){ << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 Sc_iterator sc_iter_va_vb = find_contexts(va, vb); - if(sc_iter_va_vb == contexts_end()) { + if(sc_iter_va_vb == contexts_not_found()) { #ifdef CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 std::cerr << CGAL::internal::cdt_2_indent_level << " -> the constraint is already split\n"; @@ -1254,7 +1254,7 @@ Polyline_constraint_hierarchy_2:: get_context_list(T va, T vb) const { Sc_iterator sc_iter = find_contexts(va, vb); - if(sc_iter == contexts_end()) + if(sc_iter == contexts_not_found()) return nullptr; else return sc_iter->second; From 49a9efa2eb13b084fab782dc50b76fa2dc933895 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 16:26:38 +0100 Subject: [PATCH 242/332] add a nested type using Vertex_handle_compare = Compare; ... add switch to `using` in the whole file. --- .../Polyline_constraint_hierarchy_2.h | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index c13dbe4025f..b45852b0f52 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -49,11 +49,15 @@ namespace CGAL { template class Polyline_constraint_hierarchy_2 { + using T_point_ref = decltype(std::declval()->point()); + static_assert(std::is_same_v, + "The point type of the vertex handle must be the same as the point type of the hierarchy."); public: - typedef T Vertex_handle; - typedef std::pair Subconstraint; + using Vertex_handle = T; + using Vertex_handle_compare = Compare; + using Subconstraint = std::pair; - using size_type = std::size_t; + using size_type = typename Vertex_handle::size_type; private: class Node { @@ -71,8 +75,8 @@ private: bool input_; }; - typedef CGAL::Skiplist Vertex_list; - typedef Vertex_list* Vertex_list_ptr; + using Vertex_list = CGAL::Skiplist; + using Vertex_list_ptr = Vertex_list*; public: // the base line is always @@ -100,7 +104,7 @@ public: , std::bidirectional_iterator_tag , Vertex_handle> { - typedef typename Vertex_list::skip_iterator Base_it; + using Base_it = typename Vertex_list::skip_iterator; public: Vertex_it() : Vertex_it::iterator_adaptor_() {} Vertex_it(Base_it it) : Vertex_it::iterator_adaptor_(it) {} @@ -230,8 +234,8 @@ public: size_type number_of_vertices() const {return enclosing.size(); } }; - typedef std::list Context_list; - typedef typename Context_list::iterator Context_iterator; + using Context_list = std::list; + using Context_iterator = typename Context_list::iterator; static void fix_contexts(Context_list& context_list) { const bool multiple_contexts = context_list.size() > 1; @@ -242,20 +246,18 @@ public: } } - typedef std::set Constraints_set; + using Constraints_set = std::set; #if CGAL_USE_BARE_STD_MAP - typedef std::map Sc_to_c_map; + using Sc_to_c_map = std::map; #else - typedef CGAL::unordered_flat_map> Sc_to_c_map; + using Sc_to_c_map = CGAL::unordered_flat_map>; #endif - typedef typename Constraints_set::iterator Constraint_iterator; - typedef const Constraints_set& Constraints; - typedef typename Sc_to_c_map::const_iterator Sc_iterator; - typedef typename Sc_to_c_map::iterator Sc_it; - typedef Sc_iterator Subconstraint_and_contexts_iterator; - typedef const Sc_to_c_map& Subconstraints_and_contexts; + using Constraint_iterator = typename Constraints_set::iterator; + using Constraints = const Constraints_set&; + using Sc_iterator = typename Sc_to_c_map::const_iterator; + using Sc_it = typename Sc_to_c_map::iterator; + using Subconstraint_and_contexts_iterator = Sc_iterator; + using Subconstraints_and_contexts = const Sc_to_c_map&; class Subconstraint_iterator : public boost::stl_interfaces::proxy_iterator_interface< #if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS @@ -445,7 +447,7 @@ public: return *this; } }; // end class Subconstraint_iterator - typedef Iterator_range Subconstraints; + using Subconstraints = Iterator_range; private: Compare comp; From 3d61960ea325e72c30edc57dfc3c0aa398490d23 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 17:14:31 +0100 Subject: [PATCH 243/332] use using-declarations and type aliases --- .../Constrained_Delaunay_triangulation_2.h | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index caed792fa5e..bce4d832860 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -40,7 +40,7 @@ struct Get_iterator_value_type{ template struct Get_iterator_value_type{ - typedef typename std::iterator_traits::value_type type; + using type = typename std::iterator_traits::value_type; }; } } //namespace CGAL::internal @@ -56,8 +56,8 @@ class Cdt_2_less_edge { const Tr* tr_ptr; - typedef typename Tr::Point Point; - typedef typename Tr::Edge Edge; + using Point = typename Tr::Point; + using Edge = typename Tr::Edge; public: Cdt_2_less_edge(const Tr* tr_ptr) : tr_ptr(tr_ptr) { } @@ -94,39 +94,45 @@ class Constrained_Delaunay_triangulation_2 : public Constrained_triangulation_2 { public: - typedef Constrained_triangulation_2 Ctr; - typedef typename Ctr::Tds Tds; - typedef typename Ctr::Itag Itag; + using Base = Constrained_triangulation_2; + using Ctr = Base; - typedef Constrained_Delaunay_triangulation_2 CDt; - typedef typename Ctr::Geom_traits Geom_traits; - typedef typename Ctr::Intersection_tag Intersection_tag; + // using-declarations, to import types from the base class + // (do not mix-up with type aliases) + // see: https://en.cppreference.com/w/cpp/language/type_alias + // https://en.cppreference.com/w/cpp/language/using_declaration + using typename Ctr::Tds; + using typename Ctr::Itag; - typedef typename Ctr::Constraint Constraint; - typedef typename Ctr::Vertex_handle Vertex_handle; - typedef typename Ctr::Face_handle Face_handle; - typedef typename Ctr::Edge Edge; - typedef typename Ctr::Finite_faces_iterator Finite_faces_iterator; - typedef typename Ctr::Constrained_edges_iterator Constrained_edges_iterator; - typedef typename Ctr::Face_circulator Face_circulator; - typedef typename Ctr::size_type size_type; - typedef typename Ctr::Locate_type Locate_type; + using typename Ctr::Geom_traits; + using typename Ctr::Intersection_tag; - typedef typename Ctr::List_edges List_edges; - typedef typename Ctr::List_faces List_faces; - typedef typename Ctr::List_vertices List_vertices; - typedef typename Ctr::List_constraints List_constraints; + using typename Ctr::Constraint; + using typename Ctr::Vertex_handle; + using typename Ctr::Face_handle; + using typename Ctr::Edge; + using typename Ctr::Finite_faces_iterator; + using typename Ctr::Constrained_edges_iterator; + using typename Ctr::Face_circulator; + using typename Ctr::size_type; + using typename Ctr::Locate_type; - typedef internal::Cdt_2_less_edge Less_edge; - typedef boost::container::flat_set Edge_set; + using typename Ctr::List_edges; + using typename Ctr::List_faces; + using typename Ctr::List_vertices; + using typename Ctr::List_constraints; + + // type aliases (aka type defs) + using CDt = Constrained_Delaunay_triangulation_2; + using Point = typename Geom_traits::Point_2; //Tag to distinguish Delaunay from regular triangulations - typedef Tag_false Weighted_tag; + using Weighted_tag = Tag_false; // Tag to distinguish periodic triangulations from others - typedef Tag_false Periodic_tag; + using Periodic_tag = Tag_false; -#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 + // using-declarations to import member functions from the base class using Ctr::geom_traits; using Ctr::number_of_vertices; using Ctr::finite_faces_begin; @@ -151,9 +157,6 @@ public: using Ctr::delete_vertex; using Ctr::push_back; using Ctr::mirror_index; -#endif - - typedef typename Geom_traits::Point_2 Point; Constrained_Delaunay_triangulation_2(const Geom_traits& gt=Geom_traits()) : Ctr(gt) { } @@ -388,8 +391,8 @@ private: indices.push_back(index++); } - typedef typename Pointer_property_map::type Pmap; - typedef Spatial_sort_traits_adapter_2 Search_traits; + using Pmap = typename Pointer_property_map::type; + using Search_traits = Spatial_sort_traits_adapter_2; spatial_sort(indices.begin(), indices.end(), @@ -604,6 +607,9 @@ public: Face_handle ni, f,ff; Edge ei,eni; + using Less_edge = internal::Cdt_2_less_edge; + using Edge_set = boost::container::flat_set; + Less_edge less_edge(this); Edge_set edge_set(less_edge); From 0dcc28794153156eaf8aa6c09e8f4a2e4c3ecbab Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 17:23:12 +0100 Subject: [PATCH 244/332] add CGAL::unordered_flat_set --- .../include/CGAL/unordered_flat_map.h | 27 +++++++++++++++++++ .../include/CGAL/unordered_flat_set.h | 17 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 STL_Extension/include/CGAL/unordered_flat_set.h diff --git a/STL_Extension/include/CGAL/unordered_flat_map.h b/STL_Extension/include/CGAL/unordered_flat_map.h index 8eb3203f87e..73ff2135033 100644 --- a/STL_Extension/include/CGAL/unordered_flat_map.h +++ b/STL_Extension/include/CGAL/unordered_flat_map.h @@ -18,12 +18,19 @@ # define CGAL_USE_BOOST_UNORDERED 1 #endif +#if CGAL_USE_BARE_STD_SET +# define CGAL_USE_BARE_STD_MAP CGAL_USE_BARE_STD_SET +#endif + #if CGAL_USE_BARE_STD_MAP // to benchmark with the ordered std::map # include +# include #elif CGAL_USE_BOOST_UNORDERED # include +# include #else // Boost before 1.81.0, use the C++11 std::unordered_map # include +# include #endif #include // for std::hash, std::equal_to @@ -52,6 +59,26 @@ template < #endif +template < + typename Key, + typename Hash = std::hash, + typename KeyEqual = std::equal_to, + typename Allocator = std::allocator + > +#if CGAL_USE_BARE_STD_MAP + + using unordered_flat_set = std::set, Allocator>; + +#elif CGAL_USE_BOOST_UNORDERED + + using unordered_flat_set = boost::unordered_flat_set; + +#else // use the C++11 std::unordered_set + + using unordered_flat_set = std::unordered_set; + +#endif + } // end namespace CGAL #endif // CGAL_UNORDERED_FLAT_MAP_H diff --git a/STL_Extension/include/CGAL/unordered_flat_set.h b/STL_Extension/include/CGAL/unordered_flat_set.h new file mode 100644 index 00000000000..bf71b173013 --- /dev/null +++ b/STL_Extension/include/CGAL/unordered_flat_set.h @@ -0,0 +1,17 @@ +// Copyright (c) 2025 GeometryFactory Sarl (France). +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_UNORDERED_FLAT_SET_H +#define CGAL_UNORDERED_FLAT_SET_H + +// lazy implementation: define the two template aliases in the same header file +#include + +#endif // CGAL_UNORDERED_FLAT_SET_H From 239a2adb1ad2289ab163f0d4f792f5f2818f5933 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 17:26:06 +0100 Subject: [PATCH 245/332] virtual -> override --- .../Constrained_Delaunay_triangulation_2.h | 20 +++++++++---------- .../CGAL/Constrained_triangulation_plus_2.h | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index bce4d832860..9066bc8dae0 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -179,7 +179,7 @@ public: CGAL_postcondition( is_valid() ); } - virtual ~Constrained_Delaunay_triangulation_2() {} + ~Constrained_Delaunay_triangulation_2() override {} // Ensure rule-of-five: define the copy- and move- constructors @@ -296,17 +296,17 @@ public: bool is_valid(bool verbose = false, int level = 0) const; protected: - virtual Vertex_handle virtual_insert(const Point & a, - Face_handle start = Face_handle()); - virtual Vertex_handle virtual_insert(const Point& a, - Locate_type lt, - Face_handle loc, - int li ); + Vertex_handle virtual_insert(const Point & a, + Face_handle start = Face_handle()) override; + Vertex_handle virtual_insert(const Point& a, + Locate_type lt, + Face_handle loc, + int li ) override; //Vertex_handle special_insert_in_edge(const Point & a, Face_handle f, int i); void remove_2D(Vertex_handle v ); - virtual void triangulate_hole(List_faces& intersected_faces, - List_edges& conflict_boundary_ab, - List_edges& conflict_boundary_ba); + void triangulate_hole(List_faces& intersected_faces, + List_edges& conflict_boundary_ab, + List_edges& conflict_boundary_ba) override; public: // MESHING diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 4c4a1e3929d..89c55e91484 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -204,7 +204,7 @@ public: Constrained_triangulation_plus_2(Constrained_triangulation_plus_2&&) = default; - virtual ~Constrained_triangulation_plus_2() {} + ~Constrained_triangulation_plus_2() override {} Constrained_triangulation_plus_2 & operator=(const Constrained_triangulation_plus_2& ctp) { @@ -693,9 +693,9 @@ public: return cid; } - virtual Vertex_handle intersect(Face_handle f, int i, - Vertex_handle vaa, - Vertex_handle vbb); + Vertex_handle intersect(Face_handle f, int i, + Vertex_handle vaa, + Vertex_handle vbb) override; Vertex_handle intersect(Face_handle f, int i, Vertex_handle vaa, Vertex_handle vbb, From 796190863c553f03aab0120fbb393369d1c9593e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 17:51:11 +0100 Subject: [PATCH 246/332] derive Ct_plus_2 from the hierarchy Instead of storing the hierarchy as a data member, store it as a hidden (protected) base class. That allows to forward member functions easily with using-declarations. That also avoids mismatches between the names in the triangulation and the hierarchy. --- .../CGAL/Mesh_complex_3_in_triangulation_3.h | 2 +- .../CGAL/Constrained_triangulation_plus_2.h | 596 +++++------------- .../Polyline_constraint_hierarchy_2.h | 3 +- 3 files changed, 174 insertions(+), 427 deletions(-) diff --git a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h index db0cc2fa28d..19fd269cc32 100644 --- a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h +++ b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h @@ -973,7 +973,7 @@ private: typedef typename Vertex_map_iterator_first::reference pointer; typedef typename iterator_adaptor_::reference reference; - Vertex_map_iterator_first_dereference() : Self::iterator_adaptor_() { } + Vertex_map_iterator_first_dereference() = default; template < typename Iterator > Vertex_map_iterator_first_dereference(Iterator i) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 89c55e91484..5562c90ec8a 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -22,34 +22,44 @@ #include #include #include -#include #include #include #include +#include #include +#include namespace CGAL { // Comparison functor that compares two Vertex_handle. // Used as 'Compare' functor for the constraint hierarchy. template < class Tr > -class Pct2_vertex_handle_less_xy { +class Ctp_2_compare_vertex_handles { const Tr* tr_p; public: - Pct2_vertex_handle_less_xy(const Tr* tr_p) : tr_p(tr_p) {} + Ctp_2_compare_vertex_handles(const Tr* tr_p) : tr_p(tr_p) {} - typedef typename Tr::Vertex_handle Vertex_handle; + using Vertex_handle = typename Tr::Vertex_handle; bool operator()(const Vertex_handle& va, const Vertex_handle& vb) const { return tr_p->compare_xy(va->point(), vb->point()) == SMALLER; } -}; // end class template Pct2_vertex_handle_less_xy +}; // end class template Ctp_2_compare_vertex_handles + +template +using Ctp_2_point_type = typename Tr::Geom_traits::Point_2; + +template +using Ctp_2_hierarchy_type = + Polyline_constraint_hierarchy_2, + Ctp_2_point_type>; // Tr the base triangulation class // Tr has to be Constrained or Constrained_Delaunay with Constrained_triangulation_plus_vertex_base @@ -57,42 +67,45 @@ public: template < class Tr_> class Constrained_triangulation_plus_2 : public Tr_ + , protected Ctp_2_hierarchy_type { - typedef Tr_ Tr; +public: + using Self = Constrained_triangulation_plus_2; + using Base = Tr_; + using Constraint_hierarchy = Ctp_2_hierarchy_type; +protected: + const auto& hierarchy() const { return static_cast(*this); } + auto& hierarchy() { return static_cast(*this); } + +private: + using Tr = Tr_; template class Face_container { - typedef typename CDT::Vertex_handle Vertex_handle; - typedef typename CDT::Face_handle Face_handle; - private: - typedef boost::tuple TFace; - std::vector faces; + using Vertex_handle = typename CDT::Vertex_handle; + using Face_handle = typename CDT::Face_handle; + + using Array = std::array; + std::vector faces; CDT& cdt; public: - typedef Face_handle value_type; - typedef Face_handle& reference; - typedef const Face_handle& const_reference; - + using value_type = Face_handle; Face_container(CDT& cdt_ ) : cdt(cdt_) {} - void push_back(Face_handle fh) - { - faces.push_back(boost::make_tuple(fh->vertex(0), - fh->vertex(1), - fh->vertex(2))); + void push_back(Face_handle fh) { + faces.push_back(Array{fh->vertex(0), fh->vertex(1), fh->vertex(2)}); } template void write_faces(OutputIterator out) { - for(typename std::vector::reverse_iterator - it = faces.rbegin(); it != faces.rend(); ++it) { + for(auto [v0, v1, v2] : make_range(faces.rbegin(), faces.rend())) { Face_handle fh; - if(cdt.is_face(boost::get<0>(*it), boost::get<1>(*it), boost::get<2>(*it), fh)){ + if(cdt.is_face(v0, v1, v2, fh)) { *out++ = fh; } } @@ -100,106 +113,92 @@ class Constrained_triangulation_plus_2 }; public: - typedef Tr Triangulation; - typedef typename Tr::Intersection_tag Intersection_tag; - typedef Constrained_triangulation_plus_2 Self; - typedef Tr Base; + // type aliases (aka type defs) + using Triangulation = Tr; + using Intersection_tag = typename Tr::Intersection_tag; - -#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 + // using-declaration of types or member functions from the two bases using Triangulation::vertices_begin; using Triangulation::vertices_end; using Triangulation::is_infinite; using Triangulation::number_of_vertices; -#endif + + using typename Triangulation::Edge; + using typename Triangulation::Vertex; + using typename Triangulation::Vertex_handle; + using typename Triangulation::Face_handle; + using typename Triangulation::Face_circulator; + using typename Triangulation::Vertex_iterator; + using typename Triangulation::Vertex_circulator; + using typename Triangulation::Locate_type; + using typename Triangulation::Line_face_circulator; + using typename Triangulation::Geom_traits; + using typename Triangulation::Constraint; + using typename Triangulation::size_type; + using typename Triangulation::List_edges; + using typename Triangulation::List_faces; + using typename Triangulation::List_vertices; + using typename Triangulation::List_constraints; + using typename Triangulation::Constrained_edges_iterator; + + using typename Constraint_hierarchy::Context; + using typename Constraint_hierarchy::Context_iterator; + using typename Constraint_hierarchy::Contexts; + using typename Constraint_hierarchy::Constraint_iterator; + using typename Constraint_hierarchy::Constraints; + using typename Constraint_hierarchy::Subconstraint_iterator; + using typename Constraint_hierarchy::Subconstraints; + using typename Constraint_hierarchy::Subconstraint_and_contexts_iterator; + using typename Constraint_hierarchy::Subconstraints_and_contexts; + using typename Constraint_hierarchy::Constraint_id; + using typename Constraint_hierarchy::Vertex_handle_compare; + #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS using Triangulation::display_vertex; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - typedef typename Triangulation::Edge Edge; - typedef typename Triangulation::Vertex Vertex; - typedef typename Triangulation::Vertex_handle Vertex_handle; - typedef typename Triangulation::Face_handle Face_handle; - typedef typename Triangulation::Face_circulator Face_circulator ; - typedef typename Triangulation::Vertex_iterator Vertex_iterator; - typedef typename Triangulation::Vertex_circulator Vertex_circulator; - typedef typename Triangulation::Locate_type Locate_type; - typedef typename Triangulation::Line_face_circulator Line_face_circulator; - typedef typename Triangulation::Geom_traits Geom_traits; - typedef typename Geom_traits::Point_2 Point; - typedef typename Geom_traits::Segment_2 Segment; - typedef typename Triangulation::Constraint Constraint; - typedef typename Triangulation::size_type size_type; + using Point = typename Geom_traits::Point_2; + using Segment = typename Geom_traits::Segment_2; - typedef typename Triangulation::List_edges List_edges; - typedef typename Triangulation::List_faces List_faces; - typedef typename Triangulation::List_vertices List_vertices; - typedef typename Triangulation::List_constraints List_constraints; - typedef typename Triangulation::Constrained_edges_iterator Constrained_edges_iterator; - - typedef Pct2_vertex_handle_less_xy Vh_less_xy; - typedef Polyline_constraint_hierarchy_2 - Constraint_hierarchy; -public: // Tag to mark the presence of a hierarchy of constraints - typedef Tag_true Constraint_hierarchy_tag; + using Constraint_hierarchy_tag = Tag_true; //Tag to distinguish Delaunay from regular triangulations - typedef Tag_false Weighted_tag; + using Weighted_tag = Tag_false; // Tag to distinguish periodic triangulations from others - typedef Tag_false Periodic_tag; + using Periodic_tag = Tag_false; // for user interface with the constraint hierarchy - typedef typename Constraint_hierarchy::Vertex_it - Vertices_in_constraint_iterator; + using Vertices_in_constraint_iterator = typename Constraint_hierarchy::Vertex_it; - typedef Iterator_range Vertices_in_constraint; + using Vertices_in_constraint = Iterator_range; - typedef typename Constraint_hierarchy::Point_it - Points_in_constraint_iterator; - typedef Iterator_range Points_in_constraint; + using Points_in_constraint_iterator = typename Constraint_hierarchy::Point_it; + using Points_in_constraint = Iterator_range; - typedef typename Constraint_hierarchy::Context Context; - typedef typename Constraint_hierarchy::Context_iterator Context_iterator; - typedef Iterator_range Contexts; - typedef typename Constraint_hierarchy::Constraint_iterator Constraint_iterator; - typedef typename Constraint_hierarchy::Constraints Constraints; - - typedef typename Constraint_hierarchy::Subconstraint_iterator Subconstraint_iterator; - typedef typename Constraint_hierarchy::Subconstraints Subconstraints; - - typedef typename Constraint_hierarchy::Subconstraint_and_contexts_iterator Subconstraint_and_contexts_iterator; - typedef typename Constraint_hierarchy::Subconstraints_and_contexts Subconstraints_and_contexts; - - typedef typename Constraint_hierarchy::Constraint_id Constraint_id; - - typedef std::pair Subconstraint; + using Subconstraint = std::pair; using Triangulation::geom_traits; using Triangulation::cw; using Triangulation::ccw; using Triangulation::incident_faces; -protected: - Constraint_hierarchy hierarchy; - public: Constraint_hierarchy& hierarchy_ref() { - return hierarchy; + return *this; } Constrained_triangulation_plus_2(const Geom_traits& gt=Geom_traits()) : Triangulation(gt) - , hierarchy(Vh_less_xy(this)) + , Constraint_hierarchy(Vertex_handle_compare(this)) { } Constrained_triangulation_plus_2(const Constrained_triangulation_plus_2& ctp) - : Triangulation() - , hierarchy(Vh_less_xy(this)) + : Constrained_triangulation_plus_2(ctp.geom_traits()) { copy_triangulation(ctp);} Constrained_triangulation_plus_2(Constrained_triangulation_plus_2&&) = default; @@ -218,8 +217,7 @@ public: Constrained_triangulation_plus_2(InputIterator first, InputIterator last, const Geom_traits& gt=Geom_traits() ) - : Triangulation(gt) - , hierarchy(Vh_less_xy(this)) + : Constrained_triangulation_plus_2(gt) { insert_constraints(first, last); CGAL_postcondition( this->is_valid() ); @@ -228,14 +226,13 @@ public: Constrained_triangulation_plus_2(const std::list > &constraints, const Geom_traits& gt=Geom_traits() ) - : Triangulation(gt) - , hierarchy(Vh_less_xy(this)) + : Constrained_triangulation_plus_2(gt) { insert_constraints(constraints.begin(), constraints.end()); CGAL_postcondition( this->is_valid() ); } //Helping - void clear() { Base::clear(); hierarchy.clear(); } + void clear() { Base::clear(); hierarchy().clear(); } void copy_triangulation(const Constrained_triangulation_plus_2 &ctp); void swap(Constrained_triangulation_plus_2 &ctp); @@ -274,7 +271,7 @@ public: return Constraint_id(nullptr); } // protects against inserting twice the same constraint - Constraint_id cid = hierarchy.insert_constraint_old_API(va, vb); + Constraint_id cid = hierarchy().insert_constraint_old_API(va, vb); if (va != vb && (cid != Constraint_id(nullptr)) ) insert_subconstraint(va,vb); return cid; @@ -389,14 +386,14 @@ public: { if(pos == vertices_in_constraint_begin(cid)){ // cid is [P, A, ..., B] -> split to aux=[P, A] and cid=[A...B] - Constraint_id aux = hierarchy.split2(cid, std::next(pos)); + Constraint_id aux = hierarchy().split2(cid, std::next(pos)); remove_constraint(aux, out); return vertices_in_constraint_begin(cid); } if(pos == std::prev(vertices_in_constraint_end(cid))){ // cid is [A, ..., B, P] -> split to cid=[A...B] and aux=[B,P] - Constraint_id aux = hierarchy.split(cid, std::prev(pos)); + Constraint_id aux = hierarchy().split(cid, std::prev(pos)); remove_constraint(aux, out); return vertices_in_constraint_end(cid); } @@ -411,7 +408,7 @@ public: // head = [A...B] and, // cid = [B, P, C...D] // split off head - head = hierarchy.split2(cid, std::prev(pos)); + head = hierarchy().split2(cid, std::prev(pos)); } if(pos != next_to_last_vertex_of_cid){ // cid is now [B, P, C, ..., D] @@ -419,7 +416,7 @@ public: // cid = [B, P, C] and, // tail = [C...D] // split off tail - tail = hierarchy.split(cid,std::next(pos)); + tail = hierarchy().split(cid,std::next(pos)); } // now: @@ -439,15 +436,15 @@ public: // `pos_before_c` is not necessarily == vertices_in_constraint_begin(aux) // there might have been intersecting constraints - hierarchy.swap(cid, aux); + hierarchy().swap(cid, aux); remove_constraint(aux, std::back_inserter(fc)); // removes [B, P, C] if(head != nullptr){ - hierarchy.concatenate2(head, cid); + hierarchy().concatenate2(head, cid); } if(tail != nullptr){ - hierarchy.concatenate(cid, tail); + hierarchy().concatenate(cid, tail); } fc.write_faces(out); @@ -467,7 +464,7 @@ public: if(pos == vertices_in_constraint_begin(cid)){ //std::cout << "insertion before first vertex" << std::endl; Constraint_id head = insert_constraint(vh, *pos, out); - hierarchy.concatenate2(head, cid); + hierarchy().concatenate2(head, cid); return vertices_in_constraint_begin(cid); } @@ -476,7 +473,7 @@ public: //std::cout << "insertion after last vertex" << std::endl; Constraint_id tail = insert_constraint(*std::prev(pos), vh, out); auto returned_pos = std::prev(vertices_in_constraint_end(tail)); - hierarchy.concatenate(cid, tail); + hierarchy().concatenate(cid, tail); return returned_pos; } Vertices_in_constraint_iterator pred = std::prev(pos); @@ -501,7 +498,7 @@ public: // in the middle: cid is just the segment [A, B] if((pos == second_vertex_of_cid) && (second_vertex_of_cid == last)){ //std::cout << "insertion in constraint which is a segment" << std::endl; - hierarchy.swap(cid, aux1); + hierarchy().swap(cid, aux1); remove_constraint(aux1, std::back_inserter(fc)); fc.write_faces(out); return returned_pos; @@ -528,9 +525,9 @@ public: if(head != nullptr){ //std::cout << "concatenate head" << std::endl; remove_constraint(cid, std::back_inserter(fc)); - hierarchy.concatenate(head, aux1); + hierarchy().concatenate(head, aux1); } else { - hierarchy.swap(cid, aux1); + hierarchy().swap(cid, aux1); remove_constraint(aux1, std::back_inserter(fc)); head = cid; } @@ -561,12 +558,12 @@ public: if(n == 1){ return nullptr; } - Constraint_id ca = hierarchy.insert_constraint(vertices[0],vertices[1]); + Constraint_id ca = hierarchy().insert_constraint(vertices[0],vertices[1]); insert_subconstraint(vertices[0],vertices[1], std::back_inserter(fc)); if(n>2){ for(int j=1; j= 2); - Constraint_id ca = hierarchy.insert_constraint(vertices[0],vertices[1]); + Constraint_id ca = hierarchy().insert_constraint(vertices[0],vertices[1]); insert_subconstraint(vertices[0],vertices[1]); if(n>2){ for(std::size_t j=1; j(*this); Unique_hash_map V(0, number_of_vertices()); int inum = 0; - for(Vertex_iterator vit = vertices_begin(); vit != vertices_end() ; ++vit){ - if(! is_infinite(vit)){ - V[vit] = inum++; - } + for(auto vh : this->finite_vertex_handles()) { + V[vh] = inum++; } - - for(const auto& cid : constraints()) { + for(auto cid : constraints()) { os << cid.size(); for(Vertex_handle vh : vertices_in_constraint(cid)) { os << " " << V[vh]; } os << std::endl; } + return os; } + friend std::ostream& operator<<(std::ostream& os, const Constrained_triangulation_plus_2& ctp) { + return ctp.file_output(os); + } - void file_input(std::istream& is) - { - + auto& file_input(std::istream& is) { is >> static_cast(*this); - std::vector V; - V.reserve(number_of_vertices()); - for(Vertex_iterator vit = vertices_begin(); vit != vertices_end() ; ++vit){ - if(! is_infinite(vit)){ - V.push_back(vit); - } - } - Constraint_id cid; - int n, i0, i1; - while(is >> n){ - is >> i0 >> i1; - cid = insert_constraint(V[i0],V[i1]); + std::vector vertices(number_of_vertices()); + auto [first, last] = this->finite_vertex_handles(); + std::copy(first, last, vertices.data()); - for(int i = 2; i < n; i++){ - i0 = i1; - is >> i1; - Constraint_id cid2 = insert_constraint(V[i0],V[i1]); + size_type n, id, id_next; + while(is >> n) { + is >> id >> id_next; + Constraint_id cid = insert_constraint(vertices[id], vertices[id_next]); + + for(size_type i = 2; i < n; ++i) { + id = id_next; + is >> id_next; + Constraint_id cid2 = insert_constraint(vertices[id], vertices[id_next]); cid = concatenate(cid, cid2); } } + return is; } + friend std::istream& operator>>(std::istream& is, Constrained_triangulation_plus_2& ctp) { + return ctp.file_input(is); + } template typename Constrained_triangulation_plus_2::Constraint_id @@ -684,7 +678,7 @@ public: return Constraint_id(); } // protects against inserting twice the same constraint - Constraint_id cid = hierarchy.insert_constraint(va, vb); + Constraint_id cid = hierarchy().insert_constraint(va, vb); if (va != vb && (cid != nullptr) ) insert_subconstraint(va,vb,out); for(auto vh : vertices_in_constraint(cid)) { @@ -718,10 +712,10 @@ public: template void remove_constraint(Constraint_id cid, OutputIterator out) { - std::vector vertices(hierarchy.vertices_in_constraint_begin(cid), - hierarchy.vertices_in_constraint_end(cid)); + std::vector vertices(hierarchy().vertices_in_constraint_begin(cid), + hierarchy().vertices_in_constraint_end(cid)); - hierarchy.remove_constraint(cid); + hierarchy().remove_constraint(cid); for(auto it = vertices.begin(), succ = it; ++succ != vertices.end(); ++it){ if(! is_subconstraint(*it, *succ)){ // this checks whether other constraints pass Face_handle fh; @@ -743,7 +737,7 @@ public: Vertices_in_constraint_iterator u = std::prev(v); Vertices_in_constraint_iterator w = std::next(v); bool unew = (*u != *w); - hierarchy.simplify(u,v,w); + hierarchy().simplify(u,v,w); Triangulation::remove_incident_constraints(*v); @@ -754,83 +748,49 @@ public: } } - std::size_t remove_points_without_corresponding_vertex(Constraint_id cid) - { - return hierarchy.remove_points_without_corresponding_vertex(cid); - } - std::size_t remove_points_without_corresponding_vertex() - { - return hierarchy.remove_points_without_corresponding_vertex(); - } - + using Constraint_hierarchy::remove_points_without_corresponding_vertex; // CONCATENATE AND SPLIT // concatenates two constraints - Constraint_id - concatenate(Constraint_id first, Constraint_id second); + using Constraint_hierarchy::concatenate; // split a constraint in two constraints, so that vcit becomes the first // vertex of the new constraint // returns the new constraint - Constraint_id - split(Constraint_id first, Vertices_in_constraint_iterator vcit); + using Constraint_hierarchy::split; // Query of the constraint hierarchy - Constraint_iterator constraints_begin() const; - Constraint_iterator constraints_end() const; - Constraints constraints() const; - Subconstraint_iterator subconstraints_begin() const; - Subconstraint_iterator subconstraints_end() const; - Subconstraints subconstraints() const; - - Subconstraint_and_contexts_iterator subconstraints_and_contexts_begin() const; - Subconstraint_and_contexts_iterator subconstraints_and_contexts_end() const; - Subconstraints_and_contexts subconstraints_and_contexts() const; - - Context context(Vertex_handle va, Vertex_handle vb); //AF: const; - - bool is_subconstraint(Vertex_handle va, - Vertex_handle vb); - size_type number_of_enclosing_constraints(Vertex_handle va, - Vertex_handle vb) const; - Context_iterator contexts_begin(Vertex_handle va, - Vertex_handle vb) const; - Context_iterator contexts_end(Vertex_handle va, - Vertex_handle vb) const; - - Contexts contexts(Vertex_handle va, Vertex_handle vb) const - { - return hierarchy.contexts(va, vb); - } - - Vertices_in_constraint_iterator vertices_in_constraint_begin(Constraint_id cid) const; - Vertices_in_constraint_iterator vertices_in_constraint_end(Constraint_id cid) const; - - Vertices_in_constraint vertices_in_constraint(Constraint_id cid) const - { - return Vertices_in_constraint(vertices_in_constraint_begin(cid), vertices_in_constraint_end(cid)); - } - - Points_in_constraint_iterator points_in_constraint_begin(Constraint_id cid) const; - Points_in_constraint_iterator points_in_constraint_end(Constraint_id cid) const ; + using Constraint_hierarchy::constraints_begin; + using Constraint_hierarchy::constraints_end; + using Constraint_hierarchy::constraints; + using Constraint_hierarchy::subconstraints_begin; + using Constraint_hierarchy::subconstraints_end; + using Constraint_hierarchy::subconstraints; + using Constraint_hierarchy::subconstraints_and_contexts_begin; + using Constraint_hierarchy::subconstraints_and_contexts_end; + using Constraint_hierarchy::subconstraints_and_contexts; + using Constraint_hierarchy::context; + using Constraint_hierarchy::number_of_enclosing_constraints; + using Constraint_hierarchy::is_subconstraint; + using Constraint_hierarchy::contexts_begin; + using Constraint_hierarchy::contexts_end; + using Constraint_hierarchy::contexts; + using Constraint_hierarchy::vertices_in_constraint_begin; + using Constraint_hierarchy::vertices_in_constraint_end; + using Constraint_hierarchy::vertices_in_constraint; + using Constraint_hierarchy::points_in_constraint_begin; + using Constraint_hierarchy::points_in_constraint_end; Points_in_constraint points_in_constraint(Constraint_id cid) const { return Points_in_constraint(points_in_constraint_begin(cid), points_in_constraint_end(cid)); } - size_type number_of_constraints() { - return static_cast (hierarchy.number_of_constraints());} - size_type number_of_subconstraints(){ - return static_cast (hierarchy.number_of_subconstraints());} - - // public member, used by Mesh_2::Refine_edges - void split_constraint(Vertex_handle v1, Vertex_handle v2, - Vertex_handle va) { - hierarchy.split_constraint(v1,v2,va); - } + using Constraint_hierarchy::number_of_constraints; + using Constraint_hierarchy::number_of_subconstraints; + using Constraint_hierarchy::split_constraint; protected: template @@ -879,7 +839,7 @@ insert_subconstraint(Vertex_handle vaa, stack.push(std::make_pair(vaa,vbb)); while(! stack.empty()){ - boost::tie(vaa,vbb) = stack.top(); + auto [vaa, vbb] = stack.top(); stack.pop(); CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS @@ -905,7 +865,7 @@ insert_subconstraint(Vertex_handle vaa, #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS this->mark_constraint(fr,i); if (vi != vbb) { - hierarchy.split_constraint(vaa,vbb,vi); + hierarchy().split_constraint(vaa,vbb,vi); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_plus_2::insert_constraint (includes_edge) stack push [vi, vbb] ( " << display_vertex(vi) @@ -929,7 +889,7 @@ insert_subconstraint(Vertex_handle vaa, if ( intersection) { if (vi != vaa && vi != vbb) { - hierarchy.split_constraint(vaa,vbb,vi); + hierarchy().split_constraint(vaa,vbb,vi); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_plus_2::insert_constraint stack push [vaa, vi] ( " << display_vertex(vaa) @@ -986,7 +946,7 @@ insert_subconstraint(Vertex_handle vaa, out); if (vi != vbb) { - hierarchy.split_constraint(vaa,vbb,vi); + hierarchy().split_constraint(vaa,vbb,vi); stack.push(std::make_pair(vi,vbb)); } } @@ -996,7 +956,7 @@ insert_subconstraint(Vertex_handle vaa, //to debug public: - void print_hierarchy(std::ostream& os = std::cout) { hierarchy.print(os); } + void print_hierarchy(std::ostream& os = std::cout) { hierarchy().print(os); } //template member functions public: @@ -1041,7 +1001,7 @@ copy_triangulation(const Constrained_triangulation_plus_2 &ctp) CGAL_assertion(vit->point() == vvit->point()); vmap[vit] = vvit; } - hierarchy.copy(ctp.hierarchy, vmap); + hierarchy().copy(ctp.hierarchy(), vmap); } template @@ -1050,7 +1010,7 @@ Constrained_triangulation_plus_2:: swap(Constrained_triangulation_plus_2 &ctp) { Base::swap(ctp); - hierarchy.swap(ctp.hierarchy); + hierarchy().swap(ctp.hierarchy()); } template < class Tr > @@ -1094,7 +1054,7 @@ insert(const Point& a, Locate_type lt, Face_handle loc, int li) << " , #" << v2->time_stamp() << "= " << v2->point() << std::endl; #endif - hierarchy.split_constraint(v1,v2,va); + hierarchy().split_constraint(v1,v2,va); } return va; } @@ -1148,8 +1108,8 @@ intersect(Face_handle f, int i, { const Vertex_handle vcc = f->vertex(cw(i)); const Vertex_handle vdd = f->vertex(ccw(i)); - const auto [vc, vd] = hierarchy.enclosing_constraint(vcc, vdd); - const auto [va, vb] = hierarchy.enclosing_constraint(vaa, vbb); + const auto [vc, vd] = hierarchy().enclosing_constraint(vcc, vdd); + const auto [va, vb] = hierarchy().enclosing_constraint(vaa, vbb); CGAL_assertion(vc != vd); CGAL_assertion(va != vb); @@ -1212,7 +1172,7 @@ intersect(Face_handle f, int i, // vi == vc or vi == vd may happen even if intersection==true // due to approximate construction of the intersection if (vi != vcc && vi != vdd) { - hierarchy.split_constraint(vcc,vdd,vi); + hierarchy().split_constraint(vcc,vdd,vi); insert_subconstraint(vcc,vi); insert_subconstraint(vi, vdd); } @@ -1222,220 +1182,6 @@ intersect(Face_handle f, int i, return vi; } - // CONCATENATE AND SPLIT - - // concatenates two constraints -template -typename Constrained_triangulation_plus_2::Constraint_id -Constrained_triangulation_plus_2::concatenate(Constraint_id first, Constraint_id second) -{ - return hierarchy.concatenate(first,second); -} - - // split a constraint in two constraints, so that vcit becomes the first - // vertex of the new constraint - // returns the new constraint -template -typename Constrained_triangulation_plus_2::Constraint_id -Constrained_triangulation_plus_2::split(Constraint_id first, Vertices_in_constraint_iterator vcit) -{ - return hierarchy.split(first, vcit); -} - - -template -std::ostream & -operator<<(std::ostream& os, - const Constrained_triangulation_plus_2 &ct) -{ - ct.file_output(os); - return os ; -} - -template -std::istream & -operator>>(std::istream& is, - Constrained_triangulation_plus_2 &ct) -{ - ct.file_input(is); - return is ; -} - -// Constraint Hierarchy Queries - -template -inline -typename -Constrained_triangulation_plus_2::Constraint_iterator -Constrained_triangulation_plus_2:: -constraints_begin() const -{ - return hierarchy.constraints_begin(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Constraint_iterator -Constrained_triangulation_plus_2:: -constraints_end() const -{ - return hierarchy.constraints_end(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Constraints -Constrained_triangulation_plus_2:: -constraints() const -{ - return hierarchy.constraints(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraint_iterator -Constrained_triangulation_plus_2:: -subconstraints_begin() const -{ - return hierarchy.subconstraints_begin(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraint_iterator -Constrained_triangulation_plus_2:: -subconstraints_end() const -{ - return hierarchy.subconstraints_end(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraints -Constrained_triangulation_plus_2:: -subconstraints() const -{ - return hierarchy.subconstraints(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraint_and_contexts_iterator -Constrained_triangulation_plus_2:: -subconstraints_and_contexts_begin() const -{ - return hierarchy.subconstraints_and_contexts_begin(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraint_and_contexts_iterator -Constrained_triangulation_plus_2:: -subconstraints_and_contexts_end() const -{ - return hierarchy.subconstraints_and_contexts_end(); -} - -template -inline -typename -Constrained_triangulation_plus_2::Subconstraints_and_contexts -Constrained_triangulation_plus_2:: -subconstraints_and_contexts() const -{ - return hierarchy.subconstraints_and_contexts(); -} - -template -inline -typename Constrained_triangulation_plus_2::Context -Constrained_triangulation_plus_2:: -context(Vertex_handle va, Vertex_handle vb) // AF: const -{ - return hierarchy.context(va,vb); -} - - -template -inline -typename Constrained_triangulation_plus_2::size_type -Constrained_triangulation_plus_2:: -number_of_enclosing_constraints(Vertex_handle va, Vertex_handle vb) const -{ - return static_cast - (hierarchy.number_of_enclosing_constraints(va,vb)); -} - -template -inline bool -Constrained_triangulation_plus_2:: -is_subconstraint(Vertex_handle va, Vertex_handle vb) -{ - return hierarchy.is_subconstraint(va,vb); -} - - -template -inline -typename Constrained_triangulation_plus_2::Context_iterator -Constrained_triangulation_plus_2:: -contexts_begin(Vertex_handle va, Vertex_handle vb) const -{ - return hierarchy.contexts_begin(va,vb); -} - -template -inline -typename Constrained_triangulation_plus_2::Context_iterator -Constrained_triangulation_plus_2:: -contexts_end(Vertex_handle va, Vertex_handle vb) const -{ - return hierarchy.contexts_end(va,vb); -} - -template -inline -typename Constrained_triangulation_plus_2::Vertices_in_constraint_iterator -Constrained_triangulation_plus_2:: -vertices_in_constraint_begin(Constraint_id cid) const -{ - return hierarchy.vertices_in_constraint_begin(cid); -} - -template -inline -typename Constrained_triangulation_plus_2::Vertices_in_constraint_iterator -Constrained_triangulation_plus_2:: -vertices_in_constraint_end(Constraint_id cid) const -{ - return hierarchy.vertices_in_constraint_end(cid); -} - -template -inline -typename Constrained_triangulation_plus_2::Points_in_constraint_iterator -Constrained_triangulation_plus_2:: -points_in_constraint_begin(Constraint_id cid) const -{ - return hierarchy.points_in_constraint_begin(cid); -} - -template -inline -typename Constrained_triangulation_plus_2::Points_in_constraint_iterator -Constrained_triangulation_plus_2:: -points_in_constraint_end(Constraint_id cid) const -{ - return hierarchy.points_in_constraint_end(cid); -} - } //namespace CGAL #include diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index b45852b0f52..ca13456fc1c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -492,7 +492,8 @@ public: size_type number_of_enclosing_constraints(T va, T vb) const; Context_iterator contexts_begin(T va, T vb) const; Context_iterator contexts_end(T va, T vb) const; - Iterator_range contexts(T va, T vb) const; + using Contexts = Iterator_range; + Contexts contexts(T va, T vb) const; Context_list* get_context_list(T va, T vb) const; size_type number_of_constraints() const { return constraints_set.size();} From 0d84f271d61600f41607a788a0bffb898c183266 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 18:14:05 +0100 Subject: [PATCH 247/332] whitespace and comments --- .../Polyline_constraint_hierarchy_2.h | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index ca13456fc1c..6ed00e70240 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -496,9 +496,8 @@ public: Contexts contexts(T va, T vb) const; Context_list* get_context_list(T va, T vb) const; - size_type number_of_constraints() const { return constraints_set.size();} - size_type number_of_subconstraints()const {return sc_to_c_map.size();} - + size_type number_of_constraints() const { return constraints_set.size(); } + size_type number_of_subconstraints() const { return sc_to_c_map.size(); } // insert/remove void add_Steiner(const T va, const T vb, const T vx); @@ -510,9 +509,7 @@ public: void split_constraint(T va, T vb, T vc); - void simplify(Vertex_it u, - Vertex_it v, - Vertex_it w); + void simplify(Vertex_it u, Vertex_it v, Vertex_it w); size_type remove_points_without_corresponding_vertex(Constraint_id); size_type remove_points_without_corresponding_vertex(); @@ -564,21 +561,17 @@ public: void swap(Polyline_constraint_hierarchy_2& ch); private: - auto find_contexts(Vertex_handle va, Vertex_handle vb) { - return sc_to_c_map.find(sorted_pair(va, vb)); - } - auto find_contexts(Vertex_handle va, Vertex_handle vb) const { - return sc_to_c_map.find(sorted_pair(va, vb)); - } - auto contexts_not_found() { return sc_to_c_map.end(); } + // a few member functions to encapsulate more of the uses of `sc_to_c_map` + auto find_contexts(Vertex_handle va, Vertex_handle vb) { return sc_to_c_map.find(sorted_pair(va, vb)); } + auto find_contexts(Vertex_handle va, Vertex_handle vb) const { return sc_to_c_map.find(sorted_pair(va, vb)); } + auto contexts_not_found() { return sc_to_c_map.end(); } auto contexts_not_found() const { return sc_to_c_map.end(); } - void erase_context(Sc_iterator it) { - sc_to_c_map.erase(it); - } + void erase_context(Sc_iterator it) { sc_to_c_map.erase(it); } + auto& contexts_of(Vertex_handle va, Vertex_handle vb) { return sc_to_c_map[sorted_pair(va, vb)]; } - auto& contexts_of(Vertex_handle va, Vertex_handle vb) { - return sc_to_c_map[sorted_pair(va, vb)]; - } + // + // functions to traverse and act on the context lists + // template void for_context_lists_of_all_subconstraints(Constraint_id cid, const F& f) { @@ -590,10 +583,10 @@ private: f(hcl, it, scit); } } - + // static void replace_first_in_context_list(Context_list* hcl, Constraint_id old_id, Constraint_id new_id) { - // std::find_if is a sort of std::for_each with a break + // std::find_if is a sort of std::for_each with a break when the lambda returns true [[maybe_unused]] auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { if(ctxt.enclosing == old_id) { ctxt.enclosing = new_id; @@ -602,7 +595,7 @@ private: return false; }); } - + // static void update_first_context_position(Context_list* hcl, Constraint_id id, Vertex_it new_pos) { [[maybe_unused]] auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { @@ -613,7 +606,7 @@ private: return false; }); } - + // static void remove_first_in_context_list(Context_list* hcl, Constraint_id id) { auto it = std::find_if(hcl->begin(), hcl->end(), [&](Context& ctxt) { @@ -624,6 +617,9 @@ private: } } + // + // other utilities as private member functions + // Constraint_id new_constraint_id() const { // TODO: handle ids auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; @@ -636,9 +632,9 @@ private: const auto& [va, vb] = sc; return sorted_pair(va, vb); } - //to_debug public: - void print(std::ostream& os = std::cout) const; + //to_debug + void print(std::ostream& os = std::cout) const; }; template From 310f4bdf4e79ac49059ea74a678497c4171fc5c8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 23 Jan 2025 18:20:21 +0100 Subject: [PATCH 248/332] glue constraints_set.insert(..) and new_constraint_id() .. to prepare a refactoring --- .../internal/Polyline_constraint_hierarchy_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 6ed00e70240..fbf3cc83ee1 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -681,13 +681,13 @@ copy(const Polyline_constraint_hierarchy_2& other, std::mappush_back(Node(vmap[node.vertex()], node.input())); } cid2.vl_with_info_ptr->may_share_subconstraint_with_others = cid1.vl_with_info_ptr->may_share_subconstraint_with_others; - constraints_set.insert(cid2); } // copy sc_to_c_map for(const auto& [sc1, hcl1] : other.subconstraints_and_contexts()) { @@ -1096,6 +1096,7 @@ insert_constraint(T va, T vb){ << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 Constraint_id cid = new_constraint_id(); + constraints_set.insert(cid); auto& context_list_ptr = contexts_of(va, vb); if(context_list_ptr == nullptr){ context_list_ptr = new Context_list; @@ -1104,7 +1105,6 @@ insert_constraint(T va, T vb){ auto children = cid.vl_ptr(); children->push_front(Node(va, true)); children->push_back(Node(vb, true)); - constraints_set.insert(cid); context_list_ptr->emplace_front(cid, cid.begin()); fix_contexts(*context_list_ptr); From 49b0f52f00e7ed8cd3f1a1e7223741a8f06663ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 24 Jan 2025 08:10:05 +0100 Subject: [PATCH 249/332] remove no longer valid comment --- SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp index 337807b0e6e..1270c1d0db8 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp @@ -350,7 +350,6 @@ struct Tester Vertex_handle vertex_to_modify_copy = vertex_to_modify; c3t3.remove_from_complex(vertex_to_modify); - // now `vertex_to_modify` is a dangling ref to a `Vertex_handle` // use a copy of it: `vertex_to_modify_copy` c3t3.add_to_complex(vertex_to_modify_copy,corner_index_bis); From e4c7edc436f34a917788f715f8305ab2bfd7123d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 24 Jan 2025 10:00:20 +0100 Subject: [PATCH 250/332] undo init (will be done globally in another PR) --- .../test/STL_Extension/test_Concurrent_compact_container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index 379cfcfb3b2..a42676f8f7f 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -45,7 +45,7 @@ struct Node_1 void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_ = 0; + std::size_t time_stamp_; }; class Node_2 From eb0da467edb08eecda50f9aa03a6459ce5b84b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 24 Jan 2025 11:08:34 +0100 Subject: [PATCH 251/332] always init time_stamp to -1 --- .../internal/Alpha_wrap_triangulation_cell_base_3.h | 4 ++-- Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h | 2 +- Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h | 2 +- Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h | 2 +- Mesh_3/include/CGAL/Mesh_cell_base_3.h | 2 +- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 10 +++++----- Mesh_3/include/CGAL/Mesh_vertex_base_3.h | 2 +- .../include/CGAL/Compact_simplicial_mesh_cell_base_3.h | 6 ++---- SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h | 6 ++---- SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h | 3 +-- .../test/STL_Extension/test_Compact_container.cpp | 4 ++-- .../test_Concurrent_compact_container.cpp | 2 +- 12 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h index efaeb82d330..cd0c29a99e5 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h @@ -97,7 +97,7 @@ template class Cell_base_with_timestamp : public Cb { - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: using Has_timestamp = CGAL::Tag_true; @@ -112,7 +112,7 @@ public: public: template Cell_base_with_timestamp(const Args&... args) - : Cb(args...), time_stamp_(-1) + : Cb(args...) { } Cell_base_with_timestamp(const Cell_base_with_timestamp& other) diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h index a3e54124402..46eec90e7e8 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h @@ -78,7 +78,7 @@ public: void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); }; } // namespace CGAL diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h index 3093f3b49a9..159a5e77c88 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h @@ -67,7 +67,7 @@ public: void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); #endif // CGAL_MESH_2_DEBUG_REFINEMENT_POINTS }; diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index 82380d7865b..ecd0236808a 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -644,7 +644,7 @@ private: #ifdef CGAL_INTRUSIVE_LIST Cell_handle next_intrusive_ = {}, previous_intrusive_ = {}; #endif - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); std::array surface_center_index_table_ = {}; /// Stores visited facets (4 first bits) diff --git a/Mesh_3/include/CGAL/Mesh_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_cell_base_3.h index d2f09a0606a..b4552fb048a 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_base_3.h @@ -273,7 +273,7 @@ private: #ifdef CGAL_INTRUSIVE_LIST Cell_handle next_intrusive_, previous_intrusive_; #endif - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); }; // end class Mesh_cell_base_3 diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index 454c0c94aff..e6e96d03f03 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -41,7 +41,7 @@ private: typedef CGAL::HalfedgeDS_vertex_base Pdv_base; Set_of_indices indices; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: int nb_of_feature_edges; @@ -85,8 +85,8 @@ public: return indices; } - Mesh_polyhedron_vertex() : Pdv_base(), time_stamp_(-1), nb_of_feature_edges(0) {} - Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p), time_stamp_(-1), nb_of_feature_edges(0) {} + Mesh_polyhedron_vertex() : Pdv_base(), nb_of_feature_edges(0) {} + Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p), nb_of_feature_edges(0) {} }; template @@ -95,7 +95,7 @@ public CGAL::HalfedgeDS_halfedge_base { private: bool feature_edge; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: @@ -143,7 +143,7 @@ public CGAL::HalfedgeDS_face_base { private: Patch_id_ patch_id_; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: diff --git a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h index 46b09094e95..e824f0ba694 100644 --- a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h @@ -250,7 +250,7 @@ private: Vertex_handle next_intrusive_; Vertex_handle previous_intrusive_; #endif - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: friend std::istream& operator>>(std::istream &is, Mesh_vertex_3& v) diff --git a/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h index 92272897094..49ac4fcae23 100644 --- a/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h @@ -47,9 +47,7 @@ public: public: // Constructors - Compact_simplicial_mesh_cell_3() - : time_stamp_(std::size_t(-1)) - {} + Compact_simplicial_mesh_cell_3() {} Compact_simplicial_mesh_cell_3(const Compact_simplicial_mesh_cell_3& rhs) : N(rhs.N) @@ -279,7 +277,7 @@ private: std::array N; std::array V; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); // The index of the cell of the input complex that contains me Subdomain_index subdomain_index_ = {}; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index 8ed8d332f59..7affb29b535 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -96,9 +96,7 @@ public: }; public: - Simplicial_mesh_cell_base_3() - : time_stamp_(std::size_t(-1)) - {} + Simplicial_mesh_cell_base_3() {} Simplicial_mesh_cell_base_3(const Simplicial_mesh_cell_base_3& rhs) : Cb(static_cast(rhs)), @@ -191,7 +189,7 @@ private: /// Stores surface_index for each facet of the cell std::array surface_index_table_ = {}; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); // The index of the cell of the input complex that contains me Subdomain_index subdomain_index_ = {}; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h index 96a2377355c..6d86764fdca 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h @@ -130,7 +130,6 @@ public: , index_() , dimension_(-1) , cache_validity(false) - , time_stamp_(std::size_t(-1)) {} // Default copy constructor and assignment operator are ok @@ -218,7 +217,7 @@ private: // that contains me. Negative values are a marker for special vertices. short dimension_; bool cache_validity; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); public: friend std::istream& operator>>(std::istream& is, diff --git a/STL_Extension/test/STL_Extension/test_Compact_container.cpp b/STL_Extension/test/STL_Extension/test_Compact_container.cpp index bf6b0d83948..c0235b6f018 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container.cpp @@ -18,7 +18,7 @@ template struct Node_1 : public CGAL::Compact_container_base { - Node_1() {} // // it is important `time_stamp_` is not initialized + Node_1() {} bool operator==(const Node_1 &) const { return true; } bool operator!=(const Node_1 &) const { return false; } bool operator< (const Node_1 &) const { return false; } @@ -49,7 +49,7 @@ struct Node_1 } ///@} int m_erase_counter; - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); }; class Node_2 diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index a42676f8f7f..b4531b35c5c 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -45,7 +45,7 @@ struct Node_1 void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-1); }; class Node_2 From 107f3696dcaa36c661bd62141771b9bd199a1b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 24 Jan 2025 14:20:00 +0100 Subject: [PATCH 252/332] boost::tie -> std::tie --- BGL/examples/BGL_LCC/distance_lcc.cpp | 4 +- .../BGL_LCC/incident_vertices_lcc.cpp | 2 +- BGL/examples/BGL_LCC/kruskal_lcc.cpp | 2 +- BGL/examples/BGL_LCC/normals_lcc.cpp | 2 +- BGL/examples/BGL_LCC/range_lcc.cpp | 4 +- .../BGL_LCC/transform_iterator_lcc.cpp | 2 +- BGL/examples/BGL_polyhedron_3/distance.cpp | 8 ++-- .../BGL_polyhedron_3/incident_vertices.cpp | 2 +- BGL/examples/BGL_polyhedron_3/kruskal.cpp | 6 +-- .../kruskal_with_stored_id.cpp | 6 +-- BGL/examples/BGL_polyhedron_3/normals.cpp | 2 +- BGL/examples/BGL_polyhedron_3/range.cpp | 4 +- .../BGL_polyhedron_3/transform_iterator.cpp | 2 +- .../surface_mesh_partition.cpp | 2 +- BGL/include/CGAL/boost/graph/Dual.h | 4 +- .../CGAL/boost/graph/Euler_operations.h | 14 +++--- .../CGAL/boost/graph/Face_filtered_graph.h | 8 ++-- .../graph/Graph_with_descriptor_with_graph.h | 16 +++---- .../boost/graph/METIS/partition_dual_graph.h | 2 +- .../CGAL/boost/graph/METIS/partition_graph.h | 6 +-- .../boost/graph/alpha_expansion_graphcut.h | 8 ++-- BGL/include/CGAL/boost/graph/helpers.h | 2 +- .../boost/graph/split_graph_into_polylines.h | 4 +- BGL/test/BGL/test_Euler_operations.cpp | 32 ++++++------- BGL/test/BGL/test_Face_filtered_graph.cpp | 38 +++++++-------- BGL/test/BGL/test_Prefix.h | 24 +++++----- BGL/test/BGL/test_bgl_dual.cpp | 4 +- BGL/test/BGL/test_circulator.cpp | 6 +-- BGL/test/BGL/test_graph_traits.cpp | 48 +++++++++---------- .../draw_surface_mesh_small_faces.cpp | 2 +- .../demo/CGAL_ipelets/alpha_shapes.cpp | 2 +- .../demo/CGAL_ipelets/cone_spanners.cpp | 4 +- CGAL_ipelets/demo/CGAL_ipelets/generator.cpp | 4 +- CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp | 2 +- CGAL_ipelets/demo/CGAL_ipelets/mst.cpp | 4 +- .../demo/CGAL_ipelets/multi_delaunay.cpp | 2 +- .../demo/CGAL_ipelets/multi_regular.cpp | 2 +- .../CGAL_ipelets/nearest_neighbor_graph.cpp | 2 +- CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp | 2 +- .../Feature/Vertical_dispersion.h | 2 +- .../Classification/Point_set_neighborhood.h | 2 +- .../test_classification_point_set.cpp | 4 +- .../Cone_spanners_2/dijkstra_theta.cpp | 2 +- .../include/CGAL/Construct_theta_graph_2.h | 4 +- .../include/CGAL/Construct_yao_graph_2.h | 4 +- .../include/CGAL/gnuplot_output_2.h | 4 +- Convex_hull_3/include/CGAL/convex_hull_3.h | 2 +- .../include/CGAL/convexity_check_3.h | 4 +- .../boost/graph/properties_HalfedgeDS_base.h | 2 +- Hash_map/benchmark/Hash_map/hm.cpp | 4 +- .../Surface_mesh_geodesic_distances_3.h | 6 +-- .../Intrinsic_Delaunay_triangulation_3.h | 2 +- .../modules/config/support/test_BOOST.cpp | 2 +- .../Classification/Cluster_classification.cpp | 4 +- .../Point_set_item_classification.cpp | 4 +- Lab/demo/Lab/Plugins/Mesh_2/Mesh_2_plugin.cpp | 2 +- .../Lab/Plugins/PMP/Engrave_text_plugin.cpp | 2 +- ..._corrected_principal_curvatures_plugin.cpp | 2 +- .../Mean_curvature_flow_skeleton_plugin.cpp | 2 +- .../Lab/Plugins/PMP/Orient_soup_plugin.cpp | 4 +- Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp | 4 +- .../Point_set_shape_detection_plugin.cpp | 4 +- .../Point_set_to_mesh_distance_plugin.cpp | 8 ++-- .../Scene_polyhedron_shortest_path_item.cpp | 2 +- .../Scene_edit_polyhedron_item.cpp | 4 +- .../Lab/Scene_polyhedron_selection_item.h | 2 +- Lab/demo/Lab/include/Point_set_3.h | 14 +++--- .../Mesh_3/internal/Graph_manipulations.h | 4 +- Mesh_3/include/CGAL/Mesh_3/internal/helpers.h | 2 +- .../CGAL/Mesh_3/polylines_to_protect.h | 2 +- .../Protect_edges_sizing_field.h | 20 ++++---- .../include/CGAL/Periodic_3_triangulation_3.h | 2 +- .../Point_set_3/point_set_property.cpp | 4 +- Point_set_3/include/CGAL/Point_set_3/IO/LAS.h | 36 +++++++------- Point_set_3/include/CGAL/Point_set_3/IO/PLY.h | 2 +- .../test/Point_set_3/point_set_test.cpp | 2 +- .../test/Point_set_3/point_set_test_join.cpp | 2 +- .../include/CGAL/mst_orient_normals.h | 4 +- .../internal/Poisson_sphere_oracle_3.h | 8 ++-- .../Poisson_implicit_surface_oracle_3.h | 6 +-- .../interpolated_corrected_curvatures_SM.cpp | 6 +-- .../Corefinement/Face_graph_output_builder.h | 2 +- .../internal/Snapping/helper.h | 2 +- .../CGAL/Polygon_mesh_processing/locate.h | 2 +- .../test_pmp_locate.cpp | 2 +- .../test_shape_predicates.cpp | 2 +- .../examples/Ridges_3/PolyhedralSurf_rings.h | 2 +- .../include/CGAL/PolyhedralSurf_neighbors.h | 2 +- Ridges_3/include/CGAL/Ridges.h | 6 +-- Ridges_3/include/CGAL/Umbilics.h | 2 +- Ridges_3/test/Ridges_3/PolyhedralSurf_rings.h | 2 +- .../doc/STL_Extension/CGAL/Iterator_range.h | 2 +- .../scale_space_sm.cpp | 2 +- .../examples/Surface_mesh/sm_circulators.cpp | 2 +- .../examples/Surface_mesh/sm_iterators.cpp | 4 +- .../examples/Surface_mesh/sm_join.cpp | 4 +- .../examples/Surface_mesh/sm_kruskal.cpp | 2 +- .../examples/Surface_mesh/sm_properties.cpp | 4 +- .../include/CGAL/Surface_mesh/Surface_mesh.h | 2 +- .../test/Surface_mesh/sm_circulator_test.cpp | 2 +- .../test/Surface_mesh/surface_mesh_test.cpp | 16 +++---- .../deform_mesh_for_botsch08_format.cpp | 2 +- .../all_roi_assign_example.cpp | 2 +- .../all_roi_assign_example_Surface_mesh.cpp | 2 +- ...l_roi_assign_example_custom_polyhedron.cpp | 6 +-- .../all_roi_assign_example_with_OpenMesh.cpp | 2 +- ...form_mesh_for_botsch08_format_sre_arap.cpp | 2 +- ...ring_roi_translate_rotate_Surface_mesh.cpp | 2 +- .../k_ring_roi_translate_rotate_example.cpp | 2 +- .../Surface_mesh_deformation_test_commons.h | 6 +-- .../Orbifold_Tutte_parameterizer_3.h | 4 +- .../Square_border_parameterizer_3.h | 4 +- .../internal/Containers_filler.h | 2 +- .../internal/Filters.h | 8 ++-- .../internal/SDF_calculation.h | 4 +- .../internal/Surface_mesh_segmentation.h | 20 ++++---- .../benchmark_shortest_paths.cpp | 2 +- .../shortest_paths.cpp | 2 +- .../shortest_paths_OpenMesh.cpp | 2 +- .../shortest_paths_multiple_sources.cpp | 4 +- .../shortest_paths_no_id.cpp | 2 +- .../shortest_paths_with_id.cpp | 2 +- .../Surface_mesh_shortest_path_test_1.cpp | 10 ++-- .../Surface_mesh_shortest_path_test_2.cpp | 4 +- .../Surface_mesh_shortest_path_test_3.cpp | 2 +- .../Surface_mesh_shortest_path_test_4.cpp | 4 +- .../Surface_mesh_shortest_path_test_5.cpp | 2 +- ...Surface_mesh_shortest_path_traits_test.cpp | 10 ++-- .../Surface_mesh_shortest_path/TestMesh.cpp | 4 +- .../internal/Edge_collapse.h | 4 +- .../test_edge_collapse_Polyhedron_3.cpp | 2 +- .../Mean_curvature_flow_skeletonization.h | 2 +- .../internal/Curve_skeleton.h | 4 +- .../CGAL/Surface_mesher/Sphere_oracle_3.h | 8 ++-- .../CGAL/Constrained_triangulation_2.h | 4 +- .../CGAL/Constrained_triangulation_plus_2.h | 2 +- 136 files changed, 350 insertions(+), 350 deletions(-) diff --git a/BGL/examples/BGL_LCC/distance_lcc.cpp b/BGL/examples/BGL_LCC/distance_lcc.cpp index b19f0ab2b38..7baf0883ff4 100644 --- a/BGL/examples/BGL_LCC/distance_lcc.cpp +++ b/BGL/examples/BGL_LCC/distance_lcc.cpp @@ -28,7 +28,7 @@ int main(int argc, char** argv) // Here we start at an arbitrary vertex // Any other vertex could be the starting point vertex_iterator vb, ve; - boost::tie(vb,ve)=vertices(lcc); + std::tie(vb,ve)=vertices(lcc); vertex_descriptor vd = *vb; std::cout << "We compute distances to " << vd->point() << std::endl; @@ -45,7 +45,7 @@ int main(int argc, char** argv) boost::on_tree_edge())))); // Traverse all vertices and show at what distance they are - for(boost::tie(vb,ve)=vertices(lcc); vb!=ve; ++vb) + for(std::tie(vb,ve)=vertices(lcc); vb!=ve; ++vb) { vd = *vb; std::cout<point()<<" is "<id()]<<" hops away."<point() << "\n"; } diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index b729b0b4792..b91f302563b 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -31,7 +31,7 @@ void calculate_face_normals(const HalfedgeGraph& g, typedef typename boost::property_traits::value_type normal; face_iterator fb, fe; - for(boost::tie(fb, fe) = faces(g); fb != fe; ++fb) + for(std::tie(fb, fe) = faces(g); fb != fe; ++fb) { halfedge_descriptor edg = halfedge(*fb, g); halfedge_descriptor edgb = edg; diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index cdf89714c30..e6aca96a397 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -42,10 +42,10 @@ void fct(const LCC& lcc) std::cout << vd->point() << std::endl; } - std::cout << "boost::tie + std::for_each" << std::endl; + std::cout << "std::tie + std::for_each" << std::endl; vertex_iterator vb, ve; - boost::tie(vb,ve) = vertices_range(lcc); + std::tie(vb,ve) = vertices_range(lcc); std::for_each(vb,ve, Fct()); } diff --git a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp index 988c0230bae..06153ecf2ce 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -49,7 +49,7 @@ int main(int argc, char** argv) typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; - boost::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc); + std::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(lcc)); avie = boost::make_transform_iterator(he, Source(lcc)); diff --git a/BGL/examples/BGL_polyhedron_3/distance.cpp b/BGL/examples/BGL_polyhedron_3/distance.cpp index 4a289af9760..9547d9b6606 100644 --- a/BGL/examples/BGL_polyhedron_3/distance.cpp +++ b/BGL/examples/BGL_polyhedron_3/distance.cpp @@ -24,9 +24,9 @@ int main(int argc, char** argv) { vertex_iterator vb, ve; int index = 0; - // boost::tie assigns the first and second element of the std::pair + // std::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vit and ve - for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ + for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ vertex_descriptor vd = *vb; vd->id() = index++; } @@ -37,7 +37,7 @@ int main(int argc, char** argv) { // Here we start at an arbitrary vertex // Any other vertex could be the starting point - boost::tie(vb,ve)=vertices(P); + std::tie(vb,ve)=vertices(P); vertex_descriptor vd = *vb; std::cout << "We compute distances to " << vd->point() << std::endl; @@ -54,7 +54,7 @@ int main(int argc, char** argv) { // Traverse all vertices and show at what distance they are - for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ + for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ vd = *vb; std::cout << vd->point() << " is " << distance[vd->id()] << " hops away" << std::endl; } diff --git a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp index b951c472d14..464bd9ecbb5 100644 --- a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp +++ b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp @@ -36,7 +36,7 @@ adjacent_vertices_V2(const Polyhedron& g, { halfedge_around_target_iterator hi, he; - for(boost::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi) + for(std::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi) { *out++ = source(*hi,g); } diff --git a/BGL/examples/BGL_polyhedron_3/kruskal.cpp b/BGL/examples/BGL_polyhedron_3/kruskal.cpp index 64371997377..36b3c625605 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal.cpp @@ -33,9 +33,9 @@ kruskal(const Polyhedron& P) vertex_iterator vb, ve; int index = 0; - // boost::tie assigns the first and second element of the std::pair + // std::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vb and ve - for(boost::tie(vb, ve)=vertices(P); vb!=ve; ++vb){ + for(std::tie(vb, ve)=vertices(P); vb!=ve; ++vb){ vertex_index_pmap[*vb]= index++; } @@ -59,7 +59,7 @@ kruskal(const Polyhedron& P) " coord Coordinate {\n" " point [ \n"; - for(boost::tie(vb, ve) = vertices(P); vb!=ve; ++vb){ + for(std::tie(vb, ve) = vertices(P); vb!=ve; ++vb){ std::cout << " " << (*vb)->point() << "\n"; } diff --git a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp index a1280a1b479..1b8d467255c 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp @@ -41,7 +41,7 @@ kruskal( const Polyhedron& P) "point [ \n"; vertex_iterator vb, ve; - for(boost::tie(vb,ve) = vertices(P); vb!=ve; ++vb){ + for(std::tie(vb,ve) = vertices(P); vb!=ve; ++vb){ std::cout << (*vb)->point() << "\n"; } @@ -75,9 +75,9 @@ int main() { vertex_iterator vb, ve; int index = 0; - // boost::tie assigns the first and second element of the std::pair + // std::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vit and ve - for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ + for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){ vertex_descriptor vd = *vb; vd->id() = index++; } diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index 711800cb8ab..d6ed605de84 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -26,7 +26,7 @@ void calculate_face_normals(const HalfedgeGraph& g, typedef typename boost::property_traits::value_type normal; face_iterator fb, fe; - for(boost::tie(fb, fe) = faces(g); fb != fe; ++fb) + for(std::tie(fb, fe) = faces(g); fb != fe; ++fb) { halfedge_descriptor edg = halfedge(*fb, g); halfedge_descriptor edgb = edg; diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index bf54640120f..fcf325cba3b 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -40,10 +40,10 @@ void fct(const Polyhedron& p) std::cout << vd->point() << std::endl; } - std::cout << "boost::tie + std::for_each" << std::endl; + std::cout << "std::tie + std::for_each" << std::endl; vertex_iterator vb, ve; - boost::tie(vb,ve) = vertices_range(p); + std::tie(vb,ve) = vertices_range(p); std::for_each(vb,ve, Fct()); } diff --git a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp index 5642ab08d6a..3ff09778fe1 100644 --- a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp +++ b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp @@ -47,7 +47,7 @@ int main(int argc, char** argv) typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; - boost::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P); + std::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(P)); avie = boost::make_transform_iterator(he, Source(P)); diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp index 1f57a67524f..58704355d62 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp @@ -51,7 +51,7 @@ int main(int argc, char** argv) std::ofstream outxyz("out.xyz"); outxyz.precision(17); boost::graph_traits::vertex_iterator vit, ve; - boost::tie(vit, ve) = vertices(sm); + std::tie(vit, ve) = vertices(sm); for(; vit!=ve; ++vit) { if(get(vertex_pid_map, *vit) == 0) diff --git a/BGL/include/CGAL/boost/graph/Dual.h b/BGL/include/CGAL/boost/graph/Dual.h index 4ca45b9bcec..59156f7232d 100644 --- a/BGL/include/CGAL/boost/graph/Dual.h +++ b/BGL/include/CGAL/boost/graph/Dual.h @@ -306,7 +306,7 @@ edge(typename boost::graph_traits >::vertex_descriptor u, const Dual

      & dual) { typename boost::graph_traits >::out_edge_iterator e, e_end; - for(boost::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) { + for(std::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) { if(target(*e, dual) == v) return std::make_pair(*e, true); } @@ -391,7 +391,7 @@ halfedge(typename boost::graph_traits >::vertex_descriptor u, const Dual

      & dual) { typename boost::graph_traits >::out_edge_iterator e, e_end; - for(boost::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) { + for(std::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) { if(target(*e, dual) == v) return std::make_pair(halfedge(*e, dual), true); } diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index f8c79165bc5..bf9fd807255 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -136,7 +136,7 @@ join_vertex(typename boost::graph_traits::halfedge_descriptor h, CGAL_assertion( halfedge(v_to_remove, v, g).first == h ); halfedge_around_vertex_iterator ieb, iee; - for(boost::tie(ieb, iee) = halfedges_around_target(hop, g); ieb != iee; ++ieb) { + for(std::tie(ieb, iee) = halfedges_around_target(hop, g); ieb != iee; ++ieb) { CGAL_assertion( target(*ieb,g) == v_to_remove); set_target(*ieb ,v , g); } @@ -615,7 +615,7 @@ bool can_add_face(const VertexRange& vrange, const PMesh& sm) for(std::size_t i=0; i < N; ++i){ halfedge_descriptor hd; bool found; - boost::tie(hd,found) = halfedge(face[i],face[i+1],sm); + std::tie(hd,found) = halfedge(face[i],face[i+1],sm); if(found && (! is_border(hd,sm))){ return false; } @@ -1149,7 +1149,7 @@ void make_hole(typename boost::graph_traits::halfedge_descriptor h, face_descriptor fd = face(h, g); halfedge_around_face_iterator hafib, hafie; - for(boost::tie(hafib, hafie) = halfedges_around_face(h, g); + for(std::tie(hafib, hafie) = halfedges_around_face(h, g); hafib != hafie; ++hafib){ CGAL_assertion(! is_border(opposite(*hafib,g),g)); @@ -1361,7 +1361,7 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc internal::set_border(he2,g); CGAL::Halfedge_around_face_iterator hafib,hafie; - for(boost::tie(hafib, hafie) = halfedges_around_face(ohe1, g); + for(std::tie(hafib, hafie) = halfedges_around_face(ohe1, g); hafib != hafie; ++hafib){ set_face(*hafib, f, g); @@ -1421,7 +1421,7 @@ add_face_to_border(typename boost::graph_traits::halfedge_descriptor h1, internal::set_border(newhop, g); CGAL::Halfedge_around_face_iterator hafib,hafie; - for(boost::tie(hafib, hafie) = halfedges_around_face(newh, g); + for(std::tie(hafib, hafie) = halfedges_around_face(newh, g); hafib != hafie; ++hafib){ set_face(*hafib, f, g); @@ -1458,7 +1458,7 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor // The following loop checks the link condition for v0_v1. // Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh. // - for ( boost::tie(eb1,ee1) = halfedges_around_source(v0,g) ; eb1 != ee1 ; ++ eb1 ) + for ( std::tie(eb1,ee1) = halfedges_around_source(v0,g) ; eb1 != ee1 ; ++ eb1 ) { halfedge_descriptor v0_k = *eb1; @@ -1466,7 +1466,7 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor { vertex_descriptor k = target(v0_k,g); - for ( boost::tie(eb2,ee2) = halfedges_around_source(k,g) ; eb2 != ee2 ; ++ eb2 ) + for ( std::tie(eb2,ee2) = halfedges_around_source(k,g) ; eb2 != ee2 ; ++ eb2 ) { halfedge_descriptor k_v1 = *eb2; diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 362f6b241b1..00097ff1574 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -895,7 +895,7 @@ vertices(const Face_filtered_graph & w) typename Face_filtered_graph ::Is_simplex_valid predicate(&w); g_vertex_iterator b,e; - boost::tie(b,e) = vertices(w.graph()); + std::tie(b,e) = vertices(w.graph()); return make_range(vertex_iterator(predicate, b, e), vertex_iterator(predicate, e, e)); } @@ -912,7 +912,7 @@ edges(const Face_filtered_graph & w) typename Face_filtered_graph ::Is_simplex_valid predicate(&w); g_edge_iterator b,e; - boost::tie(b,e) = edges(w.graph()); + std::tie(b,e) = edges(w.graph()); return make_range(edge_iterator(predicate, b, e), edge_iterator(predicate, e, e)); } @@ -931,7 +931,7 @@ out_edges(typename boost::graph_traits ::Is_simplex_valid predicate(&w); g_out_edge_iterator b,e; - boost::tie(b,e) = out_edges(v, w.graph()); + std::tie(b,e) = out_edges(v, w.graph()); return make_range(out_edge_iterator(predicate, b, e), out_edge_iterator(predicate, e, e)); } @@ -950,7 +950,7 @@ in_edges(typename boost::graph_traits ::Is_simplex_valid predicate(&w); g_in_edge_iterator b,e; - boost::tie(b,e) = in_edges(v, w.graph()); + std::tie(b,e) = in_edges(v, w.graph()); return make_range(in_edge_iterator(predicate, b, e), in_edge_iterator(predicate, e, e)); } diff --git a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h index 368c5fca524..ad107978828 100644 --- a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h +++ b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h @@ -310,7 +310,7 @@ edge(typename boost::graph_traits >::ver CGAL_assertion(in_same_graph(v,w)); bool b; g_edge_descriptor ed; - boost::tie(ed,b) = edge(u.descriptor, v.descriptor, *w.graph); + std::tie(ed,b) = edge(u.descriptor, v.descriptor, *w.graph); return std::make_pair(edge_descriptor(ed,*w.graph),b); } @@ -320,7 +320,7 @@ CGAL::Iterator_range & w) { typename boost::graph_traits::vertex_iterator b,e; - boost::tie(b,e) = vertices(*w.graph); + std::tie(b,e) = vertices(*w.graph); return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits >::V2V(*w.graph)), boost::make_transform_iterator(e,typename boost::graph_traits >::V2V(*w.graph))); } @@ -330,7 +330,7 @@ CGAL::Iterator_range & w) { typename boost::graph_traits::edge_iterator b,e; - boost::tie(b,e) = edges(*w.graph); + std::tie(b,e) = edges(*w.graph); return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits >::E2E(*w.graph)), boost::make_transform_iterator(e,typename boost::graph_traits >::E2E(*w.graph))); } @@ -342,7 +342,7 @@ out_edges(typename boost::graph_traits > { CGAL_assertion(in_same_graph(v,w)); typename boost::graph_traits::out_edge_iterator b,e; - boost::tie(b,e) = out_edges(v.descriptor, *w.graph); + std::tie(b,e) = out_edges(v.descriptor, *w.graph); return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits >::E2E(*w.graph)), boost::make_transform_iterator(e,typename boost::graph_traits >::E2E(*w.graph))); } @@ -354,7 +354,7 @@ in_edges(typename boost::graph_traits >: { CGAL_assertion(in_same_graph(v,w)); typename boost::graph_traits::in_edge_iterator b,e; - boost::tie(b,e) = in_edges(v.descriptor, *w.graph); + std::tie(b,e) = in_edges(v.descriptor, *w.graph); return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits >::E2E(*w.graph)), boost::make_transform_iterator(e,typename boost::graph_traits >::E2E(*w.graph))); } @@ -557,7 +557,7 @@ halfedge(typename boost::graph_traits< Graph_with_descriptor_with_graph > bool b; CGAL_assertion(in_same_graph(u,w)); CGAL_assertion(in_same_graph(v,w)); - boost::tie(hd,b) = halfedge(u.descriptor, v.descriptor, *w.graph); + std::tie(hd,b) = halfedge(u.descriptor, v.descriptor, *w.graph); return std::make_pair(halfedge_descriptor(hd,*w.graph),b); } @@ -621,7 +621,7 @@ CGAL::Iterator_range & w) { typename boost::graph_traits::halfedge_iterator b,e; - boost::tie(b,e) = halfedges(*w.graph); + std::tie(b,e) = halfedges(*w.graph); return std::make_pair(boost::make_transform_iterator(b, typename boost::graph_traits >::H2H(*w.graph)), boost::make_transform_iterator(e, typename boost::graph_traits >::H2H(*w.graph))); } @@ -661,7 +661,7 @@ CGAL::Iterator_range & w) { typename boost::graph_traits::face_iterator b,e; - boost::tie(b,e) = faces(*w.graph); + std::tie(b,e) = faces(*w.graph); return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits >::F2F(*w.graph)), boost::make_transform_iterator(e,typename boost::graph_traits >::F2F(*w.graph))); } diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index 9a217389d82..32a2cb66294 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -61,7 +61,7 @@ void partition_dual_graph(const TriangleMesh& tm, // fill the adjacency info face_iterator fit, fe; - boost::tie(fit, fe) = faces(tm); + std::tie(fit, fe) = faces(tm); for(int i=0, j=0; fit!=fe; ++fit, ++i) { eptr[i] = j; diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index 42f8c240f01..362d8a1502b 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -47,7 +47,7 @@ struct Output_vertex_partition_ids VertexPartitionIDPmap vertex_partition_id_map) { typename boost::graph_traits::vertex_iterator vit, ve; - boost::tie(vit, ve) = vertices(tm); + std::tie(vit, ve) = vertices(tm); for(; vit!=ve; ++vit) put(vertex_partition_id_map, *vit, npart[get(indices, *vit)]); } @@ -64,7 +64,7 @@ struct Output_face_partition_ids FacePartitionIDPmap face_partition_id_map) { typename boost::graph_traits::face_iterator fit, fe; - boost::tie(fit, fe) = faces(tm); + std::tie(fit, fe) = faces(tm); for(int i=0; fit!=fe; ++fit, ++i) put(face_partition_id_map, *fit, epart[i]); } @@ -98,7 +98,7 @@ void partition_graph(const TriangleMesh& tm, // fill the adjacency info face_iterator fit, fe; - boost::tie(fit, fe) = faces(tm); + std::tie(fit, fe) = faces(tm); for(int i=0, j=0; fit!=fe; ++fit, ++i) { eptr[i] = j; diff --git a/BGL/include/CGAL/boost/graph/alpha_expansion_graphcut.h b/BGL/include/CGAL/boost/graph/alpha_expansion_graphcut.h index b2d6e1cc840..75014bd9371 100644 --- a/BGL/include/CGAL/boost/graph/alpha_expansion_graphcut.h +++ b/BGL/include/CGAL/boost/graph/alpha_expansion_graphcut.h @@ -238,7 +238,7 @@ public: // initialize vertex indices, it is necessary since we are using VertexList = listS Vertex_iterator v_begin, v_end; Traits::vertices_size_type index = 0; - for(boost::tie(v_begin, v_end) = vertices(graph); v_begin != v_end; ++v_begin) { + for(std::tie(v_begin, v_end) = vertices(graph); v_begin != v_end; ++v_begin) { boost::put(boost::vertex_index, graph, *v_begin, index++); } } @@ -269,8 +269,8 @@ public: Edge_descriptor v1_v2, v2_v1; bool v1_v2_added, v2_v1_added; - boost::tie(v1_v2, v1_v2_added) = boost::add_edge(v1, v2, graph); - boost::tie(v2_v1, v2_v1_added) = boost::add_edge(v2, v1, graph); + std::tie(v1_v2, v1_v2_added) = boost::add_edge(v1, v2, graph); + std::tie(v2_v1, v2_v1_added) = boost::add_edge(v2, v1, graph); CGAL_assertion(v1_v2_added && v2_v1_added); //put edge capacities @@ -360,7 +360,7 @@ public: // however from our edge_map, we know that each (2i, 2i + 1) is reverse pairs, how to facilitate that ? // will look it back Graph::edge_iterator ei, ee; - for(boost::tie(ei, ee) = boost::edges(graph); ei != ee; ++ei) { + for(std::tie(ei, ee) = boost::edges(graph); ei != ee; ++ei) { Graph::vertex_descriptor v1 = boost::source(*ei, graph); Graph::vertex_descriptor v2 = boost::target(*ei, graph); std::pair opp_edge = boost::edge(v2, v1, graph); diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 75673493e0d..26b358b3561 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -65,7 +65,7 @@ is_border(typename boost::graph_traits::vertex_descriptor vd, const FaceGraph& g) { CGAL::Halfedge_around_target_iterator havib, havie; - for(boost::tie(havib, havie) = halfedges_around_target(halfedge(vd, g), g); havib != havie; ++havib) { + for(std::tie(havib, havie) = halfedges_around_target(halfedge(vd, g), g); havib != havie; ++havib) { if(is_border(*havib,g)) { typename boost::graph_traits::halfedge_descriptor h = *havib; return h; diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index 679d48896f1..194bd6b95b1 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -147,7 +147,7 @@ void duplicate_terminal_vertices(Graph& graph, typedef typename boost::graph_traits::out_edge_iterator out_edge_iterator; vertex_iterator b,e; - boost::tie(b,e) = vertices(graph); + std::tie(b,e) = vertices(graph); std::vector V(b,e); for(vertex_descriptor v : V) { @@ -156,7 +156,7 @@ void duplicate_terminal_vertices(Graph& graph, if (deg != 2 || is_terminal(orig_v, orig)) { out_edge_iterator b, e; - boost::tie(b, e) = out_edges(v, graph); + std::tie(b, e) = out_edges(v, graph); std::vector out_edges_of_v(b, e); for (unsigned int i = 1; i < out_edges_of_v.size(); ++i) { diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 615a4fd756d..36a9d79c84e 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -97,7 +97,7 @@ join_face_test() bool found; halfedge_descriptor e; - boost::tie(e, found) = halfedge(f.w, f.v, f.m); + std::tie(e, found) = halfedge(f.w, f.v, f.m); assert(found); // manually set the halfedge of f.f1 to the edge that is to be // removed to provoke a special case @@ -108,7 +108,7 @@ join_face_test() assert(CGAL::internal::exact_num_edges(f.m) == 6); CGAL::Halfedge_around_face_iterator begin, end; - boost::tie(begin, end) = CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m); + std::tie(begin, end) = CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m); assert(std::distance(begin, end) == 4); for(; begin != end; ++begin) { @@ -119,7 +119,7 @@ join_face_test() } face_iterator fit, fend; - for(boost::tie(fit, fend) = faces(f.m); fit != fend; ++fit) { + for(std::tie(fit, fend) = faces(f.m); fit != fend; ++fit) { assert(*fit == f.f1 || *fit == f.f3); } @@ -141,7 +141,7 @@ remove_face_test_1() // find the edge between x and y bool found; halfedge_descriptor e; - boost::tie(e, found) = halfedge(f.x, f.y, f.m); + std::tie(e, found) = halfedge(f.x, f.y, f.m); assert(found); assert(face(e, f.m) == f.f3); @@ -156,7 +156,7 @@ remove_face_test_1() assert_EQUAL(CGAL::internal::exact_num_vertices(f.m) == 4); halfedge_iterator eb, ee; int count = 0; - for(boost::tie(eb, ee) = halfedges(f.m); eb != ee; ++eb) { + for(std::tie(eb, ee) = halfedges(f.m); eb != ee; ++eb) { if(face(*eb,f.m) == boost::graph_traits::null_face()) ++count; } @@ -177,9 +177,9 @@ remove_face_test_2() bool found; halfedge_descriptor e; - boost::tie(e, found) = halfedge(f.x, f.w, f.m); + std::tie(e, found) = halfedge(f.x, f.w, f.m); assert(found); - boost::tie(e, found) = halfedge(f.x, f.v, f.m); + std::tie(e, found) = halfedge(f.x, f.v, f.m); assert(found); assert(face(e, f.m) == f.f1); CGAL::Euler::remove_face(e,f.m); @@ -189,7 +189,7 @@ remove_face_test_2() assert(CGAL::internal::exact_num_edges(f.m) == 7); assert(CGAL::internal::exact_num_vertices(f.m) == 5); - boost::tie(e, found) = halfedge(f.x, f.w, f.m); + std::tie(e, found) = halfedge(f.x, f.w, f.m); assert(found); assert(face(e,f.m) == boost::graph_traits::null_face()); @@ -266,7 +266,7 @@ join_vertex_interior_test() halfedge_descriptor e; bool found; - boost::tie(e, found) = halfedge(f.w, f.x, f.m); + std::tie(e, found) = halfedge(f.w, f.x, f.m); assert(found); CGAL::Euler::join_vertex(e,f.m); assert(CGAL::internal::exact_num_faces(f.m) == 2); @@ -289,7 +289,7 @@ join_vertex_exterior_test() Surface_fixture_3 f; halfedge_descriptor e; bool found; - boost::tie(e, found) = halfedge(f.w, f.y, f.m); + std::tie(e, found) = halfedge(f.w, f.y, f.m); assert(source(e,f.m) == f.w); assert(target(e,f.m) == f.y); assert(found); @@ -307,7 +307,7 @@ join_vertex_exterior_test() Surface_fixture_3 f; halfedge_descriptor e; bool found; - boost::tie(e, found) = halfedge(f.y, f.w, f.m); + std::tie(e, found) = halfedge(f.y, f.w, f.m); assert(source(e,f.m) == f.y); assert(target(e,f.m) == f.w); @@ -335,9 +335,9 @@ split_vertex() Surface_fixture_3 f; halfedge_descriptor h1, h2; bool found; - boost::tie(h1, found) = halfedge(f.w, f.y, f.m); + std::tie(h1, found) = halfedge(f.w, f.y, f.m); assert(found); - boost::tie(h2, found) = halfedge(f.z, f.y, f.m); + std::tie(h2, found) = halfedge(f.z, f.y, f.m); assert(found); assert(face(h2, f.m) == Traits::null_face()); @@ -358,13 +358,13 @@ split_join_vertex_inverse() Surface_fixture_3 f; halfedge_descriptor h, h1, h2; bool found; - boost::tie(h, found) = halfedge(f.w, f.x, f.m); + std::tie(h, found) = halfedge(f.w, f.x, f.m); assert(found); CGAL::Euler::join_vertex(h,f.m); assert(CGAL::is_valid_polygon_mesh(f.m)); - boost::tie(h1, found) = halfedge(f.z, f.x, f.m); + std::tie(h1, found) = halfedge(f.z, f.x, f.m); assert(found); - boost::tie(h2, found) = halfedge(f.v, f.x, f.m); + std::tie(h2, found) = halfedge(f.v, f.x, f.m); assert(found); CGAL::Euler::join_vertex(CGAL::Euler::split_vertex(h1, h2,f.m),f.m); assert(CGAL::is_valid_polygon_mesh(f.m)); diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index 84e1bbbf69f..e6cfc53be6e 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -29,9 +29,9 @@ void test_halfedge_around_vertex_iterator(const Graph& g) Adapter fg(g, 0, boost::make_assoc_property_map(map)); typename boost::graph_traits::vertex_iterator vit, vend; - for(boost::tie(vit, vend) = vertices(fg); vit != vend; ++vit) { + for(std::tie(vit, vend) = vertices(fg); vit != vend; ++vit) { halfedge_around_target_iterator havit, havend; - for(boost::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, fg), fg); + for(std::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, fg), fg); havit != havend; ++havit) { assert(target(*havit, fg) == *vit); @@ -56,11 +56,11 @@ void test_halfedge_around_face_iterator(const Graph& g) Adapter fg(g, 0, boost::make_assoc_property_map(map)); face_iterator fit, fend; - for(boost::tie(fit, fend) = faces(fg); fit != fend; ++fit) { + for(std::tie(fit, fend) = faces(fg); fit != fend; ++fit) { halfedge_around_face_iterator hafit, hafend; - boost::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, fg), fg); + std::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, fg), fg); assert(std::distance(hafit, hafend) != 0); - for(boost::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, fg), fg); hafit != hafend; ++hafit) { + for(std::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, fg), fg); hafit != hafend; ++hafit) { assert(face(*hafit, fg) == *fit); } } @@ -78,11 +78,11 @@ void test_edge_iterators(const Graph& g) // do we iterate as many as that? edge_iterator eb, ee; - boost::tie(eb, ee) = edges(fg); + std::tie(eb, ee) = edges(fg); assert(static_cast(std::distance(eb, ee)) == num_edges(g)); id_map ids; unsigned int count = 0; - for(boost::tie(eb, ee) = edges(fg); eb != ee; ++eb) { + for(std::tie(eb, ee) = edges(fg); eb != ee; ++eb) { edge_descriptor e = *eb; std::pair r = ids.insert(get(boost::edge_index, g, e)); // unique? @@ -103,7 +103,7 @@ void test_vertex_iterators(Graph& g) Adapter fg(g, 0, boost::make_assoc_property_map(map)); vertex_iterator vb, ve; std::size_t count = 0; - for(boost::tie(vb, ve) = vertices(fg); vb != ve; ++vb){ + for(std::tie(vb, ve) = vertices(fg); vb != ve; ++vb){ ++count; } @@ -113,7 +113,7 @@ void test_vertex_iterators(Graph& g) id_map ids; count = 0; - for(boost::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { std::pair r = ids.insert(get(boost::vertex_index, g, *vb)); assert(r.second); ++count; @@ -133,12 +133,12 @@ void test_out_edges(const Graph& g) Adapter fg(g, 0, boost::make_assoc_property_map(map)); vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { id_map v_ids; vertex_descriptor around = *vb; out_edge_iterator oeb, oee; - for(boost::tie(oeb, oee) = out_edges(*vb, fg); oeb != oee; ++oeb) { + for(std::tie(oeb, oee) = out_edges(*vb, fg); oeb != oee; ++oeb) { vertex_descriptor t = target(*oeb, fg); vertex_descriptor s = source(*oeb, fg); assert(s != t); @@ -162,11 +162,11 @@ void test_in_edges(const Graph& g) Adapter fg(g, 0, boost::make_assoc_property_map(map)); vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { id_map v_ids; vertex_descriptor around = *vb; in_edge_iterator ieb, iee; - for(boost::tie(ieb, iee) = in_edges(*vb, fg); ieb != iee; ++ieb) { + for(std::tie(ieb, iee) = in_edges(*vb, fg); ieb != iee; ++ieb) { vertex_descriptor t = target(*ieb, fg); vertex_descriptor s = source(*ieb, fg); assert(t == around); @@ -190,18 +190,18 @@ void test_in_out_edges(const Graph& g) // check that the sets of in out edges are the same vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(fg); vb != ve; ++vb) { id_map v_ids; std::vector in, out; in_edge_iterator ieb, iee; - for(boost::tie(ieb, iee) = in_edges(*vb, fg); ieb != iee; ++ieb) { + for(std::tie(ieb, iee) = in_edges(*vb, fg); ieb != iee; ++ieb) { std::pair r = v_ids.insert(get(boost::vertex_index, g, source(*ieb, fg))); assert(r.second); in.push_back(source(*ieb, fg)); } out_edge_iterator oeb, oee; - for(boost::tie(oeb, oee) = out_edges(*vb, fg); oeb != oee; ++oeb) { + for(std::tie(oeb, oee) = out_edges(*vb, fg); oeb != oee; ++oeb) { std::pair r = v_ids.insert(get(boost::vertex_index, g, target(*oeb, fg))); // insertion must fail @@ -232,7 +232,7 @@ void test_edge_find(const Graph& g) typedef std::pair ret; edge_iterator eb, ee; - for(boost::tie(eb, ee) = edges(fg); eb != ee; ++eb) { + for(std::tie(eb, ee) = edges(fg); eb != ee; ++eb) { vertex_descriptor s = source(*eb, fg); vertex_descriptor t = target(*eb, fg); ret found = edge(s, t, fg); @@ -256,14 +256,14 @@ void test_faces(const Graph& g) unsigned int count = 0; face_iterator fb, fe; - for(boost::tie(fb, fe) = faces(fg); fb != fe; ++fb) { + for(std::tie(fb, fe) = faces(fg); fb != fe; ++fb) { ++count; // reverse look-up halfedge_descriptor assoc = halfedge(*fb, fg); assert(face(assoc, fg) == *fb); // check the enclosure halfedge_around_face_iterator encb, ence; - for(boost::tie(encb, ence) = CGAL::halfedges_around_face(halfedge(*fb, fg), fg); encb != ence; ++encb) { + for(std::tie(encb, ence) = CGAL::halfedges_around_face(halfedge(*fb, fg), fg); encb != ence; ++encb) { assert(face(*encb, fg) == *fb); } } diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index ca92ed230f2..8ad09acdf93 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -238,7 +238,7 @@ struct Surface_fixture_1 { pm = get(CGAL::vertex_point, const_cast(m)); typename boost::graph_traits::vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(m); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(m); vb != ve; ++vb) { if (get(pm, *vb) == Point_3(0, 0, 0)) u = *vb; else if(get(pm, *vb) == Point_3(1, 0, 0)) @@ -259,13 +259,13 @@ struct Surface_fixture_1 { f1 = CGAL::is_border(halfedge(u, m),m) ? face(opposite(halfedge(u, m), m), m) : face(halfedge(u, m), m); assert(f1 != boost::graph_traits::null_face()); CGAL::Halfedge_around_face_iterator hafib, hafie; - for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) + for(std::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) { if(! CGAL::is_border(opposite(*hafib, m), m)) f2 = face(opposite(*hafib, m), m); } typename boost::graph_traits::face_iterator fb, fe; - for(boost::tie(fb, fe) = faces(m); fb != fe; ++fb) { + for(std::tie(fb, fe) = faces(m); fb != fe; ++fb) { if(*fb != f1 && *fb != f2) f3 = *fb; } @@ -289,7 +289,7 @@ struct Surface_fixture_2 { pm = get(CGAL::vertex_point, const_cast(m)); typename boost::graph_traits::vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(m); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(m); vb != ve; ++vb) { if (get(pm, *vb) == Point_3(0, 2, 0)) u = *vb; else if(get(pm, *vb) == Point_3(2, 2, 0)) @@ -308,25 +308,25 @@ struct Surface_fixture_2 { assert(y != boost::graph_traits::null_vertex()); typename boost::graph_traits::halfedge_descriptor h; bool found; - boost::tie(h, found) = halfedge(x, v, m); + std::tie(h, found) = halfedge(x, v, m); assert(found); assert(! CGAL::is_border(h,m)); f1 = face(h, m); assert(f1 != boost::graph_traits::null_face()); - boost::tie(h, found) = halfedge(v, u, m); + std::tie(h, found) = halfedge(v, u, m); assert(found); assert(!CGAL::is_border(h,m)); f2 = face(h, m); assert(f2 != boost::graph_traits::null_face()); - boost::tie(h, found) = halfedge(u, w, m); + std::tie(h, found) = halfedge(u, w, m); assert(found); assert(!CGAL::is_border(h,m)); f3 = face(h, m); assert(f3 != boost::graph_traits::null_face()); - boost::tie(h, found) = halfedge(w, x, m); + std::tie(h, found) = halfedge(w, x, m); assert(found); assert(!CGAL::is_border(h,m)); f4 = face(h, m); @@ -351,7 +351,7 @@ struct Surface_fixture_3 { pm = get(CGAL::vertex_point, const_cast(m)); typename boost::graph_traits::vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(m); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(m); vb != ve; ++vb) { if (get(pm, *vb) == Point_3(0, 1, 0)) u = *vb; else if(get(pm, *vb) == Point_3(0, 0, 0)) @@ -399,7 +399,7 @@ struct Surface_fixture_4 { int found = 0; typename boost::graph_traits::halfedge_iterator hb, he; - for(boost::tie(hb, he) = halfedges(m); hb != he; ++hb) { + for(std::tie(hb, he) = halfedges(m); hb != he; ++hb) { if(CGAL::is_border(*hb,m)){ if(get(pm, target(*hb,m)) == Point_3(0,0,0)){ if(found == 0){ @@ -435,7 +435,7 @@ struct Surface_fixture_5 { int found = 0; typename boost::graph_traits::halfedge_iterator hb, he; - for(boost::tie(hb, he) = halfedges(m); hb != he; ++hb) { + for(std::tie(hb, he) = halfedges(m); hb != he; ++hb) { if(CGAL::is_border(*hb,m)){ if(get(pm, target(*hb,m)) == Point_3(2,1,0)){ h1 = *hb; @@ -500,7 +500,7 @@ struct Surface_fixture_8 { int found = 0; typename boost::graph_traits::halfedge_iterator hb, he; - for(boost::tie(hb, he) = halfedges(m); hb != he; ++hb) { + for(std::tie(hb, he) = halfedges(m); hb != he; ++hb) { if(get(pm, source(*hb,m)) == Point_3(0,0,0) && get(pm, target(*hb,m)) == Point_3(1,0,0)){ h1 = *hb; diff --git a/BGL/test/BGL/test_bgl_dual.cpp b/BGL/test/BGL/test_bgl_dual.cpp index 9a79832fcb9..e6a6330a256 100644 --- a/BGL/test/BGL/test_bgl_dual.cpp +++ b/BGL/test/BGL/test_bgl_dual.cpp @@ -42,13 +42,13 @@ int main() { out_edge_iterator b,e; - boost::tie(b,e) = out_edges(vd,dual); + std::tie(b,e) = out_edges(vd,dual); std::cerr << vd << " " << source(*b,dual) << std::endl; } { in_edge_iterator b,e; - boost::tie(b,e) = in_edges(vd,dual); + std::tie(b,e) = in_edges(vd,dual); std::cerr << vd << " " << source(*b,dual) << std::endl; } std::cerr << "done"<< std::endl; diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index 1c862324bb6..cd0a18cbbe4 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -102,7 +102,7 @@ int main(int argc, char* argv[]) { halfedge_around_target_iterator vit, end; vertex_descriptor vd = target(hd,P); - boost::tie(vit,end) = halfedges_around_target(hd,P); + std::tie(vit,end) = halfedges_around_target(hd,P); while(vit!= end) { halfedge_descriptor hd = *vit; assert(target(hd,P) == vd); @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) { halfedge_around_face_iterator vit, end; - boost::tie(vit,end) = halfedges_around_face(hd,P); + std::tie(vit,end) = halfedges_around_face(hd,P); while(vit!= end) { halfedge_descriptor hd = *vit; @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) { out_edge_iterator ohi, end; - for(boost::tie(ohi,end) = out_edges(target(hd,P),P); ohi != end; ++ohi){ + for(std::tie(ohi,end) = out_edges(target(hd,P),P); ohi != end; ++ohi){ edge_descriptor ed = *ohi; halfedge_descriptor hd2 = halfedge(ed,P); std::cout << get(CGAL::vertex_point, P, target(hd2,P)) << std::endl; diff --git a/BGL/test/BGL/test_graph_traits.cpp b/BGL/test/BGL/test_graph_traits.cpp index 082469a58a9..19e03408f21 100644 --- a/BGL/test/BGL/test_graph_traits.cpp +++ b/BGL/test/BGL/test_graph_traits.cpp @@ -26,9 +26,9 @@ void test_halfedge_around_vertex_iterator(const Graph& g) { CGAL_GRAPH_TRAITS_MEMBERS(Graph); vertex_iterator vit, vend; - for(boost::tie(vit, vend) = vertices(g); vit != vend; ++vit) { + for(std::tie(vit, vend) = vertices(g); vit != vend; ++vit) { halfedge_around_target_iterator havit, havend; - for(boost::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, g), g); + for(std::tie(havit, havend) = CGAL::halfedges_around_target(halfedge(*vit, g), g); havit != havend; ++havit) { assert(target(*havit, g) == *vit); @@ -47,11 +47,11 @@ void test_halfedge_around_face_iterator(const Graph& g) { CGAL_GRAPH_TRAITS_MEMBERS(Graph); face_iterator fit, fend; - for(boost::tie(fit, fend) = faces(g); fit != fend; ++fit) { + for(std::tie(fit, fend) = faces(g); fit != fend; ++fit) { halfedge_around_face_iterator hafit, hafend; - boost::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, g), g); + std::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, g), g); assert(std::distance(hafit, hafend) != 0); - for(boost::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, g), g); hafit != hafend; ++hafit) { + for(std::tie(hafit, hafend) = CGAL::halfedges_around_face(halfedge(*fit, g), g); hafit != hafend; ++hafit) { assert(face(*hafit, g) == *fit); } } @@ -66,12 +66,12 @@ void test_halfedge_iterators(const G& g) // do we iterate as many as that? halfedge_iterator hb, he; - boost::tie(hb, he) = halfedges(g); + std::tie(hb, he) = halfedges(g); assert(static_cast(std::distance(hb, he)) == num_halfedges(g)); id_map ids; unsigned int count = 0; - for(boost::tie(hb, he) = halfedges(g); hb != he; ++hb) { + for(std::tie(hb, he) = halfedges(g); hb != he; ++hb) { std::pair r = ids.insert(get(boost::halfedge_index, g, *hb)); // unique? assert(r.second); @@ -92,12 +92,12 @@ void test_edge_iterators(const G& g) // do we iterate as many as that? edge_iterator eb, ee; - boost::tie(eb, ee) = edges(g); + std::tie(eb, ee) = edges(g); assert(static_cast(std::distance(eb, ee)) == num_edges(g)); id_map ids; unsigned int count = 0; - for(boost::tie(eb, ee) = edges(g); eb != ee; ++eb) { + for(std::tie(eb, ee) = edges(g); eb != ee; ++eb) { edge_descriptor e = *eb; std::pair r = ids.insert(get(boost::edge_index, g, e)); // unique? @@ -115,7 +115,7 @@ void test_vertex_iterators(const G& g) vertex_iterator vb, ve; std::size_t count = 0; - for(boost::tie(vb, ve) = vertices(g); vb != ve; ++vb){ + for(std::tie(vb, ve) = vertices(g); vb != ve; ++vb){ ++count; } @@ -125,7 +125,7 @@ void test_vertex_iterators(const G& g) id_map ids; count = 0; - for(boost::tie(vb, ve) = vertices(g); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(g); vb != ve; ++vb) { std::pair r = ids.insert(get(boost::vertex_index, g, *vb)); assert(r.second); ++count; @@ -142,12 +142,12 @@ void test_out_edges(const G& g) typedef typename Traits::vertex_descriptor vertex_descriptor; vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(g); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(g); vb != ve; ++vb) { id_map v_ids; vertex_descriptor around = *vb; out_edge_iterator oeb, oee; - for(boost::tie(oeb, oee) = out_edges(*vb, g); oeb != oee; ++oeb) { + for(std::tie(oeb, oee) = out_edges(*vb, g); oeb != oee; ++oeb) { vertex_descriptor t = target(*oeb, g); vertex_descriptor s = source(*oeb, g); assert(s != t); @@ -169,11 +169,11 @@ void test_in_edges(const G& g) typedef typename Traits::vertex_descriptor vertex_descriptor; vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(g); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(g); vb != ve; ++vb) { id_map v_ids; vertex_descriptor around = *vb; in_edge_iterator ieb, iee; - for(boost::tie(ieb, iee) = in_edges(*vb, g); ieb != iee; ++ieb) { + for(std::tie(ieb, iee) = in_edges(*vb, g); ieb != iee; ++ieb) { vertex_descriptor t = target(*ieb, g); vertex_descriptor s = source(*ieb, g); assert(t == around); @@ -196,18 +196,18 @@ void test_in_out_edges(const G& g) // check that the sets of in out edges are the same vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(g); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(g); vb != ve; ++vb) { id_map v_ids; std::vector in, out; in_edge_iterator ieb, iee; - for(boost::tie(ieb, iee) = in_edges(*vb, g); ieb != iee; ++ieb) { + for(std::tie(ieb, iee) = in_edges(*vb, g); ieb != iee; ++ieb) { std::pair r = v_ids.insert(get(boost::vertex_index, g, source(*ieb, g))); assert(r.second); in.push_back(source(*ieb, g)); } out_edge_iterator oeb, oee; - for(boost::tie(oeb, oee) = out_edges(*vb, g); oeb != oee; ++oeb) { + for(std::tie(oeb, oee) = out_edges(*vb, g); oeb != oee; ++oeb) { std::pair r = v_ids.insert(get(boost::vertex_index, g, target(*oeb, g))); // insertion must fail @@ -239,13 +239,13 @@ void test_adjacent_vertices(const G& g) vertex_descriptor v = *(vertices(g).begin()); adjacency_iterator vb, ve; - boost::tie(vb, ve) = adjacent_vertices(v, g); + std::tie(vb, ve) = adjacent_vertices(v, g); in_edge_iterator ieb, iee; - boost::tie(ieb, iee) = in_edges(v, g); + std::tie(ieb, iee) = in_edges(v, g); out_edge_iterator oeb, oee; - boost::tie(oeb, oee) = out_edges(v, g); + std::tie(oeb, oee) = out_edges(v, g); assert(std::distance(vb, ve) == std::distance(ieb, iee)); assert(std::distance(vb, ve) == std::distance(oeb, oee)); @@ -271,7 +271,7 @@ void test_edge_find(const G& g) typedef std::pair ret; edge_iterator eb, ee; - for(boost::tie(eb, ee) = edges(g); eb != ee; ++eb) { + for(std::tie(eb, ee) = edges(g); eb != ee; ++eb) { vertex_descriptor s = source(*eb, g); vertex_descriptor t = target(*eb, g); ret found = edge(s, t, g); @@ -293,14 +293,14 @@ void test_faces(const G& g) unsigned int count = 0; face_iterator fb, fe; - for(boost::tie(fb, fe) = faces(g); fb != fe; ++fb) { + for(std::tie(fb, fe) = faces(g); fb != fe; ++fb) { ++count; // reverse look-up halfedge_descriptor assoc = halfedge(*fb, g); assert(face(assoc, g) == *fb); // check the enclosure halfedge_around_face_iterator encb, ence; - for(boost::tie(encb, ence) = CGAL::halfedges_around_face(halfedge(*fb, g), g); encb != ence; ++encb) { + for(std::tie(encb, ence) = CGAL::halfedges_around_face(halfedge(*fb, g), g); encb != ence; ++encb) { assert(face(*encb, g) == *fb); } } diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index 5c98556e0cf..f7f677e9660 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) Mesh::Property_map faces_size; bool created; - boost::tie(faces_size, created)=sm.add_property_map("f:size",0.); + std::tie(faces_size, created)=sm.add_property_map("f:size",0.); assert(created); for(face_descriptor fd : sm.faces()) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/alpha_shapes.cpp b/CGAL_ipelets/demo/CGAL_ipelets/alpha_shapes.cpp index f5423b0ab19..0aa825dcd77 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/alpha_shapes.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/alpha_shapes.cpp @@ -85,7 +85,7 @@ void ASphapeIpelet::protected_run(int fn) Alpha_shape_2 A(LWP.begin(),LWP.end()); int alpha=-1; int nb_ret; - boost::tie(nb_ret,alpha)=request_value_from_user((boost::format("# Spectral critical value (0-%d)") % A.number_of_alphas()).str() ); + std::tie(nb_ret,alpha)=request_value_from_user((boost::format("# Spectral critical value (0-%d)") % A.number_of_alphas()).str() ); if (nb_ret == -1) return; if(alpha<0 || (std::size_t) alpha>A.number_of_alphas()){ diff --git a/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp b/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp index 97aad8daa24..826ef549364 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp @@ -86,7 +86,7 @@ void Cone_spanners_ipelet::protected_run(int fn) } int ret_val; - boost::tie(ret_val,number_of_cones)=request_value_from_user("Enter the number of cones"); + std::tie(ret_val,number_of_cones)=request_value_from_user("Enter the number of cones"); if (ret_val < 0) { print_error_message("Incorrect value"); return; @@ -129,7 +129,7 @@ void Cone_spanners_ipelet::protected_run(int fn) } } boost::graph_traits::edge_iterator ei, ei_end; - for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { + for (std::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { boost::graph_traits::edge_descriptor e = *ei; boost::graph_traits::vertex_descriptor u = source(e, g); boost::graph_traits::vertex_descriptor v = target(e, g); diff --git a/CGAL_ipelets/demo/CGAL_ipelets/generator.cpp b/CGAL_ipelets/demo/CGAL_ipelets/generator.cpp index 92104a15cff..0c35beae131 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/generator.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/generator.cpp @@ -83,7 +83,7 @@ void generator::protected_run(int fn) origin= Kernel::Vector_2((bbox.xmin()+bbox.xmax())/2,(bbox.ymin()+bbox.ymax())/2); if (size<1){ size=200; - //boost::tie(ret_val,size)=request_value_from_user((boost::format("Size (default : %1%)") % size).str()); + //std::tie(ret_val,size)=request_value_from_user((boost::format("Size (default : %1%)") % size).str()); //if (ret_val == -1) return; //if (ret_val == 0) size=200; origin = Kernel::Vector_2(200,200); @@ -92,7 +92,7 @@ void generator::protected_run(int fn) int nbelements=30; - boost::tie(ret_val,nbelements)=request_value_from_user((boost::format("Number of elements (default : %1%)") % nbelements).str() ); + std::tie(ret_val,nbelements)=request_value_from_user((boost::format("Number of elements (default : %1%)") % nbelements).str() ); if (ret_val == -1) return; if (ret_val == 0) nbelements=30; diff --git a/CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp b/CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp index 8b4a70e49fe..f737113bbd6 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp @@ -94,7 +94,7 @@ void IpeletMesh2::protected_run(int fn) int y=static_cast( floor((bbox.max)().y()-(bbox.min)().y()) ); int ret_val; - boost::tie(ret_val,alpha)=request_value_from_user((boost::format("Max edge length (BBox %1%x%2%)") % x % y).str() ); + std::tie(ret_val,alpha)=request_value_from_user((boost::format("Max edge length (BBox %1%x%2%)") % x % y).str() ); if (ret_val == -1) return; if(alpha<0){ diff --git a/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp b/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp index 2d3f050d6cd..add1a29eb06 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp @@ -82,9 +82,9 @@ void mstIpelet::protected_run(int /*fn*/) vertex_iterator vit, ve; // Associate indices to the vertices int index = 0; - // boost::tie assigns the first and second element of the std::pair + // std::tie assigns the first and second element of the std::pair // returned by boost::vertices to the variables vit and ve - for(boost::tie(vit,ve)=boost::vertices(ft); vit!=ve; ++vit ){ + for(std::tie(vit,ve)=boost::vertices(ft); vit!=ve; ++vit ){ vertex_descriptor vd = *vit; vertex_id_map[vd] = index++; } diff --git a/CGAL_ipelets/demo/CGAL_ipelets/multi_delaunay.cpp b/CGAL_ipelets/demo/CGAL_ipelets/multi_delaunay.cpp index 9361353d575..56244ed708f 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/multi_delaunay.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/multi_delaunay.cpp @@ -172,7 +172,7 @@ void MdelaunayIpelet::protected_run(int fn) if(fn==4 ||fn==9){ int order; int ret_val; - boost::tie(ret_val,order)=request_value_from_user("Enter order"); + std::tie(ret_val,order)=request_value_from_user("Enter order"); if (ret_val < 0){ print_error_message("Incorrect value"); return; diff --git a/CGAL_ipelets/demo/CGAL_ipelets/multi_regular.cpp b/CGAL_ipelets/demo/CGAL_ipelets/multi_regular.cpp index 3727c487040..731f8a1181f 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/multi_regular.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/multi_regular.cpp @@ -80,7 +80,7 @@ void MregularIpelet::protected_run(int fn) if(fn==4 || fn==9){ int ret_val; - boost::tie(ret_val,order)=request_value_from_user("Enter order"); + std::tie(ret_val,order)=request_value_from_user("Enter order"); if (ret_val < 0){ print_error_message("Incorrect value"); return; diff --git a/CGAL_ipelets/demo/CGAL_ipelets/nearest_neighbor_graph.cpp b/CGAL_ipelets/demo/CGAL_ipelets/nearest_neighbor_graph.cpp index bf1954cf307..73f99255cb8 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/nearest_neighbor_graph.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/nearest_neighbor_graph.cpp @@ -56,7 +56,7 @@ void nngIpelet::protected_run(int fn) int ret_val; int kNeighbors=1; - boost::tie(ret_val,kNeighbors)=request_value_from_user((boost::format("Number of nearest neighbors (default : k=%1%)") % kNeighbors).str() ); + std::tie(ret_val,kNeighbors)=request_value_from_user((boost::format("Number of nearest neighbors (default : k=%1%)") % kNeighbors).str() ); if (ret_val == -1) return; if (ret_val == 0) kNeighbors=1; diff --git a/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp b/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp index 71557e65968..6ba3994a584 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/skeleton.cpp @@ -124,7 +124,7 @@ void SkeletonIpelet::protected_run(int fn) if (fn==0 || fn==1) draw_straight_skeleton(*ss,max_edge); else{ - boost::tie(ret_val,dist)= + std::tie(ret_val,dist)= request_value_from_user( (boost::format("Offset value (BBox %1%x%2%)") % (bbox.xmax()-bbox.xmin()) % (bbox.ymax()-bbox.ymin())).str() ); diff --git a/Classification/include/CGAL/Classification/Feature/Vertical_dispersion.h b/Classification/include/CGAL/Classification/Feature/Vertical_dispersion.h index 2a5c8e6e9c7..53ef4ff89e5 100644 --- a/Classification/include/CGAL/Classification/Feature/Vertical_dispersion.h +++ b/Classification/include/CGAL/Classification/Feature/Vertical_dispersion.h @@ -127,7 +127,7 @@ public: continue; std::vector::iterator min_it, max_it; - boost::tie(min_it, max_it) + std::tie(min_it, max_it) = boost::minmax_element (hori.begin(), hori.end()); std::vector occupy (1 + (std::size_t)((*max_it - *min_it) / grid.resolution()), false); diff --git a/Classification/include/CGAL/Classification/Point_set_neighborhood.h b/Classification/include/CGAL/Classification/Point_set_neighborhood.h index c27c874f0c2..e409641bf35 100644 --- a/Classification/include/CGAL/Classification/Point_set_neighborhood.h +++ b/Classification/include/CGAL/Classification/Point_set_neighborhood.h @@ -318,7 +318,7 @@ private: std::floor(p.y() / voxel_size), std::floor(p.z() / voxel_size)); typename std::map >::iterator it; - boost::tie (it, boost::tuples::ignore) + std::tie (it, boost::tuples::ignore) = grid.insert (std::make_pair (ref, std::vector())); it->second.push_back (i); } diff --git a/Classification/test/Classification/test_classification_point_set.cpp b/Classification/test/Classification/test_classification_point_set.cpp index 0a1dc9cee79..bb0cce75796 100644 --- a/Classification/test/Classification/test_classification_point_set.cpp +++ b/Classification/test/Classification/test_classification_point_set.cpp @@ -53,9 +53,9 @@ int main (int, char**) map_added = pts.add_normal_map().second; assert (map_added); normal_map = pts.normal_map(); - boost::tie (echo_map, map_added) = pts.add_property_map ("echo"); + std::tie (echo_map, map_added) = pts.add_property_map ("echo"); assert (map_added); - boost::tie (color_map, map_added) = pts.add_property_map ("color"); + std::tie (color_map, map_added) = pts.add_property_map ("color"); assert (map_added); for (std::size_t i = 0; i < 1000; ++ i) diff --git a/Cone_spanners_2/examples/Cone_spanners_2/dijkstra_theta.cpp b/Cone_spanners_2/examples/Cone_spanners_2/dijkstra_theta.cpp index 52f382fa608..62d788ee2c3 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/dijkstra_theta.cpp +++ b/Cone_spanners_2/examples/Cone_spanners_2/dijkstra_theta.cpp @@ -72,7 +72,7 @@ int main(int argc, char ** argv) // calculating edge length in Euclidean distance and store them in the edge property boost::graph_traits::edge_iterator ei, ei_end; - for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { + for (std::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { boost::graph_traits::edge_descriptor e = *ei; boost::graph_traits::vertex_descriptor u = source(e, g); boost::graph_traits::vertex_descriptor v = target(e, g); diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h index 3d1ebc15efb..5a6a73299fb 100644 --- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h @@ -193,7 +193,7 @@ protected: const Less_by_direction orderMid(g, cw90(bisector_direction)); typename Graph_::vertex_iterator vit, ve; - boost::tie(vit, ve) = boost::vertices(g); + std::tie(vit, ve) = boost::vertices(g); // Step 1: Sort S according to order induced by D1 std::vector S(vit, ve); @@ -218,7 +218,7 @@ protected: typename Graph_::edge_descriptor existing_e; bool existing; // check whether the edge already exists - boost::tie(existing_e, existing)=boost::edge(*it, *ri, g); + std::tie(existing_e, existing)=boost::edge(*it, *ri, g); if (!existing) boost::add_edge(*it, *ri, g); } diff --git a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h index 7f6fdb16a17..58090bdd506 100644 --- a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h @@ -179,7 +179,7 @@ protected: const Less_by_direction orderD2 (g, cwBound); typename Graph_::vertex_iterator vit, ve; - boost::tie(vit, ve) = boost::vertices(g); + std::tie(vit, ve) = boost::vertices(g); // Step 1: Sort S according to order induced by D1 std::vector S(vit, ve); @@ -205,7 +205,7 @@ protected: typename Graph_::edge_descriptor existing_e; bool existing; // check whether the edge already exists - boost::tie(existing_e, existing)=boost::edge(*it, *min, g); + std::tie(existing_e, existing)=boost::edge(*it, *min, g); if (!existing) boost::add_edge(*it, *min, g); } diff --git a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h index d2cb402e37a..ac3fcebb911 100644 --- a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h +++ b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h @@ -109,7 +109,7 @@ std::string gnuplot_edge_list (const Graph& g) ss << std::fixed; // Use fixed floating-point notation typename Graph::edge_iterator eit, ee; - for (boost::tie(eit, ee) = boost::edges(g); eit != ee; ++eit) { + for (std::tie(eit, ee) = boost::edges(g); eit != ee; ++eit) { typename Graph::vertex_descriptor src = boost::source(*eit, g); typename Graph::vertex_descriptor end = boost::target(*eit, g); ss << "set arrow from "; @@ -129,7 +129,7 @@ std::string gnuplot_vertex_list(const Graph& g) { ss << std::fixed; typename Graph::vertex_iterator vit, ve; - for (boost::tie(vit, ve) = boost::vertices(g); vit != ve; ++vit) { + for (std::tie(vit, ve) = boost::vertices(g); vit != ve; ++vit) { ss << to_double(g[*vit].x()) << " " << to_double(g[*vit].y()) << std::endl; } return ss.str(); diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index eac14144073..b2089fdc53c 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -963,7 +963,7 @@ convex_hull_3(InputIterator first, InputIterator beyond, } CGAL_assertion(num_vertices(P)>=3); typename boost::graph_traits::vertex_iterator b,e; - boost::tie(b,e) = vertices(P); + std::tie(b,e) = vertices(P); if (num_vertices(P) == 3){ typename boost::property_map::type vpmap = get(CGAL::vertex_point, P); typedef typename Traits::Triangle_3 Triangle_3; diff --git a/Convex_hull_3/include/CGAL/convexity_check_3.h b/Convex_hull_3/include/CGAL/convexity_check_3.h index cd18bf1d394..b895641d98c 100644 --- a/Convex_hull_3/include/CGAL/convexity_check_3.h +++ b/Convex_hull_3/include/CGAL/convexity_check_3.h @@ -83,7 +83,7 @@ bool is_strongly_convex_3(const Polyhedron& P, const Traits& traits) typename boost::property_map::const_type vpmap = get(CGAL::vertex_point, P); vertex_iterator v_it, v_it_e; - boost::tie(v_it, v_it_e) = vertices(P); + std::tie(v_it, v_it_e) = vertices(P); if (v_it == v_it_e) return false; @@ -97,7 +97,7 @@ bool is_strongly_convex_3(const Polyhedron& P, const Traits& traits) typename Traits::Coplanar_3 coplanar = traits.coplanar_3_object(); face_iterator f_it, f_it_e; - boost::tie(f_it, f_it_e) = faces(P); + std::tie(f_it, f_it_e) = faces(P); Point_3 p; Point_3 q; Point_3 r; diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index a39cfd90715..3863b149e4f 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -70,7 +70,7 @@ public: { unsigned int data = 0; typename boost::graph_traits::edge_iterator it, end; - for(boost::tie(it, end) = edges(p); it != end; ++it, ++data) + for(std::tie(it, end) = edges(p); it != end; ++it, ++data) (*map_)[*it] = data; } diff --git a/Hash_map/benchmark/Hash_map/hm.cpp b/Hash_map/benchmark/Hash_map/hm.cpp index 891ca23ef10..070b7c7cd4d 100644 --- a/Hash_map/benchmark/Hash_map/hm.cpp +++ b/Hash_map/benchmark/Hash_map/hm.cpp @@ -157,11 +157,11 @@ run(const G& g) #if 0 - std::cerr << "boost::tie(vb,ve) = vertices(g);\n"; + std::cerr << "std::tie(vb,ve) = vertices(g);\n"; t.reset(); t.start(); for(int i=0; i<100; i++){ typename boost::graph_traits::vertex_iterator vb, ve; - boost::tie(vb,ve) = vertices(g); + std::tie(vb,ve) = vertices(g); for(; vb != ve; ++vb) { vertex_descriptor vd = *vb; #ifdef NOHASH diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index a4510dd552c..16078898df6 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -297,7 +297,7 @@ private: } CGAL::Vertex_around_face_iterator vbegin, vend, vmiddle; for(face_descriptor f : faces(tm)) { - boost::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); + std::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); vertex_descriptor current = *(vbegin); vertex_descriptor neighbor_one = *(++vbegin); vertex_descriptor neighbor_two = *(++vbegin); @@ -350,7 +350,7 @@ private: Matrix indexD(dimension,1); CGAL::Vertex_around_face_iterator vbegin, vend, vmiddle; for(face_descriptor f : faces(tm)) { - boost::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); + std::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); vertex_descriptor current = *(vbegin); vertex_descriptor neighbor_one = *(++vbegin); vertex_descriptor neighbor_two = *(++vbegin); @@ -514,7 +514,7 @@ private: CGAL::Vertex_around_face_iterator vbegin, vend, vmiddle; for(face_descriptor f : faces(tm)) { - boost::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); + std::tie(vbegin, vend) = vertices_around_face(halfedge(f,tm),tm); vertex_descriptor current = *(vbegin); vertex_descriptor neighbor_one = *(++vbegin); vertex_descriptor neighbor_two = *(++vbegin); 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 77a399704ec..64a61c993ba 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 @@ -446,7 +446,7 @@ private: for(face_descriptor f : faces(m_intrinsic_tm)) { CGAL::Vertex_around_face_iterator vbegin, vend, vmiddle; - boost::tie(vbegin, vend) = vertices_around_face(halfedge(f,m_intrinsic_tm),m_intrinsic_tm); + std::tie(vbegin, vend) = vertices_around_face(halfedge(f,m_intrinsic_tm),m_intrinsic_tm); halfedge_descriptor hd = halfedge(f,m_intrinsic_tm); if(face(hd,m_intrinsic_tm) != f) { hd = opposite(hd,m_intrinsic_tm); diff --git a/Installation/cmake/modules/config/support/test_BOOST.cpp b/Installation/cmake/modules/config/support/test_BOOST.cpp index d70b9a1c59a..cd7842117b7 100644 --- a/Installation/cmake/modules/config/support/test_BOOST.cpp +++ b/Installation/cmake/modules/config/support/test_BOOST.cpp @@ -23,7 +23,7 @@ using boost::tuple; using boost::make_tuple; -using boost::tie; +using std::tie; using boost::get; int main() diff --git a/Lab/demo/Lab/Plugins/Classification/Cluster_classification.cpp b/Lab/demo/Lab/Plugins/Classification/Cluster_classification.cpp index 5b7e647e96c..689d2c5b318 100644 --- a/Lab/demo/Lab/Plugins/Classification/Cluster_classification.cpp +++ b/Lab/demo/Lab/Plugins/Classification/Cluster_classification.cpp @@ -46,9 +46,9 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po std::cerr << m_clusters.size() << " cluster(s) found" << std::endl; bool training_found = false; - boost::tie (m_training, training_found) = m_points->point_set()->add_property_map("training", -1); + std::tie (m_training, training_found) = m_points->point_set()->add_property_map("training", -1); bool classif_found = false; - boost::tie (m_classif, classif_found) = m_points->point_set()->add_property_map("label", -1); + std::tie (m_classif, classif_found) = m_points->point_set()->add_property_map("label", -1); training_found = !training_found; // add_property_map returns false if classif_found = !classif_found; // property was already there diff --git a/Lab/demo/Lab/Plugins/Classification/Point_set_item_classification.cpp b/Lab/demo/Lab/Plugins/Classification/Point_set_item_classification.cpp index 11ef26725a6..a5169477661 100644 --- a/Lab/demo/Lab/Plugins/Classification/Point_set_item_classification.cpp +++ b/Lab/demo/Lab/Plugins/Classification/Point_set_item_classification.cpp @@ -41,9 +41,9 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n backup_existing_colors_and_add_new(); bool training_found = false; - boost::tie (m_training, training_found) = m_points->point_set()->add_property_map("training", -1); + std::tie (m_training, training_found) = m_points->point_set()->add_property_map("training", -1); bool classif_found = false; - boost::tie (m_classif, classif_found) = m_points->point_set()->add_property_map("label", -1); + std::tie (m_classif, classif_found) = m_points->point_set()->add_property_map("label", -1); training_found = !training_found; // add_property_map returns false if classif_found = !classif_found; // property was already there diff --git a/Lab/demo/Lab/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_2/Mesh_2_plugin.cpp index e55c30779bb..515ad8a999c 100644 --- a/Lab/demo/Lab/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -124,7 +124,7 @@ void cdt2_to_face_graph(const CDT& cdt, TriangleMesh& tm, int constant_coordinat { typename Map::iterator it; bool insert_ok; - boost::tie(it,insert_ok) = + std::tie(it,insert_ok) = descriptors.insert(std::make_pair(fit->vertex(i),vertex_descriptor())); if (insert_ok){ const Kernel::Point_3& pt=fit->vertex(i)->point(); diff --git a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp index 1adc2ae81ea..b0a7ca79f35 100644 --- a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp @@ -897,7 +897,7 @@ private: { typename Map::iterator it; bool insert_ok; - boost::tie(it,insert_ok) = + std::tie(it,insert_ok) = descriptors.insert(std::make_pair(fit->vertex(i),vertex_descriptor())); if (insert_ok){ const EPICK::Point_2& pt=fit->vertex(i)->point(); 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 dbe630ad09f..85892713def 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 @@ -67,7 +67,7 @@ void compute(SMesh* sMesh, bool created = false; SMesh::Property_map> principal_curvatures_and_directions_map; - boost::tie(principal_curvatures_and_directions_map, created) = sMesh->add_property_map> + std::tie(principal_curvatures_and_directions_map, created) = sMesh->add_property_map> ("v:principal_curvatures_and_directions_map", { 0, 0, Vector(0,0,0), Vector(0,0,0) }); diff --git a/Lab/demo/Lab/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp index 7c333459555..884f0bb04f8 100644 --- a/Lab/demo/Lab/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp @@ -692,7 +692,7 @@ if(!contracted_item) item->mcs->poles(pole_points); vertex_iterator vb, ve; int id = 0; - for (boost::tie(vb, ve) = vertices(*pMesh); vb != ve; ++vb) + for (std::tie(vb, ve) = vertices(*pMesh); vb != ve; ++vb) { std::vector line; line.clear(); diff --git a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp index 12e6a6ead33..cbcd1ab4e50 100644 --- a/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Orient_soup_plugin.cpp @@ -116,7 +116,7 @@ void set_vcolors(SMesh* smesh, std::vector colors) SMesh::Property_map vcolors = smesh->property_map("v:color").value(); bool created; - boost::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::IO::Color(0,0,0)); + std::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_vertices()); int color_id = 0; for(vertex_descriptor vd : vertices(*smesh)) @@ -130,7 +130,7 @@ void set_fcolors(SMesh* smesh, std::vector colors) SMesh::Property_map fcolors = smesh->property_map("f:color").value(); bool created; - boost::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::IO::Color(0,0,0)); + std::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_faces()); int color_id = 0; for(face_descriptor fd : faces(*smesh)) diff --git a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp index eaf633c7cf5..dc239528d45 100644 --- a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp @@ -701,7 +701,7 @@ public Q_SLOTS: begin != selection_item->selected_edges.end(); ++begin) { fg_vertex_descriptor source = target(opposite(halfedge(*begin,*poly),*poly),*poly); - boost::tie(it_find, insert_OK) + std::tie(it_find, insert_OK) = p2vd.insert(std::make_pair(source, Edge_graph::vertex_descriptor())); if (insert_OK) { @@ -711,7 +711,7 @@ public Q_SLOTS: Edge_graph::vertex_descriptor src=it_find->second; fg_vertex_descriptor targ = target(halfedge(*begin,*poly),*poly); - boost::tie(it_find, insert_OK) + std::tie(it_find, insert_OK) = p2vd.insert(std::make_pair(targ, Edge_graph::vertex_descriptor())); if (insert_OK) { diff --git a/Lab/demo/Lab/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Lab/demo/Lab/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index 1baaa63af33..5a0c76720ea 100644 --- a/Lab/demo/Lab/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -277,7 +277,7 @@ private: Point_set::Property_map shape_id; if (dialog.add_property()) { bool added = false; - boost::tie(shape_id, added) = points->template add_property_map ("shape", -1); + std::tie(shape_id, added) = points->template add_property_map ("shape", -1); if (!added) { for (auto it = points->begin(); it != points->end(); ++ it) shape_id[*it] = -1; @@ -563,7 +563,7 @@ private: if (dialog.add_property()) { bool added = false; - boost::tie (shape_id, added) = points->template add_property_map ("shape", -1); + std::tie (shape_id, added) = points->template add_property_map ("shape", -1); if (!added) { for (Point_set::iterator it = points->begin(); it != points->end(); ++ it) diff --git a/Lab/demo/Lab/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp b/Lab/demo/Lab/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp index ea75b2286ca..95cff942339 100644 --- a/Lab/demo/Lab/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp @@ -223,10 +223,10 @@ private Q_SLOTS: bool d, r, g, b; new_item->point_set()->remove_colors(); //bind pmaps - boost::tie(distance_map , d) = new_item->point_set()->add_property_map("distance",0); - boost::tie(fred_map , r) = new_item->point_set()->add_property_map("red",0); - boost::tie(fgreen_map, g) = new_item->point_set()->add_property_map("green",0); - boost::tie(fblue_map , b) = new_item->point_set()->add_property_map("blue",0); + std::tie(distance_map , d) = new_item->point_set()->add_property_map("distance",0); + std::tie(fred_map , r) = new_item->point_set()->add_property_map("red",0); + std::tie(fgreen_map, g) = new_item->point_set()->add_property_map("green",0); + std::tie(fblue_map , b) = new_item->point_set()->add_property_map("blue",0); new_item->point_set()->check_colors(); Point_set* points = new_item->point_set(); diff --git a/Lab/demo/Lab/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp b/Lab/demo/Lab/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp index 90477043da7..5ed52540c41 100644 --- a/Lab/demo/Lab/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp +++ b/Lab/demo/Lab/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp @@ -562,7 +562,7 @@ bool Scene_polyhedron_shortest_path_item::deferred_load( std::vector listOfFaces; listOfFaces.reserve(CGAL::num_faces(*polyhedron())); face_iterator current, end; - for (boost::tie(current, end) = CGAL::faces(*polyhedron()); current != end; ++current) + for (std::tie(current, end) = CGAL::faces(*polyhedron()); current != end; ++current) { listOfFaces.push_back(*current); } diff --git a/Lab/demo/Lab/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Lab/demo/Lab/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index 786727bc145..9be866438e9 100644 --- a/Lab/demo/Lab/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Lab/demo/Lab/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -1572,7 +1572,7 @@ void Scene_edit_polyhedron_item_priv::read_roi(const char* file_name, Mesh* mesh std::vector all_vertices; all_vertices.reserve(num_vertices(fs.get_deform_mesh(mesh)->halfedge_graph())); mesh_vi vb, ve; - for(boost::tie(vb, ve) = vertices(fs.get_deform_mesh(mesh)->halfedge_graph()); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(fs.get_deform_mesh(mesh)->halfedge_graph()); vb != ve; ++vb) { all_vertices.push_back(*vb); } // read roi @@ -1731,7 +1731,7 @@ void Scene_edit_polyhedron_item::update_normals() { void Scene_edit_polyhedron_item::set_all_vertices_as_roi() { boost::graph_traits::vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(*surface_mesh()); vb != ve; ++vb) + for(std::tie(vb, ve) = vertices(*surface_mesh()); vb != ve; ++vb) { insert_roi_vertex(*vb, surface_mesh()); } diff --git a/Lab/demo/Lab/Scene_polyhedron_selection_item.h b/Lab/demo/Lab/Scene_polyhedron_selection_item.h index 7a2cc2f16bd..9467e26b782 100644 --- a/Lab/demo/Lab/Scene_polyhedron_selection_item.h +++ b/Lab/demo/Lab/Scene_polyhedron_selection_item.h @@ -415,7 +415,7 @@ public: fg_vertex_descriptor t = all_vertices[id2]; fg_halfedge_descriptor hd; bool exists; - boost::tie(hd,exists) = halfedge(s,t,*polyhedron()); + std::tie(hd,exists) = halfedge(s,t,*polyhedron()); if(! exists) { return false; } selected_edges.insert(edge(hd,*polyhedron())); } diff --git a/Lab/demo/Lab/include/Point_set_3.h b/Lab/demo/Lab/include/Point_set_3.h index fcfb3805c9e..5328cc65e8d 100644 --- a/Lab/demo/Lab/include/Point_set_3.h +++ b/Lab/demo/Lab/include/Point_set_3.h @@ -135,7 +135,7 @@ public: bool add_radius() { bool out = false; - boost::tie (m_radius, out) = this->template add_property_map ("radius", 0.); + std::tie (m_radius, out) = this->template add_property_map ("radius", 0.); return out; } double& radius (const Index& index) { return m_radius[index]; } @@ -409,20 +409,20 @@ public: { if (other.template has_property_map("red")) { - boost::tie (m_red, boost::tuples::ignore) + std::tie (m_red, boost::tuples::ignore) = this->template add_property_map("red", 0); - boost::tie (m_green, boost::tuples::ignore) + std::tie (m_green, boost::tuples::ignore) = this->template add_property_map("green", 0); - boost::tie (m_blue, boost::tuples::ignore) + std::tie (m_blue, boost::tuples::ignore) = this->template add_property_map("blue", 0); } else { - boost::tie (m_red, boost::tuples::ignore) + std::tie (m_red, boost::tuples::ignore) = this->template add_property_map("r", 0); - boost::tie (m_green, boost::tuples::ignore) + std::tie (m_green, boost::tuples::ignore) = this->template add_property_map("g", 0); - boost::tie (m_blue, boost::tuples::ignore) + std::tie (m_blue, boost::tuples::ignore) = this->template add_property_map("b", 0); } } diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/Graph_manipulations.h b/Mesh_3/include/CGAL/Mesh_3/internal/Graph_manipulations.h index 31218f7c60d..db92293abf4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/Graph_manipulations.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/Graph_manipulations.h @@ -100,7 +100,7 @@ struct Graph_manipulations edge_descriptor edge; bool b; // test if the edge is already here, using add_edge - boost::tie(edge, b) = add_edge(va, vb, g); + std::tie(edge, b) = add_edge(va, vb, g); remove_edge(edge, g); if(!b) { // The edge was already here. @@ -129,7 +129,7 @@ struct Graph_manipulations if(v1 != v2) { edge_descriptor edge; bool b; - boost::tie(edge, b) = add_edge(v1, v2, g); + std::tie(edge, b) = add_edge(v1, v2, g); return b; } else return false; diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/helpers.h b/Mesh_3/include/CGAL/Mesh_3/internal/helpers.h index f51af8cd0b3..8debd8dfdfc 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/helpers.h @@ -72,7 +72,7 @@ struct Angle_tester else { out_edge_iterator out_edge_it, out_edges_end; - boost::tie(out_edge_it, out_edges_end) = out_edges(v, g); + std::tie(out_edge_it, out_edges_end) = out_edges(v, g); vertex_descriptor v1 = target(*out_edge_it++, g); vertex_descriptor v2 = target(*out_edge_it++, g); diff --git a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h index 7b3dde34edc..67bcedd1a6b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h +++ b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h @@ -325,7 +325,7 @@ struct Angle_tester else { out_edge_iterator out_edge_it, out_edges_end; - boost::tie(out_edge_it, out_edges_end) = out_edges(v, g); + std::tie(out_edge_it, out_edges_end) = out_edges(v, g); vertex_descriptor v1 = target(*out_edge_it++, g); vertex_descriptor v2 = target(*out_edge_it++, g); diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 33420371bfc..eb9d4c93e51 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -393,7 +393,7 @@ private: const Curve_index& curve_index, const CGAL::Orientation orientation) const { Bare_point pa, pb; - boost::tie(pa, pb) = get_positions(va, vb, curve_index, orientation); + std::tie(pa, pb) = get_positions(va, vb, curve_index, orientation); return compute_distance(pa, pb); } @@ -965,8 +965,8 @@ get_positions(const Vertex_handle v1, { Bare_point p1, p2_check, p2, p3; - boost::tie(p1, p2) = get_positions(v1, v2, curve_index, orientation); - boost::tie(p2_check, p3) = get_positions(v2, v3, curve_index, orientation); + std::tie(p1, p2) = get_positions(v1, v2, curve_index, orientation); + std::tie(p2_check, p3) = get_positions(v2, v3, curve_index, orientation); CGAL_assertion(p2_check == p2); return boost::make_tuple(p1, p2, p3); @@ -1674,7 +1674,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, Vertex_handle nearest_vh; FT sq_d; - boost::tie(nearest_vh, sq_d) = tr.nearest_power_vertex_with_sq_distance(p, ch); + std::tie(nearest_vh, sq_d) = tr.nearest_power_vertex_with_sq_distance(p, ch); CGAL_assertion(nearest_vh != Vertex_handle()); CGAL_assertion(tr.point(nearest_vh) != cwp(tr.canonicalize_point(p))); @@ -1710,7 +1710,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, // Iterate ch = tr.locate(wp0, lt, li, lj, nearest_vh); - boost::tie(nearest_vh, sq_d) = tr.nearest_power_vertex_with_sq_distance(p, ch); + std::tie(nearest_vh, sq_d) = tr.nearest_power_vertex_with_sq_distance(p, ch); CGAL_assertion(nearest_vh != Vertex_handle()); } @@ -2000,7 +2000,7 @@ insert_balls(const Vertex_handle& vp, { // Get size of p & q Bare_point vpp, vqp; - boost::tie(vpp, vqp) = get_positions(vp, vq, curve_index, orientation); + std::tie(vpp, vqp) = get_positions(vp, vq, curve_index, orientation); const FT sp = get_radius(vp); const FT sq = get_radius(vq); @@ -2049,7 +2049,7 @@ insert_balls(const Vertex_handle& vp, CGAL_precondition(sp <= sq); Bare_point vpp, vqp; - boost::tie(vpp, vqp) = get_positions(vp, vq, curve_index, d_sign); + std::tie(vpp, vqp) = get_positions(vp, vq, curve_index, d_sign); #if ! defined(CGAL_NO_PRECONDITIONS) if(sp <= 0) @@ -2749,7 +2749,7 @@ is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, curve_index == domain_.curve_index(v2->index())); Bare_point v1p, v2p; - boost::tie(v1p, v2p) = get_positions(v1, v2, curve_index, orientation); + std::tie(v1p, v2p) = get_positions(v1, v2, curve_index, orientation); FT arc_length = domain_.curve_segment_length(v1p, v2p, @@ -2816,7 +2816,7 @@ orientation_of_walk(const Vertex_handle& start, #endif Bare_point start_p, next_p; - boost::tie(start_p, next_p) = get_positions_with_unknown_orientation(start, next, curve_index); + std::tie(start_p, next_p) = get_positions_with_unknown_orientation(start, next, curve_index); #if CGAL_MESH_3_PROTECTION_DEBUG & 4 std::cerr << "positions to determine orientation: " << start_p << " " << next_p << std::endl; #endif @@ -3091,7 +3091,7 @@ is_sizing_field_correct(const Vertex_handle& v1, FT s3 = get_radius(v3); Bare_point p1, p2, p3; - boost::tie(p1, p2, p3) = get_positions(v1, v2, v3, curve_index, orientation); + std::tie(p1, p2, p3) = get_positions(v1, v2, v3, curve_index, orientation); FT D = domain_.curve_segment_length(p1, p3, curve_index, orientation); FT d = domain_.curve_segment_length(p1, p2, curve_index, orientation); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 5848af0a527..516c3e7434d 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -4414,7 +4414,7 @@ test_next(const Periodic_3_triangulation_3& t1, queue.push_back(std::make_pair(c1,c2)); while(! queue.empty()) { - boost::tie(c1,c2) = queue.back(); + std::tie(c1,c2) = queue.back(); queue.pop_back(); // Precondition: c1, c2 have been registered as well as their 4 vertices. diff --git a/Point_set_3/examples/Point_set_3/point_set_property.cpp b/Point_set_3/examples/Point_set_3/point_set_property.cpp index 98a32e10fce..b34f01737d0 100644 --- a/Point_set_3/examples/Point_set_3/point_set_property.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_property.cpp @@ -40,11 +40,11 @@ int main (int, char**) bool success = false; Color_map color; - boost::tie (color, success) = point_set.add_property_map ("color", black); + std::tie (color, success) = point_set.add_property_map ("color", black); assert (success); FT_map intensity; - boost::tie (intensity, success) = point_set.add_property_map ("intensity", 0.); + std::tie (intensity, success) = point_set.add_property_map ("intensity", 0.); assert (success); point_set.reserve (10); // For memory optimization diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h b/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h index 6fcffaee3d0..aa2de169bf2 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h @@ -219,86 +219,86 @@ bool write_LAS(std::ostream& os, Ushort_map intensity; bool remove_intensity; - boost::tie(intensity, remove_intensity) + std::tie(intensity, remove_intensity) = point_set.template add_property_map("intensity", 0); Uchar_map return_number; bool remove_return_number; - boost::tie(return_number, remove_return_number) + std::tie(return_number, remove_return_number) = point_set.template add_property_map("return_number", 0); Uchar_map number_of_returns; bool remove_number_of_returns; - boost::tie(number_of_returns, remove_number_of_returns) + std::tie(number_of_returns, remove_number_of_returns) = point_set.template add_property_map("number_of_returns", 0); Uchar_map scan_direction_flag; bool remove_scan_direction_flag; - boost::tie(scan_direction_flag, remove_scan_direction_flag) + std::tie(scan_direction_flag, remove_scan_direction_flag) = point_set.template add_property_map("scan_direction_flag", 0); Uchar_map edge_of_flight_line; bool remove_edge_of_flight_line; - boost::tie(edge_of_flight_line, remove_edge_of_flight_line) + std::tie(edge_of_flight_line, remove_edge_of_flight_line) = point_set.template add_property_map("edge_of_flight_line", 0); Uchar_map classification; bool remove_classification; - boost::tie(classification, remove_classification) + std::tie(classification, remove_classification) = point_set.template add_property_map("classification", 0); Uchar_map synthetic_flag; bool remove_synthetic_flag; - boost::tie(synthetic_flag, remove_synthetic_flag) + std::tie(synthetic_flag, remove_synthetic_flag) = point_set.template add_property_map("synthetic_flag", 0); Uchar_map keypoint_flag; bool remove_keypoint_flag; - boost::tie(keypoint_flag, remove_keypoint_flag) + std::tie(keypoint_flag, remove_keypoint_flag) = point_set.template add_property_map("keypoint_flag", 0); Uchar_map withheld_flag; bool remove_withheld_flag; - boost::tie(withheld_flag, remove_withheld_flag) + std::tie(withheld_flag, remove_withheld_flag) = point_set.template add_property_map("withheld_flag", 0); Float_map scan_angle; bool remove_scan_angle; - boost::tie(scan_angle, remove_scan_angle) + std::tie(scan_angle, remove_scan_angle) = point_set.template add_property_map("scan_angle", 0.); Uchar_map user_data; bool remove_user_data; - boost::tie(user_data, remove_user_data) + std::tie(user_data, remove_user_data) = point_set.template add_property_map("user_data", 0); Ushort_map point_source_ID; bool remove_point_source_ID; - boost::tie(point_source_ID, remove_point_source_ID) + std::tie(point_source_ID, remove_point_source_ID) = point_set.template add_property_map("point_source_ID", 0); Uint_map deleted_flag; bool remove_deleted_flag; - boost::tie(deleted_flag, remove_deleted_flag) + std::tie(deleted_flag, remove_deleted_flag) = point_set.template add_property_map("deleted_flag", 0); Double_map gps_time; bool remove_gps_time; - boost::tie(gps_time, remove_gps_time) + std::tie(gps_time, remove_gps_time) = point_set.template add_property_map("gps_time", 0); Ushort_map R; bool remove_R; - boost::tie(R, remove_R) = point_set.template add_property_map("R", 0); + std::tie(R, remove_R) = point_set.template add_property_map("R", 0); Ushort_map G; bool remove_G; - boost::tie(G, remove_G) = point_set.template add_property_map("G", 0); + std::tie(G, remove_G) = point_set.template add_property_map("G", 0); Ushort_map B; bool remove_B; - boost::tie(B, remove_B) = point_set.template add_property_map("B", 0); + std::tie(B, remove_B) = point_set.template add_property_map("B", 0); Ushort_map I; bool remove_I; - boost::tie(I, remove_I) = point_set.template add_property_map("I", 0); + std::tie(I, remove_I) = point_set.template add_property_map("I", 0); if(remove_R) { diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h index f4658b4926b..0a46e477a49 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h @@ -57,7 +57,7 @@ private: PLY_property_to_point_set_property(Point_set& ps, const std::string& name) : m_name(name) { - boost::tie(m_map, boost::tuples::ignore) = ps.add_property_map(name, Type()); + std::tie(m_map, boost::tuples::ignore) = ps.add_property_map(name, Type()); m_pmap = ps.push_property_map(m_map); } diff --git a/Point_set_3/test/Point_set_3/point_set_test.cpp b/Point_set_3/test/Point_set_3/point_set_test.cpp index 086feabface..72563b63c54 100644 --- a/Point_set_3/test/Point_set_3/point_set_test.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test.cpp @@ -103,7 +103,7 @@ int main (int, char**) test (!(point_set.has_property_map ("color")), "point set shouldn't have colors."); Point_set::Property_map color_prop; bool garbage; - boost::tie (color_prop, garbage) = point_set.add_property_map ("color", Color()); + std::tie (color_prop, garbage) = point_set.add_property_map ("color", Color()); test (point_set.has_property_map ("color"), "point set should have colors."); for (Point_set::iterator it = point_set.begin(); it != point_set.end(); ++ it) diff --git a/Point_set_3/test/Point_set_3/point_set_test_join.cpp b/Point_set_3/test/Point_set_3/point_set_test_join.cpp index 986f1748cf1..bcd39c531bb 100644 --- a/Point_set_3/test/Point_set_3/point_set_test_join.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test_join.cpp @@ -72,7 +72,7 @@ int main (int, char**) Point_set::Property_map intensity; bool okay; - boost::tie (intensity, okay) = ps3.add_property_map("intensity", 0); + std::tie (intensity, okay) = ps3.add_property_map("intensity", 0); assert (okay); Point_set::iterator it = ps3.insert (Point (double(0), double(1), double(2)), diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index f9ce5352b26..5c5cd75063c 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -388,7 +388,7 @@ create_riemannian_graph( // Add edge typename boost::graph_traits::edge_descriptor e; bool inserted; - boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), + std::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(neighbor_index, riemannian_graph), riemannian_graph); CGAL_assertion(inserted); @@ -410,7 +410,7 @@ create_riemannian_graph( { typename boost::graph_traits::edge_descriptor e; bool inserted; - boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), + std::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(source_point_index, riemannian_graph), riemannian_graph); CGAL_assertion(inserted); diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h index fb0655be01c..6943afbdab3 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h @@ -185,7 +185,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); const Vector ab = vector(a, b); @@ -291,7 +291,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); #ifdef CGAL_SURFACE_MESHER_DEBUG_IMPLICIT_ORACLE @@ -353,7 +353,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); if( number_of_roots == 2 && root_2 > FT(0) ) @@ -392,7 +392,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); if( number_of_roots == 2 ) diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h index 7ebcbbe814e..0be13053ada 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h @@ -286,8 +286,8 @@ namespace CGAL { Cell_handle c1, c2; bool c1_is_inf, c2_is_inf; - boost::tie(value_at_p1, c1, c1_is_inf) = surface.function().special_func(p1); - boost::tie(value_at_p2, c2, c2_is_inf) = surface.function().special_func(p2); + std::tie(value_at_p1, c1, c1_is_inf) = surface.function().special_func(p1); + std::tie(value_at_p2, c2, c2_is_inf) = surface.function().special_func(p2); // If both extremities are in the same volume component, returns // no intersection. @@ -320,7 +320,7 @@ namespace CGAL { Cell_handle c_at_mid; FT value_at_mid; bool c_is_inf; - boost::tie(value_at_mid, c_at_mid, c_is_inf) = surface.function().special_func(mid); + std::tie(value_at_mid, c_at_mid, c_is_inf) = surface.function().special_func(mid); if ( squared_distance(p1, p2) < squared_distance_bound ) // If the two points are close, then we must decide diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_SM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_SM.cpp index ac8378781fe..e549dad832d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_SM.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_SM.cpp @@ -32,11 +32,11 @@ int main(int argc, char* argv[]) Mesh::Property_map mean_curvature_map, Gaussian_curvature_map; - boost::tie(mean_curvature_map, created) = + std::tie(mean_curvature_map, created) = smesh.add_property_map("v:mean_curvature_map", 0); assert(created); - boost::tie(Gaussian_curvature_map, created) = + std::tie(Gaussian_curvature_map, created) = smesh.add_property_map("v:Gaussian_curvature_map", 0); assert(created); @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) Mesh::Property_map> principal_curvatures_and_directions_map; - boost::tie(principal_curvatures_and_directions_map, created) = + std::tie(principal_curvatures_and_directions_map, created) = smesh.add_property_map> ("v:principal_curvatures_and_directions_map", { 0, 0, Epic_kernel::Vector_3(0,0,0), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h index 925303c6f32..60e20772372 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h @@ -2515,7 +2515,7 @@ public: typedef std::pair Hedge_pair; std::vector< Hedge_pair> hedges_to_link; typename CGAL::Halfedge_around_target_iterator hit, end; - boost::tie(hit,end) = halfedges_around_target(vd, tm1); + std::tie(hit,end) = halfedges_around_target(vd, tm1); for(; hit!=end; ++hit) { // look for a border halfedge incident to the non-manifold vertex that will not be diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h index 20e95e59610..38053bee8fe 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h @@ -67,7 +67,7 @@ void assign_tolerance_with_local_edge_length_bound(const HalfedgeRange& halfedge { const vertex_descriptor vd = target(hd, mesh); CGAL::Halfedge_around_target_iterator hit, hend; - boost::tie(hit, hend) = CGAL::halfedges_around_target(vd, mesh); + std::tie(hit, hend) = CGAL::halfedges_around_target(vd, mesh); CGAL_assertion(hit != hend); FT sq_length = gt.compute_squared_distance_3_object()(get(vpm, source(*hit, mesh)), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index c8653c0196d..7e804e6d094 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -1450,7 +1450,7 @@ void build_AABB_tree(const TriangleMesh& tm, >::value>* = 0) { typename boost::graph_traits::face_iterator ffirst, fbeyond; - boost::tie(ffirst, fbeyond) = faces(tm); + std::tie(ffirst, fbeyond) = faces(tm); outTree.rebuild(ffirst, fbeyond, tm, wrapped_vpm); outTree.build(); } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp index b2250c03641..e33c34e45cb 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp @@ -378,7 +378,7 @@ void test_predicates(const G& g, CGAL::Random& rnd) // --------------------------------------------------------------------------- int max = 1000, counter = 0; typename boost::graph_traits::halfedge_iterator hit, hend; - boost::tie(hit, hend) = halfedges(g); + std::tie(hit, hend) = halfedges(g); for(; hit!=hend; ++hit) { const halfedge_descriptor h = *hit; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp index 17228d4603f..716a5a81654 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp @@ -78,7 +78,7 @@ void test_needles_and_caps(const std::string fname) const FT eps = std::numeric_limits::epsilon(); face_iterator fit, fend; - boost::tie(fit, fend) = faces(mesh); + std::tie(fit, fend) = faces(mesh); // (0 0 0) -- (1 0 0) -- (1 1 0) (90° cap angle) face_descriptor f = *fit; diff --git a/Ridges_3/examples/Ridges_3/PolyhedralSurf_rings.h b/Ridges_3/examples/Ridges_3/PolyhedralSurf_rings.h index c3e5aefec98..72f9add2cb7 100644 --- a/Ridges_3/examples/Ridges_3/PolyhedralSurf_rings.h +++ b/Ridges_3/examples/Ridges_3/PolyhedralSurf_rings.h @@ -64,7 +64,7 @@ T_PolyhedralSurf_rings(const TPoly& P) { //init the ring_index_map Vertex_const_iterator itb, ite; - boost::tie(itb,ite) = vertices(P); + std::tie(itb,ite) = vertices(P); for(;itb!=ite;itb++) ring_index_map[*itb] = -1; } diff --git a/Ridges_3/include/CGAL/PolyhedralSurf_neighbors.h b/Ridges_3/include/CGAL/PolyhedralSurf_neighbors.h index 775fec7d89d..5d4c57f7b43 100644 --- a/Ridges_3/include/CGAL/PolyhedralSurf_neighbors.h +++ b/Ridges_3/include/CGAL/PolyhedralSurf_neighbors.h @@ -158,7 +158,7 @@ T_PolyhedralSurf_neighbors(const TriangleMesh& P) { //init the is_visited_map Vertex_const_iterator itb, ite; - boost::tie(itb,ite) = vertices(P); + std::tie(itb,ite) = vertices(P); for(;itb!=ite;itb++) is_visited_map[*itb] = false; } diff --git a/Ridges_3/include/CGAL/Ridges.h b/Ridges_3/include/CGAL/Ridges.h index d4052642864..c52aef7081b 100644 --- a/Ridges_3/include/CGAL/Ridges.h +++ b/Ridges_3/include/CGAL/Ridges.h @@ -336,7 +336,7 @@ Ridge_approximation(const TriangleMesh &p, { //init the is_visited_map and check that the mesh is a triangular one. face_iterator itb,ite; - boost::tie(itb,ite) = faces(P); + std::tie(itb,ite) = faces(P); for(;itb!=ite;itb++) { is_visited_map[*itb] = false; } @@ -411,10 +411,10 @@ compute_ridges(Ridge_interrogation_type r_type, OutputIterator ridge_lines_it, R //reinit the is_visited_map face_iterator itb,ite; - boost::tie(itb,ite) = faces(P); + std::tie(itb,ite) = faces(P); for(;itb!=ite;itb++) is_visited_map[*itb] = false; - boost::tie(itb,ite) = faces(P); + std::tie(itb,ite) = faces(P); for(;itb!=ite;itb++) { face_descriptor f = *itb; diff --git a/Ridges_3/include/CGAL/Umbilics.h b/Ridges_3/include/CGAL/Umbilics.h index f815b9c18ca..e56e0f000b8 100644 --- a/Ridges_3/include/CGAL/Umbilics.h +++ b/Ridges_3/include/CGAL/Umbilics.h @@ -184,7 +184,7 @@ compute(OutputIterator umbilics_it, FT size) //MAIN loop on P vertices Vertex_const_iterator itb, ite; - boost::tie(itb,ite) = vertices(P); + std::tie(itb,ite) = vertices(P); for (;itb != ite; itb++) { vertex_descriptor vh = *itb; umbilicEstimatorVertex = cgal_abs(get(k1,vh)-get(k2,vh)); diff --git a/Ridges_3/test/Ridges_3/PolyhedralSurf_rings.h b/Ridges_3/test/Ridges_3/PolyhedralSurf_rings.h index c3e5aefec98..72f9add2cb7 100644 --- a/Ridges_3/test/Ridges_3/PolyhedralSurf_rings.h +++ b/Ridges_3/test/Ridges_3/PolyhedralSurf_rings.h @@ -64,7 +64,7 @@ T_PolyhedralSurf_rings(const TPoly& P) { //init the ring_index_map Vertex_const_iterator itb, ite; - boost::tie(itb,ite) = vertices(P); + std::tie(itb,ite) = vertices(P); for(;itb!=ite;itb++) ring_index_map[*itb] = -1; } diff --git a/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h b/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h index 1c28472d34d..5331aaca8ab 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h @@ -21,7 +21,7 @@ namespace CGAL { \ingroup PkgSTLExtensionRef `CGAL::Iterator_range` encapsulates two iterators so they fulfill the `ForwardRange` concept. The class is essentially a clone of `boost::iterator_range`, - and it additionally is derived from `std::pair`, so that one can apply `boost::tie`. + and it additionally is derived from `std::pair`, so that one can apply `std::tie`. */ template class Iterator_range diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_sm.cpp b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_sm.cpp index a562362bfcf..398e35353b9 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_sm.cpp +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_sm.cpp @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) { // Also store the input points as vertex property Surface_mesh::Property_map original; bool created; - boost::tie(original, created) = mesh.add_property_map("v:original"); + std::tie(original, created) = mesh.add_property_map("v:original"); assert(created); int i = 0; diff --git a/Surface_mesh/examples/Surface_mesh/sm_circulators.cpp b/Surface_mesh/examples/Surface_mesh/sm_circulators.cpp index 05a166dc567..ca8593988b3 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_circulators.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_circulators.cpp @@ -42,7 +42,7 @@ int main() { std::cout << "vertices around face " << f << std::endl; CGAL::Vertex_around_face_iterator vbegin, vend; - for(boost::tie(vbegin, vend) = vertices_around_face(m.halfedge(f), m); + for(std::tie(vbegin, vend) = vertices_around_face(m.halfedge(f), m); vbegin != vend; ++vbegin){ std::cout << *vbegin << std::endl; diff --git a/Surface_mesh/examples/Surface_mesh/sm_iterators.cpp b/Surface_mesh/examples/Surface_mesh/sm_iterators.cpp index 6fe9d48402e..0e16a7f0b38 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_iterators.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_iterators.cpp @@ -44,8 +44,8 @@ int main() vb = std::begin(r); ve = std::end(r); - // or with boost::tie, as the CGAL range derives from std::pair - for(boost::tie(vb, ve) = m.vertices(); vb != ve; ++vb){ + // or with std::tie, as the CGAL range derives from std::pair + for(std::tie(vb, ve) = m.vertices(); vb != ve; ++vb){ // Print vertex index and vertex coordinates std::cout << *vb << " " << m.point(*vb) << std::endl; } diff --git a/Surface_mesh/examples/Surface_mesh/sm_join.cpp b/Surface_mesh/examples/Surface_mesh/sm_join.cpp index df0526992fe..d692035479a 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_join.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_join.cpp @@ -25,8 +25,8 @@ int main(int argc, char* argv[]) Mesh::Property_map name1, name2; bool created; sm1.add_property_map("v:weight",7812); - boost::tie(name1, created) = sm1.add_property_map("v:name","hello"); - boost::tie(name2, created) = sm2.add_property_map("v:name","world"); + std::tie(name1, created) = sm1.add_property_map("v:name","hello"); + std::tie(name2, created) = sm2.add_property_map("v:name","world"); sm1 += sm2; diff --git a/Surface_mesh/examples/Surface_mesh/sm_kruskal.cpp b/Surface_mesh/examples/Surface_mesh/sm_kruskal.cpp index 986b9e9d4e3..61f1f73745f 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_kruskal.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_kruskal.cpp @@ -34,7 +34,7 @@ void kruskal(const Mesh& sm) " point [ \n"; vertex_iterator vb,ve; - for(boost::tie(vb, ve) = vertices(sm); vb!=ve; ++vb){ + for(std::tie(vb, ve) = vertices(sm); vb!=ve; ++vb){ std::cout << " " << sm.point(*vb) << "\n"; } diff --git a/Surface_mesh/examples/Surface_mesh/sm_properties.cpp b/Surface_mesh/examples/Surface_mesh/sm_properties.cpp index 5fa15d74058..9d591e8019c 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_properties.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_properties.cpp @@ -26,7 +26,7 @@ int main() // give each vertex a name, the default is empty Mesh::Property_map name; bool created; - boost::tie(name, created) = m.add_property_map("v:name","m1"); + std::tie(name, created) = m.add_property_map("v:name","m1"); assert(created); // add some names to the vertices name[v0] = "hello"; @@ -36,7 +36,7 @@ int main() // You get an existing property, and created will be false Mesh::Property_map name; bool created; - boost::tie(name, created) = m.add_property_map("v:name", ""); + std::tie(name, created) = m.add_property_map("v:name", ""); assert(! created); } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index 83ca6a3b4b7..86a3b498b6f 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -598,7 +598,7 @@ public: /// \name Range Types /// /// Each range `R` in this section has a nested type `R::iterator`, - /// is convertible to `std::pair`, so that one can use `boost::tie()`, + /// is convertible to `std::pair`, so that one can use `std::tie()`, /// and can be used with `BOOST_FOREACH()`, as well as with the C++11 range based for-loop. ///@{ diff --git a/Surface_mesh/test/Surface_mesh/sm_circulator_test.cpp b/Surface_mesh/test/Surface_mesh/sm_circulator_test.cpp index 5e932869a44..999d54de50d 100644 --- a/Surface_mesh/test/Surface_mesh/sm_circulator_test.cpp +++ b/Surface_mesh/test/Surface_mesh/sm_circulator_test.cpp @@ -75,7 +75,7 @@ struct test_emptiness : public Surface_fixture m.remove_vertex(iv); assert(m.is_removed(iv)); Sm::Vertex_iterator vb, ve; - for(boost::tie(vb, ve) = m.vertices(); vb != ve; ++vb) { + for(std::tie(vb, ve) = m.vertices(); vb != ve; ++vb) { Sm::Vertex_around_target_range vr = m.vertices_around_target(m.halfedge(*vb)); assert(!is_empty_range(std::begin(vr), std::end(vr))); } diff --git a/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp b/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp index 16fb699982c..d4e47e53b98 100644 --- a/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp +++ b/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp @@ -28,19 +28,19 @@ void standard_iterators() Surface_fixture f; Sm::Vertex_iterator vb, ve; - boost::tie(vb, ve) = f.m.vertices(); + std::tie(vb, ve) = f.m.vertices(); test_iterator(vb, ve, 5); Sm::Halfedge_iterator hb, he; - boost::tie(hb, he) = f.m.halfedges(); + std::tie(hb, he) = f.m.halfedges(); test_iterator(hb, he, 14); Sm::Edge_iterator eb, ee; - boost::tie(eb, ee) = f.m.edges(); + std::tie(eb, ee) = f.m.edges(); test_iterator(eb, ee, 7); Sm::Face_iterator fb, fe; - boost::tie(fb, fe) = f.m.faces(); + std::tie(fb, fe) = f.m.faces(); test_iterator(fb, fe, 3); } @@ -97,7 +97,7 @@ void memory_reuse_test() Faces faces; Sm::Face_iterator fb, fe; - for(boost::tie(fb, fe) = f.m.faces(); fb != fe; ++fb) { + for(std::tie(fb, fe) = f.m.faces(); fb != fe; ++fb) { faces.push_back(VecFace()); Sm::Vertex_around_face_circulator vafb(f.m.halfedge(*fb), f.m), vafe(vafb); if(vafb) @@ -108,7 +108,7 @@ void memory_reuse_test() } Sm::Vertex_iterator vb, ve; - for(boost::tie(vb, ve) = f.m.vertices(); vb != ve; ++vb) { + for(std::tie(vb, ve) = f.m.vertices(); vb != ve; ++vb) { f.m.set_halfedge(*vb, Sm::Halfedge_index()); } @@ -223,10 +223,10 @@ void properties () { Sm::Property_map prop; bool created = false; - boost::tie(prop,created) = f.m.add_property_map("illuminatiproperty", 23); + std::tie(prop,created) = f.m.add_property_map("illuminatiproperty", 23); assert(created == true); - boost::tie(prop, created)= f.m.add_property_map("illuminatiproperty"); + std::tie(prop, created)= f.m.add_property_map("illuminatiproperty"); assert(created == false); } diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/deform_mesh_for_botsch08_format.cpp b/Surface_mesh_deformation/demo/Surface_mesh_deformation/deform_mesh_for_botsch08_format.cpp index 9f5036cc3c0..6b5c101ceb6 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/deform_mesh_for_botsch08_format.cpp +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/deform_mesh_for_botsch08_format.cpp @@ -41,7 +41,7 @@ int main(int argc,char** argv) // Definition of the region of interest (use the whole mesh) vertex_iterator vb,ve; - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); //the selection is set by a file input.open(argv[2]); diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example.cpp index 5f429231d84..ed83fd3fb13 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example.cpp @@ -33,7 +33,7 @@ int main() // Definition of the region of interest (use the whole mesh) vertex_iterator vb,ve; - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); deform_mesh.insert_roi_vertices(vb, ve); // Select two control vertices ... diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp index fe91ed58baf..4242008b653 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp @@ -29,7 +29,7 @@ int main(int argc, char** argv) // Definition of the region of interest (use the whole mesh) vertex_iterator vb,ve; - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); deform_mesh.insert_roi_vertices(vb, ve); // Select two control vertices ... diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_custom_polyhedron.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_custom_polyhedron.cpp index 74590db427b..d1927088526 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_custom_polyhedron.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_custom_polyhedron.cpp @@ -81,7 +81,7 @@ int main() Vertex_index_map vertex_index_map(internal_vertex_index_map); vertex_iterator vb, ve; std::size_t counter = 0; - for(boost::tie(vb, ve) = vertices(mesh); vb != ve; ++vb, ++counter) { + for(std::tie(vb, ve) = vertices(mesh); vb != ve; ++vb, ++counter) { put(vertex_index_map, *vb, counter); } @@ -89,14 +89,14 @@ int main() Hedge_index_map hedge_index_map(internal_hedge_index_map); counter = 0; halfedge_iterator eb, ee; - for(boost::tie(eb, ee) = halfedges(mesh); eb != ee; ++eb, ++counter) { + for(std::tie(eb, ee) = halfedges(mesh); eb != ee; ++eb, ++counter) { put(hedge_index_map, *eb, counter); } Surface_mesh_deformation deform_mesh(mesh, vertex_index_map, hedge_index_map); // Insert the whole mesh as region of interest - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); deform_mesh.insert_roi_vertices(vb, ve); // Insert two control vertices diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_with_OpenMesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_with_OpenMesh.cpp index 88ad5c127df..f0acef64d8e 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_with_OpenMesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_with_OpenMesh.cpp @@ -24,7 +24,7 @@ int main() // Definition of the region of interest (use the whole mesh) vertex_iterator vb,ve; - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); deform_mesh.insert_roi_vertices(vb, ve); // Select two control vertices ... diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_mesh_for_botsch08_format_sre_arap.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_mesh_for_botsch08_format_sre_arap.cpp index 112fdfb8467..afccc9903c7 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_mesh_for_botsch08_format_sre_arap.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_mesh_for_botsch08_format_sre_arap.cpp @@ -51,7 +51,7 @@ int main(int argc,char** argv) // Definition of the region of interest (use the whole mesh) vertex_iterator vb,ve; - boost::tie(vb, ve) = vertices(mesh); + std::tie(vb, ve) = vertices(mesh); //the selection is set by a file input.open(sel_name); diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp index 61740ac320f..2adbedc0235 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) // Select and insert the vertices of the region of interest vertex_iterator vb, ve; - boost::tie(vb,ve) = vertices(mesh); + std::tie(vb,ve) = vertices(mesh); std::vector roi = extract_k_ring(mesh, *std::next(vb, 47), 9); deform_mesh.insert_roi_vertices(roi.begin(), roi.end()); diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp index 79a82bc238b..08d82307bec 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp @@ -65,7 +65,7 @@ int main() // Select and insert the vertices of the region of interest vertex_iterator vb, ve; - boost::tie(vb,ve) = vertices(mesh); + std::tie(vb,ve) = vertices(mesh); std::vector roi = extract_k_ring(mesh, *std::next(vb, 47), 9); deform_mesh.insert_roi_vertices(roi.begin(), roi.end()); diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h b/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h index bdc14cee74e..508cd98f3a6 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/Surface_mesh_deformation_test_commons.h @@ -27,13 +27,13 @@ void init_indices(Polyhedron& poly) { vertex_iterator vb, ve; std::size_t counter = 0; - for(boost::tie(vb, ve) = vertices(poly); vb != ve; ++vb, ++counter) { + for(std::tie(vb, ve) = vertices(poly); vb != ve; ++vb, ++counter) { (*vb)->id() = counter; } counter = 0; halfedge_iterator heb, hee; - for(boost::tie(heb, hee) = halfedges(poly); heb != hee; ++heb, ++counter) { + for(std::tie(heb, hee) = halfedges(poly); heb != hee; ++heb, ++counter) { (*heb)->id() = counter; } } @@ -59,7 +59,7 @@ read_rois(DeformMesh& deform_mesh, std::vector vvertices; vvertices.reserve(num_vertices(polyhedron)); vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(polyhedron); vb != ve; ++vb) { + for(std::tie(vb, ve) = vertices(polyhedron); vb != ve; ++vb) { vvertices.push_back(*vb); } // load handles and roi from txt diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 151165423f9..6ca9c4c8fe3 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -121,7 +121,7 @@ Error_code read_cones(const TriangleMesh& tm, std::ifstream& in, VertexIndexMap // Since the cones are unique, we only need to loop all the vertices once TM_vertex_iterator vit, end; - boost::tie(vit, end) = vertices(tm); + std::tie(vit, end) = vertices(tm); for(; vit!=end; ++vit) { for(std::size_t i=0; i::max)(); - for(boost::tie(b,e) = halfedges_around_face(bhd, mesh); b!=e; ++b, ++id) { + for(std::tie(b,e) = halfedges_around_face(bhd, mesh); b!=e; ++b, ++id) { double d = CGAL::abs(offset[id] - value); if(d < min) { best = b; @@ -160,7 +160,7 @@ private: double total_len = compute_border_length(mesh, bhd); halfedge_around_face_iterator b, e; - boost::tie(b,e) = halfedges_around_face(bhd, mesh); + std::tie(b,e) = halfedges_around_face(bhd, mesh); for(halfedge_around_face_iterator it = b; it!= e; ++it) { vertex_descriptor vs = source(*it, mesh); vertex_descriptor vt = target(*it, mesh); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h index d9da2714623..6a8a74a4ebe 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h @@ -86,7 +86,7 @@ struct Index_map_filler { typename Map::iterator it; bool new_element; - boost::tie(it,new_element) = map->insert(std::make_pair(vd,1)); + std::tie(it,new_element) = map->insert(std::make_pair(vd,1)); if(new_element) { it->second = index++; } diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h index 7afb29eecf2..7ad3cec0a83 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Filters.h @@ -80,7 +80,7 @@ public: smoothed_values.reserve(num_faces(mesh)); face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { std::map neighbors; NeighborSelector()(mesh,*facet_it, window_size, @@ -126,7 +126,7 @@ public: } // put smoothed values back again to values pmap. std::vector::iterator smoothed_value_it = smoothed_values.begin(); - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it, ++smoothed_value_it) { put(values, *facet_it, *smoothed_value_it); @@ -162,7 +162,7 @@ public: std::vector smoothed_values; smoothed_values.reserve(num_faces(mesh)); face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { std::map neighbors; NeighborSelector()(mesh, *facet_it, window_size, @@ -188,7 +188,7 @@ public: } // put smoothed values back again to values pmap. std::vector::iterator smoothed_value_it = smoothed_values.begin(); - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { values[*facet_it] = *smoothed_value_it; } diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h index 5709694f491..e20738e9906 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h @@ -322,7 +322,7 @@ public: "A degenerate segment is constructed. Most probable reason is using CGAL_PI as cone_angle parameter and also picking center of disk as a sample."); } - boost::tie(is_intersected, intersection_is_acute, min_distance, closest_id) + std::tie(is_intersected, intersection_is_acute, min_distance, closest_id) = cast_and_return_minimum(segment, skip, accept_if_acute); } else { Ray ray(center, ray_direction); @@ -332,7 +332,7 @@ public: "A degenerate ray is constructed. Most probable reason is using CGAL_PI as cone_angle parameter and also picking center of disk as a sample."); } - boost::tie(is_intersected, intersection_is_acute, min_distance, closest_id) + std::tie(is_intersected, intersection_is_acute, min_distance, closest_id) = ray_casting(ray, skip, accept_if_acute); } diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Surface_mesh_segmentation.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Surface_mesh_segmentation.h index a2a2228f6f5..eb78e5ed48d 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Surface_mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/Surface_mesh_segmentation.h @@ -84,7 +84,7 @@ public: double min_sdf = (std::numeric_limits::max)(); // If there is any facet which has no sdf value, assign average sdf value of its neighbors face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { double sdf_value = get(sdf_values, *facet_it); CGAL_assertion(sdf_value == -1 || sdf_value >= 0); // validity check @@ -130,7 +130,7 @@ public: double min_sdf = (std::numeric_limits::max)(); double max_sdf = -min_sdf; face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { double sdf_value = get(sdf_values, *facet_it); max_sdf = (std::max)(sdf_value, max_sdf); @@ -147,7 +147,7 @@ public: std::pair linear_normalize_sdf_values(const Polyhedron& mesh, SDFPropertyMap sdf_values) { double min_sdf, max_sdf; - boost::tie(min_sdf, max_sdf) = min_max_value(mesh, sdf_values); + std::tie(min_sdf, max_sdf) = min_max_value(mesh, sdf_values); if(min_sdf == max_sdf) { CGAL_warning_msg(min_sdf == max_sdf, "Linear normalization is not applicable!"); @@ -156,7 +156,7 @@ public: const double max_min_dif = max_sdf - min_sdf; face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { put(sdf_values, *facet_it, (get(sdf_values, *facet_it) - min_sdf) / max_min_dif); } @@ -297,7 +297,7 @@ public: AlphaExpansionImplementationTag()); std::vector::iterator label_it = labels.begin(); face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it, ++label_it) { put(segment_pmap, *facet_it, *label_it); // fill with cluster-ids @@ -354,7 +354,7 @@ private: std::vector& normalized_sdf_values) { normalized_sdf_values.reserve(num_faces(mesh)); face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { double log_normalized = log(get(sdf_values, *facet_it) * CGAL_NORMALIZATION_ALPHA + 1) / log(CGAL_NORMALIZATION_ALPHA + 1); @@ -398,7 +398,7 @@ private: std::map facet_index_map; std::size_t facet_index = 0; face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it, ++facet_index) { facet_index_map[*facet_it] = facet_index; @@ -407,7 +407,7 @@ private: const double epsilon = 5e-6; // edges and their weights. pair stores facet-id pairs (see above) (may be using boost::tuple can be more suitable) edge_iterator edge_it, eend; - for(boost::tie(edge_it,eend) = edges(mesh); + for(std::tie(edge_it,eend) = edges(mesh); edge_it != eend; ++edge_it) { halfedge_descriptor hd = halfedge(*edge_it,mesh); halfedge_descriptor ohd = opposite(hd,mesh); @@ -461,7 +461,7 @@ private: std::size_t segment_id = number_of_clusters; std::vector > segments_with_average_sdf_values; face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { if(get(segments, *facet_it) < number_of_clusters) { // not visited by depth_first_traversal @@ -488,7 +488,7 @@ private: } // make one-pass on facets. First make segment-id zero based by subtracting number_of_clusters // . Then place its sorted index to pmap - for(boost::tie(facet_it,fend) = faces(mesh); + for(std::tie(facet_it,fend) = faces(mesh); facet_it != fend; ++facet_it) { std::size_t segment_id = get(segments, *facet_it) - number_of_clusters; put(segments, *facet_it, segment_id_to_sorted_id_map[segment_id]); diff --git a/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp b/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp index 412d7ed844f..811ab9345df 100644 --- a/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp +++ b/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp @@ -192,7 +192,7 @@ void run_benchmarks(CGAL::Random& rand, size_t numTrials, size_t numSources, siz outData.numFaces = num_faces(polyhedron); face_iterator startFace, endFace; - boost::tie(startFace, endFace) = faces(polyhedron); + std::tie(startFace, endFace) = faces(polyhedron); std::vector allFaces; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp index a3b7268b77d..fdf2afc0969 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp @@ -48,7 +48,7 @@ int main(int argc, char** argv) // into a file readable using CGAL Lab std::ofstream output("shortest_paths_with_id.polylines.txt"); vertex_iterator vit, vit_end; - for ( boost::tie(vit, vit_end) = vertices(tmesh); + for ( std::tie(vit, vit_end) = vertices(tmesh); vit != vit_end; ++vit) { std::vector points; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_OpenMesh.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_OpenMesh.cpp index 34b337d95f4..4192f5e70b8 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_OpenMesh.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_OpenMesh.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) // into a file readable using the CGAL Tmesh demo std::ofstream output("shortest_paths_OpenMesh.polylines.txt"); vertex_iterator vit, vit_end; - for ( boost::tie(vit, vit_end) = vertices(tmesh); + for ( std::tie(vit, vit_end) = vertices(tmesh); vit != vit_end; ++vit) { std::vector points; 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 a0a05111c91..eab88444695 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 @@ -39,7 +39,7 @@ int main(int argc, char** argv) // by copying the faces in a vector to get a direct access to faces std::size_t nb_faces=num_faces(tmesh); face_iterator fit, fit_end; - boost::tie(fit, fit_end) = faces(tmesh); + std::tie(fit, fit_end) = faces(tmesh); std::vector face_vector(fit, fit_end); // and creating a vector of Face_location objects const std::size_t nb_source_points = 30; @@ -59,7 +59,7 @@ int main(int argc, char** argv) // into a file readable using the CGAL Tmesh demo std::ofstream output("shortest_paths_multiple_sources.polylines.txt"); vertex_iterator vit, vit_end; - for ( boost::tie(vit, vit_end) = vertices(tmesh); + for ( std::tie(vit, vit_end) = vertices(tmesh); vit != vit_end; ++vit) { std::vector points; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp index 8b51ee23d2b..678183446cf 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) // into a file readable using CGAL Lab std::ofstream output("shortest_paths_no_id.polylines.txt"); vertex_iterator vit, vit_end; - for ( boost::tie(vit, vit_end) = vertices(tmesh); + for ( std::tie(vit, vit_end) = vertices(tmesh); vit != vit_end; ++vit) { std::vector points; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_with_id.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_with_id.cpp index 697146cc16b..ea434a51188 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_with_id.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_with_id.cpp @@ -48,7 +48,7 @@ int main(int argc, char** argv) // into a file readable using CGAL Lab std::ofstream output("shortest_paths_with_id.polylines.txt"); vertex_iterator vit, vit_end; - for ( boost::tie(vit, vit_end) = vertices(tmesh); + for ( std::tie(vit, vit_end) = vertices(tmesh); vit != vit_end; ++vit) { std::vector points; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp index 22b1869274a..e39457cf08f 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp @@ -50,7 +50,7 @@ void shortest_path_regular_tetrahedron() face_iterator startFace; face_iterator endFace; - boost::tie(startFace,endFace) = CGAL::faces(P); + std::tie(startFace,endFace) = CGAL::faces(P); face_descriptor firstFace = *startFace; @@ -66,7 +66,7 @@ void shortest_path_regular_tetrahedron() Kernel::FT halfSideLength = sideLength / Kernel::FT(2.0); Kernel::FT triangleHeight = CGAL::sqrt((sideLength*sideLength) - (halfSideLength*halfSideLength)); - for (boost::tie(currentVertex, endVertex) = CGAL::vertices(P); currentVertex != endVertex; ++currentVertex) + for (std::tie(currentVertex, endVertex) = CGAL::vertices(P); currentVertex != endVertex; ++currentVertex) { if ((*currentVertex)->point().y()==-1) { @@ -118,7 +118,7 @@ void test_simple_saddle_vertex_mesh() vertex_iterator startVertex; vertex_iterator endVertex; - boost::tie(startVertex, endVertex) = CGAL::vertices(P); + std::tie(startVertex, endVertex) = CGAL::vertices(P); vertex_iterator currentVertex = startVertex; @@ -368,7 +368,7 @@ void test_boundary_mesh() face_iterator startFace; face_iterator endFace; - boost::tie(startFace, endFace) = CGAL::faces(P); + std::tie(startFace, endFace) = CGAL::faces(P); vertex_iterator currentVertex; vertex_iterator endVertex; @@ -380,7 +380,7 @@ void test_boundary_mesh() Point_3 vertexLocations[10]; size_t currentVertexIndex = 0; - for (boost::tie(currentVertex, endVertex) = CGAL::vertices(P); currentVertex != endVertex; ++currentVertex) + for (std::tie(currentVertex, endVertex) = CGAL::vertices(P); currentVertex != endVertex; ++currentVertex) { vertexHandles[currentVertexIndex] = *currentVertex; vertexLocations[currentVertexIndex] = vpm[*currentVertex]; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp index 19bda236706..ceb07b5e178 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) std::vector vertices; - boost::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron); + std::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron); for (vertex_iterator it = verticesStart; it != verticesEnd; ++it) { @@ -85,7 +85,7 @@ int main(int argc, char* argv[]) std::vector faces; - boost::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); + std::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); for (face_iterator it = facesStart; it != facesEnd; ++it) { diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp index 26da5f2d915..608a79b29c6 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) Surface_mesh_shortest_path shortestPaths(polyhedron, traits); face_iterator facesBegin, facesEnd; - boost::tie(facesBegin, facesEnd) = faces(polyhedron); + std::tie(facesBegin, facesEnd) = faces(polyhedron); std::vector facesList; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp index 1774d928a24..b0070bd17d0 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) Surface_mesh_shortest_path shortestPaths(polyhedron, traits); face_iterator facesBegin, facesEnd; - boost::tie(facesBegin, facesEnd) = faces(polyhedron); + std::tie(facesBegin, facesEnd) = faces(polyhedron); std::vector facesList; @@ -112,7 +112,7 @@ int main(int argc, char* argv[]) } vertex_iterator startVertexIt, endVertexIt; - boost::tie(startVertexIt, endVertexIt) = vertices(polyhedron); + std::tie(startVertexIt, endVertexIt) = vertices(polyhedron); bool first = true; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp index 54e3c49e4dd..cc7ed1d29b8 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) std::vector faces; - boost::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); + std::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); for (face_iterator it = facesStart; it != facesEnd; ++it) { diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits_test.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits_test.cpp index 784be8d0abd..e02ac923237 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits_test.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits_test.cpp @@ -64,7 +64,7 @@ void test_simple_2D_barycentric_coordinatess() size_t outVertex0; CGAL::Surface_mesh_shortest_paths_3::Barycentric_coordinates_type b0Type; - boost::tie(b0Type, outVertex0) = classify_barycentric_coordinates(b0); + std::tie(b0Type, outVertex0) = classify_barycentric_coordinates(b0); CHECK_EQUAL(b0Type, CGAL::Surface_mesh_shortest_paths_3::BARYCENTRIC_COORDINATES_ON_VERTEX); CHECK_EQUAL(outVertex0, 0u); @@ -77,7 +77,7 @@ void test_simple_2D_barycentric_coordinatess() size_t outVertex1; CGAL::Surface_mesh_shortest_paths_3::Barycentric_coordinates_type b1Type; - boost::tie(b1Type, outVertex1) = classify_barycentric_coordinates(b1); + std::tie(b1Type, outVertex1) = classify_barycentric_coordinates(b1); CHECK_EQUAL(b1Type, CGAL::Surface_mesh_shortest_paths_3::BARYCENTRIC_COORDINATES_ON_VERTEX); CHECK_EQUAL(outVertex1, 1u); @@ -90,7 +90,7 @@ void test_simple_2D_barycentric_coordinatess() size_t outVertex2; CGAL::Surface_mesh_shortest_paths_3::Barycentric_coordinates_type b2Type; - boost::tie(b2Type, outVertex2) = classify_barycentric_coordinates(b2); + std::tie(b2Type, outVertex2) = classify_barycentric_coordinates(b2); CHECK_EQUAL(b2Type, CGAL::Surface_mesh_shortest_paths_3::BARYCENTRIC_COORDINATES_ON_VERTEX); CHECK_EQUAL(outVertex2, 2u); @@ -100,7 +100,7 @@ void test_simple_2D_barycentric_coordinatess() size_t dummyOut; CGAL::Surface_mesh_shortest_paths_3::Barycentric_coordinates_type bLocationType; - boost::tie(bLocationType, dummyOut) = classify_barycentric_coordinates(bLocation); + std::tie(bLocationType, dummyOut) = classify_barycentric_coordinates(bLocation); CHECK_EQUAL(bLocationType, CGAL::Surface_mesh_shortest_paths_3::BARYCENTRIC_COORDINATES_ON_BOUNDED_SIDE); @@ -282,7 +282,7 @@ void detect_is_saddle_vertex() vertex_iterator currentVertex; vertex_iterator endVertex; - for (boost::tie(currentVertex, endVertex) = vertices(P); currentVertex != endVertex; ++currentVertex) + for (std::tie(currentVertex, endVertex) = vertices(P); currentVertex != endVertex; ++currentVertex) { if (currentVertexIndex <= 3 || currentVertexIndex == 7) { diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp index aaf41537b8b..35d2c0cab86 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp @@ -168,7 +168,7 @@ struct TestMeshProgramInstance std::vector vertices; - boost::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron); + std::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron); for (vertex_iterator it = verticesStart; it != verticesEnd; ++it) { @@ -180,7 +180,7 @@ struct TestMeshProgramInstance std::vector faces; - boost::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); + std::tie(facesStart, facesEnd) = CGAL::faces(polyhedron); for (face_iterator it = facesStart; it != facesEnd; ++it) { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index 5c23e83e94f..d53b3458d15 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -754,7 +754,7 @@ is_collapse_topologically_valid(const Profile& profile) // The following loop checks the link condition for v0_v1. // Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh. // - for(boost::tie(eb1,ee1) = halfedges_around_source(profile.v0(), m_tm); res && eb1 != ee1; ++eb1) + for(std::tie(eb1,ee1) = halfedges_around_source(profile.v0(), m_tm); res && eb1 != ee1; ++eb1) { halfedge_descriptor v0_k = *eb1; @@ -762,7 +762,7 @@ is_collapse_topologically_valid(const Profile& profile) { vertex_descriptor k = target(v0_k, m_tm); - for(boost::tie(eb2,ee2) = halfedges_around_source(k, m_tm); res && eb2 != ee2; ++eb2) + for(std::tie(eb2,ee2) = halfedges_around_source(k, m_tm); res && eb2 != ee2; ++eb2) { halfedge_descriptor k_v1 = *eb2; diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index 00e6cf68501..45eba38aa7a 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -136,7 +136,7 @@ public: Profile::Triangle_vector triangles; out_edge_iterator eb, ee; - for(boost::tie(eb,ee) = halfedges_around_source(opposite(halfedge(mV,tm()),tm()),tm()); eb != ee; ++ eb) + for(std::tie(eb,ee) = halfedges_around_source(opposite(halfedge(mV,tm()),tm()),tm()); eb != ee; ++ eb) { halfedge_descriptor out_edge1 = *eb; halfedge_descriptor out_edge2 = out_edge1->opposite()->next(); diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 39b928852ea..b69e59d8e0c 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -344,7 +344,7 @@ double diagonal_length(const Bbox_3& bbox) double init_min_edge_length() { vertex_iterator vb, ve; - boost::tie(vb, ve) = vertices(m_tmesh); + std::tie(vb, ve) = vertices(m_tmesh); Vertex_to_point v_to_p(m_tmesh_point_pmap); Bbox_3 bbox = CGAL::bbox_3(boost::make_transform_iterator(vb, v_to_p), boost::make_transform_iterator(ve, v_to_p)); diff --git a/Surface_mesh_skeletonization/include/CGAL/Surface_mesh_skeletonization/internal/Curve_skeleton.h b/Surface_mesh_skeletonization/include/CGAL/Surface_mesh_skeletonization/internal/Curve_skeleton.h index f8a1f3eeb20..c1905924ba8 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Surface_mesh_skeletonization/internal/Curve_skeleton.h +++ b/Surface_mesh_skeletonization/include/CGAL/Surface_mesh_skeletonization/internal/Curve_skeleton.h @@ -177,7 +177,7 @@ public: bool exist; edge_desc edge; - boost::tie(edge, exist) = boost::edge(p1_vd, p2_vd, curve); + std::tie(edge, exist) = boost::edge(p1_vd, p2_vd, curve); if (!exist) { boost::add_edge(p1_vd, p2_vd, curve); @@ -353,7 +353,7 @@ private: // look for ei from p2's incident edges bool found; int ind; - boost::tie(found, ind) = find_edge(vertex_to_edge[p2], ei); + std::tie(found, ind) = find_edge(vertex_to_edge[p2], ei); if (!found) { continue; diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h index 2e8cf47f695..263b88cbc19 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h @@ -179,7 +179,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); const Vector ab = vector(a, b); @@ -285,7 +285,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); #ifdef CGAL_SURFACE_MESHER_DEBUG_IMPLICIT_ORACLE @@ -347,7 +347,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); if( number_of_roots == 2 && root_2 > FT(0) ) @@ -386,7 +386,7 @@ namespace CGAL { int number_of_roots; FT root_1, root_2; - boost::tie(number_of_roots, root_1, root_2) = + std::tie(number_of_roots, root_1, root_2) = intersection_line_sphere_lambda(sphere, a, b); if( number_of_roots == 2 ) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 91d01e3e042..09571f190f5 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -738,7 +738,7 @@ insert(const Point& a, Locate_type lt, Face_handle loc, int li) int i; if(this->is_edge(vp.first, vp.second, fh,i)){ fh->set_constraint(i,true); - boost::tie(fh,i) = mirror_edge(Edge(fh,i)); + std::tie(fh,i) = mirror_edge(Edge(fh,i)); fh->set_constraint(i,true); } } @@ -815,7 +815,7 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) internal::Indentation_level::Exit_guard exit_guard = CGAL::internal::cdt_2_indent_level.open_new_scope(); #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS while(! stack.empty()){ - boost::tie(vaa,vbb) = stack.top(); + std::tie(vaa,vbb) = stack.top(); stack.pop(); CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 10cdecc984f..0240f0c81b2 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -883,7 +883,7 @@ insert_subconstraint(Vertex_handle vaa, stack.push(std::make_pair(vaa,vbb)); while(! stack.empty()){ - boost::tie(vaa,vbb) = stack.top(); + std::tie(vaa,vbb) = stack.top(); stack.pop(); CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS From b31c2ddbe1c5d512e8e085d815877b487b70b76a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 24 Jan 2025 16:29:56 +0100 Subject: [PATCH 253/332] CDt_plus_2: lots of refactoring - encapsulate the creation/erasure of constraints in the hierarchy class - add encapsulation in the hierarchy class, to detect direct uses of members - add a test of `CDt_plus_2::insert_vertex_in_constraint`, and fix it - rename `concatenate` and `concatenate2` to - `concatenate` - `prepend` and force a rvalue reference on the argument corresponding to the constraint that will be swallowed - rename `split` to `split_tail` and `split2` to `split_head` - rename `fix_contexts` to give it a longer self-explaning name --- .../CGAL/Constrained_triangulation_plus_2.h | 109 ++++--- .../internal/CTP2_subconstraint_graph.h | 2 +- .../Polyline_constraint_hierarchy_2.h | 287 +++++++++--------- .../test/Triangulation_2/issue_4025.cpp | 28 +- 4 files changed, 239 insertions(+), 187 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 5562c90ec8a..47a72af4818 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -386,14 +386,14 @@ public: { if(pos == vertices_in_constraint_begin(cid)){ // cid is [P, A, ..., B] -> split to aux=[P, A] and cid=[A...B] - Constraint_id aux = hierarchy().split2(cid, std::next(pos)); + Constraint_id aux = hierarchy().split_head(cid, std::next(pos)); remove_constraint(aux, out); return vertices_in_constraint_begin(cid); } if(pos == std::prev(vertices_in_constraint_end(cid))){ // cid is [A, ..., B, P] -> split to cid=[A...B] and aux=[B,P] - Constraint_id aux = hierarchy().split(cid, std::prev(pos)); + Constraint_id aux = hierarchy().split_tail(cid, std::prev(pos)); remove_constraint(aux, out); return vertices_in_constraint_end(cid); } @@ -408,7 +408,7 @@ public: // head = [A...B] and, // cid = [B, P, C...D] // split off head - head = hierarchy().split2(cid, std::prev(pos)); + head = hierarchy().split_head(cid, std::prev(pos)); } if(pos != next_to_last_vertex_of_cid){ // cid is now [B, P, C, ..., D] @@ -416,7 +416,7 @@ public: // cid = [B, P, C] and, // tail = [C...D] // split off tail - tail = hierarchy().split(cid,std::next(pos)); + tail = hierarchy().split_tail(cid,std::next(pos)); } // now: @@ -430,25 +430,26 @@ public: Vertex_handle c = *std::next(pos); Face_container fc(*this); - Constraint_id aux = insert_constraint(b, c, std::back_inserter(fc)); + Constraint_id bc = insert_constraint(b, c, std::back_inserter(fc)); - auto pos_before_c = std::prev(vertices_in_constraint_end(aux), 2); - // `pos_before_c` is not necessarily == vertices_in_constraint_begin(aux) + auto pos_before_c = std::prev(vertices_in_constraint_end(bc), 2); + // `pos_before_c` is not necessarily == vertices_in_constraint_begin(bc) // there might have been intersecting constraints - hierarchy().swap(cid, aux); - remove_constraint(aux, std::back_inserter(fc)); // removes [B, P, C] + hierarchy().swap(cid, bc); + remove_constraint(bc, std::back_inserter(fc)); // removes [B, P, C] + // now cid is [B, C] if(head != nullptr){ - hierarchy().concatenate2(head, cid); + hierarchy().prepend(std::move(head), cid); } if(tail != nullptr){ - hierarchy().concatenate(cid, tail); + hierarchy().concatenate(cid, std::move(tail)); } fc.write_faces(out); - // we went one too far back because the last vertex `c` gets removed by concatenate + // we went one too far back because the last vertex `c` gets removed by concatenate/prepend return std::next(pos_before_c); } @@ -458,65 +459,77 @@ public: template Vertices_in_constraint_iterator insert_vertex_in_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos, - Vertex_handle vh, OutputIterator out) + Vertex_handle v, OutputIterator out) { // Insertion before the first vertex if(pos == vertices_in_constraint_begin(cid)){ //std::cout << "insertion before first vertex" << std::endl; - Constraint_id head = insert_constraint(vh, *pos, out); - hierarchy().concatenate2(head, cid); + Constraint_id head = insert_constraint(v, *pos, out); + hierarchy().prepend(std::move(head), cid); return vertices_in_constraint_begin(cid); } // Insertion after the last vertex if(pos == vertices_in_constraint_end(cid)){ //std::cout << "insertion after last vertex" << std::endl; - Constraint_id tail = insert_constraint(*std::prev(pos), vh, out); - auto returned_pos = std::prev(vertices_in_constraint_end(tail)); - hierarchy().concatenate(cid, tail); - return returned_pos; + Constraint_id tail = insert_constraint(*std::prev(pos), v, out); + auto new_pos = std::prev(vertices_in_constraint_end(tail)); + hierarchy().concatenate(cid, std::move(tail)); + CGAL_assertion(v == *new_pos); + return new_pos; } Vertices_in_constraint_iterator pred = std::prev(pos); - Vertices_in_constraint_iterator last = std::prev(vertices_in_constraint_end(cid)); + Vertices_in_constraint_iterator latest_vertex = std::prev(vertices_in_constraint_end(cid)); Vertex_handle a = *pred; Vertex_handle b = *pos; + if(v == a || v == b){ + return pos; + } - // cid is [..., A, B, ...] and M=*vh will be inserted between A and B + // cid is [..., A, B, ...] and V=*v will be inserted between A and B Face_container fc(*this); - Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc)); - Constraint_id aux2 = insert_constraint(vh, b, std::back_inserter(fc)); - auto returned_pos = vertices_in_constraint_begin(aux2); - concatenate(aux1, aux2); + Constraint_id a_v_b = insert_constraint(a, v, std::back_inserter(fc)); + Constraint_id aux = insert_constraint(v, b, std::back_inserter(fc)); + auto new_pos = vertices_in_constraint_begin(aux); + concatenate(a_v_b, std::move(aux)); + // here: - // aux1 is [A, M, B] - // aux2 is empty - // and returned_pos is the iterator to M + // a_v_b is [A,.. V,.. B] + // aux is empty + // and new_pos is the iterator to V + CGAL_assertion(v == *new_pos); + + CGAL_assertion(std::distance(vertices_in_constraint_begin(a_v_b), new_pos) > 0 && + std::distance(new_pos, vertices_in_constraint_end(a_v_b)) > 0); + // new_pos still points to something in a_v_b. In general a_v_b should only have three vertices, + // but there might have been intersectiong constraints or vertices. const auto second_vertex_of_cid = std::next(vertices_in_constraint_begin(cid)); // If the constraint consists only of a segment, and we want to insert // in the middle: cid is just the segment [A, B] - if((pos == second_vertex_of_cid) && (second_vertex_of_cid == last)){ + if((pos == second_vertex_of_cid) && (second_vertex_of_cid == latest_vertex)){ //std::cout << "insertion in constraint which is a segment" << std::endl; - hierarchy().swap(cid, aux1); - remove_constraint(aux1, std::back_inserter(fc)); + hierarchy().swap(cid, a_v_b); + remove_constraint(a_v_b, std::back_inserter(fc)); fc.write_faces(out); - return returned_pos; + return new_pos; } Constraint_id head = nullptr, tail = nullptr; if(pos != second_vertex_of_cid){ //std::cout << "split head" << std::endl; - head = split(cid, pred); - std::swap(head,cid); // split2 does the job + head = hierarchy().split_head(cid, pred); pred = vertices_in_constraint_begin(cid); pos = std::next(pred); } // head is now [..., A] or null // cid is now [A, B, ...] - if(pos != last){ + CGAL_assertion(*pred == a); + CGAL_assertion(*pos == b); + if(pos != latest_vertex){ //std::cout << "split tail" << std::endl; - tail = split(cid, pos); + tail = hierarchy().split_tail(cid, pos); } // head is now [..., A] or null // cid is now [A, B] @@ -524,20 +537,23 @@ public: if(head != nullptr){ //std::cout << "concatenate head" << std::endl; - remove_constraint(cid, std::back_inserter(fc)); - hierarchy().concatenate(head, aux1); + hierarchy().concatenate(head, std::move(a_v_b)); + hierarchy().swap(cid, head); + remove_constraint(head, std::back_inserter(fc)); } else { - hierarchy().swap(cid, aux1); - remove_constraint(aux1, std::back_inserter(fc)); - head = cid; + hierarchy().swap(cid, a_v_b); + remove_constraint(a_v_b, std::back_inserter(fc)); } + // cid is now [..., A, V, B] + // head is now null empty + // a_v_b is now empty if(tail != nullptr){ //std::cout << "concatenate tail" << std::endl; - concatenate(head, tail); + concatenate(cid, std::move(tail)); } fc.write_faces(out); - return pos; + return new_pos; } template < class InputIterator, class OutputIterator> @@ -659,7 +675,7 @@ public: id = id_next; is >> id_next; Constraint_id cid2 = insert_constraint(vertices[id], vertices[id_next]); - cid = concatenate(cid, cid2); + cid = concatenate(cid, std::move(cid2)); } } return is; @@ -758,7 +774,10 @@ public: // split a constraint in two constraints, so that vcit becomes the first // vertex of the new constraint // returns the new constraint - using Constraint_hierarchy::split; + Constraint_id + split(Constraint_id first, Vertices_in_constraint_iterator vcit) { + return hierarchy().split_tail(first, vcit); + } // Query of the constraint hierarchy diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h index e85eb22fa19..e1dbe61c614 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h @@ -86,7 +86,7 @@ public: if(current == Constraint_id()) current = cid; else - current = ctp2.concatenate(current, cid); + current = ctp2.concatenate(current, std::move(cid)); } latest_vertex = vh; } diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index fbf3cc83ee1..7b186736ff2 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -128,11 +128,11 @@ public: bool may_share_subconstraint_with_others = false; }; - struct Constraint_id + class Constraint_id { Vertex_list_with_info* vl_with_info_ptr = nullptr; size_type id = (std::numeric_limits::max)(); - + public: Constraint_id(std::nullptr_t = nullptr) {} Constraint_id(Vertex_list_with_info* ptr, size_type id) : vl_with_info_ptr(ptr), id(id) {} @@ -143,10 +143,15 @@ public: } } + auto index() const { return id; } + Vertex_list_ptr vl_ptr() const { return vl_with_info_ptr == nullptr ? nullptr : std::addressof(vl_with_info_ptr->vl); } + bool may_share() const { return vl_with_info_ptr->may_share_subconstraint_with_others; } + bool& may_share() { return vl_with_info_ptr->may_share_subconstraint_with_others; } + operator std::pair() const { Subconstraint subconstraint = vl_with_info_ptr == nullptr ? Subconstraint() @@ -160,8 +165,7 @@ public: } Constraint_id& operator=(std::nullptr_t) { - vl_with_info_ptr = nullptr; - id = (std::numeric_limits::max)(); + *this = Constraint_id{}; return *this; } bool operator==(std::nullptr_t n) const { return vl_with_info_ptr == n; } @@ -170,22 +174,22 @@ public: bool operator==(const Constraint_id& other) const { CGAL_assertion(same_hierarchy(other)); - CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (index() == other.index())); return vl_ptr() == other.vl_ptr(); } bool operator!=(const Constraint_id& other) const { CGAL_assertion(same_hierarchy(other)); - CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (index() == other.index())); return vl_ptr() != other.vl_ptr(); } bool operator<(const Constraint_id& other) const { CGAL_assertion(same_hierarchy(other)); - CGAL_assertion((vl_ptr() == other.vl_ptr()) == (id == other.id)); - return id < other.id; + CGAL_assertion((vl_ptr() == other.vl_ptr()) == (index() == other.index())); + return index() < other.index(); } // forward a new Vertex_list operations @@ -237,12 +241,18 @@ public: using Context_list = std::list; using Context_iterator = typename Context_list::iterator; - static void fix_contexts(Context_list& context_list) { - const bool multiple_contexts = context_list.size() > 1; - if(false == multiple_contexts) return; - for(auto& context : context_list) { - CGAL_assertion(context.enclosing != nullptr); - context.enclosing.vl_with_info_ptr->may_share_subconstraint_with_others = true; + static void fix_may_share_in_contexts_constraints(Context_list& context_list) { + const auto cl_size = context_list.size(); + switch(cl_size) { + case 0: + CGAL_unreachable(); + case 1: + return; + default: + for(auto& context : context_list) { + CGAL_assertion(context.enclosing != nullptr); + context.enclosing.may_share() = true; + } } } @@ -299,7 +309,7 @@ public: if(constraint_it == Constraint_iterator{}) { return false; } - if(constraint_it == hierarchy->constraints_set.end()) { + if(constraint_it == hierarchy->constraints_end()) { return vertex_it == Vertex_it{}; } if(vertex_it == Vertex_it{}) { @@ -309,17 +319,17 @@ public: } bool is_end() const { - return constraint_it == hierarchy->constraints_set.end(); + return constraint_it == hierarchy->constraints_end(); } bool is_begin() const { - return constraint_it == hierarchy->constraints_set.begin() && + return constraint_it == hierarchy->constraints_begin() && vertex_it == begin_or_null(constraint_it); } bool is_dereferenceable() const { return is_valid() && - constraint_it != hierarchy->constraints_set.end() && + constraint_it != hierarchy->constraints_end() && vertex_it != constraint_it->end() && std::next(vertex_it) != constraint_it->end(); } @@ -332,7 +342,7 @@ public: } Vertex_it begin_or_null(Constraint_iterator constraint_it) const { - if(constraint_it == hierarchy->constraints_set.end()) { + if(constraint_it == hierarchy->constraints_end()) { return Vertex_it(); } return constraint_it->begin(); @@ -342,7 +352,7 @@ public: if(is_end()) { return false; } - if(false == constraint_it->vl_with_info_ptr->may_share_subconstraint_with_others) { + if(false == constraint_it->may_share()) { return false; } auto [va, vb] = this->operator*(); @@ -392,8 +402,8 @@ public: explicit Subconstraint_iterator(typename Construction_access::Begin_tag, const Polyline_constraint_hierarchy_2* hierarchy) : hierarchy(non_null(hierarchy)) - , constraint_it(hierarchy->constraints_set.begin()) - , vertex_it(begin_or_null(hierarchy->constraints_set.begin())) + , constraint_it(hierarchy->constraints_begin()) + , vertex_it(begin_or_null(hierarchy->constraints_begin())) { if(already_seen()) { ++(*this); @@ -404,7 +414,7 @@ public: explicit Subconstraint_iterator(typename Construction_access::End_tag, const Polyline_constraint_hierarchy_2* hierarchy) : hierarchy(non_null(hierarchy)) - , constraint_it(hierarchy->constraints_set.end()) + , constraint_it(hierarchy->constraints_end()) , vertex_it() {} Subconstraint operator*() const { @@ -437,7 +447,7 @@ public: CGAL_precondition(is_valid() && false == is_begin()); do { - if(constraint_it == hierarchy->constraints_set.end() || vertex_it == constraint_it->begin()) { + if(constraint_it == hierarchy->constraints_end() || vertex_it == constraint_it->begin()) { --constraint_it; vertex_it = std::prev(constraint_it->end(), 2); } else { @@ -450,24 +460,29 @@ public: using Subconstraints = Iterator_range; private: - Compare comp; - Constraints_set constraints_set; - Sc_to_c_map sc_to_c_map; - -public: - Polyline_constraint_hierarchy_2(const Compare& comp) + struct Priv { // encapsulate the private members in a struct, to detect direct access to them + Priv(Compare comp) : comp(comp) -#if CGAL_USE_BARE_STD_MAP + #if CGAL_USE_BARE_STD_MAP , sc_to_c_map(Pair_compare(comp)) #else , sc_to_c_map() #endif - { } - Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch); + {} + + Compare comp; + Sc_to_c_map sc_to_c_map; + Constraints_set constraints_set; + } priv; +public: + Polyline_constraint_hierarchy_2(const Compare& comp) : priv(comp) {} + Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch) : priv(ch.priv.comp) {} Polyline_constraint_hierarchy_2(Polyline_constraint_hierarchy_2&&) = default; + ~Polyline_constraint_hierarchy_2(){ clear();} void clear(); - Polyline_constraint_hierarchy_2& operator=(const Polyline_constraint_hierarchy_2& ch); + + Polyline_constraint_hierarchy_2& operator=(const Polyline_constraint_hierarchy_2& ch) { return copy(ch); } Polyline_constraint_hierarchy_2& operator=(Polyline_constraint_hierarchy_2&& ch) = default; // Query @@ -496,8 +511,8 @@ public: Contexts contexts(T va, T vb) const; Context_list* get_context_list(T va, T vb) const; - size_type number_of_constraints() const { return constraints_set.size(); } - size_type number_of_subconstraints() const { return sc_to_c_map.size(); } + size_type number_of_constraints() const { return priv.constraints_set.size(); } + size_type number_of_subconstraints() const { return priv.sc_to_c_map.size(); } // insert/remove void add_Steiner(const T va, const T vb, const T vx); @@ -514,21 +529,21 @@ public: size_type remove_points_without_corresponding_vertex(Constraint_id); size_type remove_points_without_corresponding_vertex(); - Constraint_id concatenate(Constraint_id first, Constraint_id second); - Constraint_id concatenate2(Constraint_id first, Constraint_id second); - Constraint_id split(Constraint_id first, Vertex_it vcit); - Constraint_id split2(Constraint_id first, Vertex_it vcit); + Constraint_id concatenate(Constraint_id first, Constraint_id&& second); + Constraint_id prepend(Constraint_id&& first, Constraint_id second); + Constraint_id split_tail(Constraint_id first, Vertex_it vcit); + Constraint_id split_head(Constraint_id first, Vertex_it vcit); // iterators Subconstraint_and_contexts_iterator subconstraints_and_contexts_begin() const { - return sc_to_c_map.begin(); + return priv.sc_to_c_map.begin(); } Subconstraint_and_contexts_iterator subconstraints_and_contexts_end() const { - return sc_to_c_map.end(); + return priv.sc_to_c_map.end(); } Subconstraint_iterator subconstraints_begin() const { @@ -545,29 +560,43 @@ public: this); } - Constraint_iterator constraints_begin() const{ return constraints_set.begin(); } - Constraint_iterator constraints_end() const{ return constraints_set.end(); } + Constraint_iterator constraints_begin() const{ return priv.constraints_set.begin(); } + Constraint_iterator constraints_end() const{ return priv.constraints_set.end(); } // Ranges - const auto& constraints() const { return constraints_set; } - const auto& subconstraints_and_contexts() const { return sc_to_c_map; } + const auto& constraints() const { return priv.constraints_set; } + const auto& subconstraints_and_contexts() const { return priv.sc_to_c_map; } auto subconstraints() const { return Iterator_range(subconstraints_begin(), subconstraints_end()); } // Helper functions - void copy(const Polyline_constraint_hierarchy_2& ch); - void copy(const Polyline_constraint_hierarchy_2& ch, std::map& vmap); + Polyline_constraint_hierarchy_2& copy(const Polyline_constraint_hierarchy_2& ch); + Polyline_constraint_hierarchy_2& copy(const Polyline_constraint_hierarchy_2& ch, + std::map& vmap); void swap(Polyline_constraint_hierarchy_2& ch); private: // a few member functions to encapsulate more of the uses of `sc_to_c_map` - auto find_contexts(Vertex_handle va, Vertex_handle vb) { return sc_to_c_map.find(sorted_pair(va, vb)); } - auto find_contexts(Vertex_handle va, Vertex_handle vb) const { return sc_to_c_map.find(sorted_pair(va, vb)); } - auto contexts_not_found() { return sc_to_c_map.end(); } - auto contexts_not_found() const { return sc_to_c_map.end(); } - void erase_context(Sc_iterator it) { sc_to_c_map.erase(it); } - auto& contexts_of(Vertex_handle va, Vertex_handle vb) { return sc_to_c_map[sorted_pair(va, vb)]; } + auto find_contexts(Vertex_handle va, Vertex_handle vb) { return priv.sc_to_c_map.find(sorted_pair(va, vb)); } + auto find_contexts(Vertex_handle va, Vertex_handle vb) const { return priv.sc_to_c_map.find(sorted_pair(va, vb)); } + auto contexts_not_found() { return priv.sc_to_c_map.end(); } + auto contexts_not_found() const { return priv.sc_to_c_map.end(); } + void erase_context(Sc_iterator it) { priv.sc_to_c_map.erase(it); } + auto& contexts_of(Vertex_handle va, Vertex_handle vb) { return priv.sc_to_c_map[sorted_pair(va, vb)]; } + // + // then the uses of `constraints_set` + Constraint_id create_new_constraint() { + auto id{number_of_constraints() == 0 ? 0 : priv.constraints_set.rbegin()->index() + 1}; + Constraint_id cid{new Vertex_list_with_info{this}, id}; + priv.constraints_set.insert(cid); + return cid; + } + + void erase_constraint(Constraint_id cid) { + priv.constraints_set.erase(cid); + cid.destroy(); + } // // functions to traverse and act on the context lists @@ -620,13 +649,8 @@ private: // // other utilities as private member functions // - Constraint_id new_constraint_id() const { - // TODO: handle ids - auto id = number_of_constraints() == 0 ? 0 : constraints_set.rbegin()->id + 1; - return Constraint_id(new Vertex_list_with_info{this}, id); - } Subconstraint sorted_pair(T va, T vb) const { - return comp(va, vb) ? Subconstraint(va,vb) : Subconstraint(vb,va); + return priv.comp(va, vb) ? Subconstraint(va,vb) : Subconstraint(vb,va); } Subconstraint sorted_pair(Subconstraint sc) { const auto& [va, vb] = sc; return sorted_pair(va, vb); @@ -638,26 +662,8 @@ public: }; template -Polyline_constraint_hierarchy_2:: -Polyline_constraint_hierarchy_2(const Polyline_constraint_hierarchy_2& ch) - : comp(ch.comp) - , sc_to_c_map() -{ - copy(ch); -} - -template -Polyline_constraint_hierarchy_2& -Polyline_constraint_hierarchy_2:: -operator=(const Polyline_constraint_hierarchy_2& ch){ - copy(ch); - return *this; -} - -template -void -Polyline_constraint_hierarchy_2:: -copy(const Polyline_constraint_hierarchy_2& other) +auto Polyline_constraint_hierarchy_2:: +copy(const Polyline_constraint_hierarchy_2& other) -> Polyline_constraint_hierarchy_2& { // create a identity transfer vertex map std::map vmap; @@ -667,27 +673,25 @@ copy(const Polyline_constraint_hierarchy_2& other) vmap[v] = v; } } - copy(other, vmap); + return copy(other, vmap); } template -void -Polyline_constraint_hierarchy_2:: -copy(const Polyline_constraint_hierarchy_2& other, std::map& vmap) - // copy with a transfer vertex map +auto Polyline_constraint_hierarchy_2:: +copy(const Polyline_constraint_hierarchy_2& other, std::map& vmap) + -> Polyline_constraint_hierarchy_2& +// copy with a transfer vertex map { std::map cstr_map; clear(); // copy constraints_set for(const auto& cid1: other.constraints()) { - Constraint_id cid2 = new_constraint_id(); - constraints_set.insert(cid2); + Constraint_id cid2 = create_new_constraint(); cstr_map[cid1] = cid2; for(const auto& node : cid1.elements()) { cid2.vl_ptr()->push_back(Node(vmap[node.vertex()], node.input())); } - cid2.vl_with_info_ptr->may_share_subconstraint_with_others = - cid1.vl_with_info_ptr->may_share_subconstraint_with_others; + cid2.may_share() = cid1.may_share(); } // copy sc_to_c_map for(const auto& [sc1, hcl1] : other.subconstraints_and_contexts()) { @@ -704,20 +708,19 @@ copy(const Polyline_constraint_hierarchy_2& other, std::map void Polyline_constraint_hierarchy_2:: swap(Polyline_constraint_hierarchy_2& ch) { using std::swap; - swap(comp, ch.comp); - constraints_set.swap(ch.constraints_set); - sc_to_c_map.swap(ch.sc_to_c_map); + swap(priv.comp, ch.priv.comp); + priv.constraints_set.swap(ch.priv.constraints_set); + priv.sc_to_c_map.swap(ch.priv.sc_to_c_map); } @@ -799,16 +802,12 @@ swap(Constraint_id constr_a, Constraint_id constr_b) { }); }; - Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); - Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - substitute_enclosing_in_vertex_list(constr_a, constr_a, nullptr); substitute_enclosing_in_vertex_list(constr_b, constr_b, constr_a); substitute_enclosing_in_vertex_list(constr_a, nullptr, constr_b); - constr_a_vl->swap(*constr_b_vl); - std::swap(constr_a.vl_with_info_ptr->may_share_subconstraint_with_others, - constr_b.vl_with_info_ptr->may_share_subconstraint_with_others); + constr_a.vl_ptr()->swap(*constr_b.vl_ptr()); + std::swap(constr_a.may_share(), constr_b.may_share()); } template @@ -816,8 +815,6 @@ void Polyline_constraint_hierarchy_2:: remove_constraint(Constraint_id cid) { - constraints_set.erase(cid); - for_context_lists_of_all_subconstraints(cid, [&](Context_list* hcl, Vertex_it, Sc_it scit) { remove_first_in_context_list(hcl, cid); @@ -830,7 +827,8 @@ remove_constraint(Constraint_id cid) delete hcl; } }); - cid.destroy(); + + erase_constraint(cid); } @@ -919,7 +917,7 @@ typename Polyline_constraint_hierarchy_2::size_type Polyline_constraint_hierarchy_2::remove_points_without_corresponding_vertex() { size_type n = 0; - for(const auto& cid : constraints_set){ + for(const auto& cid : constraints()){ n+= remove_points_without_corresponding_vertex(cid); } return n; @@ -928,8 +926,13 @@ Polyline_constraint_hierarchy_2::remove_points_without_correspo template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::concatenate(Constraint_id constr_a, Constraint_id constr_b) +Polyline_constraint_hierarchy_2::concatenate(Constraint_id constr_a, Constraint_id&& constr_b) { + if(constr_a == nullptr) { + swap(constr_a, constr_b); + }; + if(constr_b == nullptr) return constr_a; + // constr_a is [A, ..., M] // constr_b is [M, ..., B] // we want: @@ -939,7 +942,6 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons // std::cerr << std::format("concatenate({}, {}) ", constr_a.id, constr_b.id) << std::endl; Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraints_set.erase(constr_b); for_context_lists_of_all_subconstraints(constr_b, [&](Context_list* hcl, Vertex_it, Sc_it) { replace_first_in_context_list(hcl, constr_b, constr_a); @@ -956,17 +958,22 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id cons update_first_context_position(hcl, constr_a, it); }); - if(constr_b.vl_with_info_ptr->may_share_subconstraint_with_others) { - constr_a.vl_with_info_ptr->may_share_subconstraint_with_others = true; + if(constr_b.may_share()) { + constr_a.may_share() = true; } - constr_b.destroy(); + erase_constraint(constr_b); return constr_a; } template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::concatenate2(Constraint_id constr_a, Constraint_id constr_b) +Polyline_constraint_hierarchy_2::prepend(Constraint_id&& constr_a, Constraint_id constr_b) { + if(constr_b == nullptr) { + swap(constr_a, constr_b); + }; + if(constr_a == nullptr) return constr_b; + // constr_a is [A, ..., M] // constr_b is [M, ..., B] // we want: @@ -975,7 +982,6 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con Vertex_list_ptr constr_a_vl = constr_a.vl_ptr(); Vertex_list_ptr constr_b_vl = constr_b.vl_ptr(); - constraints_set.erase(constr_a); // DIFF for_context_lists_of_all_subconstraints(constr_a, [&](Context_list* hcl, Vertex_it, Sc_it) { // DIFF replace_first_in_context_list(hcl, constr_a, constr_b); // DIFF @@ -987,16 +993,14 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con constr_a_vl->pop_back(); // because it is the same as constr_b_vl.front() constr_b_vl->splice(constr_b_vl->skip_begin(), *constr_a_vl, constr_a_vl->skip_begin(), constr_a_vl->skip_end()); // DIFF - // Note that for VC8 with iterator debugging the iterators pointing into constr_a - // are NOT valid So we have to update them for_context_lists_of_all_subconstraints(constr_b /*DIFF*/, [&](Context_list* hcl, Vertex_it it, Sc_it) { update_first_context_position(hcl, constr_b, it); // DIFF }); - if(constr_a.vl_with_info_ptr->may_share_subconstraint_with_others) { - constr_b.vl_with_info_ptr->may_share_subconstraint_with_others = true; + if(constr_a.may_share()) { + constr_b.may_share() = true; } - constr_a.destroy(); // DIFF + erase_constraint(constr_a); // DIFF return constr_b; // DIFF } @@ -1006,12 +1010,11 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id con // returns the new constraint template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::split(Constraint_id constr, Vertex_it vcit) +Polyline_constraint_hierarchy_2::split_tail(Constraint_id constr, Vertex_it vcit) { // constr is [A, ..., B], vcit points to M in [A, ..., B] - Constraint_id new_constr = new_constraint_id(); - constraints_set.insert(new_constr); + Constraint_id new_constr = create_new_constraint(); Vertex_list_ptr constr_vl = constr.vl_ptr(); Vertex_list_ptr new_vl = new_constr.vl_ptr(); @@ -1033,23 +1036,25 @@ Polyline_constraint_hierarchy_2::split(Constraint_id constr, Ve CGAL_assertion(new_vl->front().input() == true); CGAL_assertion(constr_vl->back().input() == true); + bool new_constr_share = false; for_context_lists_of_all_subconstraints(new_constr, [&](Context_list* hcl, Vertex_it, Sc_it) { + if(constr.may_share() && hcl->size() > 1) { + new_constr_share = true; + } replace_first_in_context_list(hcl, constr, new_constr); }); - new_constr.vl_with_info_ptr->may_share_subconstraint_with_others = - constr.vl_with_info_ptr->may_share_subconstraint_with_others; + new_constr.may_share() = new_constr_share; return new_constr; } template typename Polyline_constraint_hierarchy_2::Constraint_id -Polyline_constraint_hierarchy_2::split2(Constraint_id constr, Vertex_it vcit) +Polyline_constraint_hierarchy_2::split_head(Constraint_id constr, Vertex_it vcit) { // constr is [A, ..., B], vcit points to M in [A, ..., B] - Constraint_id new_constr = new_constraint_id(); - constraints_set.insert(new_constr); + Constraint_id new_constr = create_new_constraint(); Vertex_list_ptr constr_vl = constr.vl_ptr(); Vertex_list_ptr new_vl = new_constr.vl_ptr(); @@ -1071,12 +1076,15 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id constr, V CGAL_assertion(constr_vl->front().input() == true); CGAL_assertion(new_vl->back().input() == true); + bool new_constr_share = false; for_context_lists_of_all_subconstraints(new_constr, [&](Context_list* hcl, Vertex_it, Sc_it) { + if(constr.may_share() && hcl->size() > 1) { + new_constr_share = true; + } replace_first_in_context_list(hcl, constr, new_constr); }); - new_constr.vl_with_info_ptr->may_share_subconstraint_with_others = - constr.vl_with_info_ptr->may_share_subconstraint_with_others; + new_constr.may_share() = new_constr_share; return new_constr; } @@ -1095,8 +1103,7 @@ insert_constraint(T va, T vb){ << "C_hierachy.insert_constraint( " << IO::oformat(va) << ", " << IO::oformat(vb) << ")\n"; #endif // CGAL_DEBUG_POLYLINE_CONSTRAINT_HIERARCHY_2 - Constraint_id cid = new_constraint_id(); - constraints_set.insert(cid); + Constraint_id cid = create_new_constraint(); auto& context_list_ptr = contexts_of(va, vb); if(context_list_ptr == nullptr){ context_list_ptr = new Context_list; @@ -1106,7 +1113,7 @@ insert_constraint(T va, T vb){ children->push_front(Node(va, true)); children->push_back(Node(vb, true)); context_list_ptr->emplace_front(cid, cid.begin()); - fix_contexts(*context_list_ptr); + fix_may_share_in_contexts_constraints(*context_list_ptr); return cid; } @@ -1139,7 +1146,7 @@ append_constraint(Constraint_id cid, T va, T vb){ CGAL_assertion(pos_va->vertex() == va); cid.vl_ptr()->push_back(Node(vb, true)); context_list_ptr->emplace_front(cid, pos_va); - fix_contexts(*context_list_ptr); + fix_may_share_in_contexts_constraints(*context_list_ptr); } @@ -1153,12 +1160,12 @@ clear() cid.destroy(); } // clean and delete context lists - for(auto& [_, cl_ptr] : sc_to_c_map) { + for(auto& [_, cl_ptr] : priv.sc_to_c_map) { cl_ptr->clear(); delete cl_ptr; } - sc_to_c_map.clear(); - constraints_set.clear(); + priv.sc_to_c_map.clear(); + priv.constraints_set.clear(); } @@ -1241,8 +1248,8 @@ add_Steiner(const T va, const T vb, const T vc){ if (false == vc_vb_was_already_a_subconstraint) { contexts_of(vc,vb) = vc_vb_cl; } - fix_contexts(*va_vc_cl); - fix_contexts(*vc_vb_cl); + fix_may_share_in_contexts_constraints(*va_vc_cl); + fix_may_share_in_contexts_constraints(*vc_vb_cl); } @@ -1301,7 +1308,7 @@ print(std::ostream& os) const os << "# number of constraints: " << number_of_constraints() << std::endl; for(const auto& cid : constraints()) { - os << "constraint(" << cid.id << ") "; + os << "constraint(" << cid.index() << ") "; os << cid.vl_ptr(); os << "\n vertex list "; for(const auto& node : cid.elements()) { @@ -1311,13 +1318,13 @@ print(std::ostream& os) const for(const auto& node : cid.elements()) { os << node.point() << " "; } - if(cid.vl_with_info_ptr->may_share_subconstraint_with_others) { + if(cid.may_share()) { os << "\n (may have non-simple context lists)"; } os << std::endl; } os << std::endl; - os << "# number of subconstraints: " << sc_to_c_map.size() << std::endl; + os << "# number of subconstraints: " << number_of_subconstraints() << std::endl; for(const auto& subconstraint : subconstraints()) { os << "subconstraint ("; os << disp_vertex(subconstraint.first) << ", " @@ -1325,7 +1332,7 @@ print(std::ostream& os) const os << " enclosing: "; for(const auto& ctxt : contexts(subconstraint.first, subconstraint.second)) { - os << "(cid " << ctxt.id().id << ") " << ctxt.id().vl_ptr(); + os << "(cid " << ctxt.id().index() << ") " << ctxt.id().vl_ptr(); os << ", pos: " << std::distance(ctxt.vertices_begin(), ctxt.pos) << " "; } os << std::endl; diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp index 35768f975c6..784d4570860 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4025.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -68,12 +68,14 @@ int main() print_cdtp("Initial state"); Vertices_in_constraint_iterator vertex_it = std::next(cdtp.vertices_in_constraint_begin(collinear_cid), 2); + Vertex_handle v = *vertex_it; [[maybe_unused]] auto next_it = std::next(vertex_it); std::cout << "\n-> attempt to remove vertex " << oformat(*vertex_it) << std::endl; vertex_it = cdtp.remove_vertex_from_constraint(collinear_cid, vertex_it); std::cout << " cdtp.remove_vertex_from_constraint(collinear_cid, vertex_it) returned the vertex " << oformat(*vertex_it) << std::endl; assert(vertex_it == next_it); + assert(cdtp.tds().is_vertex(v)); // v (0, 2) is still in the triangulation print_cdtp("\nAfter removing third vertex from the collinear constraint"); @@ -89,12 +91,14 @@ int main() << value_check_expected(nb_of_vertices(cdtp, collinear_cid), 6U) << std::endl; vertex_it = std::next(cdtp.vertices_in_constraint_begin(non_collinear_cid), 2); + Vertex_handle v2 = *vertex_it; next_it = std::next(vertex_it); std::cout << "\n-> attempt to remove vertex " << oformat(*vertex_it) << std::endl; vertex_it = cdtp.remove_vertex_from_constraint(non_collinear_cid, vertex_it); std::cout << " cdtp.remove_vertex_from_constraint(non_collinear_cid, vertex_it) returned the vertex " << oformat(*vertex_it) << std::endl; assert(vertex_it == next_it); + assert(cdtp.tds().is_vertex(v2)); // v2 (4, 2) is still in the triangulation print_cdtp("\nAfter removing third vertex from the non-collinear constraint"); @@ -102,9 +106,31 @@ int main() << value_check_expected(cdtp.number_of_subconstraints(), 9U) << std::endl; std::cout << "number of constraints: " << value_check_expected(cdtp.number_of_constraints(), 2U) << std::endl; - std::cout << "number of vertex in collinear constraint: " + std::cout << "number of vertex in non-collinear constraint: " << value_check_expected(nb_of_vertices(cdtp, non_collinear_cid), 5U) << std::endl; + // re-insert v and v2 in the their constraints + vertex_it = cdtp.insert_vertex_in_constraint(collinear_cid, + std::next(cdtp.vertices_in_constraint_begin(collinear_cid), 2), + v); + assert(*vertex_it == v); + assert(std::distance(cdtp.vertices_in_constraint_begin(collinear_cid), vertex_it) == 2); + vertex_it = cdtp.insert_vertex_in_constraint(non_collinear_cid, + std::next(cdtp.vertices_in_constraint_begin(non_collinear_cid), 2), + v2); + assert(*vertex_it == v2); + assert(std::distance(cdtp.vertices_in_constraint_begin(non_collinear_cid), vertex_it) == 2); + + print_cdtp("\nAfter re-inserting the two vertices in their constraint"); + + std::cout << "number of subconstraints: " + << value_check_expected(cdtp.number_of_subconstraints(), 10U) << std::endl; + std::cout << "number of constraints: " + << value_check_expected(cdtp.number_of_constraints(), 2U) << std::endl; + std::cout << "number of vertex in collinear constraint: " + << value_check_expected(nb_of_vertices(cdtp, collinear_cid), 6U) << std::endl; + std::cout << "number of vertex in non-collinear constraint: " + << value_check_expected(nb_of_vertices(cdtp, non_collinear_cid), 6U) << std::endl; // NOW test another scenario, that has nothing to do with the issue #4025 cdtp.clear(); From e1e94a1304ca2b1afe98dd7ad1703643dc2b141c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 24 Jan 2025 18:14:29 +0100 Subject: [PATCH 254/332] fix a warning from UBSAN (in a postcondition) --- Number_types/include/CGAL/MP_Float.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/MP_Float.h b/Number_types/include/CGAL/MP_Float.h index f6811a0f116..f5790515241 100644 --- a/Number_types/include/CGAL/MP_Float.h +++ b/Number_types/include/CGAL/MP_Float.h @@ -167,7 +167,7 @@ public: low = static_cast(l & mask); //extract low bits from l high= static_cast((l - low) >> sizeof_limb); //extract high bits from l - CGAL_postcondition ( l == low + ( static_cast(high) << sizeof_limb ) ); + CGAL_postcondition ( l == low + ( high * (limb2(1) << sizeof_limb) ) ); } // Given a limb2, returns the higher limb. From 9fa067cb4d531d12a24d593a43c527425c9c50b2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 24 Jan 2025 19:36:57 +0100 Subject: [PATCH 255/332] recycle the constraints indices --- .../Polyline_constraint_hierarchy_2.h | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 7b186736ff2..40a59450325 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -470,9 +471,10 @@ private: #endif {} - Compare comp; - Sc_to_c_map sc_to_c_map; - Constraints_set constraints_set; + Compare comp; + Sc_to_c_map sc_to_c_map; + std::queue free_ids; + Constraints_set constraints_set; } priv; public: Polyline_constraint_hierarchy_2(const Compare& comp) : priv(comp) {} @@ -587,13 +589,20 @@ private: // // then the uses of `constraints_set` Constraint_id create_new_constraint() { - auto id{number_of_constraints() == 0 ? 0 : priv.constraints_set.rbegin()->index() + 1}; + size_type id; // uninitialized + if(priv.free_ids.empty()) { + id = priv.constraints_set.size(); + } else { + id = priv.free_ids.front(); + priv.free_ids.pop(); + } Constraint_id cid{new Vertex_list_with_info{this}, id}; priv.constraints_set.insert(cid); return cid; } void erase_constraint(Constraint_id cid) { + priv.free_ids.push(cid.index()); priv.constraints_set.erase(cid); cid.destroy(); } @@ -719,6 +728,7 @@ swap(Polyline_constraint_hierarchy_2& ch) { using std::swap; swap(priv.comp, ch.priv.comp); + priv.free_ids.swap(ch.priv.free_ids); priv.constraints_set.swap(ch.priv.constraints_set); priv.sc_to_c_map.swap(ch.priv.sc_to_c_map); } @@ -1164,8 +1174,7 @@ clear() cl_ptr->clear(); delete cl_ptr; } - priv.sc_to_c_map.clear(); - priv.constraints_set.clear(); + priv = Priv(priv.comp); } From 3d260ba6eb7a10619cb77443d493a38dd9a95706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 27 Jan 2025 10:18:42 +0100 Subject: [PATCH 256/332] typo --- BGL/test/BGL/test_OpenMesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/test/BGL/test_OpenMesh.cpp b/BGL/test/BGL/test_OpenMesh.cpp index e5c5206223d..e3ddcc9c2ca 100644 --- a/BGL/test/BGL/test_OpenMesh.cpp +++ b/BGL/test/BGL/test_OpenMesh.cpp @@ -22,7 +22,7 @@ int main() { CGAL_USE(ed); } - for (halfedge_descriptor hd : edges(om)) + for (halfedge_descriptor hd : halfedges(om)) { CGAL_USE(hd); } From 4737f581300e0356294ff64ef92b0bc32e6a9e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 27 Jan 2025 13:59:10 +0100 Subject: [PATCH 257/332] do not use tie when not needed --- .../Classification/Point_set_neighborhood.h | 5 ++--- Lab/demo/Lab/include/Point_set_3.h | 18 ++++++------------ Point_set_3/include/CGAL/Point_set_3/IO/PLY.h | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Classification/include/CGAL/Classification/Point_set_neighborhood.h b/Classification/include/CGAL/Classification/Point_set_neighborhood.h index e409641bf35..5a051426088 100644 --- a/Classification/include/CGAL/Classification/Point_set_neighborhood.h +++ b/Classification/include/CGAL/Classification/Point_set_neighborhood.h @@ -317,9 +317,8 @@ private: Point ref (std::floor(p.x() / voxel_size), std::floor(p.y() / voxel_size), std::floor(p.z() / voxel_size)); - typename std::map >::iterator it; - std::tie (it, boost::tuples::ignore) - = grid.insert (std::make_pair (ref, std::vector())); + typename std::map >::iterator it + = grid.insert (std::make_pair (ref, std::vector())).first; it->second.push_back (i); } diff --git a/Lab/demo/Lab/include/Point_set_3.h b/Lab/demo/Lab/include/Point_set_3.h index 5328cc65e8d..a0444c9b744 100644 --- a/Lab/demo/Lab/include/Point_set_3.h +++ b/Lab/demo/Lab/include/Point_set_3.h @@ -409,21 +409,15 @@ public: { if (other.template has_property_map("red")) { - std::tie (m_red, boost::tuples::ignore) - = this->template add_property_map("red", 0); - std::tie (m_green, boost::tuples::ignore) - = this->template add_property_map("green", 0); - std::tie (m_blue, boost::tuples::ignore) - = this->template add_property_map("blue", 0); + m_red = this->template add_property_map("red", 0).first; + m_green = this->template add_property_map("green", 0).first; + m_blue = this->template add_property_map("blue", 0).first; } else { - std::tie (m_red, boost::tuples::ignore) - = this->template add_property_map("r", 0); - std::tie (m_green, boost::tuples::ignore) - = this->template add_property_map("g", 0); - std::tie (m_blue, boost::tuples::ignore) - = this->template add_property_map("b", 0); + m_red = this->template add_property_map("r", 0).first; + m_green = this->template add_property_map("g", 0).first; + m_blue = this->template add_property_map("b", 0).first; } } diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h index 0a46e477a49..5cad538b3ea 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h @@ -57,7 +57,7 @@ private: PLY_property_to_point_set_property(Point_set& ps, const std::string& name) : m_name(name) { - std::tie(m_map, boost::tuples::ignore) = ps.add_property_map(name, Type()); + m_map = ps.add_property_map(name, Type()).first; m_pmap = ps.push_property_map(m_map); } From 1b9dca6e1f39b20b328b10ff5be2703892fae1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 27 Jan 2025 16:06:35 +0100 Subject: [PATCH 258/332] use std tuple --- .../internal/SDF_calculation.h | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h index e20738e9906..1baaa2b8c91 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/SDF_calculation.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #define CGAL_NUMBER_OF_MAD 1.5 @@ -90,11 +90,11 @@ private: typedef typename Tree::Primitive_id Primitive_id; // Sampled points from disk, t1 = coordinate-x, t2 = coordinate-y, t3 = weight. - typedef boost::tuple Disk_sample; + typedef std::tuple Disk_sample; typedef std::vector Disk_samples_list; // DiskSampling class responsible for the sampling points in a disk. It is used for generating rays in the cones. For different example see Disk_samplers.h - typedef Vogel_disk_sampling > + typedef Vogel_disk_sampling > Default_sampler; // member variables @@ -303,8 +303,8 @@ public: Primitive_id closest_id; Vector disk_vector = sum_functor( - scale_functor(v1, FT(disk_multiplier * sample_it->get<0>())), - scale_functor(v2, FT(disk_multiplier * sample_it->get<1>())) ); + scale_functor(v1, FT(disk_multiplier * std::get<0>(*sample_it))), + scale_functor(v2, FT(disk_multiplier * std::get<1>(*sample_it))) ); Vector ray_direction = sum_functor(scaled_normal, disk_vector); if(use_diagonal) { @@ -342,7 +342,7 @@ public: visitor(closest_id, min_distance); - ray_distances.push_back(std::make_pair(min_distance, sample_it->get<2>())); + ray_distances.push_back(std::make_pair(min_distance, std::get<2>(*sample_it))); } if(ray_distances.empty()) { @@ -407,9 +407,9 @@ private: * - get<3> Primitive_id : closest intersected primitive if get<0> is true, else Primitive_id() */ template - boost::tuple cast_and_return_minimum( + std::tuple cast_and_return_minimum( const Query& query, SkipPrimitiveFunctor skip, bool accept_if_acute) const { - boost::tuple + std::tuple min_distance(false, false, 0.0, Primitive_id()); typedef typename Tree:: template Intersection_and_primitive_id::Type Intersection_and_primitive_id; @@ -440,16 +440,16 @@ private: Vector i_ray(*i_point, query.source()); double new_distance = to_double( i_ray.squared_length() ); - if(!min_distance.template get<0>() - || new_distance < min_distance.template get<2>()) { - min_distance.template get<3>() = id; - min_distance.template get<2>() = new_distance; - min_distance.template get<0>() = true; + if(!std::get<0>(min_distance) + || new_distance < std::get<2>(min_distance)) { + std::get<3>(min_distance) = id; + std::get<2>(min_distance) = new_distance; + std::get<0>(min_distance) = true; min_id = id; min_i_ray = i_ray; } } - if(!min_distance.template get<0>()) { + if(!std::get<0>(min_distance)) { return min_distance; } @@ -467,32 +467,32 @@ private: } } - min_distance.template get<1>() = true; // founded intersection is acceptable. - min_distance.template get<2>() = std::sqrt(min_distance.template get<2>()); + std::get<1>(min_distance) = true; // founded intersection is acceptable. + std::get<2>(min_distance) = std::sqrt(std::get<2>(min_distance)); return min_distance; } // function similar to `cast_and_return_minimum()` but using the function // first_intersection with a Ray to get the closest intersected primitive template - boost::tuple ray_casting( + std::tuple ray_casting( const Ray& query, SkipFunctor s, bool accept_if_acute) const { const std::optional< typename Tree::template Intersection_and_primitive_id::Type > min_intersection = tree.first_intersection(query, s); if(!min_intersection) - return boost::make_tuple(false, false, 0.0, Primitive_id()); + return std::make_tuple(false, false, 0.0, Primitive_id()); const Point* i_point = std::get_if( &min_intersection->first ); if (!i_point) //segment case ignored - return boost::make_tuple(false, false, 0.0, Primitive_id()); + return std::make_tuple(false, false, 0.0, Primitive_id()); Vector min_i_ray(*i_point, query.source()); - boost::tuple + std::tuple min_distance(true, false, to_double(min_i_ray.squared_length()), min_intersection->second); - const Primitive_id& min_id = min_distance.template get<3>(); + const Primitive_id& min_id = std::get<3>(min_distance); if(accept_if_acute) { // check whether the ray makes acute angle with intersected facet @@ -508,8 +508,8 @@ private: } } - min_distance.template get<1>() = true; // founded intersection is acceptable. - min_distance.template get<2>() = std::sqrt(min_distance.template get<2>()); + std::get<1>(min_distance) = true; // founded intersection is acceptable. + std::get<2>(min_distance) = std::sqrt(std::get<2>(min_distance)); return min_distance; } From 17e3878a5ad705b8fd906131e28a6d15903c08b9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 28 Jan 2025 07:29:25 +0000 Subject: [PATCH 259/332] Explain union/intersetion rule better --- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 79e3f01096f..8cfe5ce7582 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -98,8 +98,13 @@ Input (left), non-zero (middle) even-odd (right). \section SectionPolygonRepair_UnionIntersection Union and Intersection Rule -Given several valid polygons this rule computes their union or intersection. -This approximates from outside and from inside, respectively. +Given several valid polygons these rules apply a %Boolean operation: +In the arrangement of two valid multipolygons with holes, the faces that are in any and both multipolygons +with holes are in the resulting multipolygon with holes for a union and intersection, respectively. + +While this %Boolean operation works for any two valid multipolygons, in the scope of repairing +it serves to obtain an approximation from outside and inside when applying union and intersection, respectively, +when the input is similar. \cgalFigureBegin{UnionIntersection, UnionIntersection.svg} Union (top) and Intersection (bottom). From 5a1f8cdb2167bb7591f5ff949782f6ab74b83c33 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 28 Jan 2025 09:44:35 +0100 Subject: [PATCH 260/332] small optimization --- .../constrained_hierarchy_plus.cpp | 2 +- .../internal/Polyline_constraint_hierarchy_2.h | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp index b67d5a5a507..d276b5a4d36 100644 --- a/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp +++ b/Triangulation_2/examples/Triangulation_2/constrained_hierarchy_plus.cpp @@ -23,7 +23,7 @@ int main( ) { Triangulation cdt; - std::cout << "Inserting a grid 5 x 5 of constraints " << std::endl; + std::cout << "Inserting a grid 5 x 5 of 10 intersecting constraints " << std::endl; for (int i = 1; i < 6; ++i) cdt.insert_constraint( Point(0,i), Point(6,i)); for (int j = 1; j < 6; ++j) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 40a59450325..a3f33ef6da4 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -1211,15 +1211,14 @@ add_Steiner(const T va, const T vb, const T vc){ Context_list* va_vb_cl = sc_iter_va_vb->second; erase_context(sc_iter_va_vb); - Context_list* va_vc_cl = get_context_list(va,vc); - Context_list* vc_vb_cl = get_context_list(vc,vb); + Context_list*& vc_vb_cl_ref = contexts_of(vc,vb); - bool vc_vb_was_already_a_subconstraint = vc_vb_cl != nullptr; - - if(vc_vb_cl == nullptr) { - vc_vb_cl = new Context_list; + if(vc_vb_cl_ref == nullptr) { + vc_vb_cl_ref = new Context_list; } + Context_list* vc_vb_cl = vc_vb_cl_ref; + for(Context& ctxt : *va_vb_cl) { Vertex_it pos = ctxt.current(); Vertex_it next_pos = std::next(pos); @@ -1246,17 +1245,14 @@ add_Steiner(const T va, const T vb, const T vc){ vc_vb_cl->push_back(vc_vb_ctxt); } + Context_list*& va_vc_cl = contexts_of(va,vc); if (va_vc_cl != nullptr) { // (va,vc) was already a subconstraint va_vc_cl->splice(va_vc_cl->end(), *va_vb_cl); delete va_vb_cl; } else { va_vc_cl = va_vb_cl; - contexts_of(va,vc) = va_vc_cl; } - if (false == vc_vb_was_already_a_subconstraint) { - contexts_of(vc,vb) = vc_vb_cl; - } fix_may_share_in_contexts_constraints(*va_vc_cl); fix_may_share_in_contexts_constraints(*vc_vb_cl); } From 7f88e5b0cf2d4e2be3d5334697d6ad03cd21c853 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 28 Jan 2025 14:01:58 +0100 Subject: [PATCH 261/332] fix compilation errors with MSVC 2017 (VC++ 19.16) --- .../include/CGAL/Constrained_triangulation_plus_2.h | 10 +++++++--- .../internal/Polyline_constraint_hierarchy_2.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 47a72af4818..5f159044b65 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -117,7 +117,7 @@ public: using Triangulation = Tr; using Intersection_tag = typename Tr::Intersection_tag; - // using-declaration of types or member functions from the two bases + // using-declarations of types or member functions from the two bases using Triangulation::vertices_begin; using Triangulation::vertices_end; using Triangulation::is_infinite; @@ -125,7 +125,11 @@ public: using typename Triangulation::Edge; using typename Triangulation::Vertex; +#if defined(BOOST_MSVC) && (BOOST_MSVC < 1920) + using Vertex_handle = typename Triangulation::Vertex_handle; // workaround for VC++ 19.16 (from MSVC 2017) +#else using typename Triangulation::Vertex_handle; +#endif using typename Triangulation::Face_handle; using typename Triangulation::Face_circulator; using typename Triangulation::Vertex_iterator; @@ -158,8 +162,8 @@ public: #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS - using Point = typename Geom_traits::Point_2; - using Segment = typename Geom_traits::Segment_2; + using Point = typename Triangulation::Geom_traits::Point_2; + using Segment = typename Triangulation::Geom_traits::Segment_2; // Tag to mark the presence of a hierarchy of constraints using Constraint_hierarchy_tag = Tag_true; diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index a3f33ef6da4..8b7c504797a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -1301,6 +1301,7 @@ print(std::ostream& os) const constexpr bool star_v_has_timestamp = internal::has_timestamp_v>; if constexpr(star_v_has_timestamp) { + CGAL_USE(vertex_num_map); return os << '#' << v->time_stamp(); } else { auto it = vertex_num_map.find(v); From b7019815720cd7a0e9b66fa56941fb545365b784 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 28 Jan 2025 15:27:48 +0100 Subject: [PATCH 262/332] fix another compilation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VC++ 19.16 thought there was an ambiguous call to `operator==` between `skip_iterator` and `skip_iterator` in the internals of `boost::iterator_adaptor` (yet another matching bug) of VC++ 19.16). I solved it by using the more modern `boost::stl_interfaces::iterator_interface` from Boost.STLintface (Boost>=1.74). --- .../Polyline_constraint_hierarchy_2.h | 99 +++++++++++++------ 1 file changed, 68 insertions(+), 31 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 8b7c504797a..e7321efe4ec 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -67,7 +67,7 @@ private: : vertex_(vh), point_(vertex_->point()), input_(input) {} const Point& point() const { return point_; } - Vertex_handle vertex() const { return vertex_; } + const Vertex_handle& vertex() const { return vertex_; } bool& input() { return input_; } const bool& input() const { return input_; } private: @@ -81,47 +81,82 @@ private: public: // the base line is always - class Point_it - : public boost::iterator_adaptor< - Point_it - , typename Vertex_list::all_iterator - , const Point& - > + class Point_it : public boost::stl_interfaces::iterator_interface< +#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Point_it, +#endif + std::bidirectional_iterator_tag, + const Point> { - public: - Point_it() : Point_it::iterator_adaptor_() {} - Point_it(typename Vertex_list::all_iterator it) : Point_it::iterator_adaptor_(it) {} +public: + using Base_it = typename Vertex_list::all_iterator; + using Self = Point_it; + + Base_it base() const { return it; } + Base_it& base_reference() { return it; } + const Base_it& base_reference() const { return it; } + + Point_it() = default; + Point_it(Base_it it) : it(it) {} + + const Point& operator*() const { return base()->point(); } private: - friend class boost::iterator_core_access; - const Point& dereference() const { return this->base()->point(); } + friend bool operator==(const Self& lhs, const Self& rhs) { + return lhs.base() == rhs.base(); + } + friend bool operator==(const Self& lhs, const Base_it& rhs) { + return lhs.base() == rhs; + } + friend bool operator==(const Base_it& lhs, const Self& rhs) { + return lhs == rhs.base(); + } + Base_it it; }; + BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Point_it, std::bidirectional_iterator); + BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Point_it, std::bidirectional_iterator_tag, + std::bidirectional_iterator, Point, const Point&, const Point*, std::ptrdiff_t); + // only nodes with a vertex_handle that is still in the triangulation - class Vertex_it - : public boost::iterator_adaptor< - Vertex_it - , typename Vertex_list::skip_iterator - , Vertex_handle - , std::bidirectional_iterator_tag - , Vertex_handle> + class Vertex_it : public boost::stl_interfaces::iterator_interface< + #if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Vertex_it, + #endif + std::bidirectional_iterator_tag, + const Vertex_handle> { - using Base_it = typename Vertex_list::skip_iterator; public: - Vertex_it() : Vertex_it::iterator_adaptor_() {} - Vertex_it(Base_it it) : Vertex_it::iterator_adaptor_(it) {} + using Base_it = typename Vertex_list::skip_iterator; + using Self = Vertex_it; + + Base_it base() const { return it; } + Base_it& base_reference() { return it; } + const Base_it& base_reference() const { return it; } + + Vertex_it() = default; + Vertex_it(Base_it it) : it(it) {} + + const Vertex_handle& operator*() const { return this->base()->vertex(); } + operator Point_it() const { return Point_it(this->base()); } + bool& input() { return this->base()->input(); } const bool& input() const { return this->base()->input(); } - - friend bool operator==(const Vertex_it& a, const Base_it& it) { return a.base() == it; } - friend bool operator==(const Base_it& it, const Vertex_it& a) { return a.base() == it; } - friend bool operator!=(const Vertex_it& a, const Base_it& it) { return a.base() != it; } - friend bool operator!=(const Base_it& it, const Vertex_it& a) { return a.base() != it; } - private: - friend class boost::iterator_core_access; - Vertex_handle dereference() const { return this->base()->vertex(); } + friend bool operator==(const Self& lhs, const Self& rhs) { + return lhs.base() == rhs.base(); + } + friend bool operator==(const Self& lhs, const Base_it& rhs) { + return lhs.base() == rhs; + } + friend bool operator==(const Base_it& lhs, const Self& rhs) { + return lhs == rhs.base(); + } + Base_it it; }; + BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Vertex_it, std::bidirectional_iterator); + BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Vertex_it, std::bidirectional_iterator_tag, + std::bidirectional_iterator, Vertex_handle, const Vertex_handle&, const Vertex_handle*, std::ptrdiff_t); struct Vertex_list_with_info { const Polyline_constraint_hierarchy_2* hierarchy_ptr = nullptr; @@ -708,7 +743,9 @@ copy(const Polyline_constraint_hierarchy_2& other, std::map Date: Tue, 28 Jan 2025 21:05:27 +0100 Subject: [PATCH 263/332] Fix types --- BGL/doc/BGL/BGL.txt | 2 +- BGL/doc/BGL/Concepts/FaceListGraph.h | 2 +- BGL/doc/BGL/Concepts/HalfedgeListGraph.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index cf7e8a73903..fc770bee398 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -88,7 +88,7 @@ boost::graph_traits::edge_iterator ei; Algorithms obtain incidence information in graphs with the help of global functions such as: - `std::pair vertices(const Graph& g);` to obtain an iterator range providing access to all the vertices, or -- `int num_vertices(const Graph&);` to obtain the number of vertices of a graph, or +- `size_type num_vertices(const Graph&);` to obtain the number of vertices of a graph, or - `vertex_descriptor source(edge_descriptor, const Graph&);` to obtain the source vertex of an edge. Note, that the way we have written the types is a simplification; in reality, diff --git a/BGL/doc/BGL/Concepts/FaceListGraph.h b/BGL/doc/BGL/Concepts/FaceListGraph.h index 6e7936f5ad9..b9075e2920f 100644 --- a/BGL/doc/BGL/Concepts/FaceListGraph.h +++ b/BGL/doc/BGL/Concepts/FaceListGraph.h @@ -38,6 +38,6 @@ faces(const FaceListGraph& g); This is the case for implementations only marking faces deleted in the face container. */ template -boost::graph_traits::face_size_type +boost::graph_traits::faces_size_type num_faces(const FaceListGraph& g); diff --git a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h index 1019f3c336b..4610c612bd4 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h @@ -38,6 +38,6 @@ halfedges(const HalfedgeListGraph& g); This is the case for implementations only marking halfedges deleted in the halfedge container. */ template -boost::graph_traits::halfedge_size_type +boost::graph_traits::halfedges_size_type num_halfedges(const HalfedgeListGraph& g); From 68e7bfa4aac6cd5236d68383e64490e8eb19ce1a Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 28 Jan 2025 21:07:58 +0100 Subject: [PATCH 264/332] Might as well use the real type --- BGL/doc/BGL/BGL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index fc770bee398..c256f4f30fa 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -88,7 +88,7 @@ boost::graph_traits::edge_iterator ei; Algorithms obtain incidence information in graphs with the help of global functions such as: - `std::pair vertices(const Graph& g);` to obtain an iterator range providing access to all the vertices, or -- `size_type num_vertices(const Graph&);` to obtain the number of vertices of a graph, or +- `vertices_size_type num_vertices(const Graph&);` to obtain the number of vertices of a graph, or - `vertex_descriptor source(edge_descriptor, const Graph&);` to obtain the source vertex of an edge. Note, that the way we have written the types is a simplification; in reality, From 96dbd55463536df8ba0208c25c5c7550ef248646 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 29 Jan 2025 14:27:43 +0100 Subject: [PATCH 265/332] extra fix for MSVC 2017 in Constrained_Delaunay_triangulation_2 --- .../include/CGAL/Constrained_Delaunay_triangulation_2.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index 9066bc8dae0..9570587f2ad 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -108,7 +108,11 @@ public: using typename Ctr::Intersection_tag; using typename Ctr::Constraint; + #if defined(BOOST_MSVC) && (BOOST_MSVC < 1920) + using Vertex_handle = typename Ctr::Vertex_handle; // workaround for VC++ 19.16 (from MSVC 2017) +#else using typename Ctr::Vertex_handle; +#endif using typename Ctr::Face_handle; using typename Ctr::Edge; using typename Ctr::Finite_faces_iterator; From c6d6d673afb378a2b09dae5955ead57a0f2e1876 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 29 Jan 2025 16:12:04 +0100 Subject: [PATCH 266/332] fix compilation error with gcc-12.2 --- .../Polyline_constraint_hierarchy_2.h | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index e7321efe4ec..0c43eaf0dc3 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -89,8 +89,14 @@ public: const Point> { public: - using Base_it = typename Vertex_list::all_iterator; using Self = Point_it; + using Base = boost::stl_interfaces::iterator_interface< +#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Point_it, +#endif + std::bidirectional_iterator_tag, + const Point>; + using Base_it = typename Vertex_list::all_iterator; Base_it base() const { return it; } Base_it& base_reference() { return it; } @@ -100,6 +106,13 @@ public: Point_it(Base_it it) : it(it) {} const Point& operator*() const { return base()->point(); } + + using Base::operator++; + Self& operator++() { ++it; return *this; } + + using Base::operator--; + Self& operator--() { --it; return *this; } + private: friend bool operator==(const Self& lhs, const Self& rhs) { return lhs.base() == rhs.base(); @@ -126,8 +139,14 @@ public: const Vertex_handle> { public: - using Base_it = typename Vertex_list::skip_iterator; using Self = Vertex_it; + using Base = boost::stl_interfaces::iterator_interface< +#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS + Vertex_it, +#endif + std::bidirectional_iterator_tag, + const Vertex_handle>; + using Base_it = typename Vertex_list::skip_iterator; Base_it base() const { return it; } Base_it& base_reference() { return it; } @@ -138,6 +157,12 @@ public: const Vertex_handle& operator*() const { return this->base()->vertex(); } + using Base::operator++; + Self& operator++() { ++it; return *this; } + + using Base::operator--; + Self& operator--() { --it; return *this; } + operator Point_it() const { return Point_it(this->base()); } bool& input() { return this->base()->input(); } From a45ac3eb694f5f8b4acdd270efb57f9ba54686c9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 29 Jan 2025 16:28:48 +0100 Subject: [PATCH 267/332] fix the detection of and std::format --- Installation/include/CGAL/config.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index a154b5caad8..a9e215f26e2 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -461,6 +461,11 @@ namespace CGAL { using cpp11::copy_n; } // end of the temporary compatibility with CGAL-4.14 #endif // CGAL_NO_DEPRECATED_CODE + +#if __has_include() +# include +#endif + namespace CGAL { // Typedef for the type of nullptr. @@ -501,7 +506,7 @@ namespace cpp11{ # define CGAL_FALLTHROUGH while(false){} #endif -#if __cpp_lib_format >= 201907L || (__has_include() && (__cplusplus >= 202000L || _MSVC_LANG >= 202000L)) +#if __cpp_lib_format >= 201907L # define CGAL_CAN_USE_CXX20_FORMAT 1 #endif From 571c2ccadc440672917313d8540016894ae7fa78 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 30 Jan 2025 17:38:05 +0100 Subject: [PATCH 268/332] fix compilation errors with C++>=20, or g++12.2.0 --- .../include/CGAL/Base_with_time_stamp.h | 8 +++++++ .../Constrained_Delaunay_triangulation_2.h | 2 +- .../Polyline_constraint_hierarchy_2.h | 22 ++++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/STL_Extension/include/CGAL/Base_with_time_stamp.h b/STL_Extension/include/CGAL/Base_with_time_stamp.h index 962eec8a1e1..b1be12db7ac 100644 --- a/STL_Extension/include/CGAL/Base_with_time_stamp.h +++ b/STL_Extension/include/CGAL/Base_with_time_stamp.h @@ -20,7 +20,15 @@ template class Base_with_time_stamp : public Base { std::size_t time_stamp_ = std::size_t(-2); public: +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1920) using Base::Base; +#else // workaround for MSVC 2017 + // VC++ 19.16 (from MSVC 2017) may mix up the constructor `Base::Base` + // with a possible member type `Base` from the base class. + // see a repro of the issue at https://compiler-explorer.com/z/d5hxv7Wze + using base_t = Base; + using base_t::base_t; +#endif using Has_timestamp = CGAL::Tag_true; diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index 9570587f2ad..8e9aa157817 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -108,7 +108,7 @@ public: using typename Ctr::Intersection_tag; using typename Ctr::Constraint; - #if defined(BOOST_MSVC) && (BOOST_MSVC < 1920) +#if defined(BOOST_MSVC) && (BOOST_MSVC < 1920) using Vertex_handle = typename Ctr::Vertex_handle; // workaround for VC++ 19.16 (from MSVC 2017) #else using typename Ctr::Vertex_handle; diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 0c43eaf0dc3..50786f05bce 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -107,11 +108,11 @@ public: const Point& operator*() const { return base()->point(); } - using Base::operator++; Self& operator++() { ++it; return *this; } + Self operator++(int i) { return static_cast(Base::operator++(i)); } - using Base::operator--; Self& operator--() { --it; return *this; } + Self operator--(int i) { return static_cast(Base::operator--(i)); } private: friend bool operator==(const Self& lhs, const Self& rhs) { @@ -127,8 +128,10 @@ public: }; BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Point_it, std::bidirectional_iterator); +#if BOOST_VERSION >= 108300 BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Point_it, std::bidirectional_iterator_tag, std::bidirectional_iterator, Point, const Point&, const Point*, std::ptrdiff_t); +#endif // only nodes with a vertex_handle that is still in the triangulation class Vertex_it : public boost::stl_interfaces::iterator_interface< @@ -149,19 +152,23 @@ public: using Base_it = typename Vertex_list::skip_iterator; Base_it base() const { return it; } + Base_it& base_reference() { return it; } const Base_it& base_reference() const { return it; } Vertex_it() = default; - Vertex_it(Base_it it) : it(it) {} + Vertex_it(Base_it it) : it(it) { + [[maybe_unused]] Vertex_it itt; + static_assert(std::is_same_v); + } const Vertex_handle& operator*() const { return this->base()->vertex(); } - using Base::operator++; Self& operator++() { ++it; return *this; } + Self operator++(int i) { return static_cast(Base::operator++(i)); } - using Base::operator--; Self& operator--() { --it; return *this; } + Self operator--(int i) { return static_cast(Base::operator--(i)); } operator Point_it() const { return Point_it(this->base()); } @@ -180,9 +187,10 @@ public: Base_it it; }; BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Vertex_it, std::bidirectional_iterator); +#if BOOST_VERSION >= 108300 BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(Vertex_it, std::bidirectional_iterator_tag, std::bidirectional_iterator, Vertex_handle, const Vertex_handle&, const Vertex_handle*, std::ptrdiff_t); - +#endif struct Vertex_list_with_info { const Polyline_constraint_hierarchy_2* hierarchy_ptr = nullptr; Vertex_list vl{}; @@ -610,9 +618,11 @@ public: Subconstraint_iterator subconstraints_begin() const { BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Subconstraint_iterator, std::bidirectional_iterator); +#if BOOST_VERSION >= 108300 BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS( Subconstraint_iterator, std::bidirectional_iterator_tag, std::bidirectional_iterator, Subconstraint, Subconstraint, typename Subconstraint_iterator::pointer, std::ptrdiff_t); +#endif return Subconstraint_iterator(Subconstraint_iterator::Construction_access::begin_tag(), this); } From d837dbde218d9c24727b65b8e533404651341954 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 30 Jan 2025 17:51:20 +0100 Subject: [PATCH 269/332] fix for STL debug mode It is invalid to try to detect if an iterator is singular or value-initialized. The only operations allowed with value-initialized iterators are: - copy the iterator, or - destroy or assign the iterator. Comparisons like `vertex_it == Vertex_it{}` are not allowed. --- .../Polyline_constraint_hierarchy_2.h | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 50786f05bce..aa7560acf4b 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -365,26 +365,11 @@ public: // - Otherwise all members must be valid pointers or dereferencable iterators. bool is_singular() const { - CGAL_assertion((hierarchy == nullptr) == (constraint_it == Constraint_iterator{})); - CGAL_assertion((hierarchy != nullptr) || (vertex_it == Vertex_it{})); return hierarchy == nullptr; } bool is_valid() const { - if(hierarchy == nullptr) { - CGAL_assertion(is_singular()); - return false; - } - if(constraint_it == Constraint_iterator{}) { - return false; - } - if(constraint_it == hierarchy->constraints_end()) { - return vertex_it == Vertex_it{}; - } - if(vertex_it == Vertex_it{}) { - return false; - } - return true; + return (hierarchy != nullptr); } bool is_end() const { @@ -406,8 +391,8 @@ public: bool equal(const Subconstraint_iterator& other) const { if(hierarchy != other.hierarchy) return false; if(is_singular()) return true; - return (constraint_it == other.constraint_it && - vertex_it == other.vertex_it); + + return (constraint_it == other.constraint_it) && (this->is_end() == other.is_end()); } Vertex_it begin_or_null(Constraint_iterator constraint_it) const { From f7a57a6c41a289e4905c29761304b8b38dbaf946 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 17 Jan 2025 10:16:08 +0000 Subject: [PATCH 270/332] Add smaller failing issue --- Nef_3/test/Nef_3/issue8644bis.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Nef_3/test/Nef_3/issue8644bis.cpp diff --git a/Nef_3/test/Nef_3/issue8644bis.cpp b/Nef_3/test/Nef_3/issue8644bis.cpp new file mode 100644 index 00000000000..f419094bfc6 --- /dev/null +++ b/Nef_3/test/Nef_3/issue8644bis.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +using Kernel = CGAL::Extended_cartesian; +using Nef = CGAL::Nef_polyhedron_3; + +int main(int argc, char ** argv) +{ + Nef hspace_1(Nef::Plane_3(1.0, 0.0, 0.0, 0.0), Nef::INCLUDED); + Nef hspace_2(Nef::Plane_3(1.0, 0.0, 0.0, 1.0), Nef::INCLUDED); + Nef hspace_3(Nef::Plane_3(0.0, 0.0, 1.0, 1.0), Nef::INCLUDED); + + Nef intersection_1 = hspace_1*hspace_2; // Line 14. Works fine. + Nef intersection_2 = hspace_2*hspace_3; // Line 15. Assertion failure. + + return 0; +} From f20af1a946ca9255963b965e54178b66f302df93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 30 Jan 2025 18:17:12 +0100 Subject: [PATCH 271/332] fix the value used creating the infimax box used for pairing halfedges without the abs the intersection line of x=-1 and z=-1 would be on the box leading to invalid behavior (and degenerate halfedges) --- Nef_3/include/CGAL/Nef_3/Infimaximal_box.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h b/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h index b1eb8d6b9ee..463b5f85f60 100644 --- a/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h +++ b/Nef_3/include/CGAL/Nef_3/Infimaximal_box.h @@ -402,9 +402,9 @@ class Infimaximal_box { typename SNC_structure::Vertex_const_iterator v; CGAL_forall_vertices(v, snc) { Point_3 p(v->point()); - if(p.hx()[0] > eval) eval = p.hx()[0]; - if(p.hy()[0] > eval) eval = p.hy()[0]; - if(p.hz()[0] > eval) eval = p.hz()[0]; + if(abs(p.hx()[0]) > eval) eval = abs(p.hx()[0]); + if(abs(p.hy()[0]) > eval) eval = abs(p.hy()[0]); + if(abs(p.hz()[0]) > eval) eval = abs(p.hz()[0]); } eval *= 4; if(eval == 0) return 1; From ca17f813b6102230ec6c4c73d4740e2a86349153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 30 Jan 2025 18:24:06 +0100 Subject: [PATCH 272/332] fix debug --- .../CGAL/Nef_2/Segment_overlay_traits.h | 1 + Nef_3/include/CGAL/Nef_3/K3_tree.h | 2 +- .../CGAL/Nef_3/SNC_external_structure.h | 22 ++++++++++++------- Nef_3/include/CGAL/Nef_3/SNC_intersection.h | 4 ++-- Nef_3/include/CGAL/Nef_3/SNC_point_locator.h | 4 ++-- Nef_3/test/Nef_3/issue8644bis.cpp | 8 +++---- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h index 1eecd047efd..639b4781d6e 100644 --- a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h +++ b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h @@ -627,6 +627,7 @@ public: out << "SweepStatus:\n"; typename SweepStatus::iterator sit3; for( sit3 = YS.begin(); *sit3 != &sh; ++sit3 ) { + if (*sit3==&sl) continue; int b = orientation(sit3, p_sweep); if(*sit3 == &sl) out << " 1"; else if(*sit3 == &sh) out <<"-1"; diff --git a/Nef_3/include/CGAL/Nef_3/K3_tree.h b/Nef_3/include/CGAL/Nef_3/K3_tree.h index 3bec191d7c2..15392c5d5b9 100644 --- a/Nef_3/include/CGAL/Nef_3/K3_tree.h +++ b/Nef_3/include/CGAL/Nef_3/K3_tree.h @@ -517,7 +517,7 @@ Node_handle build_kdtree(Vertex_list& V, Halfedge_list& E, Halffacet_list& F, int coord = depth%3; Point_3 point_on_plane = find_median_point(V, coord); - CGAL_NEF_TRACEN("build_kdtree: plane: "<second.sort(Halfedge_key_lt()); - CGAL_NEF_TRACEN("search opposite "<first); + CGAL_NEF_TRACEN("search opposite (M4) "<first); typename Halfedge_list::iterator itl; CGAL_forall_iterators(itl,it->second) { Halfedge_handle e1 = itl->e; @@ -482,7 +482,7 @@ public: Halfedge_handle e2 = itl->e; CGAL_NEF_TRACEN(" " << e1->source()->point() << " -> " << e2->source()->point()); - CGAL_NEF_TRACEN(e1->vector()<<" -> "<<-e2->vector()); + CGAL_NEF_TRACEN(" " << e1->vector()<<" -> "<<-e2->vector()); make_twins(e1,e2); CGAL_assertion(e1->mark()==e2->mark()); @@ -493,7 +493,7 @@ public: CGAL_forall_iterators(it,M3) { // progress++; it->second.sort(Halfedge_key_lt()); - CGAL_NEF_TRACEN("search opposite "<first); + CGAL_NEF_TRACEN("search opposite (M3) "<first); typename Halfedge_list::iterator itl; CGAL_forall_iterators(itl,it->second) { Halfedge_handle e1 = itl->e; @@ -502,7 +502,7 @@ public: Halfedge_handle e2 = itl->e; CGAL_NEF_TRACEN(" " << e1->source()->point() << " -> " << e2->source()->point()); - CGAL_NEF_TRACEN(e1->vector()<<" -> "<<-e2->vector()); + CGAL_NEF_TRACEN(" " << e1->vector()<<" -> "<<-e2->vector()); make_twins(e1,e2); CGAL_assertion(e1->mark()==e2->mark()); @@ -513,7 +513,7 @@ public: CGAL_forall_iterators(it,M2) { // progress++; it->second.sort(Halfedge_key_lt()); - CGAL_NEF_TRACEN("search opposite "<first); + CGAL_NEF_TRACEN("search opposite (M2) "<first); typename Halfedge_list::iterator itl; CGAL_forall_iterators(itl,it->second) { Halfedge_handle e1 = itl->e; @@ -522,7 +522,7 @@ public: Halfedge_handle e2 = itl->e; CGAL_NEF_TRACEN(" " << e1->source()->point() << " -> " << e2->source()->point()); - CGAL_NEF_TRACEN(e1->vector()<<" -> "<<-e2->vector()); + CGAL_NEF_TRACEN(" " << e1->vector()<<" -> "<<-e2->vector()); make_twins(e1,e2); CGAL_assertion(e1->mark()==e2->mark()); @@ -533,7 +533,7 @@ public: CGAL_forall_iterators(it,M) { // progress++; it->second.sort(Halfedge_key_lt()); - CGAL_NEF_TRACEN("search opposite "<first); + CGAL_NEF_TRACEN("search opposite (M) "<first); typename Halfedge_list::iterator itl; CGAL_forall_iterators(itl,it->second) { Halfedge_handle e1 = itl->e; @@ -542,7 +542,7 @@ public: Halfedge_handle e2 = itl->e; CGAL_NEF_TRACEN(" " << e1->source()->point() << " -> " << e2->source()->point()); - CGAL_NEF_TRACEN(e1->vector()<<" -> "<< -e2->vector()); + CGAL_NEF_TRACEN(" " << e1->vector()<<" -> "<< -e2->vector()); CGAL_assertion(e1->source()->point() != e2->source()->point()); CGAL_assertion(e1->mark()==e2->mark()); make_twins(e1,e2); @@ -585,10 +585,16 @@ public: break; } else #endif + CGAL_assertion_code(bool found = false;) CGAL_For_all(cet,cete) if ( cet->circle() == ce->circle().opposite() && cet->source()->twin() == ce->source() ) + { + CGAL_assertion_code(found = true;) break; + } + + CGAL_assertion(found); #ifdef CGAL_USE_TRACE if( cet->circle() != ce->circle().opposite() ) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_intersection.h b/Nef_3/include/CGAL/Nef_3/SNC_intersection.h index a3a26fb3041..be8345069e2 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_intersection.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_intersection.h @@ -139,7 +139,7 @@ class SNC_intersection { if( !CGAL::assign( p, o)) return false; CGAL_NEF_TRACEN( "-> intersection point: " << p ); - CGAL_NEF_TRACEN( "-> point in facet interior? "< point in facet interior? "< intersection point: " << p ); - CGAL_NEF_TRACEN( "-> point in facet interior? "< point in facet interior? "<source()->point() << "->" << e->twin()->source()->point()); if (SNC_intersection::does_contain_internally(e->source()->point(), e->twin()->source()->point(), p)) { - _CGAL_NEF_TRACEN("found on edge "<< ss); +// _CGAL_NEF_TRACEN("found on edge "<< ss); return make_object(e); } if((e->source() != v) && (e->twin()->source() != v) && @@ -557,7 +557,7 @@ private: if(SNC_intersection::does_intersect_internally( s, *f, q) ) { q = normalized(q); call_back( e0, *f, q); - _CGAL_NEF_TRACEN("edge intersects facet on plane "<plane()<<" on "<plane()<<" on "<; using Nef = CGAL::Nef_polyhedron_3; -int main(int argc, char ** argv) +int main() { Nef hspace_1(Nef::Plane_3(1.0, 0.0, 0.0, 0.0), Nef::INCLUDED); Nef hspace_2(Nef::Plane_3(1.0, 0.0, 0.0, 1.0), Nef::INCLUDED); Nef hspace_3(Nef::Plane_3(0.0, 0.0, 1.0, 1.0), Nef::INCLUDED); - Nef intersection_1 = hspace_1*hspace_2; // Line 14. Works fine. - Nef intersection_2 = hspace_2*hspace_3; // Line 15. Assertion failure. - + Nef intersection_1 = hspace_1*hspace_2; + Nef intersection_2 = hspace_2*hspace_3; + return 0; } From b50579bd09fa8fd0857c26afb193052d4e3ebe02 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2025 10:12:04 +0100 Subject: [PATCH 273/332] another fix for the buggy compiler from MSVC 2017 --- .../include/CGAL/Base_with_time_stamp.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/STL_Extension/include/CGAL/Base_with_time_stamp.h b/STL_Extension/include/CGAL/Base_with_time_stamp.h index b1be12db7ac..5e19193c142 100644 --- a/STL_Extension/include/CGAL/Base_with_time_stamp.h +++ b/STL_Extension/include/CGAL/Base_with_time_stamp.h @@ -16,19 +16,11 @@ namespace CGAL { -template -class Base_with_time_stamp : public Base { +template +class Base_with_time_stamp : public B_w_ts_base { std::size_t time_stamp_ = std::size_t(-2); public: -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1920) - using Base::Base; -#else // workaround for MSVC 2017 - // VC++ 19.16 (from MSVC 2017) may mix up the constructor `Base::Base` - // with a possible member type `Base` from the base class. - // see a repro of the issue at https://compiler-explorer.com/z/d5hxv7Wze - using base_t = Base; - using base_t::base_t; -#endif + using B_w_ts_base::B_w_ts_base; using Has_timestamp = CGAL::Tag_true; @@ -41,7 +33,7 @@ public: template < class TDS > struct Rebind_TDS { - typedef typename Base::template Rebind_TDS::Other Base2; + typedef typename B_w_ts_base::template Rebind_TDS::Other Base2; typedef Base_with_time_stamp Other; }; }; From 5853673267cf7f2319c2c7f92b6589754522ecff Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2025 18:07:59 +0100 Subject: [PATCH 274/332] fix the concurrent compact container with timestamps --- .../include/CGAL/Compact_container.h | 68 ++++++------------- .../CGAL/Concurrent_compact_container.h | 37 ++++------ STL_Extension/include/CGAL/Time_stamper.h | 19 +++++- 3 files changed, 50 insertions(+), 74 deletions(-) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 073300c8a82..4ff6fb08246 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -220,6 +220,10 @@ class Compact_container CGAL_INCREMENT_COMPACT_CONTAINER_BLOCK_SIZE> >::type Increment_policy; typedef TimeStamper_ Ts; + + template using EraseCounterStrategy = + internal::Erase_counter_strategy::value>; + typedef Compact_container Self; typedef Compact_container_traits Traits; public: @@ -354,7 +358,7 @@ public: return all_items[block_number].first[index_in_block]; } - friend void swap(Compact_container& a, Compact_container b) { + friend void swap(Compact_container& a, Compact_container b) noexcept { a.swap(b); } @@ -390,22 +394,16 @@ public: // (just forward the arguments to the constructor, to optimize a copy). template < typename... Args > iterator - emplace(const Args&... args) + emplace(Args&&... args) { if (free_list == nullptr) allocate_new_block(); pointer ret = free_list; free_list = clean_pointee(ret); - std::size_t ts; - CGAL_USE(ts); - if constexpr (Time_stamper::has_timestamp) { - ts = ret->time_stamp(); - } - new (ret) value_type(args...); - if constexpr (Time_stamper::has_timestamp) { - ret->set_time_stamp(ts); - } + const auto ts = Time_stamper::time_stamp(ret); + std::allocator_traits::construct(alloc, ret, std::forward(args)...); + Time_stamper::restore_timestamp(ret, ts); Time_stamper::set_time_stamp(ret, time_stamp); CGAL_assertion(type(ret) == USED); ++size_; @@ -414,24 +412,7 @@ public: iterator insert(const T &t) { - if (free_list == nullptr) - allocate_new_block(); - - pointer ret = free_list; - free_list = clean_pointee(ret); - std::size_t ts; - CGAL_USE(ts); - if constexpr (Time_stamper::has_timestamp) { - ts = ret->time_stamp(); - } - std::allocator_traits::construct(alloc, ret, t); - if constexpr (Time_stamper::has_timestamp) { - ret->set_time_stamp(ts); - } - Time_stamper::set_time_stamp(ret, time_stamp); - CGAL_assertion(type(ret) == USED); - ++size_; - return iterator(ret, 0); + return emplace(t); } template < class InputIterator > @@ -450,22 +431,14 @@ public: void erase(iterator x) { - typedef internal::Erase_counter_strategy< - internal::has_increment_erase_counter::value> EraseCounterStrategy; + auto ptr = &*x; + CGAL_precondition(type(ptr) == USED); + EraseCounterStrategy::increment_erase_counter(*x); + const auto ts = Time_stamper::time_stamp(ptr); + std::allocator_traits::destroy(alloc, ptr); + Time_stamper::restore_timestamp(ptr, ts); - CGAL_precondition(type(&*x) == USED); - EraseCounterStrategy::increment_erase_counter(*x); - std::size_t ts; - CGAL_USE(ts); - if constexpr (Time_stamper::has_timestamp) { - ts = x->time_stamp(); - } - std::allocator_traits::destroy(alloc, &*x); - if constexpr (Time_stamper::has_timestamp) { - x->set_time_stamp(ts); - } - - put_on_free_list(&*x); + put_on_free_list(ptr); --size_; } @@ -697,7 +670,7 @@ public: static bool is_begin_or_end(const_pointer ptr) { return type(ptr)==START_END; } - void swap(Self &c) + void swap(Self &c) noexcept { std::swap(alloc, c.alloc); std::swap(capacity_, c.capacity_); @@ -805,9 +778,6 @@ void Compact_container::clear() template < class T, class Allocator, class Increment_policy, class TimeStamper > void Compact_container::allocate_new_block() { - typedef internal::Erase_counter_strategy< - internal::has_increment_erase_counter::value> EraseCounterStrategy; - pointer new_block = alloc.allocate(block_size + 2); all_items.push_back(std::make_pair(new_block, block_size + 2)); capacity_ += block_size; @@ -816,7 +786,7 @@ void Compact_container::allocate_ne // will correspond to the iterator order... for (size_type i = block_size; i >= 1; --i) { - EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); + EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); Time_stamper::initialize_time_stamp(new_block + i); put_on_free_list(new_block + i); } diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 7f5533f92b7..93ed4495c35 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -202,6 +202,9 @@ class Concurrent_compact_container typedef Concurrent_compact_container Self; typedef Concurrent_compact_container_traits Traits; + template using EraseCounterStrategy = + internal::Erase_counter_strategy::value>; + public: typedef CGAL::Time_stamper_impl Time_stamper; typedef Time_stamper Time_stamper_impl; // backward compatibility @@ -344,28 +347,21 @@ public: // (just forward the arguments to the constructor, to optimize a copy). template < typename... Args > iterator - emplace(const Args&... args) + emplace(Args&&... args) { - typedef CCC_internal::Erase_counter_strategy< - CCC_internal::has_increment_erase_counter::value> EraseCounterStrategy; FreeList * fl = get_free_list(); pointer ret = init_insert(fl); - auto erase_counter = EraseCounterStrategy::erase_counter(*ret);; - new (ret) value_type(args...); - EraseCounterStrategy::set_erase_counter(*ret, erase_counter); + auto erase_counter = EraseCounterStrategy::erase_counter(*ret); + const auto ts = Time_stamper::time_stamp(ret); + std::allocator_traits::construct(m_alloc, ret, std::forward(args)...); + Time_stamper::restore_timestamp(ret, ts); + EraseCounterStrategy::set_erase_counter(*ret, erase_counter); return finalize_insert(ret, fl); } iterator insert(const T &t) { - typedef CCC_internal::Erase_counter_strategy< - CCC_internal::has_increment_erase_counter::value> EraseCounterStrategy; - FreeList * fl = get_free_list(); - pointer ret = init_insert(fl); - auto erase_counter = EraseCounterStrategy::erase_counter(*ret);; - std::allocator_traits::construct(m_alloc, ret, t); - EraseCounterStrategy::set_erase_counter(*ret, erase_counter); - return finalize_insert(ret, fl); + return emplace(t); } template < class InputIterator > @@ -385,13 +381,13 @@ public: private: void erase(iterator x, FreeList * fl) { - typedef CCC_internal::Erase_counter_strategy< - CCC_internal::has_increment_erase_counter::value> EraseCounterStrategy; - CGAL_precondition(type(x) == USED); - EraseCounterStrategy::increment_erase_counter(*x); + EraseCounterStrategy::increment_erase_counter(*x); + auto ptr = &*x; + const auto ts = Time_stamper::time_stamp(ptr); std::allocator_traits::destroy(m_alloc, &*x); + Time_stamper::restore_timestamp(ptr, ts); put_on_free_list(&*x, fl); } @@ -778,9 +774,6 @@ template < class T, class Allocator > void Concurrent_compact_container:: allocate_new_block(FreeList * fl) { - typedef CCC_internal::Erase_counter_strategy< - CCC_internal::has_increment_erase_counter::value> EraseCounterStrategy; - size_type old_block_size; pointer new_block; @@ -818,7 +811,7 @@ void Concurrent_compact_container:: // will correspond to the iterator order... for (size_type i = old_block_size; i >= 1; --i) { - EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); + EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); Time_stamper::initialize_time_stamp(new_block + i); put_on_free_list(new_block + i, fl); } diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index 081c003b69b..2ac0617a3ac 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -30,13 +30,17 @@ struct Time_stamper { static constexpr bool has_timestamp = true; + static bool is_valid(const T* pt) { + return pt != nullptr && pt->time_stamp() != std::size_t(-2); + } + static void initialize_time_stamp(T* pt) { pt->set_time_stamp(std::size_t(-1)); } template static void set_time_stamp(T* pt, time_stamp_t& time_stamp_) { - CGAL_assertion(pt->time_stamp() != std::size_t(-2)); + CGAL_assertion(is_valid(pt)); if(pt->time_stamp() == std::size_t(-1)) { const std::size_t new_ts = time_stamp_++; pt->set_time_stamp(new_ts); @@ -64,13 +68,18 @@ struct Time_stamper static std::size_t time_stamp(const T* pt) { - CGAL_assertion(pt == nullptr || pt->time_stamp() != std::size_t(-2)); + CGAL_assertion(is_valid(pt)); if(pt == nullptr){ return std::size_t(-1); } return pt->time_stamp(); } + static void restore_timestamp(T* pt, std::size_t ts) + { + pt->set_time_stamp(ts); + } + static auto display_id(const T* pt, int offset = 0) { if(pt == nullptr) @@ -80,7 +89,7 @@ struct Time_stamper } static std::size_t hash_value(const T* p) { - CGAL_assertion(p == nullptr || p->time_stamp() != std::size_t(-2)); + CGAL_assertion(is_valid(p)); if(nullptr == p) return std::size_t(-1); else @@ -116,6 +125,10 @@ public: return 0; } + static void restore_timestamp(T*, std::size_t) + { + } + static auto display_id(const T* pt, int) { return static_cast(pt); From fad5e30a549ce418b4df010e9588466dc6a91cb2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2025 18:09:07 +0100 Subject: [PATCH 275/332] initialize to -2, to use the debugging assertions --- .../Alpha_wrap_triangulation_cell_base_3.h | 2 +- Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h | 2 +- Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h | 2 +- Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h | 2 +- Mesh_3/include/CGAL/Mesh_cell_base_3.h | 2 +- Mesh_3/include/CGAL/Mesh_polyhedron_3.h | 13 ++++++------- Mesh_3/include/CGAL/Mesh_vertex_base_3.h | 2 +- .../CGAL/Compact_simplicial_mesh_cell_base_3.h | 15 ++------------- SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h | 4 ++-- .../include/CGAL/Simplicial_mesh_vertex_base_3.h | 2 +- .../test/STL_Extension/test_Compact_container.cpp | 3 +-- .../test_Concurrent_compact_container.cpp | 3 +-- 12 files changed, 19 insertions(+), 33 deletions(-) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h index cd0c29a99e5..bcca1bd0143 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h @@ -97,7 +97,7 @@ template class Cell_base_with_timestamp : public Cb { - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); public: using Has_timestamp = CGAL::Tag_true; diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h index 46eec90e7e8..5601684ed22 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h @@ -78,7 +78,7 @@ public: void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); }; } // namespace CGAL diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h index 159a5e77c88..0c62a20fb5c 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h @@ -67,7 +67,7 @@ public: void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); #endif // CGAL_MESH_2_DEBUG_REFINEMENT_POINTS }; diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index ecd0236808a..e47d899faec 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -644,7 +644,7 @@ private: #ifdef CGAL_INTRUSIVE_LIST Cell_handle next_intrusive_ = {}, previous_intrusive_ = {}; #endif - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); std::array surface_center_index_table_ = {}; /// Stores visited facets (4 first bits) diff --git a/Mesh_3/include/CGAL/Mesh_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_cell_base_3.h index b4552fb048a..ac5535f7090 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_base_3.h @@ -273,7 +273,7 @@ private: #ifdef CGAL_INTRUSIVE_LIST Cell_handle next_intrusive_, previous_intrusive_; #endif - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); }; // end class Mesh_cell_base_3 diff --git a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h index e6e96d03f03..04b6d247da1 100644 --- a/Mesh_3/include/CGAL/Mesh_polyhedron_3.h +++ b/Mesh_3/include/CGAL/Mesh_polyhedron_3.h @@ -41,10 +41,9 @@ private: typedef CGAL::HalfedgeDS_vertex_base Pdv_base; Set_of_indices indices; - std::size_t time_stamp_ = std::size_t(-1); - + std::size_t time_stamp_ = std::size_t(-2); public: - int nb_of_feature_edges; + int nb_of_feature_edges = 0; bool is_corner() const { return nb_of_feature_edges > 2; @@ -85,8 +84,8 @@ public: return indices; } - Mesh_polyhedron_vertex() : Pdv_base(), nb_of_feature_edges(0) {} - Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p), nb_of_feature_edges(0) {} + Mesh_polyhedron_vertex() = default; + Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p) {} }; template @@ -95,7 +94,7 @@ public CGAL::HalfedgeDS_halfedge_base { private: bool feature_edge; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); public: @@ -143,7 +142,7 @@ public CGAL::HalfedgeDS_face_base { private: Patch_id_ patch_id_; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); public: diff --git a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h index e824f0ba694..db43424ec4f 100644 --- a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h @@ -250,7 +250,7 @@ private: Vertex_handle next_intrusive_; Vertex_handle previous_intrusive_; #endif - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); public: friend std::istream& operator>>(std::istream &is, Mesh_vertex_3& v) diff --git a/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h index 49ac4fcae23..9f26f6f3b29 100644 --- a/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h @@ -47,18 +47,7 @@ public: public: // Constructors - Compact_simplicial_mesh_cell_3() {} - - Compact_simplicial_mesh_cell_3(const Compact_simplicial_mesh_cell_3& rhs) - : N(rhs.N) - , V(rhs.V) - , time_stamp_(rhs.time_stamp_) - , subdomain_index_(rhs.subdomain_index_) - { - for(int i=0; i <4; i++){ - surface_index_table_[i] = rhs.surface_index_table_[i]; - } - } + Compact_simplicial_mesh_cell_3() = default; Compact_simplicial_mesh_cell_3(Vertex_handle v0, Vertex_handle v1, @@ -277,7 +266,7 @@ private: std::array N; std::array V; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); // The index of the cell of the input complex that contains me Subdomain_index subdomain_index_ = {}; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index 7affb29b535..a9a98b155ba 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -96,7 +96,7 @@ public: }; public: - Simplicial_mesh_cell_base_3() {} + Simplicial_mesh_cell_base_3() = default; Simplicial_mesh_cell_base_3(const Simplicial_mesh_cell_base_3& rhs) : Cb(static_cast(rhs)), @@ -189,7 +189,7 @@ private: /// Stores surface_index for each facet of the cell std::array surface_index_table_ = {}; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); // The index of the cell of the input complex that contains me Subdomain_index subdomain_index_ = {}; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h index 6d86764fdca..1a15aaf09d7 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h @@ -217,7 +217,7 @@ private: // that contains me. Negative values are a marker for special vertices. short dimension_; bool cache_validity; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); public: friend std::istream& operator>>(std::istream& is, diff --git a/STL_Extension/test/STL_Extension/test_Compact_container.cpp b/STL_Extension/test/STL_Extension/test_Compact_container.cpp index c0235b6f018..8cb5d9726ec 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container.cpp @@ -18,7 +18,6 @@ template struct Node_1 : public CGAL::Compact_container_base { - Node_1() {} bool operator==(const Node_1 &) const { return true; } bool operator!=(const Node_1 &) const { return false; } bool operator< (const Node_1 &) const { return false; } @@ -49,7 +48,7 @@ struct Node_1 } ///@} int m_erase_counter; - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); }; class Node_2 diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index b4531b35c5c..e919369cabf 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -32,7 +32,6 @@ int main() struct Node_1 : public CGAL::Compact_container_base { - Node_1() {} bool operator==(const Node_1 &) const { return true; } bool operator!=(const Node_1 &) const { return false; } bool operator< (const Node_1 &) const { return false; } @@ -45,7 +44,7 @@ struct Node_1 void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_ = std::size_t(-1); + std::size_t time_stamp_ = std::size_t(-2); }; class Node_2 From d582ec6ee17506329fe25b07af1f11b09f8f70db Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2025 19:17:36 +0100 Subject: [PATCH 276/332] bug fix --- STL_Extension/include/CGAL/Time_stamper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index 2ac0617a3ac..01187a33085 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -89,7 +89,7 @@ struct Time_stamper } static std::size_t hash_value(const T* p) { - CGAL_assertion(is_valid(p)); + CGAL_assertion(nullptr== p || is_valid(p)); if(nullptr == p) return std::size_t(-1); else From 45da3684badde91880b0464f529f69402385d278 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2025 19:19:01 +0100 Subject: [PATCH 277/332] Bug with Linear_cell_complex One cannot call `std::allocator_traits::construct`, because some of linear cell complex classes have protected constructors with a lot of friend classes. They cannot be friend of all possible allocator classes, so... --- STL_Extension/include/CGAL/Compact_container.h | 2 +- STL_Extension/include/CGAL/Concurrent_compact_container.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 4ff6fb08246..5c9e7b00567 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -402,7 +402,7 @@ public: pointer ret = free_list; free_list = clean_pointee(ret); const auto ts = Time_stamper::time_stamp(ret); - std::allocator_traits::construct(alloc, ret, std::forward(args)...); + new (ret) value_type(std::forward(args)...); Time_stamper::restore_timestamp(ret, ts); Time_stamper::set_time_stamp(ret, time_stamp); CGAL_assertion(type(ret) == USED); diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 93ed4495c35..653ea056e74 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -353,7 +353,7 @@ public: pointer ret = init_insert(fl); auto erase_counter = EraseCounterStrategy::erase_counter(*ret); const auto ts = Time_stamper::time_stamp(ret); - std::allocator_traits::construct(m_alloc, ret, std::forward(args)...); + new (ret) value_type(std::forward(args)...); Time_stamper::restore_timestamp(ret, ts); EraseCounterStrategy::set_erase_counter(*ret, erase_counter); return finalize_insert(ret, fl); From 3abe02075b92dcc03354a21315c8ab5da25e29cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 1 Feb 2025 23:11:25 +0100 Subject: [PATCH 278/332] GMP is not always available --- Nef_3/test/Nef_3/issue8644bis.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/test/Nef_3/issue8644bis.cpp b/Nef_3/test/Nef_3/issue8644bis.cpp index 6968f704c4e..1424419e6cf 100644 --- a/Nef_3/test/Nef_3/issue8644bis.cpp +++ b/Nef_3/test/Nef_3/issue8644bis.cpp @@ -1,8 +1,8 @@ #include -#include +#include #include -using Kernel = CGAL::Extended_cartesian; +using Kernel = CGAL::Extended_cartesian; using Nef = CGAL::Nef_polyhedron_3; int main() From 094507cfaa9f0bf373ca39d7360f52553236c5fd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 3 Feb 2025 17:25:31 +0100 Subject: [PATCH 279/332] fix an unrelated warning That is not correct C++ code to copy uninitialized values. --- STL_Extension/test/STL_Extension/test_namespaces.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/test/STL_Extension/test_namespaces.cpp b/STL_Extension/test/STL_Extension/test_namespaces.cpp index 63a9971c576..f7293e8a7c4 100644 --- a/STL_Extension/test/STL_Extension/test_namespaces.cpp +++ b/STL_Extension/test/STL_Extension/test_namespaces.cpp @@ -13,7 +13,7 @@ int main() { - CGAL::cpp0x::array arr; + CGAL::cpp0x::array arr{1, 2, 3}; std::array arr2; CGAL::cpp0x::tuple tuple; From e5001d1a507d49eef048a322a66dea951a7345f7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 4 Feb 2025 14:32:37 +0100 Subject: [PATCH 280/332] update our CMake version 3.18...3.31 That will suppress the warnings about `CMP0167` (from CMake 3.30): ``` CMake Warning (dev) at cmake/modules/display-third-party-libs-versions.cmake:37 (find_package): Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake --help-policy CMP0167" for policy details. Use the cmake_policy command to set the policy and suppress this warning. ``` --- AABB_tree/benchmark/AABB_tree/CMakeLists.txt | 2 +- AABB_tree/demo/AABB_tree/CMakeLists.txt | 2 +- AABB_tree/examples/AABB_tree/CMakeLists.txt | 2 +- AABB_tree/test/AABB_tree/CMakeLists.txt | 2 +- .../Advancing_front_surface_reconstruction/CMakeLists.txt | 2 +- .../Advancing_front_surface_reconstruction/CMakeLists.txt | 2 +- .../examples/Algebraic_foundations/CMakeLists.txt | 2 +- .../test/Algebraic_foundations/CMakeLists.txt | 2 +- Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt | 2 +- Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt | 2 +- .../test/Algebraic_kernel_for_circles/CMakeLists.txt | 2 +- .../test/Algebraic_kernel_for_spheres/CMakeLists.txt | 2 +- Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt | 2 +- Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt | 2 +- Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt | 2 +- Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt | 2 +- Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt | 2 +- Alpha_wrap_3/benchmark/Alpha_wrap_3/CMakeLists.txt | 2 +- Alpha_wrap_3/examples/Alpha_wrap_3/CMakeLists.txt | 2 +- Alpha_wrap_3/test/Alpha_wrap_3/CMakeLists.txt | 2 +- Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt | 2 +- Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt | 2 +- Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt | 2 +- .../demo/Arrangement_on_surface_2/CMakeLists.txt | 2 +- .../demo/Arrangement_on_surface_2_earth/CMakeLists.txt | 2 +- .../examples/Arrangement_on_surface_2/CMakeLists.txt | 2 +- .../test/Arrangement_on_surface_2/CMakeLists.txt | 2 +- BGL/examples/BGL_LCC/CMakeLists.txt | 2 +- BGL/examples/BGL_OpenMesh/CMakeLists.txt | 2 +- BGL/examples/BGL_arrangement_2/CMakeLists.txt | 2 +- BGL/examples/BGL_graphcut/CMakeLists.txt | 2 +- BGL/examples/BGL_polyhedron_3/CMakeLists.txt | 2 +- BGL/examples/BGL_surface_mesh/CMakeLists.txt | 2 +- BGL/examples/BGL_triangulation_2/CMakeLists.txt | 2 +- BGL/test/BGL/CMakeLists.txt | 2 +- .../benchmark/Barycentric_coordinates_2/CMakeLists.txt | 2 +- .../examples/Barycentric_coordinates_2/CMakeLists.txt | 2 +- .../test/Barycentric_coordinates_2/CMakeLists.txt | 2 +- Basic_viewer/examples/Basic_viewer/CMakeLists.txt | 2 +- .../examples/Boolean_set_operations_2/CMakeLists.txt | 2 +- .../test/Boolean_set_operations_2/CMakeLists.txt | 2 +- .../examples/Approximate_min_ellipsoid_d/CMakeLists.txt | 2 +- Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt | 2 +- Bounding_volumes/examples/Min_circle_2/CMakeLists.txt | 2 +- Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt | 2 +- Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt | 2 +- Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt | 2 +- .../examples/Min_sphere_of_spheres_d/CMakeLists.txt | 2 +- .../examples/Rectangular_p_center_2/CMakeLists.txt | 2 +- Bounding_volumes/test/Bounding_volumes/CMakeLists.txt | 2 +- Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt | 2 +- Box_intersection_d/test/Box_intersection_d/CMakeLists.txt | 2 +- CGAL_Core/examples/Core/CMakeLists.txt | 2 +- CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt | 2 +- CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt | 2 +- CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt | 2 +- CGAL_ipelets/test/CGAL_ipelets/CMakeLists.txt | 2 +- CMakeLists.txt | 2 +- Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt | 2 +- Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt | 2 +- Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt | 2 +- Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt | 2 +- Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt | 2 +- Circulator/examples/Circulator/CMakeLists.txt | 2 +- Circulator/test/Circulator/CMakeLists.txt | 2 +- Classification/examples/Classification/CMakeLists.txt | 2 +- Classification/test/Classification/CMakeLists.txt | 2 +- Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt | 2 +- Combinatorial_map/test/Combinatorial_map/CMakeLists.txt | 2 +- Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt | 2 +- Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt | 2 +- .../examples/Convex_decomposition_3/CMakeLists.txt | 2 +- .../test/Convex_decomposition_3/CMakeLists.txt | 2 +- Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt | 2 +- Convex_hull_2/test/Convex_hull_2/CMakeLists.txt | 2 +- Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt | 2 +- Convex_hull_3/test/Convex_hull_3/CMakeLists.txt | 2 +- Convex_hull_d/test/Convex_hull_d/CMakeLists.txt | 2 +- Distance_2/test/Distance_2/CMakeLists.txt | 2 +- Distance_3/test/Distance_3/CMakeLists.txt | 2 +- Documentation/doc/CMakeLists.txt | 4 ++-- Envelope_2/examples/Envelope_2/CMakeLists.txt | 2 +- Envelope_2/test/Envelope_2/CMakeLists.txt | 2 +- Envelope_3/examples/Envelope_3/CMakeLists.txt | 2 +- Envelope_3/test/Envelope_3/CMakeLists.txt | 2 +- Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt | 2 +- Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt | 2 +- Filtered_kernel/test/Filtered_kernel/CMakeLists.txt | 2 +- Generalized_map/examples/Generalized_map/CMakeLists.txt | 2 +- Generalized_map/test/Generalized_map/CMakeLists.txt | 2 +- Generator/benchmark/Generator/CMakeLists.txt | 2 +- Generator/examples/Generator/CMakeLists.txt | 2 +- Generator/test/Generator/CMakeLists.txt | 2 +- GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt | 2 +- GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt | 2 +- GraphicsView/demo/Bounding_volumes/CMakeLists.txt | 2 +- GraphicsView/demo/Circular_kernel_2/CMakeLists.txt | 2 +- GraphicsView/demo/Generator/CMakeLists.txt | 2 +- GraphicsView/demo/GraphicsView/CMakeLists.txt | 2 +- GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt | 2 +- GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt | 2 +- GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt | 2 +- GraphicsView/demo/Polygon/CMakeLists.txt | 2 +- GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt | 2 +- .../demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt | 2 +- GraphicsView/demo/Snap_rounding_2/CMakeLists.txt | 2 +- GraphicsView/demo/Spatial_searching_2/CMakeLists.txt | 2 +- GraphicsView/demo/Stream_lines_2/CMakeLists.txt | 2 +- GraphicsView/demo/Triangulation_2/CMakeLists.txt | 2 +- HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt | 2 +- HalfedgeDS/test/HalfedgeDS/CMakeLists.txt | 2 +- Hash_map/benchmark/Hash_map/CMakeLists.txt | 2 +- Hash_map/test/Hash_map/CMakeLists.txt | 2 +- Heat_method_3/examples/Heat_method_3/CMakeLists.txt | 2 +- Heat_method_3/test/Heat_method_3/CMakeLists.txt | 2 +- .../benchmark/Hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../demo/Hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../examples/Hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../test/Hyperbolic_triangulation_2/CMakeLists.txt | 2 +- Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt | 2 +- Inscribed_areas/test/Inscribed_areas/CMakeLists.txt | 2 +- Installation/CMakeLists.txt | 2 +- Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake | 2 +- Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake | 2 +- Installation/cmake/modules/CGAL_SetupLEDA.cmake | 2 +- .../cmake/modules/CGAL_enable_end_of_configuration_hook.cmake | 2 +- Installation/demo/CMakeLists.txt | 2 +- Installation/examples/CMakeLists.txt | 2 +- Installation/test/CMakeLists.txt | 2 +- Installation/test/Installation/CMakeLists.txt | 2 +- Installation/test/Installation/test_configuration.cmake.in | 2 +- Installation/test/Installation/test_configuration_qt.cmake.in | 2 +- Installation/test/Installation/test_find_package.cmake.in | 2 +- Interpolation/examples/Interpolation/CMakeLists.txt | 2 +- Interpolation/test/Interpolation/CMakeLists.txt | 2 +- Intersections_2/test/Intersections_2/CMakeLists.txt | 2 +- Intersections_3/test/Intersections_3/CMakeLists.txt | 2 +- Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt | 2 +- Interval_skip_list/test/Interval_skip_list/CMakeLists.txt | 2 +- Interval_support/test/Interval_support/CMakeLists.txt | 2 +- Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt | 2 +- Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt | 2 +- Kernel_23/benchmark/Kernel_23/CMakeLists.txt | 2 +- Kernel_23/examples/Kernel_23/CMakeLists.txt | 2 +- Kernel_23/test/Kernel_23/CMakeLists.txt | 2 +- Kernel_d/test/Kernel_d/CMakeLists.txt | 2 +- .../examples/Kinetic_space_partition/CMakeLists.txt | 2 +- .../test/Kinetic_space_partition/CMakeLists.txt | 2 +- .../examples/Kinetic_surface_reconstruction/CMakeLists.txt | 2 +- .../test/Kinetic_surface_reconstruction/CMakeLists.txt | 2 +- Lab/demo/Lab/CMakeLists.txt | 2 +- Lab/demo/Lab/Plugins/Three_examples/CMakeLists.txt | 2 +- Lab/demo/Lab/implicit_functions/CMakeLists.txt | 2 +- .../benchmark/Linear_cell_complex_2/CMakeLists.txt | 2 +- .../benchmark/Linear_cell_complex_3/CMakeLists.txt | 2 +- Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt | 2 +- .../examples/Linear_cell_complex/CMakeLists.txt | 2 +- Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt | 2 +- Matrix_search/examples/Matrix_search/CMakeLists.txt | 2 +- Matrix_search/test/Matrix_search/CMakeLists.txt | 2 +- Mesh_2/demo/Mesh_2/CMakeLists.txt | 2 +- Mesh_2/examples/Mesh_2/CMakeLists.txt | 2 +- Mesh_2/test/Mesh_2/CMakeLists.txt | 2 +- Mesh_3/benchmark/Mesh_3/CMakeLists.txt | 2 +- Mesh_3/examples/Mesh_3/CMakeLists.txt | 2 +- Mesh_3/test/Mesh_3/CMakeLists.txt | 2 +- Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt | 2 +- Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt | 2 +- Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt | 2 +- Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt | 2 +- Modifier/test/Modifier/CMakeLists.txt | 2 +- Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt | 2 +- Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt | 2 +- Nef_2/examples/Nef_2/CMakeLists.txt | 2 +- Nef_2/test/Nef_2/CMakeLists.txt | 2 +- Nef_3/examples/Nef_3/CMakeLists.txt | 2 +- Nef_3/test/Nef_3/CMakeLists.txt | 2 +- Nef_S2/examples/Nef_S2/CMakeLists.txt | 2 +- Nef_S2/test/Nef_S2/CMakeLists.txt | 2 +- NewKernel_d/test/NewKernel_d/CMakeLists.txt | 2 +- Number_types/test/Number_types/CMakeLists.txt | 2 +- .../benchmark/Optimal_bounding_box/CMakeLists.txt | 2 +- .../examples/Optimal_bounding_box/CMakeLists.txt | 2 +- Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt | 2 +- .../Optimal_transportation_reconstruction_2/CMakeLists.txt | 2 +- .../Optimal_transportation_reconstruction_2/CMakeLists.txt | 2 +- .../Optimal_transportation_reconstruction_2/CMakeLists.txt | 2 +- Orthtree/benchmark/Orthtree/CMakeLists.txt | 2 +- Orthtree/examples/Orthtree/CMakeLists.txt | 2 +- Orthtree/test/Orthtree/CMakeLists.txt | 2 +- Partition_2/examples/Partition_2/CMakeLists.txt | 2 +- Partition_2/test/Partition_2/CMakeLists.txt | 2 +- .../examples/Periodic_2_triangulation_2/CMakeLists.txt | 2 +- .../test/Periodic_2_triangulation_2/CMakeLists.txt | 2 +- Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt | 2 +- Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt | 2 +- .../demo/Periodic_3_triangulation_3/CMakeLists.txt | 2 +- .../demo/Periodic_Lloyd_3/CMakeLists.txt | 2 +- .../examples/Periodic_3_triangulation_3/CMakeLists.txt | 2 +- .../test/Periodic_3_triangulation_3/CMakeLists.txt | 2 +- .../Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt | 2 +- .../test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt | 2 +- Point_set_2/examples/Point_set_2/CMakeLists.txt | 2 +- Point_set_2/test/Point_set_2/CMakeLists.txt | 2 +- Point_set_3/examples/Point_set_3/CMakeLists.txt | 2 +- Point_set_3/test/Point_set_3/CMakeLists.txt | 2 +- .../examples/Point_set_processing_3/CMakeLists.txt | 2 +- .../test/Point_set_processing_3/CMakeLists.txt | 2 +- .../examples/Poisson_surface_reconstruction_3/CMakeLists.txt | 2 +- .../test/Poisson_surface_reconstruction_3/CMakeLists.txt | 2 +- Polygon/examples/Polygon/CMakeLists.txt | 2 +- Polygon/test/Polygon/CMakeLists.txt | 2 +- .../benchmark/Polygon_mesh_processing/CMakeLists.txt | 2 +- .../examples/Polygon_mesh_processing/CMakeLists.txt | 2 +- .../test/Polygon_mesh_processing/CMakeLists.txt | 2 +- Polygon_repair/examples/Polygon_repair/CMakeLists.txt | 2 +- Polygon_repair/test/Polygon_repair/CMakeLists.txt | 2 +- .../examples/Polygonal_surface_reconstruction/CMakeLists.txt | 2 +- .../test/Polygonal_surface_reconstruction/CMakeLists.txt | 2 +- Polyhedron/examples/Polyhedron/CMakeLists.txt | 2 +- Polyhedron/test/Polyhedron/CMakeLists.txt | 2 +- .../demo/Polyline_simplification_2/CMakeLists.txt | 2 +- .../examples/Polyline_simplification_2/CMakeLists.txt | 2 +- .../test/Polyline_simplification_2/CMakeLists.txt | 2 +- Polynomial/examples/Polynomial/CMakeLists.txt | 2 +- Polynomial/test/Polynomial/CMakeLists.txt | 2 +- .../examples/Polytope_distance_d/CMakeLists.txt | 2 +- Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt | 2 +- .../demo/Principal_component_analysis/CMakeLists.txt | 2 +- .../examples/Principal_component_analysis/CMakeLists.txt | 2 +- .../test/Principal_component_analysis/CMakeLists.txt | 2 +- Profiling_tools/examples/Profiling_tools/CMakeLists.txt | 2 +- Profiling_tools/test/Profiling_tools/CMakeLists.txt | 2 +- Property_map/examples/Property_map/CMakeLists.txt | 2 +- Property_map/test/Property_map/CMakeLists.txt | 2 +- QP_solver/examples/QP_solver/CMakeLists.txt | 2 +- QP_solver/test/QP_solver/CMakeLists.txt | 2 +- Random_numbers/test/Random_numbers/CMakeLists.txt | 2 +- Ridges_3/examples/Ridges_3/CMakeLists.txt | 2 +- Ridges_3/test/Ridges_3/CMakeLists.txt | 2 +- SMDS_3/examples/SMDS_3/CMakeLists.txt | 2 +- SMDS_3/test/SMDS_3/CMakeLists.txt | 2 +- .../benchmark/compact_container_benchmark/CMakeLists.txt | 2 +- STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt | 2 +- STL_Extension/examples/STL_Extension/CMakeLists.txt | 2 +- STL_Extension/test/STL_Extension/CMakeLists.txt | 2 +- .../examples/Scale_space_reconstruction_3/CMakeLists.txt | 2 +- .../developer_scripts/cgal_create_release_with_cmake.cmake | 2 +- Scripts/scripts/cgal_create_CMakeLists | 2 +- Scripts/scripts/cgal_create_cmake_script | 2 +- SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt | 2 +- SearchStructures/test/RangeSegmentTrees/CMakeLists.txt | 2 +- .../benchmark/Segment_Delaunay_graph_2/CMakeLists.txt | 2 +- .../examples/Segment_Delaunay_graph_2/CMakeLists.txt | 2 +- .../test/Segment_Delaunay_graph_2/CMakeLists.txt | 2 +- .../benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt | 2 +- .../examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt | 2 +- .../test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt | 2 +- .../examples/Set_movable_separability_2/CMakeLists.txt | 2 +- .../test/Set_movable_separability_2/CMakeLists.txt | 2 +- Shape_detection/benchmark/Shape_detection/CMakeLists.txt | 2 +- Shape_detection/examples/Shape_detection/CMakeLists.txt | 2 +- Shape_detection/test/Shape_detection/CMakeLists.txt | 2 +- .../benchmark/Shape_regularization/CMakeLists.txt | 2 +- .../examples/Shape_regularization/CMakeLists.txt | 2 +- Shape_regularization/test/Shape_regularization/CMakeLists.txt | 2 +- Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt | 2 +- Skin_surface_3/test/Skin_surface_3/CMakeLists.txt | 2 +- Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt | 2 +- Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt | 2 +- Solver_interface/examples/Solver_interface/CMakeLists.txt | 2 +- Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt | 2 +- .../benchmark/Spatial_searching/tools/CMakeLists.txt | 2 +- Spatial_searching/examples/Spatial_searching/CMakeLists.txt | 2 +- Spatial_searching/test/Spatial_searching/CMakeLists.txt | 2 +- Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt | 2 +- Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt | 2 +- Spatial_sorting/test/Spatial_sorting/CMakeLists.txt | 2 +- .../examples/Straight_skeleton_2/CMakeLists.txt | 2 +- Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt | 2 +- .../test/Straight_skeleton_extrusion_2/CMakeLists.txt | 2 +- Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt | 2 +- Stream_lines_2/test/Stream_lines_2/CMakeLists.txt | 2 +- Stream_support/benchmark/Stream_support/CMakeLists.txt | 2 +- Stream_support/examples/Stream_support/CMakeLists.txt | 2 +- Stream_support/test/Stream_support/CMakeLists.txt | 2 +- .../examples/Subdivision_method_3/CMakeLists.txt | 2 +- Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt | 2 +- Surface_mesh/benchmark/CMakeLists.txt | 2 +- Surface_mesh/examples/Surface_mesh/CMakeLists.txt | 2 +- Surface_mesh/test/Surface_mesh/CMakeLists.txt | 2 +- .../benchmark/Surface_mesh_approximation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_approximation/CMakeLists.txt | 2 +- .../test/Surface_mesh_approximation/CMakeLists.txt | 2 +- .../Surface_mesh_deformation/optimal_rotation/CMakeLists.txt | 2 +- .../demo/Surface_mesh_deformation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_deformation/CMakeLists.txt | 2 +- .../test/Surface_mesh_deformation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_parameterization/CMakeLists.txt | 2 +- .../test/Surface_mesh_parameterization/CMakeLists.txt | 2 +- .../examples/Surface_mesh_segmentation/CMakeLists.txt | 2 +- .../test/Surface_mesh_segmentation/CMakeLists.txt | 2 +- .../examples/Surface_mesh_shortest_path/CMakeLists.txt | 2 +- .../test/Surface_mesh_shortest_path/CMakeLists.txt | 2 +- .../examples/Surface_mesh_simplification/CMakeLists.txt | 2 +- .../test/Surface_mesh_simplification/CMakeLists.txt | 2 +- .../benchmark/Surface_mesh_skeletonization/CMakeLists.txt | 2 +- .../examples/Surface_mesh_skeletonization/CMakeLists.txt | 2 +- .../test/Surface_mesh_skeletonization/CMakeLists.txt | 2 +- .../benchmark/Surface_mesh_topology/CMakeLists.txt | 2 +- .../examples/Surface_mesh_topology/CMakeLists.txt | 2 +- .../test/Surface_mesh_topology/CMakeLists.txt | 2 +- Surface_mesher/examples/Surface_mesher/CMakeLists.txt | 2 +- Surface_mesher/test/Surface_mesher/CMakeLists.txt | 2 +- Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt | 2 +- Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt | 2 +- TDS_2/test/TDS_2/CMakeLists.txt | 2 +- TDS_3/examples/TDS_3/CMakeLists.txt | 2 +- TDS_3/test/TDS_3/CMakeLists.txt | 2 +- .../examples/Tetrahedral_remeshing/CMakeLists.txt | 2 +- .../test/Tetrahedral_remeshing/CMakeLists.txt | 2 +- Three/doc/Three/Three.txt | 4 ++-- Triangulation/applications/Triangulation/CMakeLists.txt | 2 +- Triangulation/benchmark/Triangulation/CMakeLists.txt | 2 +- Triangulation/examples/Triangulation/CMakeLists.txt | 2 +- Triangulation/test/Triangulation/CMakeLists.txt | 2 +- Triangulation_2/examples/Triangulation_2/CMakeLists.txt | 2 +- Triangulation_2/test/Triangulation_2/CMakeLists.txt | 2 +- Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt | 2 +- Triangulation_3/demo/Triangulation_3/CMakeLists.txt | 2 +- Triangulation_3/examples/Triangulation_3/CMakeLists.txt | 2 +- Triangulation_3/test/Triangulation_3/CMakeLists.txt | 2 +- .../benchmark/Triangulation_on_sphere_2/CMakeLists.txt | 2 +- .../demo/Triangulation_on_sphere_2/CMakeLists.txt | 2 +- .../examples/Triangulation_on_sphere_2/CMakeLists.txt | 2 +- .../test/Triangulation_on_sphere_2/CMakeLists.txt | 2 +- Union_find/test/Union_find/CMakeLists.txt | 2 +- Visibility_2/examples/Visibility_2/CMakeLists.txt | 2 +- Visibility_2/test/Visibility_2/CMakeLists.txt | 2 +- Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt | 2 +- Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt | 2 +- Weights/examples/Weights/CMakeLists.txt | 2 +- Weights/test/Weights/CMakeLists.txt | 2 +- 345 files changed, 347 insertions(+), 347 deletions(-) diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 63ac01c5851..5e5b1d39dc2 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(AABB_traits_benchmark) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index eabac21335c..3af9388139f 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling the AABB tree demo. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(AABB_tree_Demo) # Find includes in corresponding build directories diff --git a/AABB_tree/examples/AABB_tree/CMakeLists.txt b/AABB_tree/examples/AABB_tree/CMakeLists.txt index 620a79dccdb..ba856721722 100644 --- a/AABB_tree/examples/AABB_tree/CMakeLists.txt +++ b/AABB_tree/examples/AABB_tree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(AABB_tree_Examples) find_package(CGAL REQUIRED) diff --git a/AABB_tree/test/AABB_tree/CMakeLists.txt b/AABB_tree/test/AABB_tree/CMakeLists.txt index 72cd7d066a2..1e13ff0ba26 100644 --- a/AABB_tree/test/AABB_tree/CMakeLists.txt +++ b/AABB_tree/test/AABB_tree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(AABB_tree_Tests) find_package(CGAL REQUIRED) diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt index 3378a510767..255045d782d 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Advancing_front_surface_reconstruction_Examples) find_package(CGAL REQUIRED) diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt index 27973a058d8..23e1dd2529b 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Advancing_front_surface_reconstruction_Tests) find_package(CGAL REQUIRED) diff --git a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt index 186e8a01b2e..7150fdadd62 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_foundations_Examples) find_package(CGAL REQUIRED) diff --git a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt index 467fdca406f..170d443ae71 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_foundations_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index f93c12d0950..a06ae073399 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_kernel_d_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 1e6570dd393..0f0d16a3c9c 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_kernel_d_Tests) # CGAL and its components diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt index 424bd86fd28..f957c0e835c 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_kernel_for_circles_Tests) find_package(CGAL REQUIRED) diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt index 637387543f2..0167d0c1d98 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Algebraic_kernel_for_spheres_Tests) find_package(CGAL REQUIRED) diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt index 493cacad635..35daf075ee4 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_2_Examples) find_package(CGAL REQUIRED) diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt index a4b13149993..94a0b7a934b 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_2_Tests) find_package(CGAL REQUIRED) diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index 1028c6f4ea4..097684b274e 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_3_Demo) # Find includes in corresponding build directories diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt index 04f6565859d..892c164faa2 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_3_Examples) find_package(CGAL REQUIRED) diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt index e4aca061940..fe6da11668c 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_3_Tests) find_package(CGAL REQUIRED) diff --git a/Alpha_wrap_3/benchmark/Alpha_wrap_3/CMakeLists.txt b/Alpha_wrap_3/benchmark/Alpha_wrap_3/CMakeLists.txt index 23150027c4f..c118956dcbf 100644 --- a/Alpha_wrap_3/benchmark/Alpha_wrap_3/CMakeLists.txt +++ b/Alpha_wrap_3/benchmark/Alpha_wrap_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_wrap_3_Benchmark) find_package(CGAL REQUIRED) diff --git a/Alpha_wrap_3/examples/Alpha_wrap_3/CMakeLists.txt b/Alpha_wrap_3/examples/Alpha_wrap_3/CMakeLists.txt index 8a1c8d1b9fe..ed779a17df5 100644 --- a/Alpha_wrap_3/examples/Alpha_wrap_3/CMakeLists.txt +++ b/Alpha_wrap_3/examples/Alpha_wrap_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_wrap_3_Examples) find_package(CGAL REQUIRED) diff --git a/Alpha_wrap_3/test/Alpha_wrap_3/CMakeLists.txt b/Alpha_wrap_3/test/Alpha_wrap_3/CMakeLists.txt index d719fae8a63..4281c1efcda 100644 --- a/Alpha_wrap_3/test/Alpha_wrap_3/CMakeLists.txt +++ b/Alpha_wrap_3/test/Alpha_wrap_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_wrap_3_Tests) find_package(CGAL REQUIRED) diff --git a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt index 8b4217331c6..758309e7dc0 100644 --- a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Apollonius_graph_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt index c9d061984c7..51ea8576fa6 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Apollonius_graph_2_Tests) find_package(CGAL REQUIRED) diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 2b62b5b12c9..a2df1177140 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Arithmetic_kernel_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt index 990e8d5092e..5e94ede8117 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Arrangement_on_surface_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt index fa18ff35df6..332c3deada6 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Arrangement_on_surface_2_earth_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index 2784310f4ed..bb5566835ab 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Arrangement_on_surface_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core OPTIONAL_COMPONENTS Qt6) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt index adb6df001b3..60add4ac51b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Arrangement_on_surface_2_Tests) enable_testing() diff --git a/BGL/examples/BGL_LCC/CMakeLists.txt b/BGL/examples/BGL_LCC/CMakeLists.txt index da350e1ac2d..10fb6c09dc0 100644 --- a/BGL/examples/BGL_LCC/CMakeLists.txt +++ b/BGL/examples/BGL_LCC/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_LCC_Examples) # CGAL and its components diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index a5091363a51..c56f97d03d7 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_OpenMesh_Examples) # CGAL and its components diff --git a/BGL/examples/BGL_arrangement_2/CMakeLists.txt b/BGL/examples/BGL_arrangement_2/CMakeLists.txt index b803d5b9a37..d0347efa6e0 100644 --- a/BGL/examples/BGL_arrangement_2/CMakeLists.txt +++ b/BGL/examples/BGL_arrangement_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_arrangement_2_Examples) find_package(CGAL REQUIRED) diff --git a/BGL/examples/BGL_graphcut/CMakeLists.txt b/BGL/examples/BGL_graphcut/CMakeLists.txt index 0de1b979314..8acc8de042c 100644 --- a/BGL/examples/BGL_graphcut/CMakeLists.txt +++ b/BGL/examples/BGL_graphcut/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_graphcut_Examples) diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 8c5c669409b..1141da29b73 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_polyhedron_3_Examples) # CGAL and its components diff --git a/BGL/examples/BGL_surface_mesh/CMakeLists.txt b/BGL/examples/BGL_surface_mesh/CMakeLists.txt index 921104583dc..87982059ae9 100644 --- a/BGL/examples/BGL_surface_mesh/CMakeLists.txt +++ b/BGL/examples/BGL_surface_mesh/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_surface_mesh_Examples) find_package(CGAL REQUIRED) diff --git a/BGL/examples/BGL_triangulation_2/CMakeLists.txt b/BGL/examples/BGL_triangulation_2/CMakeLists.txt index 7d479d36c4f..d597f2217dd 100644 --- a/BGL/examples/BGL_triangulation_2/CMakeLists.txt +++ b/BGL/examples/BGL_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_triangulation_2_Examples) find_package(CGAL REQUIRED) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 53d474d67e2..bc18562bb6e 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script_with_options # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(BGL_Tests) # CGAL and its components diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt index 11d40187de3..1d4deb97575 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt @@ -3,7 +3,7 @@ project(Barycentric_coordinates_2_Benchmarks) -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index cd3533b5ca7..43a49733d1a 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Barycentric_coordinates_2_Examples) diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index c50f052a490..7b01647d5c1 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Barycentric_coordinates_2_Tests) diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 305e502bd47..4106c9defb4 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -6,7 +6,7 @@ # Used in /CGAL/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt. # Careful when modifying -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Basic_viewer_Examples) #CGAL_Qt6 is needed for the drawing. diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt index aee59825ba1..99d2c05f6ce 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Boolean_set_operations_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core OPTIONAL_COMPONENTS Qt6) diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt index 60bd93b4d37..b7b8ec33bba 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Boolean_set_operations_2_Tests) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt index aed57e369fc..1829009c9c0 100644 --- a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Approximate_min_ellipsoid_d_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt index 9c56c1f8cd2..4d968380aef 100644 --- a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_annulus_d_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt index 9d537c51338..864ad950c98 100644 --- a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_circle_2_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt index 5a8ff8b5094..8e54fb2aab0 100644 --- a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_ellipse_2_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt index 4ec0538e65a..ee65337ea99 100644 --- a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_quadrilateral_2_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt index 52f22930d06..7df4fa04f95 100644 --- a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_sphere_d_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt index 04fdce0a6c7..5a4d610bd42 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Min_sphere_of_spheres_d_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt index b4232b361a1..5f4df68a419 100644 --- a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Rectangular_p_center_2_Examples) find_package(CGAL REQUIRED) diff --git a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt index a5b3adfd744..143e296e6ff 100644 --- a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt +++ b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Bounding_volumes_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt index f1de0dd7150..7cad98a5e06 100644 --- a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Box_intersection_d_Examples) find_package(CGAL REQUIRED) diff --git a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt index a82e578f345..74af1828b43 100644 --- a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Box_intersection_d_Tests) find_package(CGAL REQUIRED) diff --git a/CGAL_Core/examples/Core/CMakeLists.txt b/CGAL_Core/examples/Core/CMakeLists.txt index 5f1d17eeb8a..a3552430f3c 100644 --- a/CGAL_Core/examples/Core/CMakeLists.txt +++ b/CGAL_Core/examples/Core/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Core_Examples) # CGAL and its components diff --git a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt index ee152bc87a8..69a3b23a9d9 100644 --- a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGALimageIO_Examples) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt index 9a5154fe35a..92bc01f4576 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_ImageIO_Tests) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 6c942000068..a27008458d1 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_ipelets_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) diff --git a/CGAL_ipelets/test/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/test/CGAL_ipelets/CMakeLists.txt index ae82aa48f7f..f52731322b7 100644 --- a/CGAL_ipelets/test/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/test/CGAL_ipelets/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_ipelets_Tests) find_package(CGAL REQUIRED) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb6cbcce79a..c4ac65d480d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Top level CMakeLists.txt for CGAL-branchbuild # Minimal version of CMake: -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) message("== CMake setup ==") project(CGAL CXX C) diff --git a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt index 7b2f5e9e627..33f717ffe50 100644 --- a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_2_Examples) find_package(CGAL REQUIRED) diff --git a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt index c74331fa0da..18d14536942 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_2_Tests) find_package(CGAL REQUIRED) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 15b323a35e4..eb14ee65d51 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_3_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt index dd790cb013e..6570aa61957 100644 --- a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_3_Examples) find_package(CGAL REQUIRED) diff --git a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt index 11f64e04486..3194864b973 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_3_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Circulator/examples/Circulator/CMakeLists.txt b/Circulator/examples/Circulator/CMakeLists.txt index 45ce196888c..7ac0a4ca88c 100644 --- a/Circulator/examples/Circulator/CMakeLists.txt +++ b/Circulator/examples/Circulator/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circulator_Examples) find_package(CGAL REQUIRED) diff --git a/Circulator/test/Circulator/CMakeLists.txt b/Circulator/test/Circulator/CMakeLists.txt index 379b55cc364..a502c47e06f 100644 --- a/Circulator/test/Circulator/CMakeLists.txt +++ b/Circulator/test/Circulator/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circulator_Tests) find_package(CGAL REQUIRED) diff --git a/Classification/examples/Classification/CMakeLists.txt b/Classification/examples/Classification/CMakeLists.txt index 803d4279ead..e9e93a6d3a6 100644 --- a/Classification/examples/Classification/CMakeLists.txt +++ b/Classification/examples/Classification/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Classification_Examples) # CGAL and its components diff --git a/Classification/test/Classification/CMakeLists.txt b/Classification/test/Classification/CMakeLists.txt index 332dc9216d8..0135ea6f175 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Classification_Tests) # CGAL and its components diff --git a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt index 828f4756926..98a1e50f7e1 100644 --- a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Combinatorial_map_Examples) find_package(CGAL REQUIRED) diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index b440e257636..271451857f9 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Combinatorial_map_Tests) find_package(CGAL REQUIRED) diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index 4f4f2226ffc..2ac677d7d71 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Cone_spanners_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index e4d05d60618..559a6418940 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt index 6fb39bf6485..3e4532f6ffc 100644 --- a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_decomposition_3_Examples) find_package(CGAL REQUIRED) diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt index 660388d7120..e06420b426b 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_decomposition_3_Tests) find_package(CGAL REQUIRED) diff --git a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt index dad37d65a65..76a81ede555 100644 --- a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_hull_2_Examples) find_package(CGAL REQUIRED) diff --git a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt index ba7b0c0b8c1..3a37f23f9aa 100644 --- a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_hull_2_Tests) find_package(CGAL REQUIRED) diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index add02f31d30..99b49365013 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_hull_3_Examples) # CGAL and its components diff --git a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt index 3f8e9eb6830..600579792d5 100644 --- a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_hull_3_Tests) find_package(CGAL REQUIRED) diff --git a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt index 5e04a505476..15d4dd6b201 100644 --- a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt +++ b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Convex_hull_d_Tests) find_package(CGAL REQUIRED) diff --git a/Distance_2/test/Distance_2/CMakeLists.txt b/Distance_2/test/Distance_2/CMakeLists.txt index 18adb56e7b8..944049ddb60 100644 --- a/Distance_2/test/Distance_2/CMakeLists.txt +++ b/Distance_2/test/Distance_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Distance_2_Tests) find_package(CGAL REQUIRED) diff --git a/Distance_3/test/Distance_3/CMakeLists.txt b/Distance_3/test/Distance_3/CMakeLists.txt index 9d4d21a31ec..0bdc29865c1 100644 --- a/Distance_3/test/Distance_3/CMakeLists.txt +++ b/Distance_3/test/Distance_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Distance_3_Tests) find_package(CGAL REQUIRED) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index b251731cafc..8695b4b144d 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Documentation NONE) # Check whether this cmake script is the top level one @@ -24,7 +24,7 @@ else() set(CGAL_ROOT "${CMAKE_SOURCE_DIR}") endif() -cmake_minimum_required(VERSION 3.18..3.29) # for list(SORT ... COMPARE NATURAL) +cmake_minimum_required(VERSION 3.18...3.31) # for list(SORT ... COMPARE NATURAL) find_package(Doxygen REQUIRED) find_package(Python3 REQUIRED COMPONENTS Interpreter) diff --git a/Envelope_2/examples/Envelope_2/CMakeLists.txt b/Envelope_2/examples/Envelope_2/CMakeLists.txt index 54144877d58..4afdfc6f5f8 100644 --- a/Envelope_2/examples/Envelope_2/CMakeLists.txt +++ b/Envelope_2/examples/Envelope_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Envelope_2_Examples) find_package(CGAL REQUIRED) diff --git a/Envelope_2/test/Envelope_2/CMakeLists.txt b/Envelope_2/test/Envelope_2/CMakeLists.txt index 37225c2f3a0..9e771071fb6 100644 --- a/Envelope_2/test/Envelope_2/CMakeLists.txt +++ b/Envelope_2/test/Envelope_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Envelope_2_Tests) find_package(CGAL REQUIRED) diff --git a/Envelope_3/examples/Envelope_3/CMakeLists.txt b/Envelope_3/examples/Envelope_3/CMakeLists.txt index 089c44b56b4..283a2b54ce4 100644 --- a/Envelope_3/examples/Envelope_3/CMakeLists.txt +++ b/Envelope_3/examples/Envelope_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Envelope_3_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Envelope_3/test/Envelope_3/CMakeLists.txt b/Envelope_3/test/Envelope_3/CMakeLists.txt index 251474dc57a..b9038463e38 100644 --- a/Envelope_3/test/Envelope_3/CMakeLists.txt +++ b/Envelope_3/test/Envelope_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Envelope_3_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt index 9852fdad283..290027a019c 100644 --- a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Filtered_kernel_test) add_executable(bench_simple_comparisons bench_simple_comparisons.cpp) diff --git a/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt index bd9a629f447..cd7bdb737ce 100644 --- a/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Filtered_kernel_Examples) find_package(CGAL REQUIRED) diff --git a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt index da741c2f754..1536d81a950 100644 --- a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Filtered_kernel_Tests) find_package(CGAL REQUIRED) diff --git a/Generalized_map/examples/Generalized_map/CMakeLists.txt b/Generalized_map/examples/Generalized_map/CMakeLists.txt index d0ec729d64c..84d5801abdc 100644 --- a/Generalized_map/examples/Generalized_map/CMakeLists.txt +++ b/Generalized_map/examples/Generalized_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generalized_map_Examples) find_package(CGAL REQUIRED) diff --git a/Generalized_map/test/Generalized_map/CMakeLists.txt b/Generalized_map/test/Generalized_map/CMakeLists.txt index 24ac67748cd..792b023745e 100644 --- a/Generalized_map/test/Generalized_map/CMakeLists.txt +++ b/Generalized_map/test/Generalized_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generalized_map_Tests) # CGAL and its components diff --git a/Generator/benchmark/Generator/CMakeLists.txt b/Generator/benchmark/Generator/CMakeLists.txt index e1daf72a299..b8d4c9b9e01 100644 --- a/Generator/benchmark/Generator/CMakeLists.txt +++ b/Generator/benchmark/Generator/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generator_example) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Generator/examples/Generator/CMakeLists.txt b/Generator/examples/Generator/CMakeLists.txt index 39e4934705d..0575929b894 100644 --- a/Generator/examples/Generator/CMakeLists.txt +++ b/Generator/examples/Generator/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generator_Examples) find_package(CGAL REQUIRED) diff --git a/Generator/test/Generator/CMakeLists.txt b/Generator/test/Generator/CMakeLists.txt index e7708299971..060c4b02905 100644 --- a/Generator/test/Generator/CMakeLists.txt +++ b/Generator/test/Generator/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generator_Tests) find_package(CGAL REQUIRED) diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index d421e758dc2..0f092bdddba 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Alpha_shapes_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index 79a9c584324..0e495788267 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Apollonius_graph_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 7a1c55e2375..a28575fd8a7 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Bounding_volumes_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 3689b6a4495..7f84c3aa5e6 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Circular_kernel_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index 75ab3c6083e..b1b3ef328c6 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Generator_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 9568fd3efae..357832f21b3 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(GraphicsView_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index 0a682e80fa8..b08284c8501 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(L1_Voronoi_diagram_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index 2dbae37b697..970f4eb17ba 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Largest_empty_rect_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index f630c8c6e80..08f3756e10f 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_2_triangulation_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index 85a964989c8..eb899f59ba3 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index 7f805e60986..2ea54637c3c 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index fc773d81ace..d7aafeb267e 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_Linf_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core) diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index 9d3c41854bf..ea60ca9c267 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Snap_rounding_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index fd02ea6c1e9..a4a73095859 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_searching_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index 3c76339638a..d07003892d3 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_lines_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index 141852b3ed5..613df8d2348 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_2_Demo) set(CMAKE_AUTOMOC ON) diff --git a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt index 49a4bd1c16f..d2669e130dc 100644 --- a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(HalfedgeDS_Examples) find_package(CGAL REQUIRED) diff --git a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt index bab4ef15f0a..cd29aa12692 100644 --- a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(HalfedgeDS_Tests) find_package(CGAL REQUIRED) diff --git a/Hash_map/benchmark/Hash_map/CMakeLists.txt b/Hash_map/benchmark/Hash_map/CMakeLists.txt index 51860317694..860f31fd055 100644 --- a/Hash_map/benchmark/Hash_map/CMakeLists.txt +++ b/Hash_map/benchmark/Hash_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hash_map) # CGAL and its components diff --git a/Hash_map/test/Hash_map/CMakeLists.txt b/Hash_map/test/Hash_map/CMakeLists.txt index c2a6220bc7a..22e0de0f9a6 100644 --- a/Hash_map/test/Hash_map/CMakeLists.txt +++ b/Hash_map/test/Hash_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hash_map_Tests) find_package(CGAL REQUIRED) diff --git a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt index 250921f012f..8bc9d360ca3 100644 --- a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Heat_method_3_Examples) # CGAL and its components diff --git a/Heat_method_3/test/Heat_method_3/CMakeLists.txt b/Heat_method_3/test/Heat_method_3/CMakeLists.txt index 056f15040a3..f8b3f13f0b1 100644 --- a/Heat_method_3/test/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/test/Heat_method_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Heat_method_3_Tests) # CGAL and its components diff --git a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt index 7664529ebee..55c2cce7fb5 100644 --- a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hyperbolic_triangulation_2_benchmark) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index 7c0da4ed37b..c27e6da78fa 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hyperbolic_triangulation_2_Demo) # Find includes in corresponding build directories diff --git a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt index 04291fd4612..48b87097c62 100644 --- a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hyperbolic_triangulation_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt index 4d4c4397245..4c251645f27 100644 --- a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Hyperbolic_triangulation_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt index ae8130bfe5d..b9a8add8e8e 100644 --- a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Inscribed_areas_Examples) find_package(CGAL REQUIRED) diff --git a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt index afd79762867..0b5ba8ac02e 100644 --- a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Inscribed_areas_Tests) find_package(CGAL REQUIRED) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 7ec3a5575ce..216c8c47ac6 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -4,7 +4,7 @@ # ${CGAL_SOURCE_DIR} and to the root binary directory of the project as # ${CGAL_BINARY_DIR} or ${CGAL_BINARY_DIR}. if(NOT PROJECT_NAME) - cmake_minimum_required(VERSION 3.12...3.29) + cmake_minimum_required(VERSION 3.12...3.31) project(CGAL CXX C) endif() diff --git a/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake b/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake index 0b0a2b80b1b..464d2bdd911 100644 --- a/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake +++ b/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support) if( WIN32 ) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index e3dadc7b4e4..a73e12026d1 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -23,7 +23,7 @@ # If set, the `LEDA` library will be searched and used to provide # the exact number types used by CGAL kernels. # -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) if(CGAL_SetupCGALDependencies_included) return() endif() diff --git a/Installation/cmake/modules/CGAL_SetupLEDA.cmake b/Installation/cmake/modules/CGAL_SetupLEDA.cmake index 171f6f39e9d..4037c21f5b1 100644 --- a/Installation/cmake/modules/CGAL_SetupLEDA.cmake +++ b/Installation/cmake/modules/CGAL_SetupLEDA.cmake @@ -9,7 +9,7 @@ # find_package(LEDA) # # and defines the function :command:`use_CGAL_LEDA_support`. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) if(CGAL_SetupLEDA_included) return() endif() diff --git a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake index 4559bf506d1..43d17a055f8 100644 --- a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake +++ b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake @@ -6,7 +6,7 @@ # the configuration. # # See https://stackoverflow.com/a/43300621/1728537 for the starting point. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) if(CGAL_SKIP_CMAKE_HOOKS) return() diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 96c284fa9d8..763a23f1903 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_DEMOS) if(CGAL_BRANCH_BUILD) diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index e62d49c187d..dbea4ed3589 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_EXAMPLES) if(CGAL_BRANCH_BUILD) diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index e0163f201ab..3b9e82aa53a 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(CGAL_TESTS) if(CGAL_BRANCH_BUILD) diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index 5fb67b8eae2..183337517e3 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Installation_Tests ) diff --git a/Installation/test/Installation/test_configuration.cmake.in b/Installation/test/Installation/test_configuration.cmake.in index fa820a795a5..e300407f0c8 100644 --- a/Installation/test/Installation/test_configuration.cmake.in +++ b/Installation/test/Installation/test_configuration.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(test_configuration) find_package(CGAL) add_definitions(-DQT_NO_KEYWORDS) diff --git a/Installation/test/Installation/test_configuration_qt.cmake.in b/Installation/test/Installation/test_configuration_qt.cmake.in index 5dda5a91bc2..3e2e50894f4 100644 --- a/Installation/test/Installation/test_configuration_qt.cmake.in +++ b/Installation/test/Installation/test_configuration_qt.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(test_configuration) find_package(CGAL COMPONENTS Qt6) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) diff --git a/Installation/test/Installation/test_find_package.cmake.in b/Installation/test/Installation/test_find_package.cmake.in index cf759c73b85..eab8e03ed2e 100644 --- a/Installation/test/Installation/test_find_package.cmake.in +++ b/Installation/test/Installation/test_find_package.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( test_find_package_${mode} ) find_package(CGAL ${VERSION} ${EXACT}REQUIRED PATHS ${CGAL_DIR} diff --git a/Interpolation/examples/Interpolation/CMakeLists.txt b/Interpolation/examples/Interpolation/CMakeLists.txt index 0277e9aaf30..7d49ebcd9ae 100644 --- a/Interpolation/examples/Interpolation/CMakeLists.txt +++ b/Interpolation/examples/Interpolation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Interpolation_Examples) find_package(CGAL REQUIRED) diff --git a/Interpolation/test/Interpolation/CMakeLists.txt b/Interpolation/test/Interpolation/CMakeLists.txt index cbfc358658e..f0b23d66367 100644 --- a/Interpolation/test/Interpolation/CMakeLists.txt +++ b/Interpolation/test/Interpolation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Interpolation_Tests) find_package(CGAL REQUIRED) diff --git a/Intersections_2/test/Intersections_2/CMakeLists.txt b/Intersections_2/test/Intersections_2/CMakeLists.txt index 5fc9f53991f..773045a2af5 100644 --- a/Intersections_2/test/Intersections_2/CMakeLists.txt +++ b/Intersections_2/test/Intersections_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Intersections_2_Tests) find_package(CGAL REQUIRED) diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index 9b9ae08edee..8d34a143d23 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Intersections_3_Tests) find_package(CGAL REQUIRED) diff --git a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt index 458b71b043f..e0750e6dada 100644 --- a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Interval_skip_list_Examples) find_package(CGAL REQUIRED) diff --git a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt index 690a918f787..12315e15177 100644 --- a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Interval_skip_list_Tests) find_package(CGAL REQUIRED) diff --git a/Interval_support/test/Interval_support/CMakeLists.txt b/Interval_support/test/Interval_support/CMakeLists.txt index fd3788e50e9..d586b8c075f 100644 --- a/Interval_support/test/Interval_support/CMakeLists.txt +++ b/Interval_support/test/Interval_support/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Interval_support_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index a8bcc29b90c..abb85906be2 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Jet_fitting_3_Examples) find_package(CGAL REQUIRED) diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index 114067d5247..62b395e1d4b 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Jet_fitting_3_Tests) find_package(CGAL REQUIRED) diff --git a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt index 3d2109157eb..2a5152a9e61 100644 --- a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt +++ b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kernel_23_benchmark) find_package(CGAL QUIET OPTIONAL_COMPONENTS Core) diff --git a/Kernel_23/examples/Kernel_23/CMakeLists.txt b/Kernel_23/examples/Kernel_23/CMakeLists.txt index f1a8ba7716f..a9f8d9090b5 100644 --- a/Kernel_23/examples/Kernel_23/CMakeLists.txt +++ b/Kernel_23/examples/Kernel_23/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kernel_23_Examples) find_package(CGAL REQUIRED) diff --git a/Kernel_23/test/Kernel_23/CMakeLists.txt b/Kernel_23/test/Kernel_23/CMakeLists.txt index 106eced3810..ce9af1c75bc 100644 --- a/Kernel_23/test/Kernel_23/CMakeLists.txt +++ b/Kernel_23/test/Kernel_23/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kernel_23_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Kernel_d/test/Kernel_d/CMakeLists.txt b/Kernel_d/test/Kernel_d/CMakeLists.txt index 6798d13a087..221d83e5d9c 100644 --- a/Kernel_d/test/Kernel_d/CMakeLists.txt +++ b/Kernel_d/test/Kernel_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kernel_d_Tests) find_package(CGAL REQUIRED) diff --git a/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt b/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt index 0ae368020c1..5541e7b43ee 100644 --- a/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt +++ b/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kinetic_space_partition_Examples) diff --git a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt index 3df57e9e4d0..81789f3965f 100644 --- a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt +++ b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kinetic_space_partition_Tests) diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt index 5445891abb0..9ec2ba71fb9 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kinetic_surface_reconstruction_Examples) diff --git a/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt b/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt index bf6b5fc9d13..b4a355e2b65 100644 --- a/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt +++ b/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Kinetic_surface_reconstruction_Tests) diff --git a/Lab/demo/Lab/CMakeLists.txt b/Lab/demo/Lab/CMakeLists.txt index 885cd774ce1..13e6104e252 100644 --- a/Lab/demo/Lab/CMakeLists.txt +++ b/Lab/demo/Lab/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Lab_Demo) include(FeatureSummary) diff --git a/Lab/demo/Lab/Plugins/Three_examples/CMakeLists.txt b/Lab/demo/Lab/Plugins/Three_examples/CMakeLists.txt index 71dab011d58..ffa00e9b08d 100644 --- a/Lab/demo/Lab/Plugins/Three_examples/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/Three_examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Three_examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) diff --git a/Lab/demo/Lab/implicit_functions/CMakeLists.txt b/Lab/demo/Lab/implicit_functions/CMakeLists.txt index 5b42135b28f..8a3b34484c5 100644 --- a/Lab/demo/Lab/implicit_functions/CMakeLists.txt +++ b/Lab/demo/Lab/implicit_functions/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling the CGAL Mesh_3 demo implicit functions. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) include(CGALlab_macros) 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 23999e2d847..1b60deff9f5 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(LCC_performance_2) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt index 5166eee35ab..07266448a6f 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(LCC_performance_3) if(NOT POLICY CMP0070 AND POLICY CMP0053) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index 16b346a7564..b71bfe57fe0 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. # cmake ../ -DCMAKE_BUILD_TYPE=Debug -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Linear_cell_complex_Demo) # Find includes in corresponding build directories diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 22760ad87b6..e9604793e4b 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Linear_cell_complex_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 3f12de77cee..d19fc827d59 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Linear_cell_complex_Tests) find_package(CGAL REQUIRED) diff --git a/Matrix_search/examples/Matrix_search/CMakeLists.txt b/Matrix_search/examples/Matrix_search/CMakeLists.txt index 489663a3b18..9fb3b898c53 100644 --- a/Matrix_search/examples/Matrix_search/CMakeLists.txt +++ b/Matrix_search/examples/Matrix_search/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Matrix_search_Examples) find_package(CGAL REQUIRED) diff --git a/Matrix_search/test/Matrix_search/CMakeLists.txt b/Matrix_search/test/Matrix_search/CMakeLists.txt index d4f61200d6f..9e9f6d6d7a2 100644 --- a/Matrix_search/test/Matrix_search/CMakeLists.txt +++ b/Matrix_search/test/Matrix_search/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Matrix_search_Tests) find_package(CGAL REQUIRED) diff --git a/Mesh_2/demo/Mesh_2/CMakeLists.txt b/Mesh_2/demo/Mesh_2/CMakeLists.txt index 4c827ece080..c66e7cf908d 100644 --- a/Mesh_2/demo/Mesh_2/CMakeLists.txt +++ b/Mesh_2/demo/Mesh_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script (and then adapted manually). # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mesh_2_Demo) find_package(CGAL REQUIRED) diff --git a/Mesh_2/examples/Mesh_2/CMakeLists.txt b/Mesh_2/examples/Mesh_2/CMakeLists.txt index 474a477a39a..c94cec90f83 100644 --- a/Mesh_2/examples/Mesh_2/CMakeLists.txt +++ b/Mesh_2/examples/Mesh_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mesh_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 9ce291f819a..624252bb10f 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mesh_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt index 7e195ce1ff1..3d405fe7a39 100644 --- a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt +++ b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mesh_3_benchmark) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 18924a5dfeb..43bfed4f149 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mesh_3_Examples) add_compile_definitions(CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 38df3832193..9939a2710e7 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Mesh_3_Tests ) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt b/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt index 2675890b483..6d3c41dc210 100644 --- a/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt +++ b/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Minkowski_sum_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt index 8101b6f796f..ed1e8ab4b17 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt +++ b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Minkowski_sum_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt b/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt index ce370521c8d..aabbb66cef6 100644 --- a/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt +++ b/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Minkowski_sum_3_Examples) find_package(CGAL REQUIRED) diff --git a/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt b/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt index be42c09b870..e0ceeb5a0ae 100644 --- a/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt +++ b/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Minkowski_sum_3_Tests) find_package(CGAL REQUIRED) diff --git a/Modifier/test/Modifier/CMakeLists.txt b/Modifier/test/Modifier/CMakeLists.txt index f3e97f25058..b108e17d957 100644 --- a/Modifier/test/Modifier/CMakeLists.txt +++ b/Modifier/test/Modifier/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Modifier_Tests) find_package(CGAL REQUIRED) diff --git a/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt b/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt index 3c6dac4fb32..e5b0921efad 100644 --- a/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt +++ b/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Modular_arithmetic_Examples) find_package(CGAL REQUIRED) diff --git a/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt b/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt index 2e1de64de95..63f72c081cf 100644 --- a/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt +++ b/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Modular_arithmetic_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Nef_2/examples/Nef_2/CMakeLists.txt b/Nef_2/examples/Nef_2/CMakeLists.txt index 9ca8957decf..3c490beeff9 100644 --- a/Nef_2/examples/Nef_2/CMakeLists.txt +++ b/Nef_2/examples/Nef_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_2_Examples) find_package(CGAL REQUIRED) diff --git a/Nef_2/test/Nef_2/CMakeLists.txt b/Nef_2/test/Nef_2/CMakeLists.txt index ef5af7b668c..cb3cc582064 100644 --- a/Nef_2/test/Nef_2/CMakeLists.txt +++ b/Nef_2/test/Nef_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_2_Tests) find_package(CGAL REQUIRED) diff --git a/Nef_3/examples/Nef_3/CMakeLists.txt b/Nef_3/examples/Nef_3/CMakeLists.txt index 6518c16a63a..fcb40d9df4b 100644 --- a/Nef_3/examples/Nef_3/CMakeLists.txt +++ b/Nef_3/examples/Nef_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_3_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Nef_3/test/Nef_3/CMakeLists.txt b/Nef_3/test/Nef_3/CMakeLists.txt index c677695e7a4..2d25d23d28c 100644 --- a/Nef_3/test/Nef_3/CMakeLists.txt +++ b/Nef_3/test/Nef_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_3_Tests) find_package(CGAL REQUIRED) diff --git a/Nef_S2/examples/Nef_S2/CMakeLists.txt b/Nef_S2/examples/Nef_S2/CMakeLists.txt index 98f9d50a745..ca59ec51f5f 100644 --- a/Nef_S2/examples/Nef_S2/CMakeLists.txt +++ b/Nef_S2/examples/Nef_S2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_S2_Examples) find_package(CGAL REQUIRED) diff --git a/Nef_S2/test/Nef_S2/CMakeLists.txt b/Nef_S2/test/Nef_S2/CMakeLists.txt index f017155ef25..0d7c5961cb5 100644 --- a/Nef_S2/test/Nef_S2/CMakeLists.txt +++ b/Nef_S2/test/Nef_S2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Nef_S2_Tests) find_package(CGAL REQUIRED) diff --git a/NewKernel_d/test/NewKernel_d/CMakeLists.txt b/NewKernel_d/test/NewKernel_d/CMakeLists.txt index 9bdfee78314..aa9bf6f75f5 100644 --- a/NewKernel_d/test/NewKernel_d/CMakeLists.txt +++ b/NewKernel_d/test/NewKernel_d/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. # Then modified by hand to add Eigen3. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(NewKernel_d_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index cf016a80eb9..2866af70bbf 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -3,7 +3,7 @@ # that dependency so as to test all the number types not depending on CORE # when it is not installed -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Number_types_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt index 3037ca8cb79..dbff84b5cf6 100644 --- a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_bounding_box_Benchmark) # CGAL and its components diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt index 816d10c0403..5e9acc6a48d 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_bounding_box_Examples) find_package(CGAL REQUIRED) diff --git a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt index 760507a79dd..c2f277d1f6a 100644 --- a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_bounding_box_Tests) find_package(CGAL REQUIRED) diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt index 97595c0cf1a..4003e1cb641 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling the Optimal_transportation_reconstruction_2 demo. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_transportation_reconstruction_2_Demo) # Find CGAL and CGAL Qt6 diff --git a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt index bd9f655378c..b5deb81be03 100644 --- a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_transportation_reconstruction_2_Examples) find_package(CGAL REQUIRED) diff --git a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt index e29f69f4789..bef1792ee07 100644 --- a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Optimal_transportation_reconstruction_2_Tests) find_package(CGAL REQUIRED) diff --git a/Orthtree/benchmark/Orthtree/CMakeLists.txt b/Orthtree/benchmark/Orthtree/CMakeLists.txt index db70e151365..80e8a7f627a 100644 --- a/Orthtree/benchmark/Orthtree/CMakeLists.txt +++ b/Orthtree/benchmark/Orthtree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Orthtree_benchmarks) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Orthtree/examples/Orthtree/CMakeLists.txt b/Orthtree/examples/Orthtree/CMakeLists.txt index d3f055198e0..ac8701d8606 100644 --- a/Orthtree/examples/Orthtree/CMakeLists.txt +++ b/Orthtree/examples/Orthtree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Orthtree_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Orthtree/test/Orthtree/CMakeLists.txt b/Orthtree/test/Orthtree/CMakeLists.txt index 95fe59cc1f3..dc748180184 100644 --- a/Orthtree/test/Orthtree/CMakeLists.txt +++ b/Orthtree/test/Orthtree/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Orthtree_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Partition_2/examples/Partition_2/CMakeLists.txt b/Partition_2/examples/Partition_2/CMakeLists.txt index 24b09d7c89e..d49f9f442ac 100644 --- a/Partition_2/examples/Partition_2/CMakeLists.txt +++ b/Partition_2/examples/Partition_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Partition_2_Examples) find_package(CGAL REQUIRED) diff --git a/Partition_2/test/Partition_2/CMakeLists.txt b/Partition_2/test/Partition_2/CMakeLists.txt index a2ad0dec5b1..800296c631c 100644 --- a/Partition_2/test/Partition_2/CMakeLists.txt +++ b/Partition_2/test/Partition_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Partition_2_Tests) find_package(CGAL REQUIRED) diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt index 671221a301b..85d443b4c6f 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_2_triangulation_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt index 3857996a534..97515a1033e 100644 --- a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_2_triangulation_2_Tests) find_package(CGAL REQUIRED) diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt index 1141a255ca4..f235193705c 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_3_mesh_3_Examples) # CGAL and its components diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt index aae24ad082f..9f3c5f07053 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_3_mesh_3_Tests) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index c4c128de19b..6b90b0e0f25 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_3_triangulation_3_Demo) # Find CGAL diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index d67cc64b6b1..d29a1ece79f 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_Lloyd_3_Demo) # Find includes in corresponding build directories diff --git a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt index f3e7a18fe8c..fb35b20f971 100644 --- a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_3_triangulation_3_Examples) find_package(CGAL REQUIRED) diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt index 815a9b879ee..05b76f88ab1 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_3_triangulation_3_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 17ac086a9bb..ee71ca43dd8 100644 --- a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_4_hyperbolic_triangulation_2_Benchmarks) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index fc1fe3c37f5..c1caa76995d 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_4_hyperbolic_triangulation_2_Demo) # Find includes in corresponding build directories diff --git a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 333f5b8bb70..fdd4bb5dba1 100644 --- a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_4_hyperbolic_triangulation_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index e96c2cde310..da0ae01213d 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Periodic_4_hyperbolic_triangulation_2_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Point_set_2/examples/Point_set_2/CMakeLists.txt b/Point_set_2/examples/Point_set_2/CMakeLists.txt index 1647542ae82..976cbdd6252 100644 --- a/Point_set_2/examples/Point_set_2/CMakeLists.txt +++ b/Point_set_2/examples/Point_set_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_2_Examples) find_package(CGAL REQUIRED) diff --git a/Point_set_2/test/Point_set_2/CMakeLists.txt b/Point_set_2/test/Point_set_2/CMakeLists.txt index 7c16ce3b6e6..77cf12967f8 100644 --- a/Point_set_2/test/Point_set_2/CMakeLists.txt +++ b/Point_set_2/test/Point_set_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_2_Tests) find_package(CGAL REQUIRED) diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index a8246bf0f58..1019bcd4ef1 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_3_Examples) # CGAL and its components diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index b2c092e2aad..9e71a02f4d6 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_3_Tests) # CGAL and its components diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index 01a9ff49e64..8b5670a14d2 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_processing_3_Examples) # Find CGAL diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index b4389a10e2a..057375261ad 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Point_set_processing_3_Tests) # Find CGAL diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt index 3e6aeed0e53..3832688cbd9 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Poisson_surface_reconstruction_3_Examples) # Find CGAL diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt index 6fdba5526cb..3592fc3e950 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Poisson_surface_reconstruction_3_Tests) # Find CGAL diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index 55e73061294..f41d86812bd 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Polygon/test/Polygon/CMakeLists.txt b/Polygon/test/Polygon/CMakeLists.txt index 3f05c88ad8d..f8f4d524748 100644 --- a/Polygon/test/Polygon/CMakeLists.txt +++ b/Polygon/test/Polygon/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_Tests) find_package(CGAL REQUIRED) diff --git a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt index 11c27fb7f81..c24a90d7904 100644 --- a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_mesh_processing) # CGAL and its components diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 6f010df3bab..cbeb71cb6b9 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_mesh_processing_Examples) # CGAL and its components diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 44b52f55548..12cb26ca381 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_mesh_processing_Tests) # CGAL and its components diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 93722bb7c3b..1053fbe2725 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_repair_Examples) find_package(CGAL REQUIRED) diff --git a/Polygon_repair/test/Polygon_repair/CMakeLists.txt b/Polygon_repair/test/Polygon_repair/CMakeLists.txt index a1564d5dd16..1ec7a341fc2 100644 --- a/Polygon_repair/test/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/test/Polygon_repair/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygon_repair_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt index c2a83f6adaf..677cfe1d36f 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygonal_surface_reconstruction_Examples) diff --git a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt index 343c6c9bf8f..43ee357b3b4 100644 --- a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polygonal_surface_reconstruction_Tests) diff --git a/Polyhedron/examples/Polyhedron/CMakeLists.txt b/Polyhedron/examples/Polyhedron/CMakeLists.txt index 3bd3c35604f..aa94d1a604a 100644 --- a/Polyhedron/examples/Polyhedron/CMakeLists.txt +++ b/Polyhedron/examples/Polyhedron/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polyhedron_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Polyhedron/test/Polyhedron/CMakeLists.txt b/Polyhedron/test/Polyhedron/CMakeLists.txt index 731cae0763b..d84cec3bf76 100644 --- a/Polyhedron/test/Polyhedron/CMakeLists.txt +++ b/Polyhedron/test/Polyhedron/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polyhedron_Tests) find_package(CGAL REQUIRED) diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 97f1671d671..9f5b6aa8870 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polyline_simplification_2_Demo) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt index 11ced7973c1..e0f8fe666df 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polyline_simplification_2_Examples) find_package(CGAL REQUIRED) diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt index 6099c152bd8..be79ae27506 100644 --- a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polyline_simplification_2_Tests) # CGAL and its components diff --git a/Polynomial/examples/Polynomial/CMakeLists.txt b/Polynomial/examples/Polynomial/CMakeLists.txt index 330d6653e99..5b6244410d9 100644 --- a/Polynomial/examples/Polynomial/CMakeLists.txt +++ b/Polynomial/examples/Polynomial/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polynomial_Examples) find_package(CGAL REQUIRED) diff --git a/Polynomial/test/Polynomial/CMakeLists.txt b/Polynomial/test/Polynomial/CMakeLists.txt index e39eb04c74b..85669731c54 100644 --- a/Polynomial/test/Polynomial/CMakeLists.txt +++ b/Polynomial/test/Polynomial/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polynomial_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt index 20a8fde663f..5635786cc3a 100644 --- a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polytope_distance_d_Examples) find_package(CGAL REQUIRED) diff --git a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt index 12ea05b9a05..f229a4a3fc8 100644 --- a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Polytope_distance_d_Tests) find_package(CGAL REQUIRED) diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index 9f3d7cbefb7..bfcf7dcc124 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling the PCA demo. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Principal_component_analysis_Demo) include_directories(./) diff --git a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt index a7b0a40595b..13cdc5491b6 100644 --- a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Principal_component_analysis_Examples) find_package(CGAL REQUIRED) diff --git a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt index 5541cb45dff..1de7c904d88 100644 --- a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Principal_component_analysis_Tests) find_package(CGAL REQUIRED) diff --git a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt index d43577af955..003528dd134 100644 --- a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Profiling_tools_Examples) find_package(CGAL REQUIRED) diff --git a/Profiling_tools/test/Profiling_tools/CMakeLists.txt b/Profiling_tools/test/Profiling_tools/CMakeLists.txt index e366a8e9b9d..be4a6179e39 100644 --- a/Profiling_tools/test/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/test/Profiling_tools/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Profiling_tools_Tests) find_package(CGAL REQUIRED) diff --git a/Property_map/examples/Property_map/CMakeLists.txt b/Property_map/examples/Property_map/CMakeLists.txt index 79bb8862815..8e54346059c 100644 --- a/Property_map/examples/Property_map/CMakeLists.txt +++ b/Property_map/examples/Property_map/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Property_map_Examples) # CGAL and its components diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index a51a39b66d0..bd35081602c 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Property_map_Tests) # CGAL and its components diff --git a/QP_solver/examples/QP_solver/CMakeLists.txt b/QP_solver/examples/QP_solver/CMakeLists.txt index 530025ed487..29636c20e0b 100644 --- a/QP_solver/examples/QP_solver/CMakeLists.txt +++ b/QP_solver/examples/QP_solver/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(QP_solver_Examples) find_package(CGAL REQUIRED) diff --git a/QP_solver/test/QP_solver/CMakeLists.txt b/QP_solver/test/QP_solver/CMakeLists.txt index bf4d78ee26d..e113c1a0a72 100644 --- a/QP_solver/test/QP_solver/CMakeLists.txt +++ b/QP_solver/test/QP_solver/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(QP_solver_Tests) find_package(CGAL REQUIRED) diff --git a/Random_numbers/test/Random_numbers/CMakeLists.txt b/Random_numbers/test/Random_numbers/CMakeLists.txt index 9b06ba31570..3a3141fb5d9 100644 --- a/Random_numbers/test/Random_numbers/CMakeLists.txt +++ b/Random_numbers/test/Random_numbers/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Random_numbers_Tests) find_package(CGAL REQUIRED) diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index 6eab0514fad..a3bcb30ed91 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -1,5 +1,5 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Ridges_3_Examples) find_package(CGAL REQUIRED) diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index 9e7305e6953..e61df02393c 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Ridges_3_Tests) find_package(CGAL REQUIRED) diff --git a/SMDS_3/examples/SMDS_3/CMakeLists.txt b/SMDS_3/examples/SMDS_3/CMakeLists.txt index c00acbc0408..77d7ba6b6a8 100644 --- a/SMDS_3/examples/SMDS_3/CMakeLists.txt +++ b/SMDS_3/examples/SMDS_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(SMDS_3_Examples) diff --git a/SMDS_3/test/SMDS_3/CMakeLists.txt b/SMDS_3/test/SMDS_3/CMakeLists.txt index 75c24114c88..5e3c56f8260 100644 --- a/SMDS_3/test/SMDS_3/CMakeLists.txt +++ b/SMDS_3/test/SMDS_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(SMDS_3_Tests) find_package(CGAL REQUIRED) diff --git a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt index 785873363e7..cfc92cf79eb 100644 --- a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Compact_container_benchmark) find_package(CGAL REQUIRED) diff --git a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt index beb128ff1da..91adfa06755 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(copy_n_benchmark_example) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/STL_Extension/examples/STL_Extension/CMakeLists.txt b/STL_Extension/examples/STL_Extension/CMakeLists.txt index be616289bff..e0124056098 100644 --- a/STL_Extension/examples/STL_Extension/CMakeLists.txt +++ b/STL_Extension/examples/STL_Extension/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(STL_Extension_Examples) find_package(CGAL REQUIRED) diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index fafddb64a21..b1007acfcb5 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(STL_Extension_Tests) find_package(CGAL REQUIRED) diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt index 194a7c45a7a..5210e9a1e61 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Scale_space_reconstruction_3_Examples) find_package(CGAL REQUIRED) diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index b6312224eae..1d8a21b403e 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -10,7 +10,7 @@ # GPL_PACKAGE_LIST=path to a file containing the list of GPL packages to include in the release. If not provided all of them are. # GENERATE_TARBALLS=[ON/OFF] indicates if release tarballs should be created as DESTINATION -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) find_program(BASH NAMES bash sh) function(process_package pkg) if(VERBOSE) diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists index e83f25c1286..122db278a79 100755 --- a/Scripts/scripts/cgal_create_CMakeLists +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -85,7 +85,7 @@ create_cmake_script_with_options() # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) EOF #--------------------------------------------------------------------------- diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 3b74a4a3da6..5d13a29f819 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -31,7 +31,7 @@ create_cmake_script() # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( ${PROJECT}${TYPE} ) find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) diff --git a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt index cd2ca858e8c..e76de2ed570 100644 --- a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(RangeSegmentTrees_Examples) find_package(CGAL REQUIRED) diff --git a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt index 661aac496bb..4d9c045cdca 100644 --- a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(RangeSegmentTrees_Tests) find_package(CGAL REQUIRED) diff --git a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt index 7b51d363797..c8eaef98912 100644 --- a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_2_example) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt index 18da5df1518..5b83dc70bdf 100644 --- a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt index 9507b4e0539..39174628037 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 490127d7e40..c6070560bce 100644 --- a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_2_example) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 36922d90e81..85becfa330f 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_Linf_2_Examples) find_package(CGAL REQUIRED) diff --git a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 7c8b12dcd47..d4b41c10d96 100644 --- a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Segment_Delaunay_graph_Linf_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt index d8a58dc8c2e..95db7735c9c 100644 --- a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Set_movable_separability_2_Examples) find_package(CGAL REQUIRED) diff --git a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt index 7169e884959..633c1dc785c 100644 --- a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Set_movable_separability_2_Tests) if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) diff --git a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt index 5b6beaced89..600d1b6b8b0 100644 --- a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt +++ b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Shape_detection_Benchmarks) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Shape_detection/examples/Shape_detection/CMakeLists.txt b/Shape_detection/examples/Shape_detection/CMakeLists.txt index 0a942592731..7e5581c3126 100644 --- a/Shape_detection/examples/Shape_detection/CMakeLists.txt +++ b/Shape_detection/examples/Shape_detection/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Shape_detection_Examples) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Shape_detection/test/Shape_detection/CMakeLists.txt b/Shape_detection/test/Shape_detection/CMakeLists.txt index 85d23cf07d2..b8976228add 100644 --- a/Shape_detection/test/Shape_detection/CMakeLists.txt +++ b/Shape_detection/test/Shape_detection/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Shape_detection_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt index 58f2ab7b2b0..d9dd81993d4 100644 --- a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt @@ -3,7 +3,7 @@ project(Shape_regularization_Benchmarks) -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt index ed0104fe41a..fc4314a4124 100644 --- a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Shape_regularization_Examples) diff --git a/Shape_regularization/test/Shape_regularization/CMakeLists.txt b/Shape_regularization/test/Shape_regularization/CMakeLists.txt index 02762c7aa8a..a9ad0ee3e82 100644 --- a/Shape_regularization/test/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/test/Shape_regularization/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Shape_regularization_Tests) diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index 10bbb63a0e4..be6cde05f0e 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Skin_surface_3_Examples) find_package(CGAL REQUIRED) diff --git a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt index 3e6401efc37..2b31a9b2e8c 100644 --- a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Skin_surface_3_Tests) find_package(CGAL REQUIRED) diff --git a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt index 5b3941923b9..e09fa21f5d5 100644 --- a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Snap_rounding_2_Examples) find_package(CGAL REQUIRED) diff --git a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt index eba48480599..9add288c3ac 100644 --- a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Snap_rounding_2_Tests) find_package(CGAL REQUIRED) diff --git a/Solver_interface/examples/Solver_interface/CMakeLists.txt b/Solver_interface/examples/Solver_interface/CMakeLists.txt index f097c4238f3..0eb7b843212 100644 --- a/Solver_interface/examples/Solver_interface/CMakeLists.txt +++ b/Solver_interface/examples/Solver_interface/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Solver_interface_Examples) find_package(CGAL REQUIRED) diff --git a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt index f22da933174..03b97f1de01 100644 --- a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_searching_) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt index cf823429fee..be2a6e773f9 100644 --- a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(tools_) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt index bd3f74a6223..71295e2562a 100644 --- a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_searching_Examples) # CGAL and its components diff --git a/Spatial_searching/test/Spatial_searching/CMakeLists.txt b/Spatial_searching/test/Spatial_searching/CMakeLists.txt index c6bce28aef0..e078b954112 100644 --- a/Spatial_searching/test/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/test/Spatial_searching/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_searching_Tests) find_package(CGAL REQUIRED) diff --git a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt index 7311dc9811e..1b3fa5a4c03 100644 --- a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_sorting_) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt index 1fc5703e5b2..152bcab93be 100644 --- a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_sorting_Examples) find_package(CGAL REQUIRED) diff --git a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt index 1aa81dc1929..7b94c7f8bf1 100644 --- a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Spatial_sorting_Tests) find_package(CGAL REQUIRED) diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt index e5caf454fd7..5ddeeabc56c 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Straight_skeleton_2_Examples ) find_package(CGAL REQUIRED COMPONENTS Qt6 Core) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index cbc1776327c..3ca9ff986a5 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Straight_skeleton_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 Core) diff --git a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt index a2ed8ab6571..ff03f42493d 100644 --- a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt +++ b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Straight_skeleton_extrusion_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 Core) diff --git a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt index fde8f8a4077..6075d84f275 100644 --- a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_lines_2_Examples) find_package(CGAL REQUIRED) diff --git a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt index dd57b219200..8c0a52900f0 100644 --- a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_lines_2_Tests) find_package(CGAL REQUIRED) diff --git a/Stream_support/benchmark/Stream_support/CMakeLists.txt b/Stream_support/benchmark/Stream_support/CMakeLists.txt index 365ada0dc3e..7ba9a8e0799 100644 --- a/Stream_support/benchmark/Stream_support/CMakeLists.txt +++ b/Stream_support/benchmark/Stream_support/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_support) # CGAL and its components diff --git a/Stream_support/examples/Stream_support/CMakeLists.txt b/Stream_support/examples/Stream_support/CMakeLists.txt index 899b86e7d9b..fc5a12d6f6e 100644 --- a/Stream_support/examples/Stream_support/CMakeLists.txt +++ b/Stream_support/examples/Stream_support/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_support_Examples) find_package(CGAL REQUIRED) diff --git a/Stream_support/test/Stream_support/CMakeLists.txt b/Stream_support/test/Stream_support/CMakeLists.txt index 217c1cc1de9..0247c46be05 100644 --- a/Stream_support/test/Stream_support/CMakeLists.txt +++ b/Stream_support/test/Stream_support/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Stream_support_Tests) find_package(CGAL REQUIRED) find_path( diff --git a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt index f7e403c4e81..e24a5f14ab4 100644 --- a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Subdivision_method_3_Examples) find_package(CGAL REQUIRED) diff --git a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt index 2e05ac1b014..05c94dc1e01 100644 --- a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Subdivision_method_3_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_mesh/benchmark/CMakeLists.txt b/Surface_mesh/benchmark/CMakeLists.txt index c963412dd5b..af89e27a5f4 100644 --- a/Surface_mesh/benchmark/CMakeLists.txt +++ b/Surface_mesh/benchmark/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_performance) find_package(CGAL REQUIRED) diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index 6b8821ccb12..bae80a7b2c2 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -6,7 +6,7 @@ # Used in /CGAL/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt. # Careful when modifying -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_Examples) #CGAL_Qt6 is needed for the drawing. diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 62d2cb3bca7..3b516fc15d0 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt index 469d78b87a5..cb4def4fdcd 100644 --- a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_approximation_Benchmarks) # CGAL and its components diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt index d45a9693351..8da14e07439 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_approximation_Examples) # CGAL and its components diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt index d085b8cec23..35473846c94 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_approximation_Tests) # CGAL and its components diff --git a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt index 19d66a7b1a3..c4b711d6aa4 100644 --- a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt +++ b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(benchmark_for_closest_rotation) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt index 58874d3f2dc..0f1a088904f 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_deformation_Demo) set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index bc5d23347f0..496bc254011 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_deformation_Examples) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index b0c1b9bc196..354813c8e73 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_deformation_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index 5d74cdca661..6fb5830e133 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_parameterization_Examples) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt index 36f681d45fd..0a0e459223a 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling this folder. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_parameterization_Tests) # Find CGAL diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index e3f63874b1f..3f7e9457909 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script_with_options # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_segmentation_Examples) # CGAL and its components diff --git a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt index 9c2e4233b54..d30a6c96f63 100644 --- a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_segmentation_Tests) find_package(CGAL REQUIRED) 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 ba5a6455d26..a30dca613c3 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 @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_shortest_path_Examples) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt index ea1eb891aab..f5ca543e44a 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_shortest_path_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index 384067e6005..56a52dd5cc4 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script_with_options # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_simplification_Examples) # CGAL and its components diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 6707d16ccd9..5453440119b 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_simplification_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt index 66e08127abd..181714c3a51 100644 --- a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script_with_options # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Mean_curvature_skeleton) # CGAL and its components diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index b5b8d4cd23f..60ccbd71f69 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_skeletonization_Examples) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt index cfbd1507754..d581a0b6d1a 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_skeletonization_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt index ed4937594fc..287b89df09e 100644 --- a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt @@ -1,6 +1,6 @@ project(Surface_mesh_topology_Benchmarks) -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) find_package(CGAL REQUIRED) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt index ae6793d8270..b528c238d49 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_topology_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt index dc45d083c3e..298d2838256 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesh_topology_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index 4613fe7dc45..56c3805ea0b 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -1,6 +1,6 @@ # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesher_Examples) find_package(CGAL REQUIRED COMPONENTS ImageIO) diff --git a/Surface_mesher/test/Surface_mesher/CMakeLists.txt b/Surface_mesher/test/Surface_mesher/CMakeLists.txt index 751de47ec99..555e184c83b 100644 --- a/Surface_mesher/test/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/test/Surface_mesher/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_mesher_Tests) find_package(CGAL REQUIRED) diff --git a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt index 9c8742904a3..efa3b73ce6e 100644 --- a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_sweep_2_Examples) # CGAL and its components diff --git a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt index 4cf76b87681..66ada8c1f56 100644 --- a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Surface_sweep_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/TDS_2/test/TDS_2/CMakeLists.txt b/TDS_2/test/TDS_2/CMakeLists.txt index 283d2478e12..4eae9c44970 100644 --- a/TDS_2/test/TDS_2/CMakeLists.txt +++ b/TDS_2/test/TDS_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(TDS_2_Tests) find_package(CGAL REQUIRED) diff --git a/TDS_3/examples/TDS_3/CMakeLists.txt b/TDS_3/examples/TDS_3/CMakeLists.txt index c0ba49a3d79..21ee9b95fb0 100644 --- a/TDS_3/examples/TDS_3/CMakeLists.txt +++ b/TDS_3/examples/TDS_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(TDS_3_Examples) find_package(CGAL REQUIRED) diff --git a/TDS_3/test/TDS_3/CMakeLists.txt b/TDS_3/test/TDS_3/CMakeLists.txt index 5cca940fe98..90fffaac8da 100644 --- a/TDS_3/test/TDS_3/CMakeLists.txt +++ b/TDS_3/test/TDS_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(TDS_3_Tests) find_package(CGAL REQUIRED) diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt index 64bbdc1a194..1e2f8f0d0ca 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Tetrahedral_remeshing_Examples) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index de0fb965c4e..63bc0c06023 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Tetrahedral_remeshing_Tests) diff --git a/Three/doc/Three/Three.txt b/Three/doc/Three/Three.txt index 2156a47f8a9..a9d180059da 100644 --- a/Three/doc/Three/Three.txt +++ b/Three/doc/Three/Three.txt @@ -328,7 +328,7 @@ Configure CMake as you desire and fetch the right Qt6 packages : set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) - cmake_minimum_required(VERSION 3.12...3.29) + cmake_minimum_required(VERSION 3.12...3.31) #Find CGAL find_package(CGAL COMPONENTS Qt6) @@ -366,7 +366,7 @@ Notice that an external plugin will not be automatically loaded in the Lab. It m set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) - cmake_minimum_required(VERSION 3.12...3.29) + cmake_minimum_required(VERSION 3.12...3.31) #Find CGAL find_package(CGAL COMPONENTS Qt6) diff --git a/Triangulation/applications/Triangulation/CMakeLists.txt b/Triangulation/applications/Triangulation/CMakeLists.txt index 262c38e3bda..2ed210eb1ca 100644 --- a/Triangulation/applications/Triangulation/CMakeLists.txt +++ b/Triangulation/applications/Triangulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script_with_options # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_apps) # CGAL and its components diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 0abb1fc41f9..5a3787259ee 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_benchmark) find_package(CGAL REQUIRED COMPONENTS Core) diff --git a/Triangulation/examples/Triangulation/CMakeLists.txt b/Triangulation/examples/Triangulation/CMakeLists.txt index 44e2a96f1e0..34edb7814bc 100644 --- a/Triangulation/examples/Triangulation/CMakeLists.txt +++ b/Triangulation/examples/Triangulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_Examples) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index ed03cdab900..23b67f9c497 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 2e2b15634af..22051dcdf3c 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_2_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Triangulation_2/test/Triangulation_2/CMakeLists.txt b/Triangulation_2/test/Triangulation_2/CMakeLists.txt index 341976b159f..9f78f053245 100644 --- a/Triangulation_2/test/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/test/Triangulation_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_2_Tests) find_package(CGAL REQUIRED) diff --git a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt index 5a6b5b4474c..544a5c02d2a 100644 --- a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_3) diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index df83176883d..a46df3c2e84 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_3_Demo) # Find includes in corresponding build directories diff --git a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt index 1c8eb7b1584..2a9989ce852 100644 --- a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_3_Examples) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index b90ecd55af3..70cc966fc1f 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Triangulation_3_Tests) find_package(CGAL REQUIRED) diff --git a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt index 7b4e8858a12..b69f26cca91 100644 --- a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Triangulation_on_sphere_2_Benchmarks ) diff --git a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt index 076adb04ea7..380d8b0ad72 100644 --- a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project (Triangulation_on_sphere_2_Demo) diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt index 80173de13c7..da864c07bb8 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Triangulation_on_sphere_2_Examples ) diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index 6120e72d373..f41b7819920 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project( Triangulation_on_sphere_2_Tests ) diff --git a/Union_find/test/Union_find/CMakeLists.txt b/Union_find/test/Union_find/CMakeLists.txt index 1fa61d78d72..5026bd87ee7 100644 --- a/Union_find/test/Union_find/CMakeLists.txt +++ b/Union_find/test/Union_find/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Union_find_Tests) find_package(CGAL REQUIRED) diff --git a/Visibility_2/examples/Visibility_2/CMakeLists.txt b/Visibility_2/examples/Visibility_2/CMakeLists.txt index 6a95ae841ca..545c4e885e0 100644 --- a/Visibility_2/examples/Visibility_2/CMakeLists.txt +++ b/Visibility_2/examples/Visibility_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Visibility_2_Examples) find_package(CGAL REQUIRED) diff --git a/Visibility_2/test/Visibility_2/CMakeLists.txt b/Visibility_2/test/Visibility_2/CMakeLists.txt index 8cb1638680b..10500645465 100644 --- a/Visibility_2/test/Visibility_2/CMakeLists.txt +++ b/Visibility_2/test/Visibility_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Visibility_2_Tests) find_package(CGAL REQUIRED) diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt index a0c18e3d250..f7e5cdd4475 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Voronoi_diagram_2_Examples) find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Qt6) diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt index de9e0f7256e..e08fd207164 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Voronoi_diagram_2_Tests) diff --git a/Weights/examples/Weights/CMakeLists.txt b/Weights/examples/Weights/CMakeLists.txt index 629ba82340d..6679efdee36 100644 --- a/Weights/examples/Weights/CMakeLists.txt +++ b/Weights/examples/Weights/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Weights_Examples) diff --git a/Weights/test/Weights/CMakeLists.txt b/Weights/test/Weights/CMakeLists.txt index 02aef6a76c5..36e7ba70117 100644 --- a/Weights/test/Weights/CMakeLists.txt +++ b/Weights/test/Weights/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12...3.29) +cmake_minimum_required(VERSION 3.12...3.31) project(Weights_Tests) From 26c3e9cd21c327186585c3434194784ad643d940 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 5 Feb 2025 10:28:46 +0100 Subject: [PATCH 281/332] Spelling correction Spelling correction --- .../Mesh_3/mesh_3D_image_with_custom_initialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index a3d5209a74b..fd07fd1090f 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -54,7 +54,7 @@ int main() .facet_angle(30).facet_size(3).facet_distance(1) .cell_radius_edge_ratio(3).cell_size(3)); - // custom_initial_points_generator will put points on the mesh for initialisation. + // custom_initial_points_generator will put points on the mesh for initialization. // Those points are objects of type std::tuple. // Weighted_point_3 is the point's position and weight, // int is the dimension of the minimal dimension subcomplex on which the point lies, From 6f65025259e0c69277c0e80f76cb611304de19fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Feb 2025 16:54:18 +0100 Subject: [PATCH 282/332] use std tuple --- .../Protect_edges_sizing_field.h | 23 ++++++++++--------- .../internal/Poisson_sphere_oracle_3.h | 14 +++++------ .../CGAL/Surface_mesher/Sphere_oracle_3.h | 14 +++++------ 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index eb9d4c93e51..fd1e0b9e104 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -52,8 +52,7 @@ #ifndef CGAL_NO_ASSERTIONS # include // for float_prior #endif -#include -#include + #include #include @@ -62,10 +61,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -511,11 +512,11 @@ private: const Vertex_handle v2, const Curve_index& curve_index) const; - boost::tuple get_positions(const Vertex_handle v1, - const Vertex_handle v2, - const Vertex_handle v3, - const Curve_index& curve_index, - const CGAL::Orientation orientation) const; + std::tuple get_positions(const Vertex_handle v1, + const Vertex_handle v2, + const Vertex_handle v3, + const Curve_index& curve_index, + const CGAL::Orientation orientation) const; private: C3T3& c3t3_; @@ -953,9 +954,9 @@ get_positions_with_unknown_orientation(const Vertex_handle v1, template -boost::tuple::Bare_point, - typename Protect_edges_sizing_field::Bare_point, - typename Protect_edges_sizing_field::Bare_point> +std::tuple::Bare_point, + typename Protect_edges_sizing_field::Bare_point, + typename Protect_edges_sizing_field::Bare_point> Protect_edges_sizing_field:: get_positions(const Vertex_handle v1, const Vertex_handle v2, @@ -969,7 +970,7 @@ get_positions(const Vertex_handle v1, std::tie(p2_check, p3) = get_positions(v2, v3, curve_index, orientation); CGAL_assertion(p2_check == p2); - return boost::make_tuple(p1, p2, p3); + return std::make_tuple(p1, p2, p3); } diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h index 6943afbdab3..36e56fe4d89 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_surface_reconstruction_3/internal/Poisson_sphere_oracle_3.h @@ -24,7 +24,7 @@ #include #include -#include +#include namespace CGAL { @@ -102,7 +102,7 @@ namespace CGAL { { const Self& oracle; - boost::tuple + std::tuple intersection_line_sphere_lambda(const Surface_3& sphere, const Point& a, const Point& b) const @@ -154,18 +154,18 @@ namespace CGAL { switch( CGAL::sign(deltaprime) ) { case ZERO: - return boost::make_tuple(1, ab_ac / ab2, 0); + return std::make_tuple(1, ab_ac / ab2, 0); case POSITIVE: { const FT sqrt_deltaprime = CGAL::sqrt(deltaprime); - return boost::make_tuple(2, - (ab_ac - sqrt_deltaprime) / ab2, - (ab_ac + sqrt_deltaprime) / ab2); + return std::make_tuple(2, + (ab_ac - sqrt_deltaprime) / ab2, + (ab_ac + sqrt_deltaprime) / ab2); } case NEGATIVE: break; } - return boost::make_tuple(0, 0, 0); + return std::make_tuple(0, 0, 0); } //end intersection_line_sphere_lambda template diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h index 263b88cbc19..92c9b08a56b 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Sphere_oracle_3.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace CGAL { @@ -96,7 +96,7 @@ namespace CGAL { { const Self& oracle; - boost::tuple + std::tuple intersection_line_sphere_lambda(const Surface_3& sphere, const Point& a, const Point& b) const @@ -148,18 +148,18 @@ namespace CGAL { switch( CGAL::sign(deltaprime) ) { case ZERO: - return boost::make_tuple(1, ab_ac / ab2, 0); + return std::make_tuple(1, ab_ac / ab2, 0); case POSITIVE: { const FT sqrt_deltaprime = CGAL::sqrt(deltaprime); - return boost::make_tuple(2, - (ab_ac - sqrt_deltaprime) / ab2, - (ab_ac + sqrt_deltaprime) / ab2); + return std::make_tuple(2, + (ab_ac - sqrt_deltaprime) / ab2, + (ab_ac + sqrt_deltaprime) / ab2); } case NEGATIVE: break; } - return boost::make_tuple(0, 0, 0); + return std::make_tuple(0, 0, 0); } //end intersection_line_sphere_lambda template From 050677f002f7478d95a61d75c30db7c5cf27263d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 6 Feb 2025 01:21:42 +0100 Subject: [PATCH 283/332] add CMake option CGAL_with_benchmarks --- AABB_tree/benchmark/AABB_tree/CMakeLists.txt | 2 +- Installation/CMakeLists.txt | 30 ++++--- Installation/cmake/modules/CGALHelpers.cmake | 84 +++++++++++++++++++ .../CGAL_CreateSingleSourceCGALProgram.cmake | 14 ++++ Installation/cmake/modules/CGAL_Macros.cmake | 49 +---------- .../cmake/modules/CGAL_SetupBoost.cmake | 6 +- Installation/demo/CMakeLists.txt | 40 +-------- Installation/examples/CMakeLists.txt | 41 +-------- Installation/test/CMakeLists.txt | 39 +-------- .../Linear_cell_complex_2/CMakeLists.txt | 4 +- .../surface_mesh/CMakeLists.txt | 4 +- Scripts/scripts/cgal_create_cmake_script | 17 ++-- 12 files changed, 146 insertions(+), 184 deletions(-) create mode 100644 Installation/cmake/modules/CGALHelpers.cmake diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 63ac01c5851..702558b2a05 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -13,7 +13,7 @@ create_single_source_cgal_program("tree_construction.cpp") find_package(benchmark QUIET) if(benchmark_FOUND) create_single_source_cgal_program("tree_creation.cpp") - target_link_libraries(tree_creation benchmark::benchmark) + target_link_libraries(tree_creation PRIVATE benchmark::benchmark) else() message(STATUS "NOTICE: The benchmark 'tree_creation.cpp' requires the Google benchmark library, and will not be compiled.") endif() diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 7ec3a5575ce..f0b7a66b321 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -826,36 +826,44 @@ if(NOT TARGET ALL_CGAL_TARGETS) add_custom_target(ALL_CGAL_TARGETS) endif() -macro(add_programs subdir target ON_OFF) +function(CGAL_add_subdirectories subdir name ON_OFF) + cmake_minimum_required(VERSION 3.14) + # CMake>=3.14 for `if(DEFINED CACHE{...})` + # see https://cmake.org/cmake/help/v3.31/command/if.html#defined cache_set(CGAL_EXECUTABLE_TARGETS "") - add_custom_target(${target}) - add_dependencies(ALL_CGAL_TARGETS ${target}) + add_custom_target(${name}) + add_dependencies(ALL_CGAL_TARGETS ${name}) - option(WITH_${target} "Select ${target}" ${ON_OFF}) - if(WITH_${target}) - add_subdirectory(${subdir} EXCLUDE_FROM_ALL) + if(DEFINED CACHE{WITH_${name}} AND "${WITH_${name}}" AND CMAKE_PROJECT_NAME STREQUAL "CGAL") + set(ON_OFF ON) + endif() + option(CGAL_WITH_${name} "Compile CGAL ${name}" ${ON_OFF}) + + if(CGAL_WITH_${name}) + CGAL_handle_subdirectories(${subdir} ${name}) endif() cache_get(CGAL_EXECUTABLE_TARGETS) foreach(CGAL_EXECUTABLE_TARGET ${CGAL_EXECUTABLE_TARGETS}) - add_dependencies(${target} ${CGAL_EXECUTABLE_TARGET}) + add_dependencies(${name} ${CGAL_EXECUTABLE_TARGET}) endforeach() -endmacro() +endfunction() # This allows programs to locate CGALConfig.cmake set(CGAL_DIR ${CGAL_BINARY_DIR}) if(NOT RUNNING_CGAL_AUTO_TEST) - add_programs(examples examples OFF) - add_programs(demo demos OFF) + CGAL_add_subdirectories(examples examples OFF) + CGAL_add_subdirectories(demo demos OFF) if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") - add_programs(test tests OFF) + CGAL_add_subdirectories(test tests OFF) endif() + CGAL_add_subdirectories(benchmark benchmarks OFF) endif() message("== Setting paths ==") diff --git a/Installation/cmake/modules/CGALHelpers.cmake b/Installation/cmake/modules/CGALHelpers.cmake new file mode 100644 index 00000000000..4c91469324f --- /dev/null +++ b/Installation/cmake/modules/CGALHelpers.cmake @@ -0,0 +1,84 @@ +cmake_minimum_required(VERSION 3.14) +include_guard(GLOBAL) + +function(process_CGAL_subdirectory entry subdir type_name) + # For example, subdir can be "examples", type_name "example", and entry "Mesh_2" + get_filename_component(ENTRY_DIR_NAME "${entry}" NAME) + + if( NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") # out-of-source + make_directory("${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") + endif() + + message("\n-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") + + set(source_dir "") + if(EXISTS ${entry}/CMakeLists.txt) + set(source_dir ${entry}) + else() + if(CGAL_CREATE_CMAKE_SCRIPT) + execute_process( + COMMAND bash ${CGAL_CREATE_CMAKE_SCRIPT} ${type_name} --source_dir "${entry}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}" + RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUTPUT_VAR ERROR_VARIABLE ERROR_VAR) + if(RESULT_VAR) + message(AUTHOR_WARNING "Error with ${CGAL_CREATE_CMAKE_SCRIPT} ${type_name} --source_dir ${entry}\n${OUTPUT_VAR}\n${ERROR_VAR}") + else() + set(source_dir "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") + endif() + endif() + endif() + if(source_dir) + add_subdirectory( "${source_dir}" "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}" EXCLUDE_FROM_ALL) + endif() +endfunction() + +function(CGAL_handle_subdirectories subdir_name plural_name) + string(TOUPPER "${plural_name}" plural_name_upper) + if("${plural_name}" MATCHES "s$") + string(LENGTH "${plural_name}" plural_name_length) + math(EXPR plural_name_length_minus_one "${plural_name_length} - 1") + string(SUBSTRING "${plural_name}" 0 "${plural_name_length_minus_one}" singular_name) + else() + set(singular_name "${plural_name}") + endif() + + project(CGAL_${plural_name_upper}) + + if(CGAL_BRANCH_BUILD) + + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + #message (STATUS "Current package: ${package}") + file(GLOB listtmp "${package}/${subdir_name}/*") + list(APPEND list CONFIGURE_DEPENDS ${listtmp}) + endforeach() + + else() + + file(GLOB list "*") + + endif() + + if(NOT list) + return() + endif() + + list(SORT list) + + message("== Generating build files for ${plural_name} ==") + foreach(entry ${list}) + + if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) + + file(GLOB files "${entry}/*.cpp") + + # If there is no .cpp files, ignore the sub-directory + if(files) + process_cgal_subdirectory("${entry}" ${subdir_name} ${singular_name}) + endif() + + endif() + + endforeach() + message("== Generating build files for ${plural_name} (DONE) ==\n") + +endfunction() diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index d6d992267bb..c0976f84628 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -6,6 +6,19 @@ set(CGAL_CreateSingleSourceCGALProgram_included TRUE) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_add_test.cmake) include(CMakeParseArguments) +function(CGAL_check_target_name target_name new_target_var_name) + set(cmake_reserved_names all ALL_BUILD help install + INSTALL preinstall clean edit_cache + rebuild_cache ZERO_CHECK package PACKAGE package_source test RUN_TESTS) + + while(TARGET "${target_name}" OR target_name IN_LIST cmake_reserved_names) + message(AUTHOR_WARNING "The executable name ${target_name} is reserved by CMake or already exists. Renaming it to ${target_name}_") + set(target_name "${target_name}_") + endwhile() + + set(${new_target_var_name} ${target_name} PARENT_SCOPE) +endfunction() + function(create_single_source_cgal_program firstfile ) set(options NO_TESTING) set(oneValueArgs) @@ -42,6 +55,7 @@ function(create_single_source_cgal_program firstfile ) set( all ${all} ${CMAKE_CURRENT_SOURCE_DIR}/${i} ) endforeach() + CGAL_check_target_name(${exe_name} exe_name) add_executable(${exe_name} ${all}) if(CXX_FEATURES) target_compile_features(${exe_name} PRIVATE ${CXX_FEATURES}) diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 596bc592a15..49b6bf19ec2 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -456,51 +456,4 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() -function(process_CGAL_subdirectory entry subdir type_name) - # For example, subdir can be "examples", type_name "example", and entry "Mesh_2" - get_filename_component(ENTRY_DIR_NAME "${entry}" NAME) - - if( NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") # out-of-source - make_directory("${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") - endif() - - set(ADD_SUBDIR TRUE) - - if(EXISTS ${entry}/../../dont_submit) - file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${ENTRY_DIR_NAME}/?\$") - if(dont_submit_grep) - set(ADD_SUBDIR FALSE) - endif() - file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}/${ENTRY_DIR_NAME}/?\$") - if(dont_submit_grep) - set(ADD_SUBDIR FALSE) - endif() - file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}/?\$") - if(dont_submit_grep) - set(ADD_SUBDIR FALSE) - endif() - endif() - - if(ADD_SUBDIR) - message("\n-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") - if(EXISTS ${entry}/CMakeLists.txt) - set(source_dir ${entry}) - add_subdirectory( ${entry} ${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME} ) - else() - if(CGAL_CREATE_CMAKE_SCRIPT) -# message("bah ${CGAL_CREATE_CMAKE_SCRIPT} ${type_name} --source_dir ${entry}") - execute_process( - COMMAND bash ${CGAL_CREATE_CMAKE_SCRIPT} ${type_name} --source_dir "${entry}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}" - RESULT_VARIABLE RESULT_VAR OUTPUT_QUIET) - if(NOT RESULT_VAR) -# message("Subdir ${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") - set(source_dir "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") - add_subdirectory( "${source_dir}" "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") - endif() - endif() - endif() - else() - message(STATUS "${subdir}/${ENTRY_DIR_NAME} is in dont_submit") - endif() -endfunction() +include(${CMAKE_CURRENT_LIST_DIR}/CGALHelpers.cmake) diff --git a/Installation/cmake/modules/CGAL_SetupBoost.cmake b/Installation/cmake/modules/CGAL_SetupBoost.cmake index bd8a6dfe6f4..abd5fe9fc0c 100644 --- a/Installation/cmake/modules/CGAL_SetupBoost.cmake +++ b/Installation/cmake/modules/CGAL_SetupBoost.cmake @@ -10,11 +10,7 @@ # # and defines the function :command:`use_CGAL_Boost_support`. -if ( CGAL_Boost_Setup ) - return() -endif() -set ( CGAL_Boost_Setup TRUE ) - +include_guard(GLOBAL) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake) cmake_policy(VERSION 3.12...3.30) diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 96c284fa9d8..4e3e8765c8e 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,39 +1,7 @@ cmake_minimum_required(VERSION 3.12...3.29) -project(CGAL_DEMOS) - -if(CGAL_BRANCH_BUILD) - - foreach(package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file(GLOB listtmp "${package}/demo/*") - list(APPEND list ${listtmp}) - endforeach() - -else() - - file(GLOB list "*") +if(NOT CGAL_MODULES_DIR) + find_package(CGAL REQUIRED) endif() - -list(SORT list) - -find_package(CGAL REQUIRED) -include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) - -message("== Generating build files for demos ==") -foreach(entry ${list}) - - if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) - - file(GLOB files "${entry}/*.cpp") - - # If there is no .cpp files, ignore the sub-directory - if(files) - process_cgal_subdirectory("${entry}" demo demo) - # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() - - endif() - -endforeach() -message("== Generating build files for demos (DONE) ==\n") +include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) +CGAL_handle_subdirectories(demo demos) diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index e62d49c187d..e5a3ff4be1e 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,39 +1,6 @@ cmake_minimum_required(VERSION 3.12...3.29) -project(CGAL_EXAMPLES) - -if(CGAL_BRANCH_BUILD) - - foreach(package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file(GLOB listtmp "${package}/examples/*") - list(APPEND list ${listtmp}) - endforeach() - -else() - - file(GLOB list "*") - +if(NOT CGAL_MODULES_DIR) + find_package(CGAL REQUIRED) endif() - -list(SORT list) - -find_package(CGAL REQUIRED) -include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) - -message("== Generating build files for examples ==") -foreach(entry ${list}) - - if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) - - file(GLOB files "${entry}/*.cpp") - - # If there is no .cpp files, ignore the sub-directory - if(files) - process_cgal_subdirectory("${entry}" examples example) - # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() - - endif() - -endforeach() -message("== Generating build files for examples (DONE) ==\n") +include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) +CGAL_handle_subdirectories(examples examples) diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index e0163f201ab..67d1367d520 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,39 +1,8 @@ cmake_minimum_required(VERSION 3.12...3.29) -project(CGAL_TESTS) -if(CGAL_BRANCH_BUILD) - - foreach(package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file(GLOB listtmp "${package}/test/*") - list(APPEND list ${listtmp}) - endforeach() - -else() - - file(GLOB list "*") +if(NOT CGAL_MODULES_DIR) + find_package(CGAL REQUIRED) endif() - -list(SORT list) - -find_package(CGAL REQUIRED) -include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) - -message("== Generating build files for tests ==") -foreach(entry ${list}) - - if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) - - file(GLOB files "${entry}/*.cpp") - - # If there is no .cpp files, ignore the sub-directory - if(files) - process_cgal_subdirectory("${entry}" test test) - # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() - - endif() - -endforeach() -message("== Generating build files for tests (DONE) ==\n") +include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) +CGAL_handle_subdirectories(test tests) 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 23999e2d847..7c4998cafb6 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -35,7 +35,7 @@ target_link_libraries(lcc_performance_2 CGAL::CGAL) add_executable( surface_mesh_performance performance_2.h surface_mesh_performance.h surface_mesh_performance.cpp) -target_link_libraries(surface_mesh_performance surface_mesh) +target_link_libraries(surface_mesh_performance lcc_surface_mesh_lib) # Open_mesh add_executable(openmesh_performance performance_2.h openmesh_performance.h @@ -79,7 +79,7 @@ add_executable( target_link_libraries( performance_2 CGAL::CGAL - surface_mesh + lcc_surface_mesh_lib algo assimp container diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/CMakeLists.txt index 9c7a8ad46a4..b80ccb6d124 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/surface_mesh/CMakeLists.txt @@ -4,7 +4,7 @@ file(GLOB_RECURSE SRCS ./*.cpp) file(GLOB_RECURSE HDRS ./*.h) if(UNIX) - add_library(surface_mesh SHARED ${SRCS} ${HDRS}) + add_library(lcc_surface_mesh_lib SHARED ${SRCS} ${HDRS}) elseif(WIN32) - add_library(surface_mesh STATIC ${SRCS} ${HDRS}) + add_library(lcc_surface_mesh_lib STATIC ${SRCS} ${HDRS}) endif() diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 3b74a4a3da6..299456797bc 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -49,7 +49,7 @@ EOF echo "include_directories (BEFORE \"${SOURCE_DIR}include\")" echo fi - + for file in `ls "$SOURCE_DIR"*.cc "$SOURCE_DIR"*.cp "$SOURCE_DIR"*.cxx "$SOURCE_DIR"*.cpp "$SOURCE_DIR"*.CPP "$SOURCE_DIR"*.c++ "$SOURCE_DIR"*.C 2>/dev/null | sort` ; do # Create an executable for each cpp that contains a function "main()" BASE=`basename $file .cc` @@ -90,18 +90,21 @@ while [ $1 ]; do -h|-help|--h|--help) usage; exit ;; - example) + example) if [ -z "$TYPE" ]; then TYPE=_Examples; shift; else usage; exit 1; fi ;; - demo) + demo) if [ -z "$TYPE" ]; then TYPE=_Demo; shift; else usage; exit 1; fi ;; - test) + test) if [ -z "$TYPE" ]; then TYPE=; shift; else usage; exit 1; fi ;; + benchmark) + if [ -z "$TYPE" ]; then TYPE=_Benchmarks; shift; else usage; exit 1; fi + ;; --source_dir) - if [ -d "$2" ]; then - SOURCE_DIR=$2; + if [ -d "$2" ]; then + SOURCE_DIR=$2; shift; shift; else @@ -112,7 +115,7 @@ while [ $1 ]; do echo "Error: \"$2\" is not a directory!" echo fi - usage; exit 1; + usage; exit 1; fi ;; *) From 765744e8b2ea77a00b2ba99b42f5b7e6527601c7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 6 Feb 2025 01:22:02 +0100 Subject: [PATCH 284/332] fix WKT I/O error handling --- Stream_support/include/CGAL/IO/WKT.h | 215 +++++++----------- .../internal/Geometry_container.h | 10 +- 2 files changed, 79 insertions(+), 146 deletions(-) diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index 3a3eea129d6..4aa12443fc1 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -44,18 +44,42 @@ namespace internal { template void pop_back_if_equal_to_front(CGAL::Polygon_2& poly) { - typename CGAL::Polygon_2::iterator it = poly.end(); - --it; - if((*poly.begin()) == *it) - poly.erase(it); + auto last_it = std::prev(poly.end()); + if((*poly.begin()) == *last_it) + poly.erase(last_it); } template void pop_back_if_equal_to_front(CGAL::Polygon_with_holes_2& pwh) { pop_back_if_equal_to_front(pwh.outer_boundary()); - for(auto i = pwh.holes_begin(); i!= pwh.holes_end(); ++i) - pop_back_if_equal_to_front(*i); + for(auto& hole : pwh.holes()) + pop_back_if_equal_to_front(hole); +} + +template +bool read_wkt_or_fail_stream(std::istream& in, + const std::string& line, + Geometry& geometry) +{ + try { + boost::geometry::read_wkt(line, geometry); + } catch(std::exception& e) { + std::cerr << "error: " << e.what() << std::endl; + in.clear(in.rdstate() | std::ios::failbit); + return false; + } + return true; +} + +bool get_a_new_line(std::istream& in, std::string& line) +{ + in >> std::ws; // skip whitespaces + if(in.good()) { + return !std::getline(in, line).fail(); + } else { + return false; + } } } // namespace internal @@ -76,28 +100,12 @@ template bool read_point_WKT(std::istream& in, Point& point) { - if(!in.good()) - return false; - std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 5).compare("POINT") == 0) + if(line.substr(0, 5).compare("POINT") == 0) { - try - { - boost::geometry::read_wkt(line, point); - } - catch(...) - { - std::cerr << "error." << std::endl; - return false; - } - + internal::read_wkt_or_fail_stream(in, line, point); break; } } @@ -124,25 +132,13 @@ template bool read_multi_point_WKT(std::istream& in, MultiPoint& mp) { - if(!in.good()) - return false; - - CGAL::internal::Geometry_container gc(mp); std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 10).compare("MULTIPOINT") == 0) + if(line.substr(0, 10).compare("MULTIPOINT") == 0) { - try{ - boost::geometry::read_wkt(line, gc); - } catch(...){ - std::cerr << "error." << std::endl; - return false; - } + CGAL::internal::Geometry_container gc(mp); + internal::read_wkt_or_fail_stream(in, line, gc); break; } } @@ -170,25 +166,13 @@ template bool read_linestring_WKT(std::istream& in, LineString& polyline) { - if(!in.good()) - return false; - - CGAL::internal::Geometry_container gc(polyline); std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 10).compare("LINESTRING") == 0) + if(line.substr(0, 10).compare("LINESTRING") == 0) { - try{ - boost::geometry::read_wkt(line, gc); - } catch(...){ - std::cerr << "error." << std::endl; - return false; - } + CGAL::internal::Geometry_container gc(polyline); + internal::read_wkt_or_fail_stream(in, line, gc); break; } } @@ -214,40 +198,26 @@ template bool read_multi_linestring_WKT(std::istream& in, MultiLineString& mls) { - if(!in.good()) - return false; - - typedef typename MultiLineString::value_type PointRange; - typedef CGAL::internal::Geometry_container LineString; - - std::vector pr_range; - CGAL::internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 15).compare("MULTILINESTRING") == 0) + if(line.substr(0, 15).compare("MULTILINESTRING") == 0) { - try - { - boost::geometry::read_wkt(line, gc); - } - catch(...) - { - std::cerr << "error." << std::endl; - return false; + using PointRange = typename MultiLineString::value_type; + using LineString = CGAL::internal::Geometry_container; + + std::vector pr_range; + CGAL::internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); + + internal::read_wkt_or_fail_stream(in, line, gc); + for(LineString& ls : gc) { + mls.push_back(*ls.range); } break; } } - for(LineString& ls : gc) - mls.push_back(*ls.range); - return !in.fail(); } @@ -266,28 +236,12 @@ template bool read_polygon_WKT(std::istream& in, Polygon& polygon) { - if(!in.good()) - return false; - std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 7).compare("POLYGON") == 0) + if(line.substr(0, 7).compare("POLYGON") == 0) { - try - { - boost::geometry::read_wkt(line, polygon); - } - catch( ...) - { - in.setstate(std::ios::failbit); - return false; - }; - + internal::read_wkt_or_fail_stream(in, line, polygon); internal::pop_back_if_equal_to_front(polygon); break; } @@ -313,31 +267,16 @@ template bool read_multi_polygon_WKT(std::istream& in, MultiPolygon& polygons) { - if(!in.good()) - return false; - - CGAL::internal::Geometry_container gc(polygons); std::string line; - while(std::getline(in, line)) + while(internal::get_a_new_line(in, line)) { - std::istringstream iss(line); - std::string type; - iss >> type; - - if(type.substr(0, 12).compare("MULTIPOLYGON") == 0) + if(line.substr(0, 12).compare("MULTIPOLYGON") == 0) { - try - { - boost::geometry::read_wkt(line, gc); - } - catch( ...) - { - in.setstate(std::ios::failbit); - return false; - }; + CGAL::internal::Geometry_container gc(polygons); + internal::read_wkt_or_fail_stream(in, line, gc); - for(typename CGAL::internal::Geometry_container::iterator it = gc.begin(); it != gc.end(); ++it) - internal::pop_back_if_equal_to_front(*it); + for(auto& p : gc) + internal::pop_back_if_equal_to_front(p); break; } @@ -517,17 +456,15 @@ bool read_WKT(std::istream& is, MultiLineString& polylines, MultiPolygon& polygons) { - if(!is.good()) - return false; + auto fail = [&is]() { is.clear(is.rdstate() | std::ios::failbit); return false; }; - while(is.good() && !is.eof()) + std::string line; + while(is >> std::ws && is.good() && std::getline(is, line)) { typedef typename MultiPoint::value_type Point; typedef typename MultiLineString::value_type LineString; typedef typename MultiPolygon::value_type Polygon; - std::string line; - std::getline(is, line); std::string::size_type header_end = line.find("("); // } if(header_end == std::string::npos){ continue; @@ -549,42 +486,42 @@ bool read_WKT(std::istream& is, if(type == "POINT") { Point p; - CGAL::IO::read_point_WKT(iss, p); + if(!IO::read_point_WKT(iss, p) ) return fail(); points.push_back(p); } else if(type == "LINESTRING") { LineString l; - CGAL::IO::read_linestring_WKT(iss, l); - polylines.push_back(l); + if(!IO::read_linestring_WKT(iss, l)) return fail(); + polylines.push_back(std::move(l)); } else if(type == "POLYGON") { Polygon p; - CGAL::IO::read_polygon_WKT(iss, p); + if(!IO::read_polygon_WKT(iss, p)) return fail(); if(!p.outer_boundary().is_empty()) - polygons.push_back(p); + polygons.push_back(std::move(p)); } else if(type == "MULTIPOINT") { MultiPoint mp; - CGAL::IO::read_multi_point_WKT(iss, mp); + if(!IO::read_multi_point_WKT(iss, mp)) return fail(); for(const Point& point : mp) points.push_back(point); } else if(type == "MULTILINESTRING") { MultiLineString mls; - CGAL::IO::read_multi_linestring_WKT(iss, mls); - for(const LineString& ls : mls) - polylines.push_back(ls); + if(!IO::read_multi_linestring_WKT(iss, mls)) return fail(); + for(LineString& ls : mls) + polylines.push_back(std::move(ls)); } else if(type == "MULTIPOLYGON") { MultiPolygon mp; - CGAL::IO::read_multi_polygon_WKT(iss, mp); - for(const Polygon& poly : mp) - polygons.push_back(poly); + if(!IO::read_multi_polygon_WKT(iss, mp)) return fail(); + for(Polygon& poly : mp) + polygons.push_back(std::move(poly)); } } diff --git a/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h b/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h index e3e26fe8b61..28a1aff6245 100644 --- a/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h +++ b/Stream_support/include/CGAL/Stream_support/internal/Geometry_container.h @@ -46,20 +46,16 @@ struct Geometry_container{ typedef typename Range::size_type size_type; typedef typename Range::value_type value_type; std::shared_ptr range; - bool must_delete; // // Default constructor. // Creates a new internal Range. // De-allocate memory after usage. - Geometry_container():range(new Range()), must_delete(true) - { - } + Geometry_container() : range(std::make_shared()) {} /* - Copy constructor. + Store a pointer to the given range. Memory NOT de-allocated after usage. */ - Geometry_container(Range& range) - :range(&range, Dummy_deleter()), must_delete(false){} + Geometry_container(Range& range) : range(&range, Dummy_deleter()) {} iterator begin() { return range->begin(); } From ab1983a066533eb534031f981c7edcddb22c097f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 6 Feb 2025 09:09:47 +0100 Subject: [PATCH 285/332] another missing tuple --- .../CGAL/Poisson_reconstruction_function.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index abe83515408..488e15b0b3a 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -598,24 +598,24 @@ public: } #endif - boost::tuple special_func(const Point& p) const + std::tuple special_func(const Point& p) const { Cell_handle& hint = get_hint(); hint = m_tr->locate(p, hint); if(m_tr->is_infinite(hint)) { int i = hint->index(m_tr->infinite_vertex()); - return boost::make_tuple(hint->vertex((i+1)&3)->f(), - hint, true); + return std::make_tuple(hint->vertex((i+1)&3)->f(), + hint, true); } FT a,b,c,d; barycentric_coordinates(p,hint,a,b,c,d); - return boost::make_tuple(a * hint->vertex(0)->f() + - b * hint->vertex(1)->f() + - c * hint->vertex(2)->f() + - d * hint->vertex(3)->f(), - hint, false); + return std::make_tuple(a * hint->vertex(0)->f() + + b * hint->vertex(1)->f() + + c * hint->vertex(2)->f() + + d * hint->vertex(3)->f(), + hint, false); } /// \endcond From 07d7615d91e6c6ceec012e78ad4e9cd413d04de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 6 Feb 2025 10:16:10 +0100 Subject: [PATCH 286/332] Require a FaceGraph for boundary checks --- .../include/CGAL/Polygon_mesh_processing/curvature.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h index cdcf687d678..f612535dfc5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/curvature.h @@ -34,7 +34,7 @@ namespace Polygon_mesh_processing { * * The angle sum is given in degrees. * - * @tparam PolygonMesh a model of `HalfedgeGraph` + * @tparam PolygonMesh a model of `FaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param v the vertex whose sum of angles is computed @@ -114,7 +114,7 @@ angle_sum(typename boost::graph_traits::vertex_descriptor v, * * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete Gaussian curvature. * - * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam TriangleMesh a model of `FaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param v the vertex whose discrete Gaussian curvature is being computed @@ -227,7 +227,7 @@ discrete_Gaussian_curvature(typename boost::graph_traits::vertex_d * * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete Gaussian curvature. * - * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam TriangleMesh a model of `FaceGraph` * @tparam VertexCurvatureMap must be a model of `WritablePropertyMap` with key type * `boost::graph_traits::%vertex_descriptor` and value type `FT`, * which is either `geom_traits::FT` if this named parameter is provided, @@ -284,7 +284,7 @@ void discrete_Gaussian_curvatures(const TriangleMesh& tmesh, * * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete mean curvature. * - * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam TriangleMesh a model of `FaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param v the vertex whose discrete mean curvature is being computed @@ -425,7 +425,7 @@ discrete_mean_curvature(typename boost::graph_traits::vertex_descr * * We refer to Meyer et al. \cgalCite{cgal:mdsb-ddgot-02} for the definition of discrete mean curvature. * - * @tparam TriangleMesh a model of `HalfedgeGraph` + * @tparam TriangleMesh a model of `FaceGraph` * @tparam VertexCurvatureMap must be a model of `WritablePropertyMap` with key type * `boost::graph_traits::%vertex_descriptor` and value type `FT`, * which is either `geom_traits::FT` if this named parameter is provided, From 1407790f6c414b020f2c58f6ac1866d95e26e342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Thu, 6 Feb 2025 11:21:14 +0100 Subject: [PATCH 287/332] Doc: Improve description of the repair rules of Repair_polygon and create a group Repair Rules --- Polygon_repair/doc/Polygon_repair/PackageDescription.txt | 5 +++-- Polygon_repair/doc/Polygon_repair/Polygon_repair.txt | 6 +++--- Polygon_repair/include/CGAL/Polygon_repair/Even_odd_rule.h | 6 +++++- .../include/CGAL/Polygon_repair/Intersection_rule.h | 5 ++++- Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h | 3 ++- Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h | 4 +++- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt index bd014eb61fd..3a311dd0cd1 100644 --- a/Polygon_repair/doc/Polygon_repair/PackageDescription.txt +++ b/Polygon_repair/doc/Polygon_repair/PackageDescription.txt @@ -1,10 +1,11 @@ -// PRETTY PACKAGE NAME should equal the project title in Doxyfile.in - /// \defgroup PkgPolygonRepairRef 2D Polygon Repair Reference /// \defgroup PkgPolygonRepairFunctions Functions /// \ingroup PkgPolygonRepairRef +/// \defgroup PkgPolygonRepairRules Repair Rules +/// \ingroup PkgPolygonRepairRef + /*! \addtogroup PkgPolygonRepairRef diff --git a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt index 8cfe5ce7582..f837f18e9eb 100644 --- a/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt +++ b/Polygon_repair/doc/Polygon_repair/Polygon_repair.txt @@ -25,9 +25,9 @@ It does not distinguish between edges that are part of outer boundaries from those of inner boundaries. The non-zero rule results in areas with a non-zero winding number. The union and intersection rules are useful when given -two or more similar valid polygons with holes. They compute either their -union or their intersection, and they are hence conservative -by bounding from the interior or the exterior. +two or more similar valid polygons with holes. +The union rule results in areas that are contained in at least one of the input polygons with holes. +Similarly, the intersection rule results in areas that are contained in all input polygons with holes. \section SectionPolygonRepair_Definitions Definitions diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Even_odd_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Even_odd_rule.h index b2dc51bfe36..372fb2479ee 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Even_odd_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Even_odd_rule.h @@ -18,11 +18,15 @@ namespace CGAL { namespace Polygon_repair { -/// \addtogroup PkgPolygonRepairRef +/// \addtogroup PkgPolygonRepairRules /// @{ /*! Tag class to select the even odd rule when calling `CGAL::Polygon_repair::repair()`. + The even-odd rule results in areas that are alternately assigned as polygon +interiors and exterior/holes each time that an input edge is passed. +It does not distinguish between edges that are part of outer boundaries +from those of inner boundaries. */ struct Even_odd_rule {}; diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h index 1bf449fb692..7c2984b3c2d 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Intersection_rule.h @@ -18,11 +18,14 @@ namespace CGAL { namespace Polygon_repair { -/// \addtogroup PkgPolygonRepairRef +/// \addtogroup PkgPolygonRepairRules /// @{ /*! Tag class to select the %intersection rule when calling `CGAL::Polygon_repair::repair()`. + The intersection rule are useful when given +two or more similar valid polygons with holes. +The intersection rule results in areas that are contained in all input polygons with holes. */ struct Intersection_rule {}; diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h index 4c4585df59f..8df2f32ad61 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Non_zero_rule.h @@ -18,11 +18,12 @@ namespace CGAL { namespace Polygon_repair { -/// \addtogroup PkgPolygonRepairRef +/// \addtogroup PkgPolygonRepairRules /// @{ /*! Tag class to select the non zero rule when calling `CGAL::Polygon_repair::repair()`. + The non-zero rule results in areas with a non-zero winding number. */ struct Non_zero_rule {}; diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h index 011b67da466..fbba8d1cbed 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Union_rule.h @@ -18,11 +18,13 @@ namespace CGAL { namespace Polygon_repair { -/// \addtogroup PkgPolygonRepairRef +/// \addtogroup PkgPolygonRepairRules /// @{ /*! Tag class to select the %union rule when calling `CGAL::Polygon_repair::repair()`. + The union rules are useful when given two or more similar valid polygons with holes. +The union rule results in areas that are contained in at least one of the input polygons with holes. */ struct Union_rule {}; From 931ae674d2cfe6e773ef9ce237ba746e7e12ff4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Thu, 6 Feb 2025 12:58:36 +0100 Subject: [PATCH 288/332] add a reference to repair rule group in the description of repair for more clarity --- Polygon_repair/include/CGAL/Polygon_repair/repair.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/repair.h b/Polygon_repair/include/CGAL/Polygon_repair/repair.h index e96e5439249..03961636059 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/repair.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/repair.h @@ -92,7 +92,7 @@ Multipolygon_with_holes_2 repair(const Polygon_with_holes_2 Multipolygon_with_holes_2 repair(const Multipolygon_with_holes_2& p, Rule = Rule()) From d76edec2f07df69ab5100bc731a4723b22bcec5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Thu, 6 Feb 2025 14:29:58 +0100 Subject: [PATCH 289/332] Correct documentation mistakes in double.h and long_double.h --- Number_types/doc/Number_types/CGAL/double.h | 2 +- Number_types/doc/Number_types/CGAL/long_double.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Number_types/doc/Number_types/CGAL/double.h b/Number_types/doc/Number_types/CGAL/double.h index 5c48d4332c8..658fc68e083 100644 --- a/Number_types/doc/Number_types/CGAL/double.h +++ b/Number_types/doc/Number_types/CGAL/double.h @@ -4,7 +4,7 @@ This header provides all necessary functions so the fundamental type `double` is a model of the concepts `RealEmbeddable` and -`Field`. Due to rounding errors and overflow `double` is considered as +`FieldWithSqrt`. Due to rounding errors and overflow `double` is considered as not exact. \cgalModels{FieldWithSqrt,RealEmbeddable} diff --git a/Number_types/doc/Number_types/CGAL/long_double.h b/Number_types/doc/Number_types/CGAL/long_double.h index 74275b716d1..13498d51800 100644 --- a/Number_types/doc/Number_types/CGAL/long_double.h +++ b/Number_types/doc/Number_types/CGAL/long_double.h @@ -7,6 +7,8 @@ This header provides all necessary functions so the fundamental type `long double` is a model of the concepts `RealEmbeddable` and `FieldWithSqrt`. Due to rounding errors and overflow `long double` is considered as not exact. + +\cgalModels{FieldWithSqrt,RealEmbeddable} */ namespace CGAL { From bc44c91536c1ba39172d252f9a9855261a2b9f95 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 6 Feb 2025 17:08:54 +0100 Subject: [PATCH 290/332] add a benchmark for Polyline_simplification_2 Using the tool `compare.py` from [Google Benchmark Tools][1]... [1]: https://github.com/google/benchmark/blob/main/docs/tools.md ...given that: - `benchmark_simplify-AFTER` is the file `benchmark_simplify.cpp` compiled from this branch, and flags `-msse3 -DNDEBUG -O3` with gcc version 14.2.1, - `benchmark_simplify-BEFORE` is the same file compiled from the branch `master`, and same flags and compiler. the command line was: ```shell compare.py benchmarks build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-BEFORE build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-AFTER Data/data/wkt/norway-MP.wkt --benchmark_repetitions=20 --benchmark_counters_tabular=true --benchmark_time_unit=s ``` The following results show that there is a speedup of about 15% (mean) or 18% (median) ``` RUNNING: build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-BEFORE Data/data/wkt/norway-MP.wkt --benchmark_repetitions=20 --benchmark_counters_tabular=true --benchmark_time_unit=s --benchmark_out=/tmp/tmpvxyq_i24 2025-02-06T17:23:08+01:00 Running Data/data/wkt/norway-MP.wkt Run on (16 X 800 MHz CPU s) CPU Caches: L1 Data 48 KiB (x8) L1 Instruction 32 KiB (x8) L2 Unified 1280 KiB (x8) L3 Unified 24576 KiB (x1) Load Average: 1.47, 2.07, 1.65 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations #points #polygons #polylines nb of constraints nb of sub-constraints nb of vertices ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- simplify file Data/data/wkt/norway-MP.wkt 0.067 s 0.067 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.066 s 0.066 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.065 s 0.065 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.073 s 0.072 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.066 s 0.066 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.064 s 0.064 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.067 s 0.066 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.071 s 0.071 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.064 s 0.064 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.064 s 0.064 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.074 s 0.074 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.066 s 0.066 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.075 s 0.074 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.074 s 0.074 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.076 s 0.076 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.078 s 0.078 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.074 s 0.074 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.067 s 0.067 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.064 s 0.064 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.069 s 0.069 s 12 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_mean 0.069 s 0.069 s 20 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_median 0.067 s 0.067 s 20 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_stddev 0.005 s 0.005 s 20 0 0 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_cv 6.73 % 6.68 % 20 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% RUNNING: build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-AFTER Data/data/wkt/norway-MP.wkt --benchmark_repetitions=20 --benchmark_counters_tabular=true --benchmark_time_unit=s --benchmark_out=/tmp/tmp59ui0dsw 2025-02-06T17:29:26+01:00 Running Data/data/wkt/norway-MP.wkt Run on (16 X 800.961 MHz CPU s) CPU Caches: L1 Data 48 KiB (x8) L1 Instruction 32 KiB (x8) L2 Unified 1280 KiB (x8) L3 Unified 24576 KiB (x1) Load Average: 1.61, 1.94, 1.73 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations #points #polygons #polylines nb of constraints nb of sub-constraints nb of vertices ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- simplify file Data/data/wkt/norway-MP.wkt 0.054 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.057 s 0.057 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.059 s 0.059 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.065 s 0.065 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.058 s 0.058 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.056 s 0.056 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.053 s 0.053 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.061 s 0.061 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.058 s 0.058 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.052 s 0.052 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.054 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.055 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.054 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.055 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.054 s 0.054 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.059 s 0.059 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.057 s 0.057 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.058 s 0.057 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.055 s 0.055 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt 0.059 s 0.059 s 13 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_mean 0.057 s 0.057 s 20 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_median 0.057 s 0.056 s 20 0 848 0 849 40.568k 40.565k simplify file Data/data/wkt/norway-MP.wkt_stddev 0.003 s 0.003 s 20 0 0 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_cv 5.37 % 5.32 % 20 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% Comparing build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-BEFORE to build/Release/benchmark/Polyline_simplification_2/benchmark_simplify-AFTER Benchmark Time CPU Time Old Time New CPU Old CPU New ----------------------------------------------------------------------------------------------------------------------------------------------- simplify file Data/data/wkt/norway-MP.wkt -0.1941 -0.1942 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1269 -0.1272 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.0900 -0.0918 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1049 -0.1065 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1204 -0.1206 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1279 -0.1282 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1962 -0.1961 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1370 -0.1377 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.0951 -0.0962 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1851 -0.1852 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2720 -0.2716 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1702 -0.1717 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2700 -0.2703 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2644 -0.2634 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2861 -0.2856 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2492 -0.2488 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.2310 -0.2301 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1382 -0.1389 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1401 -0.1406 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt -0.1464 -0.1467 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_pvalue 0.0000 0.0000 U Test, Repetitions: 20 vs 20 simplify file Data/data/wkt/norway-MP.wkt_mean -0.1804 -0.1806 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_median -0.1547 -0.1549 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_stddev -0.3458 -0.3479 0 0 0 0 simplify file Data/data/wkt/norway-MP.wkt_cv -0.2018 -0.2041 0 0 0 0 OVERALL_GEOMEAN -0.1797 -0.1800 0 0 0 0 ``` --- .../Linear_cell_complex_2/CMakeLists.txt | 2 +- .../Linear_cell_complex_3/CMakeLists.txt | 2 + .../Polyline_simplification_2/CMakeLists.txt | 11 +++ .../benchmark_simplify.cpp | 98 +++++++++++++++++++ 4 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 Polyline_simplification_2/benchmark/Polyline_simplification_2/CMakeLists.txt create mode 100644 Polyline_simplification_2/benchmark/Polyline_simplification_2/benchmark_simplify.cpp 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 7c4998cafb6..195d30d3ba0 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -16,7 +16,7 @@ include_directories(BEFORE "/usr/include/libxml2/") #add_compile_definitions("-pg") #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") # add_compile_definitions("-g") - +return() # OpenMesh find_package(OpenMesh REQUIRED) include(CGAL_OpenMesh_support) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt index 5166eee35ab..0a74b036673 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.12...3.29) project(LCC_performance_3) +return() + if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. cmake_policy(SET CMP0053 OLD) diff --git a/Polyline_simplification_2/benchmark/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/benchmark/Polyline_simplification_2/CMakeLists.txt new file mode 100644 index 00000000000..5c6747a2883 --- /dev/null +++ b/Polyline_simplification_2/benchmark/Polyline_simplification_2/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.12...3.29) +project(Polyline_simplification_2_Benchmarks) + +# Add Google Benchmark +find_package(benchmark REQUIRED) + +# Add CGAL +find_package(CGAL REQUIRED) + +add_executable(benchmark_simplify benchmark_simplify.cpp) +target_link_libraries(benchmark_simplify PRIVATE benchmark::benchmark CGAL::CGAL CGAL::Data) diff --git a/Polyline_simplification_2/benchmark/Polyline_simplification_2/benchmark_simplify.cpp b/Polyline_simplification_2/benchmark/Polyline_simplification_2/benchmark_simplify.cpp new file mode 100644 index 00000000000..6b78ba89142 --- /dev/null +++ b/Polyline_simplification_2/benchmark/Polyline_simplification_2/benchmark_simplify.cpp @@ -0,0 +1,98 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace PS = CGAL::Polyline_simplification_2; + +using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using Polygon_2 = CGAL::Polygon_2; +using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + +using Vb = PS::Vertex_base_2; +using Fb = CGAL::Constrained_triangulation_face_base_2; +using TDS = CGAL::Triangulation_data_structure_2; +using CDT = CGAL::Constrained_Delaunay_triangulation_2; +using CT = CGAL::Constrained_triangulation_plus_2; +using Stop = PS::Stop_below_count_ratio_threshold; +using Cost = PS::Squared_distance_cost; + +static void BM_Simplify(benchmark::State& state, std::string filename) { + using Point_2 = K::Point_2; + using MultiPoint = std::vector; + + using LineString = std::vector; + using MultiLineString = std::deque; + + using Polygon_2 = CGAL::Polygon_2; + using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; + using MultiPolygon = std::deque; + + std::ifstream ifs(filename); + MultiPoint points; + MultiLineString polylines; + MultiPolygon polygons; + if(!CGAL::IO::read_WKT(ifs, points, polylines, polygons) && false) { + state.SkipWithError("Cannot read file " + filename); + return; + } + + state.counters["#points"] = points.size(); + state.counters["#polylines"] = polylines.size(); + state.counters["#polygons"] = polygons.size(); + + CT ct; + for(const auto& point : points) { + ct.insert(point); + } + for(const auto& polyline : polylines) { + ct.insert_constraint(polyline); + } + for(const auto& polygon_with_holes : polygons) { + const Polygon_2& outer_polygon = polygon_with_holes.outer_boundary(); + ct.insert_constraint(outer_polygon); + for(Polygon_with_holes_2::Hole_const_iterator it = polygon_with_holes.holes_begin(); + it != polygon_with_holes.holes_end(); ++it) + { + const Polygon_2& hole = *it; + ct.insert_constraint(hole); + } + } + + state.counters["nb of constraints"] = ct.number_of_constraints(); + state.counters["nb of vertices"] = ct.number_of_vertices(); + state.counters["nb of sub-constraints"] = ct.number_of_subconstraints(); + + for([[maybe_unused]] auto _ : state) { + state.PauseTiming(); + CT ct_copy = ct; // Copy the object `ct` in the loop + state.ResumeTiming(); + PS::simplify(ct_copy, Cost(), Stop(0.5)); + } +} + +int main(int argc, char** argv) { + std::string filename = CGAL::data_file_path("wkt/norway-MP.wkt"); + if(argc > 1) { + std::string_view arg1{argv[1]}; + if(arg1.size() < 2 || arg1[0] != '-' || arg1[1] != '-') { + --argc; + ++argv; + filename = arg1; + } + } + benchmark::RegisterBenchmark("simplify file " + filename, BM_Simplify, filename); + benchmark::Initialize(&argc, argv); + benchmark::RunSpecifiedBenchmarks(); + benchmark::Shutdown(); +} From ad53f4c3ce10d153f9afd50e4fb25a191b99c3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 6 Feb 2025 20:13:51 +0100 Subject: [PATCH 291/332] Update changelog --- Installation/CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..dcd7a242061 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -7,6 +7,9 @@ - **Breaking change**: Classes based on the RS Library are no longer provided. +### [BGL](https://doc.cgal.org/6.1/Manual/packages.html#PkgBGL) +- Added the function `CGAL::Euler::remove_degree_2_vertex()`, which enables users to remove vertices which have exactly two incident edges. + ### [2D Arrangements](https://doc.cgal.org/6.1/Manual/packages.html#PkgArrangementOnSurface2) - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. From 94bd217b2ba7c7b99210537b1c387f8468e3a635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 6 Feb 2025 20:15:39 +0100 Subject: [PATCH 292/332] Update CHANGES.md --- Installation/CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..68214b3eb0b 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -11,6 +11,9 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. +### Triangulations +- All triangulations now offer the functions `point(Vertex_handle)` and `point(Simplex, int)`, which enables users to access the geometric positoin of a vertex and of the i-th vertex of a simplex of a triangulation. + ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) ### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3) From 4cc3eef67b90a46edcaac3d0654002d6c24449c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 6 Feb 2025 20:17:19 +0100 Subject: [PATCH 293/332] Update CHANGES.md --- Installation/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..fbc287d2fd1 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -3,6 +3,10 @@ ## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +### [Polygon Mesh Processing](https://doc.cgal.org/6.1/Manual/packages.html#PkgPolygonMeshProcessing) +- Added the function `CGAL::Polygon_mesh_processing::discrete_mean_curvature` and `CGAL::Polygon_mesh_processing::discrete_Guassian_curvature` to evaluate the discrete curvature at a vertex of a mesh. +- Added the function `CGAL::Polygon_mesh_processing::angle_sum` to compute the sum of the angles around a vertex. + ### [Algebraic Kernel](https://doc.cgal.org/6.1/Manual/packages.html#PkgAlgebraicKernelD) - **Breaking change**: Classes based on the RS Library are no longer provided. From 00bf449e044baab92f68b65ecebc50e346c4de21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 6 Feb 2025 20:57:28 +0100 Subject: [PATCH 294/332] restore test --- Installation/cmake/modules/config/support/test_BOOST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/cmake/modules/config/support/test_BOOST.cpp b/Installation/cmake/modules/config/support/test_BOOST.cpp index cd7842117b7..d70b9a1c59a 100644 --- a/Installation/cmake/modules/config/support/test_BOOST.cpp +++ b/Installation/cmake/modules/config/support/test_BOOST.cpp @@ -23,7 +23,7 @@ using boost::tuple; using boost::make_tuple; -using std::tie; +using boost::tie; using boost::get; int main() From 30a8e52c512b11d41e014715c0ed130d89f01483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Fri, 7 Feb 2025 16:19:29 +0100 Subject: [PATCH 295/332] Replace Sqrt with KthRoot and modify description of longlong int --- Number_types/doc/Number_types/CGAL/double.h | 4 ++-- Number_types/doc/Number_types/CGAL/float.h | 4 ++-- .../doc/Number_types/CGAL/long_double.h | 4 ++-- Number_types/doc/Number_types/CGAL/long_long.h | 18 ++++++++++-------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Number_types/doc/Number_types/CGAL/double.h b/Number_types/doc/Number_types/CGAL/double.h index 658fc68e083..a0520d46957 100644 --- a/Number_types/doc/Number_types/CGAL/double.h +++ b/Number_types/doc/Number_types/CGAL/double.h @@ -4,10 +4,10 @@ This header provides all necessary functions so the fundamental type `double` is a model of the concepts `RealEmbeddable` and -`FieldWithSqrt`. Due to rounding errors and overflow `double` is considered as +`FieldWithKthRoot`. Due to rounding errors and overflow `double` is considered as not exact. -\cgalModels{FieldWithSqrt,RealEmbeddable} +\cgalModels{FieldWithKthRoot,RealEmbeddable} */ diff --git a/Number_types/doc/Number_types/CGAL/float.h b/Number_types/doc/Number_types/CGAL/float.h index 84f782c4d82..ee5aab1d406 100644 --- a/Number_types/doc/Number_types/CGAL/float.h +++ b/Number_types/doc/Number_types/CGAL/float.h @@ -6,10 +6,10 @@ This header provides all necessary functions so the fundamental type `float` is a model of the concepts `RealEmbeddable` and -`FieldWithSqrt`. Due to rounding errors and overflow `float` is +`FieldWithKthRoot`. Due to rounding errors and overflow `float` is considered as not exact. -\cgalModels{FieldWithSqrt,RealEmbeddable} +\cgalModels{FieldWithKthRoot,RealEmbeddable} */ diff --git a/Number_types/doc/Number_types/CGAL/long_double.h b/Number_types/doc/Number_types/CGAL/long_double.h index 13498d51800..283a9458b16 100644 --- a/Number_types/doc/Number_types/CGAL/long_double.h +++ b/Number_types/doc/Number_types/CGAL/long_double.h @@ -5,10 +5,10 @@ This header provides all necessary functions so the fundamental type `long double` is a model of the concepts `RealEmbeddable` and -`FieldWithSqrt`. Due to rounding errors and overflow `long double` is +`FieldWithKthRoot`. Due to rounding errors and overflow `long double` is considered as not exact. -\cgalModels{FieldWithSqrt,RealEmbeddable} +\cgalModels{FieldWithKthRoot,RealEmbeddable} */ namespace CGAL { diff --git a/Number_types/doc/Number_types/CGAL/long_long.h b/Number_types/doc/Number_types/CGAL/long_long.h index 83e6e23a058..5d0587383f0 100644 --- a/Number_types/doc/Number_types/CGAL/long_long.h +++ b/Number_types/doc/Number_types/CGAL/long_long.h @@ -1,8 +1,10 @@ -/// \file long_long.h -/// \ingroup nt_builtin -/// -/// This header provides all necessary functions so the fundamental -/// type `long long int` is an `RealEmbeddable` `EuclideanRing`. Due -/// to overflow `long long int` is considered as not exact. -/// -/// \cgalModels{EuclideanRing,RealEmbeddable} +/*! +\file long_long.h +\ingroup nt_builtin + +This header provides all necessary functions so the fundamental +type `long long int` is a model of the concepts `RealEmbeddable` and `EuclideanRing`. Due +to overflow `long long int` is considered as not exact. + +\cgalModels{EuclideanRing,RealEmbeddable} +*/ \ No newline at end of file From bc35e39e1c87577f46551c8e40006a904e8c8aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Fri, 7 Feb 2025 16:54:06 +0100 Subject: [PATCH 296/332] add the cgalModels to int.h --- Number_types/doc/Number_types/CGAL/int.h | 1 + Number_types/doc/Number_types/CGAL/long_long.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Number_types/doc/Number_types/CGAL/int.h b/Number_types/doc/Number_types/CGAL/int.h index 8f43eac76b7..5f19f787534 100644 --- a/Number_types/doc/Number_types/CGAL/int.h +++ b/Number_types/doc/Number_types/CGAL/int.h @@ -11,4 +11,5 @@ This header provides all necessary functions so the fundamental types Due to overflow neither of those types is considered as exact. +\cgalModels{RealEmbeddable, EuclideanRing} */ diff --git a/Number_types/doc/Number_types/CGAL/long_long.h b/Number_types/doc/Number_types/CGAL/long_long.h index 5d0587383f0..26885845e4c 100644 --- a/Number_types/doc/Number_types/CGAL/long_long.h +++ b/Number_types/doc/Number_types/CGAL/long_long.h @@ -6,5 +6,5 @@ This header provides all necessary functions so the fundamental type `long long int` is a model of the concepts `RealEmbeddable` and `EuclideanRing`. Due to overflow `long long int` is considered as not exact. -\cgalModels{EuclideanRing,RealEmbeddable} +\cgalModels{RealEmbeddable, EuclideanRing} */ \ No newline at end of file From 2060b222c5221a8565ea2880d68d389fd5db1111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sun, 9 Feb 2025 18:48:14 +0100 Subject: [PATCH 297/332] remove leftover --- Lab/demo/Lab/CGALlab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/CGALlab.h b/Lab/demo/Lab/CGALlab.h index 0e40646762d..51afe5d0db0 100644 --- a/Lab/demo/Lab/CGALlab.h +++ b/Lab/demo/Lab/CGALlab.h @@ -20,7 +20,7 @@ public: * Constructor : calls the constructor of QApplication */ CGAL_Lab(int& argc, char **argv, - QString application_name = "Polyhedron_3 demo", + QString application_name = "CGAL Lab", QString main_window_title = "CGAL Lab", QStringList input_keywords = QStringList()); From a643c07a292df6e064a408396b1a9476980f6721 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 10 Feb 2025 10:19:10 +0100 Subject: [PATCH 298/332] Incorrect rendered formulas The formula in Documentation/doc/biblio/cgal_manual.bib ``` @article{cgal:cgm-fobbo-11, title={Fast Oriented Bounding Box Optimization on the Rotation Group $\SO(3, \mathrm{R})$}, author={Chang, Chia-Tche and Gorissen, Bastien and Melchior, Samuel}, ``` renders incorrectly (see Optimal_bounding_box/citelist.html) as there is no command `\SO` in LaTeX The formula in doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h ``` \pre \f$ sin_num^2 + cos_num^2 = den^2\f$ and \f$ 0 \leq e_1 < e_2 < d\f$. ``` renders in an unexpected way (see Kernel_d/classCGAL_1_1Aff__transformation__d.html) as the `_` is seen as subscript operator in LaTeX --- Documentation/doc/biblio/cgal_manual.bib | 2 +- Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/doc/biblio/cgal_manual.bib b/Documentation/doc/biblio/cgal_manual.bib index d1600747b48..26aa8fa6d61 100644 --- a/Documentation/doc/biblio/cgal_manual.bib +++ b/Documentation/doc/biblio/cgal_manual.bib @@ -425,7 +425,7 @@ Boissonnat} } @article{cgal:cgm-fobbo-11, - title={Fast Oriented Bounding Box Optimization on the Rotation Group $\SO(3, \mathrm{R})$}, + title={Fast Oriented Bounding Box Optimization on the Rotation Group $SO(3, \mathrm{R})$}, author={Chang, Chia-Tche and Gorissen, Bastien and Melchior, Samuel}, journal={ACM Transactions on Graphics (TOG)}, volume={30}, diff --git a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h index aa572c2df9a..f2edc867e1d 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Kernel_d/Aff_transformation_d.h @@ -98,7 +98,7 @@ in the plane spanned by the base vectors \f$ b_{e1}\f$ and \f$ b_{e2}\f$ in \f$ d\f$-space. Thus the default use delivers a planar rotation in the \f$ x\f$-\f$ y\f$ plane. -\pre \f$ sin_num^2 + cos_num^2 = den^2\f$ and \f$ 0 \leq e_1 < e_2 < d\f$. +\pre \f$ sin\_num^2 + cos\_num^2 = den^2\f$ and \f$ 0 \leq e_1 < e_2 < d\f$. \pre `den != 0`. */ From bfc8f2ca8079b2cb8c3a828271d809277a879ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Mon, 10 Feb 2025 10:30:31 +0100 Subject: [PATCH 299/332] Replace four almost identical sentences in int.h by one --- Number_types/doc/Number_types/CGAL/int.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Number_types/doc/Number_types/CGAL/int.h b/Number_types/doc/Number_types/CGAL/int.h index 5f19f787534..6db0d8c9e5c 100644 --- a/Number_types/doc/Number_types/CGAL/int.h +++ b/Number_types/doc/Number_types/CGAL/int.h @@ -3,11 +3,8 @@ \ingroup nt_builtin This header provides all necessary functions so the fundamental types -`int`, `long int`, and `short int` become models of their respective algebraic concepts. - -- `int` is a model of `RealEmbeddable` and `EuclideanRing`, -- `long int` is a model of `RealEmbeddable` and `EuclideanRing` -- `short int` is a model of `RealEmbeddable` and `EuclideanRing` +`int`, `long int`, and `short int` are models of the concepts `RealEmbeddable` and +`EuclideanRing`. Due to overflow neither of those types is considered as exact. From b2ea32cafc6591ae83fc7582adcfdd6cd7cfe38f Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 10 Feb 2025 14:22:54 +0100 Subject: [PATCH 300/332] Fix typo Co-authored-by: Laurent Rineau --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 68214b3eb0b..fb3d43485ff 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -12,7 +12,7 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. ### Triangulations -- All triangulations now offer the functions `point(Vertex_handle)` and `point(Simplex, int)`, which enables users to access the geometric positoin of a vertex and of the i-th vertex of a simplex of a triangulation. +- All triangulations now offer the functions `point(Vertex_handle)` and `point(Simplex, int)`, which enables users to access the geometric position of a vertex and of the i-th vertex of a simplex of a triangulation. ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) From 4e5fed81decfe5d8b19de07fd7082bff1efb509b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Feb 2025 15:08:19 +0100 Subject: [PATCH 301/332] fix a bug when `CGAL_BRANCH_BUILD` is falsy (in testsuite tarballs for example) --- Installation/cmake/modules/CGALHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/cmake/modules/CGALHelpers.cmake b/Installation/cmake/modules/CGALHelpers.cmake index 4c91469324f..936ef591f03 100644 --- a/Installation/cmake/modules/CGALHelpers.cmake +++ b/Installation/cmake/modules/CGALHelpers.cmake @@ -54,7 +54,7 @@ function(CGAL_handle_subdirectories subdir_name plural_name) else() - file(GLOB list "*") + file(GLOB list "${subdir_name}/*") endif() From fa83d0bd459e819c0861543c8ba74c872e1ce8c6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Feb 2025 18:07:32 +0100 Subject: [PATCH 302/332] fix Compact_container::reserve, with timestamps --- .../include/CGAL/Compact_container.h | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 5c9e7b00567..9b6cb202e93 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -571,25 +571,7 @@ public: while ( capacity_= 1; --i) - put_on_free_list(new_block + i); + auto [new_block, block_size] = all_items[curblock]; + put_block_on_free_list(new_block, block_size - 2); } while ( curblock>lastblock ); } private: - void allocate_new_block(); +std::pair push_back_new_block(); +void put_block_on_free_list(pointer new_block, size_type block_size); + +void allocate_new_block(); void put_on_free_list(pointer x) { @@ -776,20 +760,13 @@ void Compact_container::clear() } template < class T, class Allocator, class Increment_policy, class TimeStamper > -void Compact_container::allocate_new_block() +auto Compact_container::push_back_new_block() + -> std::pair { pointer new_block = alloc.allocate(block_size + 2); + std::pair result{new_block, block_size}; all_items.push_back(std::make_pair(new_block, block_size + 2)); capacity_ += block_size; - // We don't touch the first and the last one. - // We mark them free in reverse order, so that the insertion order - // will correspond to the iterator order... - for (size_type i = block_size; i >= 1; --i) - { - EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); - Time_stamper::initialize_time_stamp(new_block + i); - put_on_free_list(new_block + i); - } // We insert this new block at the end. if (last_item == nullptr) // First time { @@ -806,8 +783,33 @@ void Compact_container::allocate_ne set_type(last_item, nullptr, START_END); // Increase the block_size for the next time. Increment_policy::increase_size(*this); + return result; } +template < class T, class Allocator, class Increment_policy, class TimeStamper > +void Compact_container:: +put_block_on_free_list(pointer new_block, size_type block_size) +{ + // The block actually has a size==block_size+2. + // We don't touch the first and the last one. + // We mark them free in reverse order, so that the insertion order + // will correspond to the iterator order... + for (size_type i = block_size; i >= 1; --i) + { + EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); + Time_stamper::initialize_time_stamp(new_block + i); + put_on_free_list(new_block + i); + } +} + +template < class T, class Allocator, class Increment_policy, class TimeStamper > +void Compact_container::allocate_new_block() +{ + auto [new_block, block_size] = push_back_new_block(); + put_block_on_free_list(new_block, block_size); +} + + template < class T, class Allocator, class Increment_policy, class TimeStamper > inline bool operator==(const Compact_container &lhs, From e19e5b70256938e08ca0591805c9e3ee020d9df2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 11 Feb 2025 15:36:44 +0100 Subject: [PATCH 303/332] do not require `Boost_FOUND` --- .../CMakeLists.txt | 35 +++++++------- .../Kinetic_space_partition/CMakeLists.txt | 46 ++++++++----------- .../benchmark/Triangulation_3/CMakeLists.txt | 16 ------- 3 files changed, 36 insertions(+), 61 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt index 332c3deada6..faf3db032af 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/CMakeLists.txt @@ -16,27 +16,24 @@ find_package(Qt6 QUIET COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets Xml) find_package(CGAL COMPONENTS Qt6) find_package(nlohmann_json QUIET 3.9) -if (NOT CGAL_FOUND OR NOT CGAL_Qt6_FOUND OR NOT Qt6_FOUND OR NOT Boost_FOUND OR NOT nlohmann_json_FOUND) - if (NOT CGAL_FOUND) - set(MISSING_DEPS "the CGAL library, ${MISSING_DEPS}") - endif() - if (NOT CGAL_Qt6_FOUND) - set(MISSING_DEPS "the CGAL Qt6 component, ${MISSING_DEPS}") - endif() - if (NOT Qt6_FOUND) - set(MISSING_DEPS "the Qt6 library, ${MISSING_DEPS}") - endif() - if (NOT Boost_FOUND) - set(MISSING_DEPS "the Boost library, ${MISSING_DEPS}") - endif() - if (NOT nlohmann_json_FOUND) - set(MISSING_DEPS "JSON for Modern C++ 3.9+ (know as nlohmann_json), ${MISSING_DEPS}") - endif() - - message(STATUS "NOTICE: This project requires ${MISSING_DEPS} and will not be compiled.") - return() +set(MISSING_DEPS "") +if (NOT CGAL_FOUND) + set(MISSING_DEPS "the CGAL library, ${MISSING_DEPS}") +endif() +if (NOT CGAL_Qt6_FOUND) + set(MISSING_DEPS "the CGAL Qt6 component, ${MISSING_DEPS}") +endif() +if (NOT Qt6_FOUND) + set(MISSING_DEPS "the Qt6 library, ${MISSING_DEPS}") +endif() +if (NOT nlohmann_json_FOUND) + set(MISSING_DEPS "JSON for Modern C++ 3.9+ (know as nlohmann_json), ${MISSING_DEPS}") endif() +if (MISSING_DEPS) + message(STATUS "NOTICE: This project requires ${MISSING_DEPS}and will not be compiled.") + return() +endif() add_compile_definitions(QT_NO_VERSION_TAGGING) diff --git a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt index 81789f3965f..edae7092c3f 100644 --- a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt +++ b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt @@ -10,30 +10,24 @@ set(CMAKE_CXX_STANDARD 17) find_package(CGAL QUIET COMPONENTS Core) include(CGAL_CreateSingleSourceCGALProgram) -find_package(Boost REQUIRED) -if(Boost_FOUND) - message(STATUS "Found Boost") - - find_package(Eigen3 3.1.0 REQUIRED) - if(Eigen3_FOUND) - message(STATUS "Found Eigen") - include(CGAL_Eigen3_support) - - set(targets kinetic_3d_test_all issue_8624) - - set(project_linked_libraries) - set(project_compilation_definitions) - - foreach(target ${targets}) - create_single_source_cgal_program("${target}.cpp") - if(TARGET ${target}) - target_link_libraries(${target} PRIVATE ${project_linked_libraries} CGAL::Eigen3_support) - target_compile_definitions(${target} PRIVATE ${project_compilation_definitions}) - endif() - endforeach() - else() - message(ERROR "This program requires the Eigen library, and will not be compiled.") - endif() -else() - message(ERROR "This program requires the Boost library, and will not be compiled.") +find_package(Eigen3 3.1.0 REQUIRED) +if(NOT Eigen3_FOUND) + message(ERROR "This project requires the Eigen library, and will not be compiled.") + return() endif() + +message(STATUS "Found Eigen") +include(CGAL_Eigen3_support) + +set(targets kinetic_3d_test_all issue_8624) + +set(project_linked_libraries) +set(project_compilation_definitions) + +foreach(target ${targets}) + create_single_source_cgal_program("${target}.cpp") + if(TARGET ${target}) + target_link_libraries(${target} PRIVATE ${project_linked_libraries} CGAL::Eigen3_support) + target_compile_definitions(${target} PRIVATE ${project_compilation_definitions}) + endif() +endforeach() diff --git a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt index 544a5c02d2a..419938ed36e 100644 --- a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt @@ -8,22 +8,6 @@ project(Triangulation_3) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - # Creating entries for all C++ files with "main" routine # ########################################################## From 7fe3a5aa4bdf98b707073d3b24baf591675423d2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Feb 2025 11:46:12 +0000 Subject: [PATCH 304/332] Polyline_simplification: Fix unremovble vertices --- .../CGAL/Polyline_simplification_2/simplify.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index d5497788a02..f6435051313 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -143,9 +143,10 @@ public: } // endpoints of constraints are unremovable - // vertices which are not endpoint and have != 2 incident constrained edges are unremovable + // vertices which have more than 1 constraint passing through are unremovable void initialize_unremovable() { + std::unordered_map degrees; Constraint_iterator cit = pct.constraints_begin(), e = pct.constraints_end(); for(; cit!=e; ++cit){ Constraint_id cid = *cit; @@ -154,6 +155,8 @@ public: (*it)->set_removable(false); ++it; for(; it != ite; ++it){ + Vertex_handle vh = *it; + ++degrees[vh]; if((boost::next(it) != ite) && (boost::prior(it)== boost::next(it))){ (*it)->set_removable(false); } @@ -162,19 +165,8 @@ public: (*it)->set_removable(false); } - std::unordered_map degrees; - for (Constrained_edges_iterator it = pct.constrained_edges_begin(); it != pct.constrained_edges_end(); ++it) { - Edge e = *it; - Face_handle fh = e.first; - int ei = e.second; - Vertex_handle vh = fh->vertex(pct.cw(ei)); - ++degrees[vh]; - vh = fh->vertex(pct.ccw(ei)); - ++degrees[vh]; - } - for(Finite_vertices_iterator it = pct.finite_vertices_begin(); it != pct.finite_vertices_end(); ++it){ - if( it->is_removable() && (degrees[it] != 2) ){ + if( it->is_removable() && (degrees[it] > 1) ){ it->set_removable(false); } } From 33eec618303344d5ddb24f6ac7d1ca6ae65775f1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Feb 2025 12:01:03 +0000 Subject: [PATCH 305/332] Add testcase --- .../Polyline_simplification_2/CMakeLists.txt | 1 + .../Polyline_simplification_2/issue-8735.cpp | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Polyline_simplification_2/test/Polyline_simplification_2/issue-8735.cpp diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt index 954afd626ab..82a1b98bee1 100644 --- a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt @@ -8,5 +8,6 @@ project(Polyline_simplification_2_Tests) find_package(CGAL REQUIRED) create_single_source_cgal_program( "issue-5774.cpp" ) +create_single_source_cgal_program( "issue-8735.cpp" ) create_single_source_cgal_program( "simplify_polygon_test.cpp" ) create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" ) diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/issue-8735.cpp b/Polyline_simplification_2/test/Polyline_simplification_2/issue-8735.cpp new file mode 100644 index 00000000000..11f2cb75643 --- /dev/null +++ b/Polyline_simplification_2/test/Polyline_simplification_2/issue-8735.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +namespace PS = CGAL::Polyline_simplification_2; +typedef CGAL::Exact_predicates_exact_constructions_kernel K; +typedef PS::Vertex_base_2 Vb; +typedef CGAL::Constrained_triangulation_face_base_2 Fb; +typedef CGAL::Triangulation_data_structure_2 TDS; +typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; +typedef CGAL::Constrained_triangulation_plus_2 CT; +typedef CT::Point Point; +typedef PS::Stop_above_cost_threshold Stop; +typedef PS::Squared_distance_cost Cost; + +int main() +{ + double tolerance = 100; + CT ct; + std::vector pts; + + pts.push_back(CT::Point(0, 0)); + pts.push_back(CT::Point(2, 0)); + pts.push_back(CT::Point(1, 0)); + pts.push_back(CT::Point(3, 0)); + pts.push_back(CT::Point(4, 1)); + tolerance = 100; + ct.insert_constraint(pts.begin(), pts.end(), false); + + PS::simplify(ct, Cost(), Stop(tolerance * tolerance), false); + + return 0; +} From bc6d19e11bb6e0b7cf22d209143c18e2bdfa04ce Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Feb 2025 17:35:28 +0000 Subject: [PATCH 306/332] The bug was to compare prior and next, whereas we have to compare *prior with *next --- .../CGAL/Polyline_simplification_2/simplify.h | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index f6435051313..76f7468d469 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -143,10 +143,9 @@ public: } // endpoints of constraints are unremovable - // vertices which have more than 1 constraint passing through are unremovable + // vertices which are not endpoint and have != 2 incident constrained edges are unremovable void initialize_unremovable() { - std::unordered_map degrees; Constraint_iterator cit = pct.constraints_begin(), e = pct.constraints_end(); for(; cit!=e; ++cit){ Constraint_id cid = *cit; @@ -155,18 +154,30 @@ public: (*it)->set_removable(false); ++it; for(; it != ite; ++it){ - Vertex_handle vh = *it; - ++degrees[vh]; - if((boost::next(it) != ite) && (boost::prior(it)== boost::next(it))){ - (*it)->set_removable(false); + if(boost::next(it) != ite){ + Vertex_handle vp = *boost::prior(it), vn = *boost::next(it); + if(vp == vn){ + (*it)->set_removable(false); + } } } it = boost::prior(it); (*it)->set_removable(false); } + std::unordered_map degrees; + for (Constrained_edges_iterator it = pct.constrained_edges_begin(); it != pct.constrained_edges_end(); ++it) { + Edge e = *it; + Face_handle fh = e.first; + int ei = e.second; + Vertex_handle vh = fh->vertex(pct.cw(ei)); + ++degrees[vh]; + vh = fh->vertex(pct.ccw(ei)); + ++degrees[vh]; + } + for(Finite_vertices_iterator it = pct.finite_vertices_begin(); it != pct.finite_vertices_end(); ++it){ - if( it->is_removable() && (degrees[it] > 1) ){ + if( it->is_removable() && (degrees[it] != 2) ){ it->set_removable(false); } } From 98b6cf398d3a1cdc7d8f8457688cbd45162f6c19 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Feb 2025 17:48:55 +0000 Subject: [PATCH 307/332] change iterator category to bidirectional --- STL_Extension/include/CGAL/Skiplist.h | 4 ++-- .../internal/Polyline_constraint_hierarchy_2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/STL_Extension/include/CGAL/Skiplist.h b/STL_Extension/include/CGAL/Skiplist.h index 3be7908c90c..e7d7b60b422 100644 --- a/STL_Extension/include/CGAL/Skiplist.h +++ b/STL_Extension/include/CGAL/Skiplist.h @@ -75,7 +75,7 @@ public: all_iterator , typename all_list::iterator , T - > + , std::bidirectional_iterator_tag> { public: all_iterator() {} @@ -91,7 +91,7 @@ public: skip_iterator , typename skip_list::iterator , T - > + , std::bidirectional_iterator_tag> { public: skip_iterator() {} diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 8154e26251c..0cba5ca0213 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -85,7 +85,7 @@ public: Vertex_it , typename Vertex_list::skip_iterator , Vertex_handle - , boost::use_default + , std::bidirectional_iterator_tag , Vertex_handle> { public: From c8e935708091b6daf84f4dabd9e2bf81baf374bf Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Feb 2025 17:50:35 +0000 Subject: [PATCH 308/332] Use std::prev() and std::next() instead of their boost equivalents --- .../include/CGAL/Polyline_simplification_2/simplify.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index 76f7468d469..3fd443d4e2d 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -154,8 +154,8 @@ public: (*it)->set_removable(false); ++it; for(; it != ite; ++it){ - if(boost::next(it) != ite){ - Vertex_handle vp = *boost::prior(it), vn = *boost::next(it); + if(std::next(it) != ite){ + Vertex_handle vp = *std::prev(it), vn = *std::next(it); if(vp == vn){ (*it)->set_removable(false); } From 3942e1e2a60be1902f9cd067c08dcd5a2c84b000 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 13 Feb 2025 15:12:15 +0100 Subject: [PATCH 309/332] add cmap test --- .../test/Combinatorial_map/CMakeLists.txt | 6 +++- .../Combinatorial_map_empty_it_test.cpp | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 271451857f9..885b68f5b53 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -12,6 +12,8 @@ set(hfiles Combinatorial_map_2_test.h Combinatorial_map_3_test.h # create a target per cppfile create_single_source_cgal_program(Combinatorial_map_test.cpp ${hfiles}) create_single_source_cgal_program(Combinatorial_map_copy_test.cpp ${hfiles}) +create_single_source_cgal_program(cmap_test_split_attribute.cpp) +create_single_source_cgal_program(Combinatorial_map_empty_it_test.cpp) # Same targets, defining USE_COMPACT_CONTAINER_WITH_INDEX to test index version add_executable(Combinatorial_map_test_index Combinatorial_map_test.cpp ${hfiles}) @@ -24,7 +26,9 @@ target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE USE_COMPACT target_link_libraries(Combinatorial_map_copy_test_index PRIVATE CGAL::CGAL CGAL::Data) cgal_add_compilation_test(Combinatorial_map_copy_test_index) -create_single_source_cgal_program(cmap_test_split_attribute.cpp) +add_executable(Combinatorial_map_empty_it_test_index Combinatorial_map_empty_it_test.cpp) +target_compile_definitions(Combinatorial_map_empty_it_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) +cgal_add_compilation_test(Combinatorial_map_empty_it_test_index) # Link with OpenMesh if possible find_package(OpenMesh QUIET) diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp new file mode 100644 index 00000000000..cf8270f4b95 --- /dev/null +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp @@ -0,0 +1,36 @@ +#include + +struct Map_3_dart_items_3: public CGAL::Generic_map_min_items +{ +#ifdef USE_COMPACT_CONTAINER_WITH_INDEX + typedef CGAL::Tag_true Use_index; +#endif +}; + +using Map3=CGAL::Combinatorial_map<3, Map_3_dart_items_3>; + +template +bool test_empty_it(Range& r, const std::string& txt) +{ + bool res=true; + Map3 m; + if(r.size()!=0) + { + std::cout<<"[ERROR "< Date: Thu, 13 Feb 2025 16:11:12 +0100 Subject: [PATCH 310/332] update cmap test empty iterator --- .../test/Combinatorial_map/CMakeLists.txt | 1 + .../Combinatorial_map_empty_it_test.cpp | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 885b68f5b53..028f26c9d93 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -28,6 +28,7 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index) add_executable(Combinatorial_map_empty_it_test_index Combinatorial_map_empty_it_test.cpp) target_compile_definitions(Combinatorial_map_empty_it_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) +target_link_libraries(Combinatorial_map_empty_it_test_index PRIVATE CGAL::CGAL CGAL::Data) cgal_add_compilation_test(Combinatorial_map_empty_it_test_index) # Link with OpenMesh if possible diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp index cf8270f4b95..a7364439192 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_empty_it_test.cpp @@ -8,12 +8,12 @@ struct Map_3_dart_items_3: public CGAL::Generic_map_min_items }; using Map3=CGAL::Combinatorial_map<3, Map_3_dart_items_3>; +Map3 m; template -bool test_empty_it(Range& r, const std::string& txt) +bool test_empty_it(const Range& r, const std::string& txt) { bool res=true; - Map3 m; if(r.size()!=0) { std::cout<<"[ERROR "<(m.darts(), "Dart_range"); + res=res && test_empty_it + (const_cast(m).darts(), "Dart_const_range"); + + res=res && test_empty_it> + (m.one_dart_per_cell<3>(), "One_dart_per_cell_range<0>"); + + res=res && test_empty_it> + (const_cast(m).one_dart_per_cell<3>(), + "One_dart_per_cell_const_range<0>"); + + if(!res) + { return(EXIT_FAILURE); } + + std::cout<<"ALL SUCCESS."< Date: Thu, 13 Feb 2025 17:47:29 +0100 Subject: [PATCH 311/332] Bug fix for compact container with index, when iterating on empty container. --- .../include/CGAL/Cell_iterators.h | 26 ++++++++++++------- .../CGAL/Compact_container_with_index.h | 19 ++++++++------ .../include/CGAL/GMap_cell_iterators.h | 11 ++++---- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Cell_iterators.h b/Combinatorial_map/include/CGAL/Cell_iterators.h index 93104ba01e2..9f73b23f232 100644 --- a/Combinatorial_map/include/CGAL/Cell_iterators.h +++ b/Combinatorial_map/include/CGAL/Cell_iterators.h @@ -86,7 +86,8 @@ namespace CGAL { Tag_true>::value); CGAL_assertion(amap.is_whole_map_unmarked(mcell_mark_number)); - mark_cell(amap, adart, mcell_mark_number); + if(this->cont()) + { mark_cell(amap, adart, mcell_mark_number); } } /// Destructor. @@ -126,7 +127,8 @@ namespace CGAL { { unmark_treated_darts(); Ite::rewind(); - mark_cell(*this->mmap, (*this), mcell_mark_number); + if(this->cont()) + { mark_cell(*this->mmap, (*this), mcell_mark_number); } } /// Prefix ++ operator. @@ -199,7 +201,8 @@ namespace CGAL { static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); - mark_cell(amap, adart, mmark_number); + if(this->cont()) + { mark_cell(amap, adart, mmark_number); } } /// Destructor. @@ -234,7 +237,8 @@ namespace CGAL { { unmark_treated_darts(); Ite::rewind(); - mark_cell(*this->mmap, (*this), mmark_number); + if(this->cont()) + { mark_cell(*this->mmap, (*this), mmark_number); } } /// Postfix ++ operator. @@ -253,7 +257,7 @@ namespace CGAL { this->mmap->is_marked((*this), mmark_number)); if (this->cont()) - mark_cell(*this->mmap, (*this), mmark_number); + { mark_cell(*this->mmap, (*this), mmark_number); } return *this; } @@ -306,7 +310,8 @@ namespace CGAL { static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); - mark_cell(amap, (*this), mmark_number); + if(this->cont()) + { mark_cell(amap, (*this), mmark_number); } } /// Constructor with a dart in parameter (for end iterator). @@ -314,8 +319,8 @@ namespace CGAL { Base(amap, adart), mmark_number(amap.get_new_mark()) { - if (adart!=this->mmap->null_descriptor) - mark_cell(amap, (*this), mmark_number); + if (this->cont()) + { mark_cell(amap, (*this), mmark_number); } } /// Destructor. @@ -350,7 +355,8 @@ namespace CGAL { { unmark_treated_darts(); Base::rewind(); - mark_cell(*this->mmap, (*this), mmark_number); + if(this->cont()) + { mark_cell(*this->mmap, (*this), mmark_number); } } /// Postfix ++ operator. @@ -369,7 +375,7 @@ namespace CGAL { this->mmap->is_marked((*this), mmark_number)); if (this->cont()) - mark_cell(*this->mmap, (*this), mmark_number); + { mark_cell(*this->mmap, (*this), mmark_number); } return *this; } diff --git a/Combinatorial_map/include/CGAL/Compact_container_with_index.h b/Combinatorial_map/include/CGAL/Compact_container_with_index.h index b14fe21083a..7395743edb0 100644 --- a/Combinatorial_map/include/CGAL/Compact_container_with_index.h +++ b/Combinatorial_map/include/CGAL/Compact_container_with_index.h @@ -610,16 +610,16 @@ public: } iterator begin() { return empty()?end():iterator(this, 0, 0); } - iterator end() { return iterator(this, upper_bound()); } + iterator end() { return iterator(this, null_descriptor); } const_iterator begin() const { return empty()?end():const_iterator(this, 0, 0); } - const_iterator end() const { return const_iterator(this, upper_bound()); } + const_iterator end() const { return const_iterator(this, null_descriptor); } - reverse_iterator rbegin() { return reverse_iterator(end()); } + reverse_iterator rbegin() { return reverse_iterator(iterator(this, upper_bound())); } reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator - rbegin() const { return const_reverse_iterator(end()); } + rbegin() const { return const_reverse_iterator(iterator(this, upper_bound())); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } @@ -878,7 +878,8 @@ namespace internal { CC_iterator_with_index(const iterator &it): m_ptr_to_cc(it.m_ptr_to_cc), m_index(it.m_index) { - CGAL_assertion(m_index<=m_ptr_to_cc->upper_bound()); + CGAL_assertion(m_index<=m_ptr_to_cc->upper_bound() || + m_index==DSC::null_descriptor); } // Same for assignment operator @@ -928,14 +929,16 @@ namespace internal { // It's either pointing to end(), or valid. CGAL_assertion_msg(m_ptr_to_cc!=nullptr, "Incrementing a singular iterator or an empty container iterator ?"); - CGAL_assertion_msg(m_indexupper_bound(), - "Incrementing end() ?"); + CGAL_assertion_msg(m_indexupper_bound() && + m_index!=DSC::null_descriptor, + "Incrementing end() ?"); // If it's not end(), then it's valid, we can do ++. do { ++m_index; } while(m_indexupper_bound() && (!m_ptr_to_cc->is_used(m_index))); + if(m_index==m_ptr_to_cc->upper_bound()) { m_index=DSC::null_descriptor; } } void decrement() @@ -969,7 +972,7 @@ namespace internal { pointer operator->() const { return &((*m_ptr_to_cc)[m_index]); } - bool is_end() const { return m_index>=m_ptr_to_cc->upper_bound(); } + bool is_end() const { return m_index==DSC::null_descriptor; } // Can itself be used for bit-squatting. size_type for_compact_container() const diff --git a/Generalized_map/include/CGAL/GMap_cell_iterators.h b/Generalized_map/include/CGAL/GMap_cell_iterators.h index 1dbef9dcd6e..d739d64d3c2 100644 --- a/Generalized_map/include/CGAL/GMap_cell_iterators.h +++ b/Generalized_map/include/CGAL/GMap_cell_iterators.h @@ -73,7 +73,8 @@ namespace CGAL { static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); - mark_cell(amap, (*this), mmark_number); + if(this->cont()) + { mark_cell(amap, (*this), mmark_number); } } /// Constructor with a dart in parameter (for end iterator). @@ -81,8 +82,8 @@ namespace CGAL { Base(amap, adart), mmark_number(amap.get_new_mark()) { - if (adart!=this->mmap->null_descriptor) - mark_cell(amap, (*this), mmark_number); + if (this->cont()) + { mark_cell(amap, (*this), mmark_number); } } /// Destructor. @@ -136,7 +137,7 @@ namespace CGAL { this->mmap->is_marked((*this), mmark_number)); if (this->cont()) - mark_cell(*this->mmap, (*this), mmark_number); + { mark_cell(*this->mmap, (*this), mmark_number); } return *this; } @@ -249,7 +250,7 @@ namespace CGAL { this->mmap->is_marked((*this), mmark_number)); if (this->cont()) - mark_cell(*this->mmap, (*this), mmark_number); + { mark_cell(*this->mmap, (*this), mmark_number); } return *this; } From 66965f3a071ddf925484bd13805dbe052019ca77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 14 Feb 2025 11:03:32 +0100 Subject: [PATCH 312/332] remove todo --- .../doc/Algebraic_foundations/PackageDescription.txt | 1 - Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt | 1 - Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt | 1 - .../doc/Arrangement_on_surface_2/PackageDescription.txt | 1 - .../doc/Boolean_set_operations_2/PackageDescription.txt | 1 - Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt | 1 - Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt | 1 - Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt | 1 - Envelope_2/doc/Envelope_2/PackageDescription.txt | 1 - Envelope_3/doc/Envelope_3/PackageDescription.txt | 1 - HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt | 1 - Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt | 1 - Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt | 1 - Kernel_d/doc/Kernel_d/PackageDescription.txt | 1 - Matrix_search/doc/Matrix_search/PackageDescription.txt | 1 - Minkowski_sum_3/doc/Minkowski_sum_3/PackageDescription.txt | 1 - Nef_3/doc/Nef_3/PackageDescription.txt | 1 - Number_types/doc/Number_types/PackageDescription.txt | 1 - Partition_2/doc/Partition_2/PackageDescription.txt | 1 - Point_set_2/doc/Point_set_2/PackageDescription.txt | 1 - Polyhedron/doc/Polyhedron/PackageDescription.txt | 1 - Polynomial/doc/Polynomial/PackageDescription.txt | 1 - .../doc/Polytope_distance_d/PackageDescription.txt | 1 - .../doc/Principal_component_analysis/PackageDescription.txt | 1 - QP_solver/doc/QP_solver/PackageDescription.txt | 1 - Ridges_3/doc/Ridges_3/PackageDescription.txt | 1 - SearchStructures/doc/SearchStructures/PackageDescription.txt | 1 - .../doc/Segment_Delaunay_graph_2/PackageDescription.txt | 1 - .../doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt | 1 - Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt | 1 - Surface_mesher/doc/Surface_mesher/PackageDescription.txt | 1 - Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt | 1 - TDS_2/doc/TDS_2/PackageDescription.txt | 1 - TDS_3/doc/TDS_3/PackageDescription.txt | 1 - Triangulation_2/doc/Triangulation_2/PackageDescription.txt | 1 - Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt | 1 - 36 files changed, 36 deletions(-) diff --git a/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt b/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt index caa1060d544..9e12449ab5b 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt +++ b/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt @@ -5,7 +5,6 @@ /*! \addtogroup PkgAlgebraicFoundationsRef -\todo check generated documentation \cgalPkgDescriptionBegin{Algebraic Foundations,PkgAlgebraicFoundations} \cgalPkgPicture{Algebraic_foundations2.png} diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt index 4907d2a4192..b8107073f4a 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt @@ -16,7 +16,6 @@ /*! \addtogroup PkgAlgebraicKernelDRef -\todo check generated documentation \cgalPkgDescriptionBegin{Algebraic Kernel,PkgAlgebraicKernelD} \cgalPkgPicture{Algebraic_kernel_d.png} \cgalPkgSummaryBegin diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt b/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt index f82d98db1ed..102f019f68c 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgApolloniusGraph2Ref /*! \addtogroup PkgApolloniusGraph2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Apollonius Graphs (Delaunay Graphs of Disks),PkgApolloniusGraph2} \cgalPkgPicture{CircleVoronoi.png} \cgalPkgSummaryBegin diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 300970a336e..62d1384f312 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -66,7 +66,6 @@ namespace ArrTraits {} /*! \addtogroup PkgArrangementOnSurface2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Arrangements,PkgArrangementOnSurface2} \cgalPkgPicture{Arrangement_2.png} \cgalPkgSummaryBegin diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt index a562dd4e48a..c36bb0cdd61 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt @@ -14,7 +14,6 @@ namespace ArrDirectionalTraits {} /*! \addtogroup PkgBooleanSetOperations2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Regularized Boolean Set-Operations,PkgBooleanSetOperations2} \cgalPkgPicture{Boolean_set_operations_2.png} \cgalPkgSummaryBegin diff --git a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt index 7ec2b717b7b..6777f112a5b 100644 --- a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt +++ b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgBoundingVolumesRef /*! \addtogroup PkgBoundingVolumesRef -\todo check generated documentation \cgalPkgDescriptionBegin{Bounding Volumes,PkgBoundingVolumes} \cgalPkgPicture{minCircle.png} \cgalPkgSummaryBegin diff --git a/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt b/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt index f596f9b0a1b..3092d4092ba 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt +++ b/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt @@ -22,7 +22,6 @@ /*! \addtogroup PkgCircularKernel2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Circular Geometry Kernel,PkgCircularKernel2} \cgalPkgPicture{Boolean_operation_detail.png} \cgalPkgSummaryBegin diff --git a/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt b/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt index a1a4b8a3de1..bf45d7bfeb3 100644 --- a/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt +++ b/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgConvexHullDRef /*! \addtogroup PkgConvexHullDRef -\todo check generated documentation \cgalPkgDescriptionBegin{dD Convex Hulls and Delaunay Triangulations,PkgConvexHullD} \cgalPkgPicture{convex_hull_d-teaser.png} \cgalPkgSummaryBegin diff --git a/Envelope_2/doc/Envelope_2/PackageDescription.txt b/Envelope_2/doc/Envelope_2/PackageDescription.txt index 28824ca8e7d..0fe4c06e4ea 100644 --- a/Envelope_2/doc/Envelope_2/PackageDescription.txt +++ b/Envelope_2/doc/Envelope_2/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgEnvelope2Ref /*! \addtogroup PkgEnvelope2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Envelopes,PkgEnvelope2} \cgalPkgPicture{Envelope_2/fig/Envelope_2.png} \cgalPkgSummaryBegin diff --git a/Envelope_3/doc/Envelope_3/PackageDescription.txt b/Envelope_3/doc/Envelope_3/PackageDescription.txt index 7579fff2c1e..920f6b7054b 100644 --- a/Envelope_3/doc/Envelope_3/PackageDescription.txt +++ b/Envelope_3/doc/Envelope_3/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgEnvelope3Ref /*! \addtogroup PkgEnvelope3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Envelopes,PkgEnvelope3} \cgalPkgPicture{Envelope_3/fig/Envelope_3.png} \cgalPkgSummaryBegin diff --git a/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt b/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt index 48650817c57..ea6800cd6b1 100644 --- a/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt +++ b/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt @@ -19,7 +19,6 @@ /*! \addtogroup PkgHalfedgeDSRef -\todo check generated documentation \cgalPkgDescriptionBegin{Halfedge Data Structures,PkgHalfedgeDS} \cgalPkgPicture{HalfedgeDS/fig/HalfedgeDS-teaser-small.png} \cgalPkgSummaryBegin diff --git a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt index a15bb4b041c..aa77a9b9cc9 100644 --- a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt +++ b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt @@ -5,7 +5,6 @@ /*! \addtogroup PkgInscribedAreasRef -\todo check generated documentation \cgalPkgDescriptionBegin{Inscribed Areas,PkgInscribedAreas} \cgalPkgPicture{ler-detail.png} \cgalPkgSummaryBegin diff --git a/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt b/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt index cc0ea70929d..90af6ff6785 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt +++ b/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgJetFitting3Ref /*! \addtogroup PkgJetFitting3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{Estimation of Local Differential Properties of Point-Sampled Surfaces,PkgJetFitting3} \cgalPkgPicture{DavidDetail.png} \cgalPkgSummaryBegin diff --git a/Kernel_d/doc/Kernel_d/PackageDescription.txt b/Kernel_d/doc/Kernel_d/PackageDescription.txt index f8c024183a2..783f291db01 100644 --- a/Kernel_d/doc/Kernel_d/PackageDescription.txt +++ b/Kernel_d/doc/Kernel_d/PackageDescription.txt @@ -21,7 +21,6 @@ /*! \addtogroup PkgKernelDRef -\todo check generated documentation \cgalPkgDescriptionBegin{dD Geometry Kernel,PkgKernelD} \cgalPkgPicture{hypercube.png} \cgalPkgSummaryBegin diff --git a/Matrix_search/doc/Matrix_search/PackageDescription.txt b/Matrix_search/doc/Matrix_search/PackageDescription.txt index 202989f2da3..1dabc40e68c 100644 --- a/Matrix_search/doc/Matrix_search/PackageDescription.txt +++ b/Matrix_search/doc/Matrix_search/PackageDescription.txt @@ -5,7 +5,6 @@ /*! \addtogroup PkgMatrixSearchRef -\todo check generated documentation \cgalPkgDescriptionBegin{Monotone and Sorted Matrix Search,PkgMatrixSearch} \cgalPkgPicture{matrix.png} \cgalPkgSummaryBegin diff --git a/Minkowski_sum_3/doc/Minkowski_sum_3/PackageDescription.txt b/Minkowski_sum_3/doc/Minkowski_sum_3/PackageDescription.txt index 55255f3db34..5f467e1e05f 100644 --- a/Minkowski_sum_3/doc/Minkowski_sum_3/PackageDescription.txt +++ b/Minkowski_sum_3/doc/Minkowski_sum_3/PackageDescription.txt @@ -2,7 +2,6 @@ /*! \addtogroup PkgMinkowskiSum3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Minkowski Sum of Polyhedra,PkgMinkowskiSum3} \cgalPkgPicture{Minkowski_sum_3/fig/Minkowski_sum_3_teaser.png} \cgalPkgSummaryBegin diff --git a/Nef_3/doc/Nef_3/PackageDescription.txt b/Nef_3/doc/Nef_3/PackageDescription.txt index de1e15c2f1c..6f591bcfb6c 100644 --- a/Nef_3/doc/Nef_3/PackageDescription.txt +++ b/Nef_3/doc/Nef_3/PackageDescription.txt @@ -11,7 +11,6 @@ /*! \addtogroup PkgNef3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Boolean Operations on Nef Polyhedra,PkgNef3} \cgalPkgPicture{Nef_3-teaser.png} \cgalPkgSummaryBegin diff --git a/Number_types/doc/Number_types/PackageDescription.txt b/Number_types/doc/Number_types/PackageDescription.txt index 84bfd6debbd..ba551f7c153 100644 --- a/Number_types/doc/Number_types/PackageDescription.txt +++ b/Number_types/doc/Number_types/PackageDescription.txt @@ -30,7 +30,6 @@ /*! \addtogroup PkgNumberTypesRef -\todo check generated documentation \cgalPkgDescriptionBegin{Number Types,PkgNumberTypes} \cgalPkgPicture{illustration.png} \cgalPkgSummaryBegin diff --git a/Partition_2/doc/Partition_2/PackageDescription.txt b/Partition_2/doc/Partition_2/PackageDescription.txt index ec875293336..2d33fd123ce 100644 --- a/Partition_2/doc/Partition_2/PackageDescription.txt +++ b/Partition_2/doc/Partition_2/PackageDescription.txt @@ -7,7 +7,6 @@ /// \ingroup PkgPartition2Ref /*! \addtogroup PkgPartition2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Polygon Partitioning,PkgPartition2} \cgalPkgPicture{Partition_2/fig/Partition_2-teaser-small.png} \cgalPkgSummaryBegin diff --git a/Point_set_2/doc/Point_set_2/PackageDescription.txt b/Point_set_2/doc/Point_set_2/PackageDescription.txt index a191f6ff181..bf3a90fd689 100644 --- a/Point_set_2/doc/Point_set_2/PackageDescription.txt +++ b/Point_set_2/doc/Point_set_2/PackageDescription.txt @@ -10,7 +10,6 @@ /*! \addtogroup PkgPointSet2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Range and Neighbor Search,PkgPointSet2} \cgalPkgPicture{Point_set_2/fig/point_set.png} \cgalPkgSummaryBegin diff --git a/Polyhedron/doc/Polyhedron/PackageDescription.txt b/Polyhedron/doc/Polyhedron/PackageDescription.txt index 7369093e05d..f0033c7efd7 100644 --- a/Polyhedron/doc/Polyhedron/PackageDescription.txt +++ b/Polyhedron/doc/Polyhedron/PackageDescription.txt @@ -13,7 +13,6 @@ /*! \addtogroup PkgPolyhedronRef -\todo check generated documentation \cgalPkgDescriptionBegin{3D Polyhedral Surface,PkgPolyhedron} \cgalPkgPicture{Polyhedron-teaser-small.png} \cgalPkgSummaryBegin diff --git a/Polynomial/doc/Polynomial/PackageDescription.txt b/Polynomial/doc/Polynomial/PackageDescription.txt index 0f1de49b78b..96273a5ada8 100644 --- a/Polynomial/doc/Polynomial/PackageDescription.txt +++ b/Polynomial/doc/Polynomial/PackageDescription.txt @@ -9,7 +9,6 @@ /// \ingroup PkgPolynomialRef /*! \addtogroup PkgPolynomialRef -\todo check generated documentation \cgalPkgDescriptionBegin{Polynomial,PkgPolynomial} \cgalPkgPicture{Polynomial.png} \cgalPkgSummaryBegin diff --git a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt index aaecb2b37da..b49377cf9ed 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt +++ b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt @@ -4,7 +4,6 @@ /*! \addtogroup PkgPolytopeDistanceDRef -\todo check generated documentation \cgalPkgDescriptionBegin{Optimal Distances,PkgPolytopeDistanceD} \cgalPkgPicture{dist.png} \cgalPkgSummaryBegin diff --git a/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt b/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt index c1640a1188d..03acad4f33b 100644 --- a/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt +++ b/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt @@ -17,7 +17,6 @@ /*! \addtogroup PkgPrincipalComponentAnalysisDRef -\todo check generated documentation \cgalPkgDescriptionBegin{Principal Component Analysis,PkgPrincipalComponentAnalysisD} \cgalPkgPicture{teaserLeastSquaresFitting.png} \cgalPkgSummaryBegin diff --git a/QP_solver/doc/QP_solver/PackageDescription.txt b/QP_solver/doc/QP_solver/PackageDescription.txt index e63fc8a3310..0da82f7f3b6 100644 --- a/QP_solver/doc/QP_solver/PackageDescription.txt +++ b/QP_solver/doc/QP_solver/PackageDescription.txt @@ -72,7 +72,6 @@ Programs can be written to an output stream in MPSFormat, using one of the follo /*! \addtogroup PkgQPSolverRef -\todo check generated documentation \cgalPkgDescriptionBegin{Linear and Quadratic Programming Solver,PkgQPSolver} \cgalPkgPicture{qp.png} \cgalPkgSummaryBegin diff --git a/Ridges_3/doc/Ridges_3/PackageDescription.txt b/Ridges_3/doc/Ridges_3/PackageDescription.txt index d34109ac8e3..5c06986a879 100644 --- a/Ridges_3/doc/Ridges_3/PackageDescription.txt +++ b/Ridges_3/doc/Ridges_3/PackageDescription.txt @@ -5,7 +5,6 @@ /*! \addtogroup PkgRidges3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{Approximation of Ridges and Umbilics on Triangulated Surface Meshes,PkgRidges3} \cgalPkgPicture{RidgesMechPartDetail.png} \cgalPkgSummaryBegin diff --git a/SearchStructures/doc/SearchStructures/PackageDescription.txt b/SearchStructures/doc/SearchStructures/PackageDescription.txt index a2f35335bfc..3fdc12fd5b8 100644 --- a/SearchStructures/doc/SearchStructures/PackageDescription.txt +++ b/SearchStructures/doc/SearchStructures/PackageDescription.txt @@ -10,7 +10,6 @@ /*! \addtogroup PkgSearchStructuresRef -\todo check generated documentation \cgalPkgDescriptionBegin{dD Range and Segment Trees,PkgSearchStructures} \cgalPkgPicture{segment_tree.png} \cgalPkgSummaryBegin diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt index 947f7034f0d..8db5cfb3b9b 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgSegmentDelaunayGraph2Ref /*! \addtogroup PkgSegmentDelaunayGraph2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Segment Delaunay Graphs,PkgSegmentDelaunayGraph2} \cgalPkgPicture{svd.png} \cgalPkgSummaryBegin diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt index 3b8dcdecfb0..42096623238 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt @@ -4,7 +4,6 @@ /*! \addtogroup PkgSegmentDelaunayGraphLinf2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{L Infinity Segment Delaunay Graphs,PkgSegmentDelaunayGraphLinf2} \cgalPkgPicture{sdglinf-small.png} diff --git a/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt b/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt index 39d8c15bcd7..58e533bedcf 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt +++ b/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgSnapRounding2Ref /*! \addtogroup PkgSnapRounding2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Snap Rounding,PkgSnapRounding2} \cgalPkgPicture{snap-detail.png} \cgalPkgSummaryBegin diff --git a/Surface_mesher/doc/Surface_mesher/PackageDescription.txt b/Surface_mesher/doc/Surface_mesher/PackageDescription.txt index 39b9d967d97..091d2399df4 100644 --- a/Surface_mesher/doc/Surface_mesher/PackageDescription.txt +++ b/Surface_mesher/doc/Surface_mesher/PackageDescription.txt @@ -21,7 +21,6 @@ /*! \addtogroup PkgSurfaceMesher3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Surface Mesh Generation,PkgSurfaceMesher3} \cgalPkgPicture{segmented_head-small.png} \cgalPkgSummaryBegin diff --git a/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt b/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt index d6d239ae476..8f4d6fcc4d6 100644 --- a/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt +++ b/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt @@ -1,7 +1,6 @@ /// \defgroup PkgSurfaceSweep2Ref 2D Intersection of Curves Reference /*! \addtogroup PkgSurfaceSweep2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Intersection of Curves,PkgSurfaceSweep2} \cgalPkgPicture{Curve_intersections_2.png} \cgalPkgSummaryBegin diff --git a/TDS_2/doc/TDS_2/PackageDescription.txt b/TDS_2/doc/TDS_2/PackageDescription.txt index d4dc2c2645e..95af343936f 100644 --- a/TDS_2/doc/TDS_2/PackageDescription.txt +++ b/TDS_2/doc/TDS_2/PackageDescription.txt @@ -3,7 +3,6 @@ /// \ingroup PkgTDS2Ref /*! \addtogroup PkgTDS2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Triangulation Data Structure,PkgTDS2} \cgalPkgPicture{tds_small.png} \cgalPkgSummaryBegin diff --git a/TDS_3/doc/TDS_3/PackageDescription.txt b/TDS_3/doc/TDS_3/PackageDescription.txt index 06523934036..9f2efbc741f 100644 --- a/TDS_3/doc/TDS_3/PackageDescription.txt +++ b/TDS_3/doc/TDS_3/PackageDescription.txt @@ -10,7 +10,6 @@ /// \ingroup PkgTDS3Ref /*! \addtogroup PkgTDS3Ref -\todo check generated documentation \cgalPkgDescriptionBegin{3D Triangulation Data Structure,PkgTDS3} \cgalPkgPicture{tds3_small.png} \cgalPkgSummaryBegin diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index f84ffe376ba..815186bb141 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -27,7 +27,6 @@ /*! \addtogroup PkgTriangulation2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Triangulations,PkgTriangulation2} \cgalPkgPicture{cdt2d-small.png} \cgalPkgSummaryBegin diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt index 58edde2ec5a..898f2932d71 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt @@ -20,7 +20,6 @@ /*! \addtogroup PkgVoronoiDiagram2Ref -\todo check generated documentation \cgalPkgDescriptionBegin{2D Voronoi Diagram Adaptor,PkgVoronoiDiagram2} \cgalPkgPicture{voronoi.png} \cgalPkgSummaryBegin From 31f271b88c1c2fcb88b3ee39dc527decca5aa1e0 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Mon, 17 Feb 2025 10:17:11 +0200 Subject: [PATCH 313/332] Added a precondition for merge_edge(e1, e2) that requires that two halfedges have the same direction. --- .../doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h index d4c30698e16..a900bd3f6e7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_2.h @@ -973,6 +973,7 @@ public: * u_1\f$ to \f$ u_2\f$. * \pre `e1` and `e2` share a common end-vertex, such that the two other * end-vertices of the two edges are associated with `c`'s endpoints. + * \pre `e1` and `e2` have the same direction. */ Halfedge_handle merge_edge(Halfedge_handle e1, Halfedge_handle e2, From 40646af54ea486a8bafd1040612811157c119eb7 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 18 Feb 2025 17:40:01 +0200 Subject: [PATCH 314/332] Added missing const to some traits operators --- Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h index 51949d4546e..1e622f83d34 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h @@ -411,7 +411,7 @@ public: m_object(base.construct_opposite_2_object()), m_counter(counter) {} /*! operates */ - X_monotone_curve_2 operator()(const X_monotone_curve_2& xc) + X_monotone_curve_2 operator()(const X_monotone_curve_2& xc) const { ++m_counter; return m_object(xc); } }; @@ -429,7 +429,7 @@ public: m_object(base.compare_endpoints_xy_2_object()), m_counter(counter) {} /*! operates */ - Comparison_result operator()(const X_monotone_curve_2& xc) + Comparison_result operator()(const X_monotone_curve_2& xc) const { ++m_counter; return m_object(xc); } }; From cc9ab04a274b06b50f35085033f41df30013cbeb Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 19 Feb 2025 11:29:09 +0100 Subject: [PATCH 315/332] Spelling correction Spelling correction --- Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h | 2 +- .../Triangulation_2/internal/Polyline_constraint_hierarchy_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 5f159044b65..edb9279e791 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -427,7 +427,7 @@ public: // cid is [B, P, C] // head is null or [A...B] // tail is null or [C...D] - // Let create insert [C,D] and conditionnaly concatenate head and tail, + // Let create insert [C,D] and conditionally concatenate head and tail, // and return the iterator to C Vertex_handle b = *std::prev(pos); diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index aa7560acf4b..8fbc040d9bd 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -362,7 +362,7 @@ public: // - The end value is when `constraint_it` is the end iterator of `constraints_set`. // In that case `vertex_it` must be singular. // - // - Otherwise all members must be valid pointers or dereferencable iterators. + // - Otherwise all members must be valid pointers or dereferenceable iterators. bool is_singular() const { return hierarchy == nullptr; From cb1f3fb37a6301c741346182adffcf61ddaba20a Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 19 Feb 2025 11:38:14 +0100 Subject: [PATCH 316/332] Spelling correction Spelling correction As this is a spelling correction is in code (and outside my normal realm of PRs) I created a separate PR for it. I cannot test it, b I'm quite confident that it won't lead to problems. I think the old name contained a typo. --- Polygon_repair/include/CGAL/Polygon_repair/Winding.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h index 6986df67b27..c40865c67e7 100644 --- a/Polygon_repair/include/CGAL/Polygon_repair/Winding.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Winding.h @@ -88,7 +88,7 @@ private: using Context = typename CDTplus::Context; CDTplus cdt; - constexpr static int unintialized = std::numeric_limits::lowest(); + constexpr static int uninitialized = std::numeric_limits::lowest(); struct Polygon_less { @@ -180,7 +180,7 @@ sets the polygon as input of the winding number computation. queue.push_back(n); } }else{ - if(n->info().wind == unintialized){ + if(n->info().wind == uninitialized){ Vertex_handle u = e.first->vertex(cdt.cw(e.second)); Vertex_handle v = e.first->vertex(cdt.ccw(e.second)); int delta = 0; @@ -204,7 +204,7 @@ sets the polygon as input of the winding number computation. { std::list> border; for(Face_handle f : cdt.all_face_handles()){ - f->info().wind = unintialized; + f->info().wind = uninitialized; } int index = 0; label(cdt.infinite_face(),index++, border); @@ -213,7 +213,7 @@ sets the polygon as input of the winding number computation. int wind; std::tie(e,wind) = border.front(); border.pop_front(); - if(e.first->info().wind == unintialized){ + if(e.first->info().wind == uninitialized){ label(e.first, wind,border); }else{ CGAL_assertion(e.first->info().wind == wind); From c716539b2ac0f6944682cdf99c0f5507e4efd5a4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 23 Feb 2025 08:25:11 +0000 Subject: [PATCH 317/332] CGAL: Do not include basic.h in examples --- .../Arrangement_on_surface_2/algebraic_curves.cpp | 1 - .../algebraic_segments.cpp | 1 - .../batched_point_location.cpp | 1 - .../bounded_vertical_decomposition.cpp | 1 - .../conic_multiplicities.cpp | 1 - .../consolidated_curve_data.cpp | 1 - .../Arrangement_on_surface_2/curve_history.cpp | 1 - .../Arrangement_on_surface_2/dcel_extension.cpp | 1 - .../dcel_extension_io.cpp | 1 - .../Arrangement_on_surface_2/dual_with_data.cpp | 1 - .../edge_manipulation_curve_history.cpp | 1 - .../Arrangement_on_surface_2/ellipses.cpp | 1 - .../Arrangement_on_surface_2/face_extension.cpp | 1 - .../face_extension_overlay.cpp | 1 - .../generic_curve_data.cpp | 1 - .../Arrangement_on_surface_2/hyperbolas.cpp | 1 - .../incremental_insertion.cpp | 1 - .../examples/Arrangement_on_surface_2/io.cpp | 1 - .../Arrangement_on_surface_2/io_curve_history.cpp | 1 - .../Arrangement_on_surface_2/io_unbounded.cpp | 1 - .../Arrangement_on_surface_2/linear_conics.cpp | 1 - .../Arrangement_on_surface_2/observer.cpp | 1 - .../examples/Arrangement_on_surface_2/overlay.cpp | 1 - .../Arrangement_on_surface_2/overlay_color.cpp | 1 - .../overlay_unbounded.cpp | 1 - .../Arrangement_on_surface_2/parabolas.cpp | 1 - .../Arrangement_on_surface_2/point_location.cpp | 1 - .../Arrangement_on_surface_2/polycurve_bezier.cpp | 1 - .../polycurve_circular_arc.cpp | 1 - .../Arrangement_on_surface_2/polycurve_conic.cpp | 1 - .../predefined_kernel.cpp | 2 -- .../spherical_overlay.cpp | 1 - .../Arrangement_on_surface_2/tracing_counting.cpp | 1 - .../unb_planar_vertical_decomposition.cpp | 1 - .../vertical_ray_shooting.cpp | 1 - Kernel_23/examples/Kernel_23/MyKernel.cpp | 1 - .../test_sdg_traits_2.cpp | 15 ++++++++------- 37 files changed, 8 insertions(+), 44 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp index f8bc222897b..bb113edd04d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp @@ -14,7 +14,6 @@ int main () #else -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index aba48b9f222..1665af18e8f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -14,7 +14,6 @@ int main () } #else -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp index a88e118f38c..1e4ff25b9af 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include "arr_inexact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp index 77137ced487..c7b0621eace 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp @@ -3,7 +3,6 @@ #include -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp index 5eaccf5db9e..fdb8852661d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp @@ -5,7 +5,6 @@ #ifdef CGAL_USE_CORE -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp index 55ea5aada14..86a07143360 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp @@ -2,7 +2,6 @@ // Associating a color attribute with segments using the consolidated // curve-data traits. -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp index 4a7b7a57bdb..06c2b6b3f8b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/curve_history.cpp // Constructing an arrangement with curve history. -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp index 88140318fd2..63fec621829 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/dcel_extension.cpp // Extending all DCEL records (vertices, edges and faces). -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp index 441e4f7b6ca..5dab64d1041 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp @@ -3,7 +3,6 @@ #include -#include #include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp index 8ffb6688971..996728bd717 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp @@ -4,7 +4,6 @@ #include -#include #include #include "arr_linear.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp index bf1d504d4f6..92f8d96c893 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp // Removing curves and manipulating edges in an arrangement with history. -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/ellipses.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/ellipses.cpp index bc2403f2aeb..480b0eefe31 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/ellipses.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/ellipses.cpp @@ -5,7 +5,6 @@ #ifdef CGAL_USE_CORE -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp index d1bdaa8bb38..9850df520c4 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/face_extension.cpp // Extending the arrangement-face records. -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp index 27459e6ff9e..255e4473822 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp index 72710580dee..55ac76ffb59 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp @@ -2,7 +2,6 @@ // Associating a name attribute with segments using the generic curve-data // traits. -#include #include #include "arr_polylines.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/hyperbolas.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/hyperbolas.cpp index aa68c6c247f..8c165cac9f6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/hyperbolas.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/hyperbolas.cpp @@ -5,7 +5,6 @@ #ifdef CGAL_USE_CORE -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 857a5ecdf01..a2d4c8e7f43 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/incremental_insertion.cpp // Using the global incremental insertion functions. -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp index 4e38086f3ab..05f95776038 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp @@ -3,7 +3,6 @@ #include -#include #include #include "arr_inexact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp index b62c6a93ff9..6a37fd24094 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp index 5cf95522f18..1cb4d2161a8 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include "arr_linear.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/linear_conics.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/linear_conics.cpp index b0f990e0ee9..071c118052e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/linear_conics.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/linear_conics.cpp @@ -5,7 +5,6 @@ #ifdef CGAL_USE_CORE -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp index d4261d64dd2..88bbd31b83a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/observer.cpp // Using a simple arrangement observer. -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp index 4f2fa8a38dd..30b0fd90a23 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/overlay.cpp // A simple overlay of two arrangements. -#include #include #include "arr_exact_construction_segments.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp index 42c7f69aaff..1009abe7d95 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp @@ -3,7 +3,6 @@ #include -#include #include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp index 40d06f4f712..fd49d0fa95a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp @@ -3,7 +3,6 @@ #include -#include #include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/parabolas.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/parabolas.cpp index 2f3bf04bf61..7213b06f095 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/parabolas.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/parabolas.cpp @@ -5,7 +5,6 @@ #ifdef CGAL_USE_CORE -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp index 8f9c0458d55..10fbb71ab83 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/point_location.cpp // Answering point-location queries. -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp index 309a849e64b..25c74a71836 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp @@ -13,7 +13,6 @@ int main() { #else -#include #include #include "arr_Bezier.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp index 742473a79bf..46432532c00 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp @@ -15,7 +15,6 @@ int main() { #include -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp index bdaafb9ebb0..7910a723c46 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp @@ -15,7 +15,6 @@ int main() { #include -#include #include #include "arr_conics.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp index f0ed969d845..d238706a0df 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp @@ -5,8 +5,6 @@ #include #include -#include - #include "arr_exact_construction_segments.h" #include "arr_print.h" #include "read_objects.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp index ba27599b22d..e43b1df9ab8 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/spherical_overlay.cpp // Overlay of two arrangements embedded on the sphere. -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp index df5715628f7..1f2a4407b16 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index e870a714ccc..50ac2b19f3e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -3,7 +3,6 @@ #include -#include #include #include "arr_linear.h" diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp index e4e415bd825..c1e80f97c82 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp @@ -1,7 +1,6 @@ //! \file examples/Arrangement_on_surface_2/ex_vertical_ray_shooting.cpp // Answering vertical ray-shooting queries. -#include #include #include diff --git a/Kernel_23/examples/Kernel_23/MyKernel.cpp b/Kernel_23/examples/Kernel_23/MyKernel.cpp index 834a22629b8..0894706db7b 100644 --- a/Kernel_23/examples/Kernel_23/MyKernel.cpp +++ b/Kernel_23/examples/Kernel_23/MyKernel.cpp @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_traits_2.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_traits_2.cpp index aabc32a7b35..57ed0cc3fd4 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_traits_2.cpp +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/test_sdg_traits_2.cpp @@ -1,14 +1,11 @@ -#include -#include -#include -#include -#include -#include -#include + #include #include +#include +#include + #if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) #include #endif @@ -16,6 +13,10 @@ #include #include +#include +#include +#include +#include typedef CGAL::Simple_cartesian Double_Kernel; typedef CGAL::Simple_cartesian > IT_Kernel; From 29e99af9540a48844751f24f1cde1f6dbeb98655 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sun, 23 Feb 2025 14:05:40 +0000 Subject: [PATCH 318/332] A test file --- .../test_sdg_linf_traits_2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/test_sdg_linf_traits_2.cpp b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/test_sdg_linf_traits_2.cpp index 570eb727a6f..0e96c246782 100644 --- a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/test_sdg_linf_traits_2.cpp +++ b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/test_sdg_linf_traits_2.cpp @@ -5,20 +5,20 @@ #define CGAL_SDG_DEBUG(a) { a } #endif +#include +#include + #include #include #include #include -#include #include #include #include #include #include -#include -#include From f557b1ca6ee96206ae900d5964f9cccc37db08da Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Feb 2025 07:31:43 +0000 Subject: [PATCH 319/332] T2: avoid maybe uninitialized warning --- .../include/CGAL/Constrained_triangulation_plus_2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index edb9279e791..1e0c27333ab 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -739,9 +739,9 @@ public: for(auto it = vertices.begin(), succ = it; ++succ != vertices.end(); ++it){ if(! is_subconstraint(*it, *succ)){ // this checks whether other constraints pass Face_handle fh; - int i; - bool b = Triangulation::is_edge(*it, *succ, fh, i); - CGAL_assume(b); + int i = -1; + Triangulation::is_edge(*it, *succ, fh, i); + CGAL_assertion(i != -1); Triangulation::remove_constrained_edge(fh,i, out); // this does also flipping if necessary. } } From 24a31124b1ca6cfb4328a459189cca908c556d0d Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 24 Feb 2025 12:15:58 +0100 Subject: [PATCH 320/332] repairing EPECK support in KSP --- .../include/CGAL/KSP/debug.h | 8 ------ .../include/CGAL/KSP_3/Data_structure.h | 12 ++++---- .../include/CGAL/KSP_3/Initializer.h | 4 +-- .../include/CGAL/KSP_3/Support_plane.h | 28 +++++++++---------- .../include/CGAL/Kinetic_space_partition_3.h | 2 ++ .../CGAL/Kinetic_surface_reconstruction_3.h | 4 +-- 6 files changed, 26 insertions(+), 32 deletions(-) diff --git a/Kinetic_space_partition/include/CGAL/KSP/debug.h b/Kinetic_space_partition/include/CGAL/KSP/debug.h index eae47856078..6615721be51 100644 --- a/Kinetic_space_partition/include/CGAL/KSP/debug.h +++ b/Kinetic_space_partition/include/CGAL/KSP/debug.h @@ -929,14 +929,6 @@ void dump_polygon(const std::vector& pts, const std::string saver.export_polygon_soup_3(pts2, filename); } -void dump_polygon(const std::vector& pts, const std::string& filename) { - Saver saver; - std::vector > pts2; - pts2.push_back(pts); - - saver.export_polygon_soup_3(pts2, filename); -} - void dump_polygona(const std::vector& pts, const std::string& filename) { Saver saver; std::vector > pts2; diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h b/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h index 85c93daeb05..8514cff93d8 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h @@ -159,7 +159,6 @@ public: } }; - // ToDo:: check all kind of iterators/circulators using PEdge_around_pvertex_iterator = boost::transform_iterator >; using PEdges_around_pvertex = CGAL::Iterator_range; @@ -1390,16 +1389,19 @@ public: return support_plane(support_plane_idx).to_2d(segment_3); } -/* - IkSegment_2 to_2d(const std::size_t support_plane_idx, const IkSegment_3& segment_3) const { + template + auto to_2d(const std::size_t support_plane_idx, const IkSegment_3& segment_3) const + -> std::enable_if_t, IkSegment_2> { return support_plane(support_plane_idx).to_2d(segment_3); - }*/ + } Point_2 to_2d(const std::size_t support_plane_idx, const Point_3& point_3) const { return support_plane(support_plane_idx).to_2d(point_3); } - IkPoint_2 to_2d(const std::size_t support_plane_idx, const IkPoint_3& point_3) const { + template + auto to_2d(const std::size_t support_plane_idx, const IkPoint_3& point_3) const + -> std::enable_if_t, IkPoint_2> { return support_plane(support_plane_idx).to_2d(point_3); } diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Initializer.h b/Kinetic_space_partition/include/CGAL/KSP_3/Initializer.h index f3e5550a4d9..9942d696dcc 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Initializer.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Initializer.h @@ -493,7 +493,7 @@ private: typename Intersection_graph::Kinetic_interval& kinetic_interval = m_data.igraph().kinetic_interval(e, sp_idx); crossing_iedges.push_back(e); - if (emin > s || std::isinf(min_speed)) { + if (emin > s || std::isinf(CGAL::to_double(min_speed))) { typename Intersection_kernel::FT bary_edge_exact = (emin - s) / (t - s); FT bary_edge = from_exact((emin - s) / (t - s)); CGAL_assertion(bary_edge_exact >= 0); @@ -505,7 +505,7 @@ private: kinetic_interval.push_back(std::pair(0, 0)); } - if (t > emax || std::isinf(max_speed)) { + if (t > emax || std::isinf(CGAL::to_double(max_speed))) { typename Intersection_kernel::FT bary_edge_exact = (emax - s) / (t - s); FT bary_edge = from_exact((emax - s) / (t - s)); CGAL_assertion(0 <= bary_edge_exact && bary_edge_exact <= 1); diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Support_plane.h b/Kinetic_space_partition/include/CGAL/KSP_3/Support_plane.h index b85e37ea14d..c4f0e0c5ed9 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Support_plane.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Support_plane.h @@ -377,7 +377,7 @@ public: for (const auto& pair : points) { const auto& point = pair.first; directions.push_back(typename Intersection_kernel::Vector_2(to_exact(m_data->centroid), point)); - const FT length = CGAL::sqrt(CGAL::abs(from_exact(directions.back() * directions.back()))); + const FT length = CGAL::approximate_sqrt(CGAL::abs(from_exact(directions.back() * directions.back()))); sum_length += length; num += 1; } @@ -676,8 +676,9 @@ public: m_data->plane.to_2d(Point_3(0, 0, 0) + vec)); } - template::type > - const typename Intersection_kernel::Point_2 to_2d(const typename Intersection_kernel::Point_3& point) const { + template + auto to_2d(const typename Intersection_kernel::Point_3& point) const + ->std::enable_if_t, const typename Intersection_kernel::Point_2> { return m_data->exact_plane.to_2d(point); } @@ -687,8 +688,9 @@ public: m_data->plane.to_2d(line.point() + line.to_vector())); } - template::type > - const typename Intersection_kernel::Line_2 to_2d(const typename Intersection_kernel::Line_3& line) const { + template + auto to_2d(const typename Intersection_kernel::Line_3& line) const + -> std::enable_if_t, const typename Intersection_kernel::Line_2> { return typename Intersection_kernel::Line_2( m_data->exact_plane.to_2d(line.point()), m_data->exact_plane.to_2d(line.point() + line.to_vector())); @@ -700,25 +702,21 @@ public: m_data->plane.to_2d(segment.target())); } - template::type > - const typename Intersection_kernel::Segment_2 to_2d(const typename Intersection_kernel::Segment_3& segment) const { + template + auto to_2d(const typename Intersection_kernel::Segment_3& segment) const + -> std::enable_if_t, const typename Intersection_kernel::Segment_2> { return typename Intersection_kernel::Segment_2( m_data->exact_plane.to_2d(segment.source()), m_data->exact_plane.to_2d(segment.target())); } - const Vector_3 to_3d(const Vector_2& vec) const { - return Vector_3( - m_data->plane.to_3d(Point_2(FT(0), FT(0))), - m_data->plane.to_3d(Point_2(FT(0), FT(0)) + vec)); - } - const Point_3 to_3d(const Point_2& point) const { return m_data->plane.to_3d(point); } - template::type > - const typename Intersection_kernel::Point_3 to_3d(const typename Intersection_kernel::Point_2& point) const { + template + auto to_3d(const typename Intersection_kernel::Point_2& point) const + ->std::enable_if_t, const typename Intersection_kernel::Point_3> { return m_data->exact_plane.to_3d(point); } diff --git a/Kinetic_space_partition/include/CGAL/Kinetic_space_partition_3.h b/Kinetic_space_partition/include/CGAL/Kinetic_space_partition_3.h index a11a1f9dc71..23a43b8f646 100644 --- a/Kinetic_space_partition/include/CGAL/Kinetic_space_partition_3.h +++ b/Kinetic_space_partition/include/CGAL/Kinetic_space_partition_3.h @@ -398,6 +398,8 @@ public: using NP_helper = Point_set_processing_3_np_helper; using PointMap = typename NP_helper::Point_map; + static_assert(std::is_same_v); + PointMap point_map = NP_helper::get_point_map(np); To_exact to_exact; diff --git a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h index 9ff59a0202a..b2325f285d9 100644 --- a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h +++ b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h @@ -1546,7 +1546,7 @@ private: n = m_lcc.beta(n, 1); } while (n != dh); - KSP_3::internal::dump_polygon(face, fn); + KSP_3::internal::dump_polygon(face, fn); } void write_edge(typename LCC::Dart_descriptor dh, const std::string& fn) { @@ -1707,7 +1707,7 @@ private: m_face_area_lcc.resize(m_faces_lcc.size(), 0); for (std::size_t i = 0; i < m_faces_lcc.size(); i++) - m_face_area_lcc[i] = m_face_area_lcc[i] * 2.0 * m_total_inliers / total_area; + m_face_area_lcc[i] = m_face_area_lcc[i] * FT(2.0) * FT(m_total_inliers) / total_area; } FT area(typename LCC::Dart_descriptor face_dart, Plane_3 &pl, std::vector *tris = nullptr) { From ab082b29f1180c227a1922f6a852f81f3345f523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 26 Feb 2025 00:11:08 +0100 Subject: [PATCH 321/332] Make it possible to enter target coordinates in Selection item's "Move Point" --- .../Plugins/PCA/Basic_generator_plugin.cpp | 22 ++--- .../Lab/Plugins/PCA/Basic_generator_widget.ui | 32 +++---- Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp | 72 +++++++++++++++ Lab/demo/Lab/Plugins/PMP/Selection_widget.ui | 87 ++++++++++++------- .../Lab/Scene_polyhedron_selection_item.cpp | 19 +++- .../Lab/Scene_polyhedron_selection_item.h | 1 + Lab/demo/Lab/Viewer.cpp | 2 +- .../demo/Triangulation_on_sphere_2/main.cpp | 2 +- 8 files changed, 175 insertions(+), 62 deletions(-) diff --git a/Lab/demo/Lab/Plugins/PCA/Basic_generator_plugin.cpp b/Lab/demo/Lab/Plugins/PCA/Basic_generator_plugin.cpp index 15883fa976a..46539303a43 100644 --- a/Lab/demo/Lab/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PCA/Basic_generator_plugin.cpp @@ -375,7 +375,7 @@ void Basic_generator_plugin::generateCube() if (list.size()!=3){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 3 doubles."); + msgBox->setText("ERROR : Input should consist of 3 doubles."); msgBox->exec(); return; } @@ -416,7 +416,7 @@ void Basic_generator_plugin::generateCube() if (list.size()!=6){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 6 doubles."); + msgBox->setText("ERROR : Input should consist of 6 doubles."); msgBox->exec(); return; } @@ -467,7 +467,7 @@ void Basic_generator_plugin::generatePrism() if (list.size()!=3){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 3 doubles."); + msgBox->setText("ERROR : Input should consist of 3 doubles."); msgBox->exec(); return; } @@ -514,7 +514,7 @@ void Basic_generator_plugin::generatePyramid() if (list.size()!=3){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 3 doubles."); + msgBox->setText("ERROR : Input should consist of 3 doubles."); msgBox->exec(); return; } @@ -557,7 +557,7 @@ void Basic_generator_plugin::generateSphere() if (list.size()!=4){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of four doubles."); + msgBox->setText("ERROR : Input should consist of four doubles."); msgBox->exec(); return; } @@ -607,7 +607,7 @@ void Basic_generator_plugin::generateTetrahedron() if (list.size() != 3) { QMessageBox* msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 3 doubles."); + msgBox->setText("ERROR : Input should consist of 3 doubles."); msgBox->exec(); return; } @@ -641,7 +641,7 @@ void Basic_generator_plugin::generateTetrahedron() if (list.size() != 12) { QMessageBox* msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 12 doubles."); + msgBox->setText("ERROR : Input should consist of 12 doubles."); msgBox->exec(); return; } @@ -685,7 +685,7 @@ void Basic_generator_plugin::generatePoints() if (list.size()%3!=0){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of triplets."); + msgBox->setText("ERROR : Input should consist of triplets."); msgBox->exec(); return; } @@ -742,14 +742,14 @@ void Basic_generator_plugin::generateLines() if(!is_2d && list.size()%3!=0){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of triplets."); + msgBox->setText("ERROR : Input should consist of triplets."); msgBox->exec(); return false; } else if(is_2d && list.size()%2!=0){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of pairs."); + msgBox->setText("ERROR : Input should consist of pairs."); msgBox->exec(); return false; } @@ -912,7 +912,7 @@ void Basic_generator_plugin::generateGrid() if (list.size()!=6){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 6 doubles."); + msgBox->setText("ERROR : Input should consist of 6 doubles."); msgBox->exec(); return; } diff --git a/Lab/demo/Lab/Plugins/PCA/Basic_generator_widget.ui b/Lab/demo/Lab/Plugins/PCA/Basic_generator_widget.ui index eed6885a04c..f749ca97ab7 100644 --- a/Lab/demo/Lab/Plugins/PCA/Basic_generator_widget.ui +++ b/Lab/demo/Lab/Plugins/PCA/Basic_generator_widget.ui @@ -18,7 +18,7 @@ - 4 + 6 @@ -43,7 +43,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -180,7 +180,7 @@ QGroupBox::title { - Qt::RightToLeft + Qt::LayoutDirection::RightToLeft @@ -198,7 +198,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -232,7 +232,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -315,7 +315,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -349,7 +349,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -495,7 +495,7 @@ QGroupBox::title { - Qt::RightToLeft + Qt::LayoutDirection::RightToLeft @@ -513,7 +513,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -880,7 +880,7 @@ p, li { white-space: pre-wrap; } hr { height: 1px; border-width: 0; } li.unchecked::marker { content: "\2610"; } li.checked::marker { content: "\2612"; } -</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:10pt;"><br /></p></body></html> @@ -919,7 +919,7 @@ li.checked::marker { content: "\2612"; } - Qt::Vertical + Qt::Orientation::Vertical @@ -1045,7 +1045,7 @@ QGroupBox::title { - Qt::Vertical + Qt::Orientation::Vertical @@ -1081,7 +1081,7 @@ p, li { white-space: pre-wrap; } hr { height: 1px; border-width: 0; } li.unchecked::marker { content: "\2610"; } li.checked::marker { content: "\2612"; } -</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:10pt;"><br /></p></body></html> @@ -1149,7 +1149,7 @@ p, li { white-space: pre-wrap; } hr { height: 1px; border-width: 0; } li.unchecked::marker { content: "\2610"; } li.checked::marker { content: "\2612"; } -</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:10pt;"><br /></p></body></html> @@ -1167,7 +1167,7 @@ li.checked::marker { content: "\2612"; } - Qt::Vertical + Qt::Orientation::Vertical @@ -1206,7 +1206,7 @@ li.checked::marker { content: "\2612"; } - Qt::Horizontal + Qt::Orientation::Horizontal diff --git a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp index 864c5dc1eed..6daad328b43 100644 --- a/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Selection_plugin.cpp @@ -210,6 +210,7 @@ public: connect(ui_widget.Select_sharp_edges_button, SIGNAL(clicked()), this, SLOT(on_Select_sharp_edges_button_clicked())); connect(ui_widget.selectionOrEuler, SIGNAL(currentChanged(int)), this, SLOT(on_SelectionOrEuler_changed(int))); connect(ui_widget.editionBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_editionBox_changed(int))); + connect(ui_widget.movePoint_pushButton, SIGNAL(clicked()), this, SLOT(on_movePoint_pushButton_clicked())); ui_widget.Sharp_edges_label->hide(); ui_widget.Sharp_angle_spinbox->hide(); @@ -987,6 +988,10 @@ public Q_SLOTS: { Q_EMIT set_operation_mode(mode); } + + ui_widget.movePointCoordinates_textEdit->setVisible(false); + ui_widget.movePoint_pushButton->setVisible(false); + switch(mode) { //Join vertex @@ -1043,12 +1048,79 @@ public Q_SLOTS: ui_widget.docImage_Label->setPixmap(pm); break; } + // Move point + case 12: + { + ui_widget.docImage_Label->clear(); + ui_widget.movePointCoordinates_textEdit->setVisible(true); + ui_widget.movePoint_pushButton->setVisible(true); + ui_widget.movePoint_pushButton->setEnabled(true); + break; + } default: ui_widget.docImage_Label->clear(); break; } on_LassoCheckBox_changed(ui_widget.lassoCheckBox->isChecked()); } + + void on_movePoint_pushButton_clicked() + { + QString text = ui_widget.movePointCoordinates_textEdit->toPlainText(); + Scene_points_with_normal_item* item = new Scene_points_with_normal_item(); + QStringList list = text.split(QRegularExpression("\\s+"), CGAL_QT_SKIP_EMPTY_PARTS); + int counter = 0; + double coord[3]; + bool ok = true; + if (list.isEmpty()) return; + if (list.size() != 3){ + QMessageBox *msgBox = new QMessageBox; + msgBox->setWindowTitle("Error"); + msgBox->setText("ERROR : Input should consist of a triplet."); + msgBox->exec(); + return; + } + + for(QString s : list) + { + if(!s.isEmpty()) + { + double res = s.toDouble(&ok); + if(!ok) + { + QMessageBox *msgBox = new QMessageBox; + msgBox->setWindowTitle("Error"); + msgBox->setText("ERROR : Coordinates are invalid."); + msgBox->exec(); + break; + } + else + { + coord[counter++] = res; + } + } + } + + if(counter == 3) + { + const Kernel::Point_3 p(coord[0], coord[1], coord[2]); + item->point_set()->insert(p); + counter = 0; + + ui_widget.movePointCoordinates_textEdit->clear(); + + Scene_polyhedron_selection_item* selection_item = getSelectedItem(); + if(!selection_item) + selection_item = onTheFlyItem(); + if (!selection_item) { + print_message("Error: there is no selected polyhedron selection item!"); + return; + } + + selection_item->moveVertex(p); + } + } + void on_Select_sharp_edges_button_clicked() { Scene_polyhedron_selection_item* selection_item = getSelectedItem(); if(!selection_item) diff --git a/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui b/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui index f7cf53070eb..5a9dce0a662 100644 --- a/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui +++ b/Lab/demo/Lab/Plugins/PMP/Selection_widget.ui @@ -7,7 +7,7 @@ 0 0 630 - 532 + 579 @@ -46,7 +46,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -176,7 +176,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -200,7 +200,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -218,7 +218,7 @@ Sharp edges angle: - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -274,7 +274,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -294,7 +294,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -367,7 +367,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -386,7 +386,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -479,7 +479,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -572,20 +572,7 @@ - - - Qt::Vertical - - - - 20 - 40 - - - - - - + @@ -664,6 +651,29 @@ + + + + true + + + + 0 + 0 + + + + New Coordinates: X Y Z + + + + + + + Apply move + + + @@ -671,15 +681,28 @@ - - - - Ctrl+Z to cancel the temporary selection. Ctrl+U to undo last operation (if applicable). - - - + + + + Ctrl+Z to cancel the temporary selection. Ctrl+U to undo last operation (if applicable). + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + @@ -690,7 +713,7 @@ - Qt::Vertical + Qt::Orientation::Vertical diff --git a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp index 29769c95ae4..a00454c375b 100644 --- a/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp +++ b/Lab/demo/Lab/Scene_polyhedron_selection_item.cpp @@ -1056,7 +1056,7 @@ bool Scene_polyhedron_selection_item::treat_selection(const std::setoffset(); + fg_vertex_descriptor vh = *temp_selected_vertices.begin(); + + VPmap vpm = get(CGAL::vertex_point,*polyhedron()); + put(vpm, vh, Point_3(new_position.x() - offset.x, + new_position.y() - offset.y, + new_position.z() - offset.z)); + const Point_3& p = get(vpm,vh); + d->manipulated_frame->setPosition(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); + setProperty("need_invalidate_aabb_tree", true); + invalidateOpenGLBuffers(); + poly_item->updateVertex(vh); + // poly_item->invalidateOpenGLBuffers(); +} + void Scene_polyhedron_selection_item::validateMoveVertex() { temp_selected_vertices.clear(); diff --git a/Lab/demo/Lab/Scene_polyhedron_selection_item.h b/Lab/demo/Lab/Scene_polyhedron_selection_item.h index 9467e26b782..23af5a1cfee 100644 --- a/Lab/demo/Lab/Scene_polyhedron_selection_item.h +++ b/Lab/demo/Lab/Scene_polyhedron_selection_item.h @@ -917,6 +917,7 @@ public Q_SLOTS: void updateTick(); void moveVertex(); + void moveVertex(const Point_3&); protected: bool eventFilter(QObject* /*target*/, QEvent * gen_event) { diff --git a/Lab/demo/Lab/Viewer.cpp b/Lab/demo/Lab/Viewer.cpp index b93cb2cb7b1..00e98fa2b88 100644 --- a/Lab/demo/Lab/Viewer.cpp +++ b/Lab/demo/Lab/Viewer.cpp @@ -1838,7 +1838,7 @@ void Viewer::setLighting() if (list.size()!=3){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 3 floats."); + msgBox->setText("ERROR : Input should consist of 3 floats."); msgBox->exec(); return; } diff --git a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/main.cpp b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/main.cpp index 71cae05953d..1579f45389a 100644 --- a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/main.cpp +++ b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/main.cpp @@ -69,7 +69,7 @@ public slots: if (list.size()!=4){ QMessageBox *msgBox = new QMessageBox; msgBox->setWindowTitle("Error"); - msgBox->setText("ERROR : Input should consists of 4 doubles: The radius first, then the coordinates of the center."); + msgBox->setText("ERROR : Input should consist of 4 doubles: The radius first, then the coordinates of the center."); msgBox->exec(); return; } From 2d4c17a08856076b807bfee0b024dd58e678731c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 27 Feb 2025 15:13:20 +0100 Subject: [PATCH 322/332] deal with cells with subdomain_index 0 --- Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp index 58512209f23..121aa7cd6e7 100644 --- a/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp +++ b/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp @@ -447,8 +447,8 @@ public: cit != c3t3_item->c3t3().triangulation().finite_cells_end(); ++cit) { - CGAL_assertion(cit->info() >= 0); - c3t3_item->c3t3().add_to_complex(cit, cit->info()); + if(cit->info() != 0) + c3t3_item->c3t3().add_to_complex(cit, cit->info()); for(int i=0; i < 4; ++i) { if(cit->surface_patch_index(i)>0) From d6018ee8cac13fbc9a48efb123d9a2450868504c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 27 Feb 2025 16:52:12 +0100 Subject: [PATCH 323/332] open the ofstream in binary mode to be consistent with BINARY parameter in CGAL::IO::output_to_vtu() --- Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp index 121aa7cd6e7..9fcea780b98 100644 --- a/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp +++ b/Lab/demo/Lab/Plugins/IO/VTK_io_plugin.cpp @@ -250,7 +250,7 @@ public: if(!c3t3_item || extension != "vtu") return false; - std::ofstream os(output_filename.data()); + std::ofstream os(output_filename.data(), std::ios::binary); os << std::setprecision(16); const C3t3& c3t3 = c3t3_item->c3t3(); From 138b06ca1188c9aaa734801cdda7f7a6cac54602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Mar 2025 10:15:51 +0100 Subject: [PATCH 324/332] add missing include --- Algebraic_foundations/include/CGAL/number_utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Algebraic_foundations/include/CGAL/number_utils.h b/Algebraic_foundations/include/CGAL/number_utils.h index c17823d72b9..bfe2bc34641 100644 --- a/Algebraic_foundations/include/CGAL/number_utils.h +++ b/Algebraic_foundations/include/CGAL/number_utils.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { CGAL_NTS_BEGIN_NAMESPACE From de16b71eba296305a6ec430ef2b1a6ade7404b15 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 3 Mar 2025 15:48:33 +0100 Subject: [PATCH 325/332] use minimal_weight (i.e. edge_min_size) in insert_corners() --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 8 ++++++-- 1 file changed, 6 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 1f33f2d70fb..54760250f8c 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 @@ -631,7 +631,7 @@ insert_corners() // Get weight (the ball radius is given by the 'query_size' function) const FT query_weight = CGAL::square(query_size(p, 0, p_index)); FT w = use_minimal_size() - ? (std::min)(minimal_weight_, query_weight) + ? (std::max)(minimal_weight(), query_weight) : query_weight; #if CGAL_MESH_3_PROTECTION_DEBUG & 1 @@ -640,7 +640,8 @@ insert_corners() // The following lines ensure that the weight w is small enough so that // corners balls do not intersect - if(dt.number_of_vertices() >= 2) + if( dt.number_of_vertices() >= 2 + && (!use_minimal_size() || w != minimal_weight())) { typename Dt::Vertex_handle vh; CGAL_assertion_code( bool p_found = ) @@ -657,6 +658,9 @@ insert_corners() dt, vh, finite_incident_cells); w = (std::min)(w, nearest_sq_dist / FT(9)); + + if(use_minimal_size()) + w = (std::max)(w, minimal_weight_); } // Insert corner with ball (dim is zero because p is a corner) From 1b189f40fd1d36d5daf3b92ff7568c4cbfce7383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Mar 2025 16:27:24 +0100 Subject: [PATCH 326/332] check should be on the dimension not the number of points --- Alpha_shapes_2/include/CGAL/Alpha_shape_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index 3c4cb4b7d30..812f609d3ac 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -1442,7 +1442,7 @@ Alpha_shape_2::find_alpha_solid() const // takes O(#alpha_shape) time Type_of_alpha alpha_solid = 0; - if (number_of_vertices()<3) return alpha_solid; + if (dimension()!=2) return alpha_solid; Finite_vertices_iterator vertex_it; // only finite vertices From 48d8f5479682e1431d7da3cd1f7a29a6faa1f6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Mar 2025 18:03:29 +0100 Subject: [PATCH 327/332] use previous vertex as hint --- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 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 54760250f8c..4ec4fba1067 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 @@ -235,6 +235,7 @@ private: Weight w, int dim, const Index& index, + Vertex_handle prev, ErasedVeOutIt out); /// Inserts balls between the points identified by the handles `vp` and `vq` @@ -550,7 +551,7 @@ Protect_edges_sizing_field:: operator()(const bool refine) { // This class is only meant to be used with non-periodic triangulations - CGAL_assertion(!(std::is_same::value)); + CGAL_assertion(!(std::is_same_v)); #ifdef CGAL_MESH_3_VERBOSE std::cerr << "Inserting protection balls..." << std::endl @@ -664,7 +665,7 @@ insert_corners() } // Insert corner with ball (dim is zero because p is a corner) - Vertex_handle v = smart_insert_point(p, w, 0, p_index, + Vertex_handle v = smart_insert_point(p, w, 0, p_index, Vertex_handle(), CGAL::Emptyset_iterator()).first; CGAL_assertion(v != Vertex_handle()); @@ -765,7 +766,7 @@ template std::pair::Vertex_handle, ErasedVeOutIt> Protect_edges_sizing_field:: -smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, +smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, Vertex_handle prev, ErasedVeOutIt out) { #if CGAL_MESH_3_PROTECTION_DEBUG & 1 @@ -796,7 +797,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, // Check that new point will not be inside a power sphere typename Tr::Locate_type lt; int li, lj; - Cell_handle ch = tr.locate(wp0, lt, li, lj); + Cell_handle ch = tr.locate(wp0, lt, li, lj, prev); Vertex_handle nearest_vh = tr.nearest_power_vertex(p, ch); FT sq_d = sq_distance(p, cp(tr.point(nearest_vh))); @@ -1063,6 +1064,7 @@ insert_balls_on_edges() CGAL::square(p_size), 1 /*dim*/, p_index, + Vertex_handle(), CGAL::Emptyset_iterator()).first; } // No 'else' because in that case 'is_vertex(..)' already filled @@ -1252,6 +1254,7 @@ insert_balls(const Vertex_handle& vp, point_weight, dim, index, + Vertex_handle(), out); if(forced_stop()) return out; const Vertex_handle new_vertex = pair.first; @@ -1342,7 +1345,7 @@ insert_balls(const Vertex_handle& vp, // Insert point into c3t3 std::pair pair = - smart_insert_point(new_point, point_weight, dim, index, out); + smart_insert_point(new_point, point_weight, dim, index, prev, out); Vertex_handle new_vertex = pair.first; out = pair.second; From 1cecefe1c8ada343160f765b0736765f258541ee Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 7 Mar 2025 07:36:22 +0000 Subject: [PATCH 328/332] Mesh_2: Fixes of write_VTU --- Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h | 9 +++++++-- Stream_support/include/CGAL/IO/VTK/VTK_writer.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h b/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h index 35b4dda2756..5513693788b 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h +++ b/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h @@ -6,6 +6,8 @@ namespace IO { //! //! The faces output are those for which `DelaunayMeshFaceBase_2::is_in_domain()` returns `true`, //! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`. +//!\attention To read a binary file, the flag `std::ios::binary` must be set during the creation of `os`. +//! //! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face type model of `DelaunayMeshFaceBase_2`. //! //! \param os the stream used for writing. @@ -23,9 +25,12 @@ void write_VTU(std::ostream& os, //! \brief writes the faces of a domain and its constrained edges embedded in //! a 2D constrained Delaunay triangulation using the `PolyData` XML //! format. - //! The faces output are those for which `get(ipm, f)` returns - //! `true` where `f` is a `CDT::Face_handle`, +//! The faces output are those for which `get(ipm, f)` returns +//! `true` where `f` is a `CDT::Face_handle`, //! the edges are those for which `ConstrainedTriangulationFaceBase_2::is_constrained()` returns `true`. +//! +//!\attention To read a binary file, the flag `std::ios::binary` must be set during the creation of `os`. +//! //! \tparam CDT a `Constrained_Delaunay_triangulation_2` with face //! type model of `DelaunayMeshFaceBase_2`. //! \tparam InDomainPmap a class model of `ReadWritePropertyMap` with diff --git a/Stream_support/include/CGAL/IO/VTK/VTK_writer.h b/Stream_support/include/CGAL/IO/VTK/VTK_writer.h index 9be80302861..2769b3ab0f0 100644 --- a/Stream_support/include/CGAL/IO/VTK/VTK_writer.h +++ b/Stream_support/include/CGAL/IO/VTK/VTK_writer.h @@ -25,6 +25,8 @@ template void write_vector(std::ostream& os, const std::vector& vect) { + if(vect.empty()) + return; const char* buffer = reinterpret_cast(&(vect[0])); std::size_t size = vect.size()*sizeof(FT); From 2bd90e5d9c2eaddbe2efc92eba9fd82891e927b0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Mar 2025 17:12:27 +0100 Subject: [PATCH 329/332] fix issue #8773 "c3t3 -> binary -> c3t3 -> vtu writes invalid vtu files" When a c3t3 is loaded, its far vertices were not loaded correctly. --- Mesh_3/include/CGAL/Mesh_3/Mesher_3.h | 15 +- Mesh_3/test/Mesh_3/CMakeLists.txt | 4 + Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp | 132 ++++++++++++++++++ .../CGAL/Mesh_complex_3_in_triangulation_3.h | 3 + 4 files changed, 148 insertions(+), 6 deletions(-) create mode 100644 Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index 036094d60b0..982681d4ac2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -687,14 +687,16 @@ initialize() bbox.xmin() + 0.5*xdelta, bbox.ymin() + 0.5*ydelta, bbox.zmin() + 0.5*zdelta); -# ifdef CGAL_CONCURRENT_MESH_3_VERBOSE - std::cerr << "Adding points on a far sphere (radius = " << radius <<")..."; -# endif CGAL::Random rnd(0); Random_points_on_sphere_3 random_point(radius, rnd); const int NUM_PSEUDO_INFINITE_VERTICES = static_cast( float(std::thread::hardware_concurrency()) * Concurrent_mesher_config::get().num_pseudo_infinite_vertices_per_core); +#ifdef CGAL_MESH_3_VERBOSE + std::cerr << "Adding " << NUM_PSEUDO_INFINITE_VERTICES + << " points on a far sphere (radius = " << radius << ")..."; +#endif + for (int i = 0 ; i < NUM_PSEUDO_INFINITE_VERTICES ; ++i, ++random_point) r_c3t3_.add_far_point(r_c3t3_.triangulation().geom_traits().construct_weighted_point_3_object() (r_c3t3_.triangulation().geom_traits().construct_translated_point_3_object()(*random_point, center))); @@ -745,11 +747,12 @@ initialize() bbox.xmin() + 0.5*xdelta, bbox.ymin() + 0.5*ydelta, bbox.zmin() + 0.5*zdelta); -# ifdef CGAL_MESH_3_VERBOSE - std::cerr << "Adding points on a far sphere (radius = " << radius << ")..."; -# endif Random_points_on_sphere_3 random_point(radius); const int NUM_PSEUDO_INFINITE_VERTICES = 12*2; +# ifdef CGAL_MESH_3_VERBOSE + std::cerr << "Adding " << NUM_PSEUDO_INFINITE_VERTICES + << " points on a far sphere (radius = " << radius << ")..."; +#endif for (int i = 0 ; i < NUM_PSEUDO_INFINITE_VERTICES ; ++i, ++random_point) r_c3t3_.add_far_point(r_c3t3_.triangulation().geom_traits().construct_weighted_point_3_object() (r_c3t3_.triangulation().geom_traits().construct_translated_point_3_object()(*random_point, center))); diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 9939a2710e7..de33e3d2024 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -49,6 +49,7 @@ create_single_source_cgal_program( "test_meshing_with_default_edge_size.cpp" ) create_single_source_cgal_program( "test_meshing_determinism.cpp" ) create_single_source_cgal_program( "test_meshing_without_features_determinism.cpp" ) create_single_source_cgal_program( "test_mesh_3_issue_1554.cpp" ) +create_single_source_cgal_program( "test_mesh_3_issue_8773.cpp" ) create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" ) create_single_source_cgal_program( "test_meshing_with_one_step.cpp" ) create_single_source_cgal_program( "test_meshing_with_one_step_with_features.cpp" ) @@ -79,6 +80,7 @@ foreach(target test_meshing_determinism test_meshing_without_features_determinism test_mesh_3_issue_1554 + test_mesh_3_issue_8773 test_mesh_polyhedral_domain_with_features_deprecated test_mesh_cell_base_3 test_meshing_with_one_step @@ -108,6 +110,7 @@ if(TARGET CGAL::TBB_support) test_meshing_determinism test_meshing_without_features_determinism test_mesh_3_issue_1554 + test_mesh_3_issue_8773 test_mesh_polyhedral_domain_with_features_deprecated test_mesh_cell_base_3 test_min_edge_length @@ -129,6 +132,7 @@ if(TARGET CGAL::TBB_support) "execution of test_meshing_polyhedral_complex" "execution of test_mesh_capsule_var_distance_bound" "execution of test_mesh_3_issue_1554" + "execution of test_mesh_3_issue_8773" "execution of test_mesh_polyhedral_domain_with_features_deprecated" "execution of test_mesh_cell_base_3" PROPERTY RUN_SERIAL 1) diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp new file mode 100644 index 00000000000..a8ea66c07e8 --- /dev/null +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp @@ -0,0 +1,132 @@ +#define CGAL_MESH_3_VERBOSE 1 +#define CGAL_CONCURRENT_MESH_3_VERBOSE 1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Domain +using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using Polyhedron = CGAL::Surface_mesh; +using Mesh_domain = CGAL::Polyhedral_mesh_domain_with_features_3; + +// Triangulation +using Tr = CGAL::Mesh_triangulation_3::type; +using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3; + +// Criteria +using Mesh_criteria = CGAL::Mesh_criteria_3; + +namespace params = CGAL::parameters; + +void check_stream(const std::ios& stream, + const std::string& filename, + const std::string& operation, + bool ok = true) { + if(!stream || !ok) { + std::cerr << "Stream error after " << operation << " file: " << filename << std::endl; + std::cerr << "Stream state: "; + if(stream.rdstate() == std::ios::goodbit) { + std::cerr << "no error"; + } else { + if(stream.rdstate() & std::ios::eofbit) { + std::cerr << "eofbit "; + } + if(stream.rdstate() & std::ios::failbit) { + std::cerr << "failbit "; + } + if(stream.rdstate() & std::ios::badbit) { + std::cerr << "badbit "; + } + } + std::cerr << std::endl; + std::exit(EXIT_FAILURE); + } +} + +int main(int argc, char* argv[]) { + const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cube.off"); + + // Create input polyhedron + Polyhedron polyhedron; + std::ifstream input(fname); + check_stream(input, fname, "opening"); + input >> polyhedron; + check_stream(input, fname, "reading polyhedron from"); + + // Create domain + Mesh_domain domain(polyhedron); + domain.detect_features(); + + // Mesh criteria (no cell_size set) + Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.05).cell_radius_edge_ratio(3)); + + // Mesh generation + const C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); + + const auto nb_vertices = c3t3.triangulation().number_of_vertices(); + const auto nb_far_vertices = c3t3.number_of_far_points(); + const auto nb_cells = c3t3.number_of_cells(); + + std::cout << "Created a c3t3 with " << c3t3.triangulation().number_of_vertices() << " vertices, and " + << c3t3.number_of_cells() << " cells" << std::endl; + + // Output + { + const std::string filename = "ascii.vtu"; + std::ofstream out(filename); + check_stream(out, filename, "opening"); + CGAL::IO::output_to_vtu(out, c3t3, CGAL::IO::ASCII); + check_stream(out, filename, "writing (ASCII)"); + } + + { + const std::string filename = "binary.vtu"; + std::ofstream out(filename, std::ios::binary); + check_stream(out, filename, "opening"); + CGAL::IO::output_to_vtu(out, c3t3, CGAL::IO::BINARY); + check_stream(out, filename, "writing (BINARY)"); + } + + const std::string filename = "mesh.binary.cgal"; + { + std::ofstream out(filename, std::ios::binary); + check_stream(out, filename, "opening"); + bool ok = CGAL::IO::save_binary_file(out, c3t3); + check_stream(out, filename, "writing (binary)", ok); + } + + // Input + C3t3 bis; + { + std::ifstream in(filename, std::ios::binary); + check_stream(in, filename, "opening (binary)"); + bool ok = CGAL::IO::load_binary_file(in, bis); + check_stream(in, filename, "reading binary file", ok); + } + + { + const std::string bis_filename = "bis.vtu"; + std::ofstream bis_os(bis_filename); + check_stream(bis_os, bis_filename, "opening (bis.vtu)"); + CGAL::IO::output_to_vtu(bis_os, bis, CGAL::IO::ASCII); + check_stream(bis_os, bis_filename, "writing (ASCII)"); + } + + assert(bis.number_of_cells() == nb_cells); + assert(bis.triangulation().number_of_vertices() == nb_vertices); + assert(bis.number_of_far_points() == nb_far_vertices); + + std::cout << "Mesh generation and output completed successfully." << std::endl; + + return EXIT_SUCCESS; +} diff --git a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h index 19fd269cc32..6255bb26104 100644 --- a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h +++ b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h @@ -2034,6 +2034,7 @@ Mesh_complex_3_in_triangulation_3:: rescan_after_load_of_triangulation() { corners_.clear(); + far_vertices_.clear(); for(typename Tr::Finite_vertices_iterator vit = this->triangulation().finite_vertices_begin(), end = this->triangulation().finite_vertices_end(); @@ -2041,6 +2042,8 @@ rescan_after_load_of_triangulation() { if ( vit->in_dimension() == 0 ) { add_to_complex(vit, Corner_index(1)); + } else if(vit->in_dimension() == -1) { + far_vertices_.push_back(vit); } } From 4f4f78979db5e334d2939b63ba4e0405c6c144e1 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Mar 2025 17:18:09 +0100 Subject: [PATCH 330/332] remove verbose macros --- Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp index a8ea66c07e8..bc348b25676 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_8773.cpp @@ -1,5 +1,3 @@ -#define CGAL_MESH_3_VERBOSE 1 -#define CGAL_CONCURRENT_MESH_3_VERBOSE 1 #include #include #include From a3e64cffbccd73e2fae68665d72bf65814b6cd31 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Mar 2025 17:21:08 +0100 Subject: [PATCH 331/332] fix an issue with the offset meshing plugin --- Lab/demo/Lab/CGALlab_macros.cmake | 24 +- Lab/demo/Lab/MainWindow.cpp | 4 +- Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt | 2 + .../Plugins/Mesh_3/Offset_meshing_plugin.cpp | 4 - .../Surface_mesh/Offset_meshing_plugin.cpp | 691 ------------------ 5 files changed, 12 insertions(+), 713 deletions(-) delete mode 100644 Lab/demo/Lab/Plugins/Surface_mesh/Offset_meshing_plugin.cpp diff --git a/Lab/demo/Lab/CGALlab_macros.cmake b/Lab/demo/Lab/CGALlab_macros.cmake index 73f2733bc79..5a1756a0e43 100644 --- a/Lab/demo/Lab/CGALlab_macros.cmake +++ b/Lab/demo/Lab/CGALlab_macros.cmake @@ -63,30 +63,20 @@ add_dependencies(CGALlab_compile_all_plugins CGALlab_all_plugins) STRING(TOLOWER "${plugin_implementation_base_name}.json" base_name) SET(filename "${CMAKE_CURRENT_BINARY_DIR}/${base_name}") LIST(LENGTH ARG_KEYWORDS size) + SET(keywords "") if(${size} GREATER 0) - SET(keywords ) - FILE(WRITE ${filename} "{ \"Keywords\" : [") foreach(keyword ${ARG_KEYWORDS}) - LIST(APPEND keywords "\"${keyword}\", ") + SET(keywords "${keywords}\"${keyword}\", ") if(NOT TARGET ${keyword}) add_custom_target(${keyword}) endif() add_dependencies( ${keyword} ${plugin_name}) endforeach() - LIST(LENGTH keywords size) - math(EXPR size "${size} - 1") - LIST(GET keywords -1 last_element) - LIST(REMOVE_AT keywords ${size}) - STRING(LENGTH ${last_element} size) - math(EXPR size "${size} - 2") - STRING(SUBSTRING ${last_element} 0 ${size} last_element) - LIST(APPEND keywords ${last_element}) - foreach(keyword ${keywords}) - file(APPEND ${filename} ${keyword}) - endforeach() - file(APPEND ${filename} "], \n") - string(TIMESTAMP VERSION "%Y-%m-%d %H:%M") - file(APPEND ${filename} "\"ConfigDate\" : \"${VERSION}\" }") + # Remove the last comma and space + string(REGEX REPLACE ", $" "" keywords "${keywords}") endif() + file(WRITE ${filename} "{\n \"Keywords\" : [ ${keywords} ],\n") + string(TIMESTAMP VERSION "%Y-%m-%d %H:%M") + file(APPEND ${filename} " \"ConfigDate\" : \"${VERSION}\"\n}\n") CGAL_install_hooks() endmacro(cgal_lab_plugin) diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 60b75d24fe4..d4dd881780c 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -565,7 +565,7 @@ bool MainWindow::load_plugin(QString fileName, bool blacklisted) } QDebug qdebug = qDebug(); if(verbose) - qdebug << "### Loading \"" << fileName.toUtf8().data() << "\"... "; + qdebug << "### Loading" << fileName << "... "; QPluginLoader loader; loader.setFileName(fileinfo.absoluteFilePath()); QJsonArray keywords = loader.metaData().value("MetaData").toObject().value("Keywords").toArray(); @@ -612,6 +612,8 @@ bool MainWindow::load_plugin(QString fileName, bool blacklisted) } else{ pluginsStatus_map[name] = loader.errorString(); + if(verbose) + qdebug << "\n#### Error: " << loader.errorString(); } PathNames_map[name].push_back(fileinfo.absoluteDir().absolutePath()); diff --git a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt index 6edbaf4da55..b63737188ff 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt @@ -2,6 +2,8 @@ include(CGALlab_macros) remove_definitions(-DQT_STATICPLUGIN) +set(CMAKE_AUTOMOC ON) + qt6_wrap_cpp(VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h) qt6_wrap_cpp(VOLUME_MOC_OUTFILES diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Offset_meshing_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_3/Offset_meshing_plugin.cpp index df2f5ca5287..a21cdbbf655 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Offset_meshing_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_3/Offset_meshing_plugin.cpp @@ -1,7 +1,5 @@ #include "config.h" -#ifdef CGAL_LAB_DEMO_USE_SURFACE_MESHER - #include #include "ui_Offset_meshing_dialog.h" @@ -761,5 +759,3 @@ inflate_mesh() } #include "Offset_meshing_plugin.moc" - -#endif // CGAL_LAB_DEMO_USE_SURFACE_MESHER diff --git a/Lab/demo/Lab/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Lab/demo/Lab/Plugins/Surface_mesh/Offset_meshing_plugin.cpp deleted file mode 100644 index 217e5888724..00000000000 --- a/Lab/demo/Lab/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ /dev/null @@ -1,691 +0,0 @@ -#include "config.h" -#ifdef CGAL_LAB_DEMO_USE_SURFACE_MESHER -#include -#include "ui_Remeshing_dialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include "Scene_surface_mesh_item.h" -#include "Scene_polygon_soup_item.h" -#include "Scene_polylines_item.h" -#include -#include -#include -#include - -#include "C3t3_type.h" - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include // std::shared_ptr - -namespace CGAL{ - -template -class Offset_function -{ - typedef AABB_face_graph_triangle_primitive Primitive; - typedef AABB_traits_3 Traits; - typedef AABB_tree Tree; - typedef Side_of_triangle_mesh Side_of; - -public: - - Offset_function(TriangleMesh& tm, double offset_distance) - : m_tree_ptr(new Tree(std::begin(faces(tm)), - std::end(faces(tm)), - tm) ) - , m_side_of_ptr( new Side_of(*m_tree_ptr) ) - , m_offset_distance(offset_distance) - , m_is_closed( is_closed(tm) ) - { - CGAL_assertion(!m_tree_ptr->empty()); - } - - double operator()(const typename GeomTraits::Point_3& p) const - { - using CGAL::sqrt; - - Bounded_side side = m_is_closed?m_side_of_ptr->operator()(p):ON_UNBOUNDED_SIDE; - if (side==ON_BOUNDARY) return m_offset_distance; - - typename GeomTraits::Point_3 closest_point = m_tree_ptr->closest_point(p); - double distance = sqrt(squared_distance(p, closest_point)); - - return (side == ON_UNBOUNDED_SIDE ? -distance : distance) + m_offset_distance; - } - -private: - std::shared_ptr m_tree_ptr; - std::shared_ptr m_side_of_ptr; - double m_offset_distance; - bool m_is_closed; - -}; - -class Polygon_soup_offset_function { - typedef Scene_polygon_soup_item::Points Points; - typedef Scene_polygon_soup_item::Polygons Polygons; - - typedef Polygons::const_iterator Polygon_iterator; - - - class Polygon_soup_point_property_map { - const Points* points_vector_ptr; - public: - typedef Polygon_iterator key_type; - typedef EPICK::Point_3 value_type; - typedef const value_type& reference; - typedef boost::readable_property_map_tag category; - - Polygon_soup_point_property_map() = default; - Polygon_soup_point_property_map(const Points* ptr) - : points_vector_ptr(ptr) - {} - - friend reference get(Polygon_soup_point_property_map map, - key_type polygon_it) - { - return (*map.points_vector_ptr)[*polygon_it->begin()]; - } - }; - - - class Polygon_soup_triangle_property_map { - const Points* points_vector_ptr; - public: - typedef Polygon_iterator key_type; - typedef EPICK::Triangle_3 value_type; - typedef value_type reference; - typedef boost::readable_property_map_tag category; - - Polygon_soup_triangle_property_map() = default; - Polygon_soup_triangle_property_map(const Points* ptr) - : points_vector_ptr(ptr) - {} - - friend value_type get(Polygon_soup_triangle_property_map map, - key_type polygon_it) - { - auto it = polygon_it->begin(); - CGAL_assertion(it != polygon_it->end()); - const auto id0 = *it++; - CGAL_assertion(it != polygon_it->end()); - const auto id1 = *it++; - CGAL_assertion(it != polygon_it->end()); - const auto id2 = *it++; - CGAL_assertion(it == polygon_it->end()); - - return value_type( (*map.points_vector_ptr)[id0], - (*map.points_vector_ptr)[id1], - (*map.points_vector_ptr)[id2] ); - } - }; - - struct AABB_primitive : - public CGAL::AABB_primitive - { - typedef CGAL::AABB_primitive Base; - - typedef Polygon_iterator Id; - - template - AABB_primitive(Id id, ObjectPmap&& opmap, PointPmap&& ppmap) - : Base(id, std::forward(opmap), std::forward(ppmap)) - {} - - template - AABB_primitive(Iterator it, ObjectPmap&& opmap, PointPmap&& ppmap) - : Base(*it, std::forward(opmap), std::forward(ppmap)) - {} - }; // end struct template AABB_primitive - - - typedef CGAL::AABB_traits_3 AABB_traits; - typedef CGAL::AABB_tree AABB_tree; - - std::shared_ptr m_tree_ptr; - double m_offset_distance; - - typedef Polygon_soup_triangle_property_map ObjectPmap; - typedef Polygon_soup_point_property_map PointPmap; -public: - Polygon_soup_offset_function(const Scene_polygon_soup_item* soup, - const double offset_distance) - : m_tree_ptr - (std::make_shared(begin(soup->polygons()), - end(soup->polygons()), - ObjectPmap(&soup->points()), - PointPmap(&soup->points())) - ) - , m_offset_distance(offset_distance) - { - CGAL_assertion(! m_tree_ptr->empty() ); - } - - double operator()(const EPICK::Point_3& p) const - { - using CGAL::sqrt; - - EPICK::Point_3 closest_point = m_tree_ptr->closest_point(p); - double distance = sqrt(squared_distance(p, closest_point)); - - return m_offset_distance - distance; - } - -}; // end class Polygon_soup_offset_function - -} //end of CGAL namespace - -Scene_surface_mesh_item* make_item(SMesh* sm) -{ - return new Scene_surface_mesh_item(sm); -} - -CGAL::Offset_function -offset_function(SMesh* surface_mesh_ptr, double offset_value) { - return { *surface_mesh_ptr, offset_value }; -} - -CGAL::Polygon_soup_offset_function -offset_function(Scene_polygon_soup_item* item, double offset_value) { - return { item, offset_value }; -} - -template -struct Result_type { - typedef T type; -}; - -template <> -struct Result_type { - typedef SMesh type; -}; - -template -CGAL::Bbox_3 bbox(Mesh* mesh_ptr) { - return CGAL::Polygon_mesh_processing::bbox(*mesh_ptr); -} - -CGAL::Bbox_3 bbox(Scene_polygon_soup_item* item) { - return item->bbox(); -} -class MeshGuard{ - SMesh* mesh; - bool done; -public: - MeshGuard(SMesh* mesh):mesh(mesh), done(false){} - void setDone(){done = true;} - ~MeshGuard(){ - if(!done) - delete mesh; - } -}; -// declare the CGAL function -template -SMesh* cgal_off_meshing(QWidget*, - Mesh* tm_ptr, - Scene_polylines_item* polylines_item, - const double offset_value, - const double angle, - const double sizing, - const double approx, - const double edge_size, - int tag) -{ - typedef EPICK GT; - typedef CGAL::Labeled_mesh_domain_3 Mesh_domain_base; - typedef CGAL::Mesh_domain_with_polyline_features_3 Mesh_domain; - typedef C3t3::Triangulation Tr; - typedef CGAL::Mesh_criteria_3 Mesh_criteria; - typedef GT::Sphere_3 Sphere_3; - - CGAL::Bbox_3 bbox = ::bbox(tm_ptr); - - GT::Point_3 center((bbox.xmax()+bbox.xmin())/2, - (bbox.ymax()+bbox.ymin())/2, - (bbox.zmax()+bbox.zmin())/2); - double sqrad = 0.6 * std::sqrt( CGAL::square(bbox.xmax()-bbox.xmin())+ - CGAL::square(bbox.ymax()-bbox.ymin())+ - CGAL::square(bbox.zmax()-bbox.zmin()) ) - + offset_value; - sqrad=CGAL::square(sqrad); - - CGAL::Timer timer; - timer.start(); - - namespace p = CGAL::parameters; - - Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain - (p::function = offset_function(tm_ptr, offset_value), - p::bounding_object = Sphere_3(center, sqrad), - p::relative_error_bound = 1e-7, - p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); - - const CGAL::Mesh_facet_topology topology = CGAL::FACET_VERTICES_ON_SAME_SURFACE_PATCH; - auto manifold_option = p::non_manifold(); - if(tag == 1) manifold_option = p::manifold_with_boundary(); - if(tag == 2) manifold_option = p::manifold(); - Mesh_criteria criteria(p::facet_angle = angle, - p::facet_size = sizing, - p::facet_distance = approx, - p::facet_topology = topology, - p::edge_size = edge_size); - - if (polylines_item!=nullptr) - { - typedef std::vector Surface_patch_ids; - std::vector surface_patch_ids; - - domain.add_features_and_incidences(polylines_item->polylines.begin(), - polylines_item->polylines.end(), - CGAL::Identity_property_map(), - CGAL::Constant_property_map( - surface_patch_ids)); - } - - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - p::no_perturb(), - p::no_exude(), - manifold_option); - - const Tr& tr = c3t3.triangulation(); - - timer.stop(); - std::cerr << "done (" << timer.time() << " ms, " << tr.number_of_vertices() << " vertices)" << std::endl; - - if(tr.number_of_vertices() > 0) - { - typedef typename Result_type::type Result_mesh; - // add remesh as new polyhedron - Result_mesh *pRemesh = new Result_mesh; - //if the thread is interrupted before the mesh is returned, delete it. - MeshGuard guard(pRemesh); - CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, *pRemesh); - guard.setDone(); - if(CGAL::is_closed(*pRemesh) - && ! CGAL::Polygon_mesh_processing::is_outward_oriented(*pRemesh)) - { - CGAL::Polygon_mesh_processing::reverse_face_orientations(*pRemesh); - } - - return pRemesh; - } - else - return nullptr; -} - -struct Mesher_thread:public QThread{ - Q_OBJECT - -private: - SMesh* sMesh; - Scene_polygon_soup_item* soup_item; - Scene_polylines_item* polylines_item; - const double offset_value; - const double angle; - const double sizing; - const double approx; - const double edge_size; - int tag_index; -public: - Mesher_thread( SMesh* tm_ptr, - Scene_polygon_soup_item* soup_item, - Scene_polylines_item* polylines_item, - const double offset_value, - const double angle, - const double sizing, - const double approx, - const double edge_size, - int tag) - :sMesh(tm_ptr), soup_item(soup_item), polylines_item(polylines_item), - offset_value(offset_value), angle(angle), - sizing(sizing), approx(approx), edge_size(edge_size), tag_index(tag){ - } - void run() override { - SMesh* new_mesh= nullptr; - if(soup_item) - new_mesh = cgal_off_meshing(CGAL::Three::Three::mainWindow(), - soup_item, - polylines_item, - offset_value, - angle, - sizing, - approx, - edge_size, - tag_index); - else - new_mesh = cgal_off_meshing(CGAL::Three::Three::mainWindow(), - sMesh, - polylines_item, - offset_value, - angle, - sizing, - approx, - edge_size, - tag_index); - CGAL::Three::Three::getMutex()->lock(); - CGAL::Three::Three::getWaitCondition()->wakeAll(); - CGAL::Three::Three::getMutex()->unlock(); - Q_EMIT resultReady(new_mesh); - } -Q_SIGNALS: - void resultReady(SMesh *new_mesh); -}; - -using namespace CGAL::Three; -class CGAL_Lab_offset_meshing_plugin : - public QObject, - protected CGAL_Lab_plugin_interface -{ - Q_OBJECT - Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface) - Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0") - -public: - void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { - this->scene = scene_interface; - this->mw = mainWindow; - actionOffsetMeshing = new QAction(tr("Offset Meshing"), mw); - actionOffsetMeshing->setProperty("subMenuName", "3D Surface Mesh Generation"); - if(actionOffsetMeshing) { - connect(actionOffsetMeshing, SIGNAL(triggered()), - this, SLOT(offset_meshing())); - } - - actionInflateMesh= new QAction(tr("Inflate Mesh"), mw); - actionInflateMesh->setProperty("subMenuName", "Operations on Polyhedra"); - if(actionInflateMesh) { - connect(actionInflateMesh, SIGNAL(triggered()), - this, SLOT(inflate_mesh())); - } - } - - bool applicable(QAction*) const { - if ( scene->selectionIndices().size() != 1 && - scene->selectionIndices().size() != 2 ) - { - return false; - } - - for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices()) - { - if ( qobject_cast(scene->item(index)) || - qobject_cast(scene->item(index)) ) - return true; - } - return false; - } - - QList actions() const { - return QList() << actionOffsetMeshing - << actionInflateMesh; - } -public Q_SLOTS: - void offset_meshing(); - void inflate_mesh(); - -private: - QAction* actionOffsetMeshing; - QAction* actionInflateMesh; - Scene_interface *scene; - QMainWindow *mw; -}; // end class CGAL_Lab_offset_meshing_plugin - -void CGAL_Lab_offset_meshing_plugin::inflate_mesh() -{ - const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_item* item = scene->item(index); - if(item == nullptr){ - return; - } - - Scene_surface_mesh_item* sm_item = - qobject_cast(item); - - if(sm_item == nullptr){ - return; - } - - SMesh* sMesh = sm_item->face_graph(); - - if(sMesh == nullptr){ - return; - } - - double diag = sm_item->diagonalBbox(); - double offset_value = QInputDialog::getDouble(mw, - QString("Choose Inflate Distance"), - QString("Inflate Distance (use negative number for deflate)"), - 0.1*diag, - -(std::numeric_limits::max)(), - (std::numeric_limits::max)(), 10); - - auto vpm = get(CGAL::vertex_point,*sMesh); - auto vnm = - sMesh->property_map("v:normal").value(); - - for(const auto& v : vertices(*sMesh)) - { - Point_3 p = get(vpm, v); - EPICK::Vector_3 n = get(vnm, v); - n/=(CGAL::sqrt(n.squared_length())); - put(vpm, v, p + offset_value*n); - } - sm_item->invalidateOpenGLBuffers(); -} - -void CGAL_Lab_offset_meshing_plugin::offset_meshing() -{ - Scene_surface_mesh_item* sm_item = nullptr; - Scene_polygon_soup_item* soup_item = nullptr; - Scene_polylines_item* polylines_item = nullptr; - Scene_item* item = nullptr; - - bool mesh_or_soup_item_found = false; - - for(CGAL::Three::Scene_interface::Item_id index : scene->selectionIndices()) - { - if (!mesh_or_soup_item_found) - { - sm_item = qobject_cast(scene->item(index)); - if (sm_item == nullptr) - { - soup_item = qobject_cast(item); - if (soup_item != nullptr) - { - item=scene->item(index); - mesh_or_soup_item_found = true; - continue; - } - } - else - { - item=scene->item(index); - mesh_or_soup_item_found = true; - continue; - } - } - polylines_item = qobject_cast(scene->item(index)); - } - - SMesh* sMesh = nullptr; - double diag = 0; - Scene_item::Bbox box; - if(sm_item) - { - sMesh = sm_item->face_graph(); - if(!sMesh) - return; - box = bbox(sMesh); - } - else if(soup_item != nullptr) - { - box = bbox(soup_item); - } - else if(soup_item == nullptr) - return; - double X=(box.max)(0)-(box.min)(0), - Y = (box.max)(1)-(box.min)(1), - Z = (box.max)(2)-(box.min)(2); - diag = CGAL::sqrt(X*X+Y*Y+Z*Z); - double offset_value = QInputDialog::getDouble(mw, - QString("Choose Offset Value"), - QString("Offset Value (use negative number for inset)"), - 0.1*diag, - -(std::numeric_limits::max)(), - (std::numeric_limits::max)(), 10); - - QDialog dialog(mw); - Ui::Remeshing_dialog ui; - ui.setupUi(&dialog); - ui.angle->setRange(1.0, 30.0); - connect(ui.buttonBox, SIGNAL(accepted()), - &dialog, SLOT(accept())); - connect(ui.buttonBox, SIGNAL(rejected()), - &dialog, SLOT(reject())); - - ui.sizing->setRange(diag * 10e-6, // min - diag); // max - ui.sizing->setValue(diag * 0.05); // default value - - ui.approx->setRange(diag * 10e-7, // min - diag); // max - ui.approx->setValue(diag * 0.005); - - if (polylines_item!=nullptr) - { - ui.edge_sizing->setRange(diag * 10e-6, // min - diag); // max - ui.edge_sizing->setValue(diag * 0.05); // default value - } - else - ui.edge_sizing->setEnabled(false); - - int i = dialog.exec(); - if(i == QDialog::Rejected) - return; - - const double angle = ui.angle->value(); - const double approx = ui.approx->value(); - const double sizing = ui.sizing->value(); - const double edge_size=polylines_item!=nullptr?ui.edge_sizing->value():0; - const int tag_index = ui.tags->currentIndex(); - - if(tag_index < 0) return; - - QApplication::setOverrideCursor(Qt::WaitCursor); - - std::cerr << "mesh with:" - << "\n angle=" << angle - << "\n sizing=" << sizing - << "\n approx=" << approx - << "\n tag=" << tag_index - << std::boolalpha - << std::endl; - Mesher_thread* worker = nullptr; - if(soup_item) - worker = new Mesher_thread(nullptr, - soup_item, - polylines_item, - offset_value, - angle, - sizing, - approx, - edge_size, - tag_index); - else - worker = new Mesher_thread(sMesh, - nullptr, - polylines_item, - offset_value, - angle, - sizing, - approx, - edge_size, - tag_index); - connect(worker, &QThread::finished, worker, &QObject::deleteLater); - connect(worker, &Mesher_thread::resultReady, this, - [item, angle, sizing, approx, offset_value/* , index */] - (SMesh *new_mesh){ - QApplication::restoreOverrideCursor(); - if(!new_mesh){ - CGAL::Three::Three::getMutex()->lock(); - CGAL::Three::Three::isLocked() = false; - CGAL::Three::Three::getMutex()->unlock(); - return; - } - Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(new_mesh); - new_item->setName(tr("%1 offset %5 (%2 %3 %4)") - .arg(item->name()) - .arg(angle) - .arg(sizing) - .arg(approx) - .arg(offset_value)); - new_item->setColor(Qt::magenta); - new_item->setWireframeMode(); - CGAL::Three::Three::scene()->addItem(new_item); -// CGAL::Three::Three::scene()->itemChanged(index); - QApplication::restoreOverrideCursor(); - CGAL::Three::Three::getMutex()->lock(); - CGAL::Three::Three::isLocked() = false; - CGAL::Three::Three::getMutex()->unlock(); - }); - QMessageBox* message_box = new QMessageBox(QMessageBox::NoIcon, - "Meshing", - "Offset meshing in progress...", - QMessageBox::Cancel, - mw); - message_box->setDefaultButton(QMessageBox::Cancel); - QAbstractButton* cancelButton = message_box->button(QMessageBox::Cancel); - cancelButton->setText(tr("Stop")); - - connect(cancelButton, &QAbstractButton::clicked, - this, [worker](){ - worker->terminate(); - QApplication::restoreOverrideCursor();//waitcursor - QApplication::restoreOverrideCursor();//busycursor - }); - connect(worker, &Mesher_thread::finished, - message_box, &QMessageBox::close); - message_box->open(); - - QApplication::setOverrideCursor(Qt::BusyCursor); - CGAL::Three::Three::getMutex()->lock(); - CGAL::Three::Three::isLocked() = true; - CGAL::Three::Three::getMutex()->unlock(); - worker->start(); -} - -#include "Offset_meshing_plugin.moc" - -#endif // CGAL_LAB_DEMO_USE_SURFACE_MESHER From 0ecfcb9962b0a0618bcc324f5913b6470852656b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 12 Mar 2025 14:40:09 +0100 Subject: [PATCH 332/332] typo --- Lab/demo/Lab/CGAL_Lab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/CGAL_Lab.cpp b/Lab/demo/Lab/CGAL_Lab.cpp index 85880fb8add..ff4d0d3c598 100644 --- a/Lab/demo/Lab/CGAL_Lab.cpp +++ b/Lab/demo/Lab/CGAL_Lab.cpp @@ -83,7 +83,7 @@ CGAL_Lab::CGAL_Lab(int& argc, char **argv, tr("Ignore the autostart.js file, if any.")); parser.addOption(no_autostart); QCommandLineOption verbose("verbose", - tr("Print the paths explored byt the application searching for plugins.")); + tr("Print the paths explored by the application searching for plugins.")); parser.addOption(verbose); QCommandLineOption old("old", tr("Force OpenGL 2.1 context."));