From 3937c5df346053de8d0f42ceeb8fdac44d0e8b35 Mon Sep 17 00:00:00 2001 From: ange-clement Date: Fri, 13 Oct 2023 14:51:43 +0200 Subject: [PATCH 001/175] 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 002/175] 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 003/175] 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 004/175] 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 005/175] 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 006/175] 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 007/175] 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 008/175] 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 009/175] 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 010/175] 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 011/175] 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 012/175] 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 013/175] 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 014/175] 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 015/175] 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 016/175] 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 017/175] 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 018/175] 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 019/175] 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 020/175] 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 021/175] 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 022/175] 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 023/175] 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 024/175] 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 025/175] 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 026/175] 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 027/175] 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 028/175] 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 029/175] 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 030/175] 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 031/175] 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 032/175] 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 033/175] 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 034/175] 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 035/175] 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 036/175] 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 037/175] 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 038/175] 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 039/175] 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 040/175] 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 041/175] 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 042/175] 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 043/175] 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 044/175] 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 045/175] 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 2f25527e94aa8883b2a215dc0347325f09c5197b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 12 Sep 2024 11:54:52 +0200 Subject: [PATCH 046/175] "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 047/175] 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 048/175] 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 049/175] 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 050/175] 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 051/175] 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 052/175] 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 053/175] 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 054/175] 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 055/175] 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 056/175] 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 057/175] 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 058/175] 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 059/175] 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 060/175] 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 061/175] 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 062/175] 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 063/175] 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 064/175] 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 065/175] 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 066/175] 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 067/175] 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 068/175] 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 069/175] 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 070/175] 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 071/175] 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 072/175] 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 75d3d30cb40b9b010bd0ef6be568e195627fb301 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 5 Nov 2024 10:27:54 +0100 Subject: [PATCH 073/175] 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 13328c335e9596edb39e6c14897c124cf5ad88a6 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 6 Nov 2024 13:34:52 +0100 Subject: [PATCH 074/175] 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 d5203e3124e24aca8579c947ff5a5a1472e8e4ab Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 7 Nov 2024 09:27:10 +0100 Subject: [PATCH 075/175] 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 076/175] 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 077/175] 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 ddeaeb497a634ea9b574fe8dd37ef38d6adea90c Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 13 Nov 2024 18:35:18 +0200 Subject: [PATCH 078/175] Cleaned up --- .../CGAL/Arr_landmarks_point_location.h | 114 +++-- .../Arr_landmarks_pl_impl.h | 405 ++++++++---------- 2 files changed, 225 insertions(+), 294 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h index 9cfcd680aea..923009e4456 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h @@ -8,8 +8,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Idit Haran -// Ron Wein +// Author(s) : Idit Haran +// Ron Wein #ifndef CGAL_ARR_LANDMARKS_POINT_LOCATION_H #define CGAL_ARR_LANDMARKS_POINT_LOCATION_H @@ -42,44 +42,44 @@ namespace CGAL { * Generator is a class that generates the set of landmarks. */ -template > -class Arr_landmarks_point_location -{ +template > +class Arr_landmarks_point_location { public: - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef Generator_ Generator; + using Arrangement_2 = Arrangement_; + using Generator = Generator_; + using Geometry_traits_2 = typename Arrangement_2::Geometry_traits_2; - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; + using Vertex_const_handle = typename Arrangement_2::Vertex_const_handle; + using Halfedge_const_handle = typename Arrangement_2::Halfedge_const_handle; + using Face_const_handle = typename Arrangement_2::Face_const_handle; - typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; - typedef typename Arrangement_2::Halfedge_const_iterator - Halfedge_const_iterator; - typedef typename Arrangement_2::Halfedge_around_vertex_const_circulator - Halfedge_around_vertex_const_circulator; - typedef typename Arrangement_2::Ccb_halfedge_const_circulator - Ccb_halfedge_const_circulator; - typedef typename Arrangement_2::Outer_ccb_const_iterator - Outer_ccb_const_iterator; - typedef typename Arrangement_2::Inner_ccb_const_iterator - Inner_ccb_const_iterator; - typedef typename Arrangement_2::Isolated_vertex_const_iterator - Isolated_vertex_const_iterator; + using Vertex_const_iterator = typename Arrangement_2::Vertex_const_iterator; + using Halfedge_const_iterator = + typename Arrangement_2::Halfedge_const_iterator; - typedef typename Arrangement_2::Point_2 Point_2; - typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + using Halfedge_around_vertex_const_circulator = + typename Arrangement_2::Halfedge_around_vertex_const_circulator; + using Ccb_halfedge_const_circulator = + typename Arrangement_2::Ccb_halfedge_const_circulator; + using Outer_ccb_const_iterator = + typename Arrangement_2::Outer_ccb_const_iterator; + using Inner_ccb_const_iterator = + typename Arrangement_2::Inner_ccb_const_iterator; + using Isolated_vertex_const_iterator = + typename Arrangement_2::Isolated_vertex_const_iterator; - typedef Arr_point_location_result Result; - typedef typename Result::Type Result_type; + using Point_2 = typename Arrangement_2::Point_2; + using X_monotone_curve_2 = typename Arrangement_2::X_monotone_curve_2; + + using Result = Arr_point_location_result; + using Result_type = typename Result::Type; // Support cpp11::result_of - typedef Result_type result_type; + using result_type = Result_type; protected: - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; + using Traits_adaptor_2 = Arr_traits_basic_adaptor_2; /*! \struct Less_halfedge_handle * Used to sort handles. @@ -92,10 +92,10 @@ protected: typedef std::set Halfedge_set; // Data members: - const Arrangement_2* p_arr; // The associated arrangement. + const Arrangement_2* p_arr; // The associated arrangement. const Traits_adaptor_2* m_traits; // Its associated traits object. - Generator* lm_gen; // The associated landmark generator. - bool own_gen; // Indicates whether the generator + Generator* lm_gen; // The associated landmark generator. + bool own_gen; // Indicates whether the generator // has been locally allocated. template @@ -103,7 +103,7 @@ protected: inline Result_type default_result() const { return Result::default_result(); } public: - /*! Default constructor. */ + /*! constructs default. */ Arr_landmarks_point_location() : p_arr(nullptr), m_traits(nullptr), @@ -111,34 +111,32 @@ public: own_gen(false) {} - /*! Constructor given an arrangement only. */ + /*! constructs given an arrangement only. */ Arr_landmarks_point_location(const Arrangement_2& arr) : p_arr(&arr), m_traits(static_cast(p_arr->geometry_traits())), lm_gen(new Generator(arr)), // allocate the landmarks generator. own_gen(true) - { } + {} - /*! Constructor given an arrangement, and landmarks generator. */ + /*! constructs given an arrangement, and landmarks generator. */ Arr_landmarks_point_location(const Arrangement_2& arr, Generator* gen) : p_arr(&arr), m_traits(static_cast(p_arr->geometry_traits())), lm_gen(gen), own_gen(false) - { } + {} - /*! Destructor. */ - ~Arr_landmarks_point_location() - { + /*! destructs. */ + ~Arr_landmarks_point_location() { if (own_gen) { delete lm_gen; lm_gen = nullptr; } } - /*! Attach an arrangement object (and a generator, if supplied). */ - void attach(const Arrangement_2& arr, Generator* gen = nullptr) - { + /*! attaches an arrangement object (and a generator, if supplied). */ + void attach(const Arrangement_2& arr, Generator* gen = nullptr) { // Keep a pointer to the associated arrangement. p_arr = &arr; m_traits = static_cast(p_arr->geometry_traits()); @@ -163,9 +161,8 @@ public: } } - /*! Detach the instance from the arrangement object. */ - void detach() - { + /*! detaches the instance from the arrangement object. */ + void detach() { p_arr = nullptr; m_traits = nullptr; @@ -174,8 +171,7 @@ public: lm_gen->detach(); } - /*! - * Locate the arrangement feature containing the given point. + /*! locates the arrangement feature containing the given point. * \param p The query point. * \return An object representing the arrangement feature containing the * query point. This object is either a Face_const_handle or a @@ -184,7 +180,7 @@ public: result_type locate(const Point_2& p) const; protected: - /*! Walk from the given vertex to the query point. + /*! walks from the given vertex to the query point. * \param vh The given vertex handle. * \param p The query point. * \param crossed_edges In/Out: The set of edges crossed so far. @@ -196,7 +192,7 @@ protected: const Point_2& p, Halfedge_set& crossed_edges) const; - /*! Locate an edge around a given vertex that is the predecessor of the + /*! locates an edge around a given vertex that is the predecessor of the * curve connecting the vertex to the query point in a clockwise order. * \param vh The vertex. * \param p The query point. @@ -207,7 +203,7 @@ protected: const Point_2& p, bool& new_vertex) const; - /*! Walk from a point on a given halfedge to the query point. + /*! walks from a point on a given halfedge to the query point. * \param eh The given halfedge handle. * \param np The point that the walk starts from. * \param p The query point. @@ -220,7 +216,7 @@ protected: const Point_2& np, const Point_2& p, Halfedge_set& crossed_edges) const; - /*! In case the arrangement's curve contained in the segment + /*! handles the arrangement curve contained in the segment * from the nearest landmark to the query point * \param he The given halfedge handle. * \param p_is_left Is the query point the left endpoint of seg. @@ -236,7 +232,7 @@ protected: const Point_2& p, Halfedge_set& crossed_edges) const; - /*! Walk from a point in a face to the query point. + /*! walks from a point in a face to the query point. * \param fh A halfedge handle that points to the face. * \param np The point that the walk starts from. * \param p The query point. @@ -250,7 +246,7 @@ protected: const Point_2& p, Halfedge_set& crossed_edges) const; - /*! Find a halfedge on the given CCB that intersects the given x-monotone + /*! finds a halfedge on the given CCB that intersects the given x-monotone * curve, connecting the current landmark to the query point. * \param circ The CCB circulator. * \param seg The segment connecting the landmark and the query point. @@ -275,7 +271,7 @@ protected: bool& cv_is_contained_in_seg, Vertex_const_handle& new_vertex) const; - /*! Return the halfedge that contains the query point. + /*! returns the halfedge that contains the query point. * \param he The halfedge handle. * \param crossed_edges In/Out: The set of edges crossed so far. * \param p The query point. @@ -287,7 +283,7 @@ protected: const Point_2& p, bool& is_target) const; - /*! Check whether the given curve intersects a simple segment, which connects + /*! checks whether the given curve intersects a simple segment, which connects * the current landmark to the query point, an odd number of times. * \param cv The curve. * \param seg The segment connecting the landmark and the query point. @@ -305,7 +301,7 @@ protected: bool& cv_is_contained_in_seg) const; }; -} //namespace CGAL +} // namespace CGAL // The member-function definitions can be found under: #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index dae2f574090..7b2020843e8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -7,16 +7,15 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// Author(s) : Idit Haran -// Ron Wein -// Efi Fogel +// Author(s) : Idit Haran +// Ron Wein +// Efi Fogel #ifndef CGAL_ARR_LANDMARKS_PL_IMPL_H #define CGAL_ARR_LANDMARKS_PL_IMPL_H #include - /*! \file * Member-function definitions for the * Arr_landmarks_point_location class. @@ -24,60 +23,59 @@ namespace CGAL { -//----------------------------------------------------------------------------- -// Locate the arrangement feature containing the given point. -// +// Helper trait to check for the presence of nested Is_on_x_identification_2 +template > +struct has_is_on_x_identification_2 : std::false_type {}; + +// Specialization if the nested type Is_on_x_identification_2 exists +template +struct has_is_on_x_identification_2> : std::true_type {}; + +/*! locates the arrangement feature containing the given point. + */ template typename Arr_landmarks_point_location::result_type -Arr_landmarks_point_location::locate(const Point_2& p) const -{ +Arr_landmarks_point_location::locate(const Point_2& p) const { // If the arrangement is empty, return its initial (empty and // non-fictitious) face. if (p_arr->number_of_vertices() == 0) { CGAL_assertion(p_arr->number_of_faces() == 1); - Face_const_handle fh = p_arr->faces_begin(); + Face_const_handle fh = p_arr->faces_begin(); return make_result(fh); } + // Use the generator and to find the closest landmark to the query point. - result_type lm_location_obj; + result_type lm_location_obj; const Point_2& landmark_point = lm_gen->closest_landmark(p, lm_location_obj); // If the query point and the landmark point are equal, return the landmark. - if (m_traits->equal_2_object()(landmark_point, p)) - return lm_location_obj; + if (m_traits->equal_2_object()(landmark_point, p)) return lm_location_obj; // Walk from the nearest_vertex to the point p, using walk algorithm, // and find the location of the query point p. Note that the set of edges // we have crossed so far is initially empty. - Halfedge_set crossed_edges; - result_type out_obj; + Halfedge_set crossed_edges; + result_type out_obj; // Locate the arrangement feature that contains the landmark. - const Vertex_const_handle* vh; - const Halfedge_const_handle* hh; - const Face_const_handle* fh; - if ( ( vh = Result().template assign(&lm_location_obj) ) ) - out_obj = _walk_from_vertex(*vh, p, crossed_edges); - else if ( ( hh = Result().template assign(&lm_location_obj) ) ) - out_obj = _walk_from_edge(*hh, landmark_point, p, crossed_edges); - else if ( ( fh = Result().template assign(&lm_location_obj) ) ) - out_obj = _walk_from_face(*fh, landmark_point, p, crossed_edges); + if (const auto* v = std::get_if(&lm_location_obj)) + out_obj = _walk_from_vertex(*v, p, crossed_edges); + else if (const auto* e = std::get_if(&lm_location_obj)) + out_obj = _walk_from_edge(*e, landmark_point, p, crossed_edges); + else if (const auto* f = std::get_if(&lm_location_obj)) + out_obj = _walk_from_face(*f, landmark_point, p, crossed_edges); else CGAL_error_msg("lm_location_obj of an unknown type."); - if ( ( fh = Result().template assign(&out_obj) ) ) { + if (const auto* f = std::get_if(&out_obj)) { // If we reached here, we did not locate the query point in any of the // holes inside the current face, so we conclude it is contained in this - // face. - // However, we first have to check whether the query point coincides with - // any of the isolated vertices contained inside this face. - Isolated_vertex_const_iterator iso_verts_it; - typename Traits_adaptor_2::Equal_2 equal = m_traits->equal_2_object(); - - for (iso_verts_it = (*fh)->isolated_vertices_begin(); - iso_verts_it != (*fh)->isolated_vertices_end(); ++iso_verts_it) - { + // face. However, we first have to check whether the query point coincides + // with any of the isolated vertices contained inside this face. + auto equal = m_traits->equal_2_object(); + for (auto iso_verts_it = (*f)->isolated_vertices_begin(); + iso_verts_it != (*f)->isolated_vertices_end(); ++iso_verts_it) { if (equal(p, iso_verts_it->point())) { - Vertex_const_handle ivh = iso_verts_it; + Vertex_const_handle ivh = iso_verts_it; return make_result(ivh); } } @@ -86,28 +84,24 @@ Arr_landmarks_point_location::locate(const Point_2& p) const return out_obj; } -//----------------------------------------------------------------------------- -// Walk from a given vertex to the query point. -// +/*! walks from a given vertex to the query point. + */ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: -_walk_from_vertex(Vertex_const_handle nearest_vertex, - const Point_2& p, - Halfedge_set& crossed_edges) const -{ +_walk_from_vertex(Vertex_const_handle nearest_vertex, const Point_2& p, + Halfedge_set& crossed_edges) const { Vertex_const_handle vh = nearest_vertex; CGAL_assertion_msg(! vh->is_at_open_boundary(), "_walk_from_vertex() from a vertex at infinity."); // Check if the query point p coincides with the vertex. - if (m_traits->equal_2_object()(vh->point(), p)) - return make_result(vh); + if (m_traits->equal_2_object()(vh->point(), p)) return make_result(vh); // In case of an isolated vertex, walk to from the face that contains // it toward the query point. if (vh->is_isolated()) { - Face_const_handle fh = vh->face(); + Face_const_handle fh = vh->face(); return (_walk_from_face(fh, vh->point(), p, crossed_edges)); } @@ -116,30 +110,29 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, Halfedge_around_vertex_const_circulator first = vh->incident_halfedges(); // Create an x-monotone curve connecting the point associated with the // vertex vp and the query point p. - const Point_2& vp = vh->point(); - X_monotone_curve_2 seg = + const Point_2& vp = vh->point(); + X_monotone_curve_2 seg = m_traits->construct_x_monotone_curve_2_object()(vp, p); - const bool seg_dir_right = + const bool seg_dir_right = (m_traits->compare_xy_2_object()(vp, p) == SMALLER); Halfedge_around_vertex_const_circulator curr_iter = first; Halfedge_around_vertex_const_circulator next_iter = curr_iter; ++next_iter; - typename Traits_adaptor_2::Is_between_cw_2 is_between_cw = - m_traits->is_between_cw_2_object(); + auto is_between_cw = m_traits->is_between_cw_2_object(); // Traverse the halfedges around vp until we find the pair of adjacent // halfedges such as seg is located clockwise in between them. + do { bool eq_curr_iter, eq_next_iter; if (is_between_cw(seg, seg_dir_right, curr_iter->curve(), (curr_iter->direction() == ARR_RIGHT_TO_LEFT), next_iter->curve(), (next_iter->direction() == ARR_RIGHT_TO_LEFT), - vp, eq_curr_iter, eq_next_iter)) - { + vp, eq_curr_iter, eq_next_iter)) { // the assumption is that each edge is crossed at most twice - CGAL_assertion_msg(crossed_edges.count (curr_iter) < 2, + CGAL_assertion_msg(crossed_edges.count(curr_iter) < 2, "crossed_edges should contain each halfedge at most twice."); - CGAL_assertion_msg(crossed_edges.count (next_iter) < 2, + CGAL_assertion_msg(crossed_edges.count(next_iter) < 2, "crossed_edges should contain each halfedge at most twice."); crossed_edges.insert(curr_iter); crossed_edges.insert(curr_iter->twin()); @@ -158,8 +151,7 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, result_type obj = _find_face_around_vertex(vh, p, new_vertex); if (new_vertex) { // We found a vertex closer to p; Continue using this vertex. - const Vertex_const_handle* p_vh = - Result().template assign(&obj); + const auto* p_vh = std::get_if(&obj); CGAL_assertion(p_vh != nullptr); vh = *p_vh; continue; @@ -167,15 +159,13 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, // If p is located on an edge or on a vertex, return the object // that wraps this arrangement feature. - if (Result().template assign(&obj) || - Result().template assign(&obj)) + if (std::get_if(&obj) || + std::get_if(&obj)) return obj; - const Face_const_handle* p_fh = - Result().template assign(&obj); - if (p_fh) - // Walk to p from the face we have located: - return _walk_from_face(*p_fh, vh->point(), p, crossed_edges); + const auto* p_fh = std::get_if(&obj); + // Walk to p from the face we have located: + if (p_fh) return _walk_from_face(*p_fh, vh->point(), p, crossed_edges); CGAL_error_msg("_find_face_around_vertex() returned an unknown object."); } @@ -185,31 +175,28 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, return default_result(); } -//----------------------------------------------------------------------------- -// Locate an edge around a given vertex that is the predecessor of the curve -// connecting the vertex to the query point in a clockwise order. -// +/*! locates an edge around a given vertex that is the predecessor of the curve + * connecting the vertex to the query point in a clockwise order. + */ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: -_find_face_around_vertex(Vertex_const_handle vh, - const Point_2& p, - bool& new_vertex) const -{ +_find_face_around_vertex(Vertex_const_handle vh, const Point_2& p, + bool& new_vertex) const { new_vertex = false; // Create an x-monotone curve connecting the point associated with the // vertex vp and the query point p. - const Point_2& vp = vh->point(); - X_monotone_curve_2 seg = + const Point_2& vp = vh->point(); + X_monotone_curve_2 seg = m_traits->construct_x_monotone_curve_2_object()(vp, p); - const bool seg_dir_right = + const bool seg_dir_right = (m_traits->compare_xy_2_object()(vp, p) == SMALLER); // Get the first incident halfedge around v and the next halfedge. - Halfedge_around_vertex_const_circulator first = vh->incident_halfedges(); - Halfedge_around_vertex_const_circulator curr, next; - bool equal_curr = false; + Halfedge_around_vertex_const_circulator first = vh->incident_halfedges(); + Halfedge_around_vertex_const_circulator curr, next; + bool equal_curr = false; next = curr = first; ++next; @@ -241,16 +228,14 @@ _find_face_around_vertex(Vertex_const_handle vh, else { // Traverse the halfedges around v until we find the pair of adjacent // halfedges such as seg is located clockwise in between them. - typename Traits_adaptor_2::Is_between_cw_2 is_between_cw = - m_traits->is_between_cw_2_object(); - bool eq_curr, eq_next; + auto is_between_cw = m_traits->is_between_cw_2_object(); + bool eq_curr, eq_next; while (! is_between_cw(seg, seg_dir_right, curr->curve(), (curr->direction() == ARR_RIGHT_TO_LEFT), next->curve(), (next->direction() == ARR_RIGHT_TO_LEFT), - vp, eq_curr, eq_next)) - { + vp, eq_curr, eq_next)) { // Break the loop if seg equals one of the halfedges next to v. if (eq_curr) { equal_curr = true; @@ -291,10 +276,9 @@ _find_face_around_vertex(Vertex_const_handle vh, // Check whether p lies on the curve associated with the edge. if (m_traits->is_in_x_range_2_object()(curr->curve(), p) && - m_traits->compare_y_at_x_2_object()(p, curr->curve()) == EQUAL) - { + m_traits->compare_y_at_x_2_object()(p, curr->curve()) == EQUAL) { // p is located on the interior of the edge. - Halfedge_const_handle he = curr; + Halfedge_const_handle he = curr; return make_result(he); } @@ -304,22 +288,18 @@ _find_face_around_vertex(Vertex_const_handle vh, return make_result(curr->source()); } -//----------------------------------------------------------------------------- -// Walk from the edge to the query point. -// +/*! walks from the edge to the query point. + */ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: -_walk_from_edge(Halfedge_const_handle eh, - const Point_2& np, - const Point_2& p, - Halfedge_set& crossed_edges) const -{ +_walk_from_edge(Halfedge_const_handle eh, const Point_2& np, const Point_2& p, + Halfedge_set& crossed_edges) const { CGAL_assertion_msg(! eh->is_fictitious(), "_walk_from_edge() from a fictitious edge."); const X_monotone_curve_2& cv = eh->curve() ; - Comparison_result res; + Comparison_result res; X_monotone_curve_2 seg = m_traits->construct_x_monotone_curve_2_object()(np, p); @@ -345,8 +325,7 @@ _walk_from_edge(Halfedge_const_handle eh, if (m_traits->is_in_x_range_2_object()(seg, temp_p)) { //we must make sure that eh is not a tip on an "antena" if (m_traits->compare_y_at_x_2_object()(temp_p, seg) == EQUAL && - eh->prev() != eh->twin()) - { + eh->prev() != eh->twin()) { // the assumption is that each edge is crossed at most twice CGAL_assertion_msg(crossed_edges.count(eh->prev()) < 2, "crossed_edges should contain each halfedge at most twice."); @@ -367,8 +346,7 @@ _walk_from_edge(Halfedge_const_handle eh, if (m_traits->is_in_x_range_2_object()(seg, temp_p)) { //we must make sure that eh is not a tip on an "antena" if (m_traits->compare_y_at_x_2_object()(temp_p, seg) == EQUAL && - eh->next() != eh->twin()) - { + eh->next() != eh->twin()) { // the assumption is that each edge is crossed at most twice CGAL_assertion_msg(crossed_edges.count(eh->next()) < 2, "crossed_edges should contain each halfedge at most twice."); @@ -428,89 +406,69 @@ _walk_from_edge(Halfedge_const_handle eh, return (_walk_from_vertex(vh, p, crossed_edges)); } -//----------------------------------------------------------------------------- -// In case the arrangement's curve contained in the segment -// from the nearest landmark to the query point -// +/*! deals with an arrangement curve contained in the segment from the nearest + * landmark to the query point + */ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: -_deal_with_curve_contained_in_segment(Halfedge_const_handle he, - bool p_is_left, +_deal_with_curve_contained_in_segment(Halfedge_const_handle he, bool p_is_left, const Point_2& p, - Halfedge_set& crossed_edges) const -{ + Halfedge_set& crossed_edges) const { // in this case we want to walk from to the query point from the nearest // vertex either the halfedge's source or target - Vertex_const_handle vh; - bool target_is_left; - if (m_traits->compare_xy_2_object() - (he->source()->point(),he->target()->point()) == LARGER) - target_is_left = true; - else - target_is_left = false; + auto cmp_xy = m_traits->compare_xy_2_object(); + bool target_is_left = + (cmp_xy(he->source()->point(), he->target()->point()) == LARGER); + + Vertex_const_handle vh; if (p_is_left) { - if (target_is_left) - vh = he->target(); - else - vh = he->source(); + if (target_is_left) vh = he->target(); + else vh = he->source(); } else { - if (target_is_left) - vh = he->source(); - else - vh = he->target(); + if (target_is_left) vh = he->source(); + else vh = he->target(); } // vh is the closest vertex among the halfedge's end points return (_walk_from_vertex(vh, p, crossed_edges)); } -//----------------------------------------------------------------------------- -// Walk from the given face to the query point. -// +/*! walks from the given face to the query point. + */ template typename Arr_landmarks_point_location::result_type Arr_landmarks_point_location:: -_walk_from_face(Face_const_handle face, - const Point_2& np, - const Point_2& p, - Halfedge_set& crossed_edges) const -{ +_walk_from_face(Face_const_handle face, const Point_2& np, const Point_2& p, + Halfedge_set& crossed_edges) const { // Construct an x-monotone curve connecting the nearest landmark point np // to the query point p and check which CCB intersects this segment. - X_monotone_curve_2 seg = + X_monotone_curve_2 seg = m_traits->construct_x_monotone_curve_2_object()(np, p); - const bool p_is_left = - (m_traits->compare_xy_2_object()(np, p) == LARGER); + const bool p_is_left = (m_traits->compare_xy_2_object()(np, p) == LARGER); - Inner_ccb_const_iterator inner_ccb_iter; - Outer_ccb_const_iterator outer_ccb_iter; - const Halfedge_const_handle invalid_he; - Halfedge_const_handle he; - Face_const_handle new_face; - bool is_on_edge; - bool is_target; - bool cv_is_contained_in_seg; - Vertex_const_handle new_vertex; - const Vertex_const_handle invalid_vertex; + const Halfedge_const_handle invalid_he; + const Vertex_const_handle invalid_vertex; + bool cv_is_contained_in_seg; do { // Check whether p lies inside the current face (including its holes): - if (p_arr->topology_traits()->is_in_face(&(*face), p, nullptr)) - { + if (p_arr->topology_traits()->is_in_face(&(*face), p, nullptr)) { // We know that p is located inside the current face, and we check // whether it lies inside one of its holes (or on the boundary of // its holes). cv_is_contained_in_seg = false; - new_face = face; - for (inner_ccb_iter = face->inner_ccbs_begin(); - inner_ccb_iter != face->inner_ccbs_end(); ++inner_ccb_iter) - { - he = _intersection_with_ccb(*inner_ccb_iter,seg, p, p_is_left, - crossed_edges,is_on_edge, is_target, - cv_is_contained_in_seg,new_vertex); - if (he == invalid_he && cv_is_contained_in_seg) - { + auto new_face = face; + for (auto inner_ccb_iter = face->inner_ccbs_begin(); + inner_ccb_iter != face->inner_ccbs_end(); ++inner_ccb_iter) { + bool is_on_edge; + bool is_target; + Vertex_const_handle new_vertex; + Halfedge_const_handle he = + _intersection_with_ccb(*inner_ccb_iter,seg, p, p_is_left, + crossed_edges, is_on_edge, is_target, + cv_is_contained_in_seg, new_vertex); + if (he == invalid_he && cv_is_contained_in_seg) { return _deal_with_curve_contained_in_segment(*inner_ccb_iter, p_is_left,p, crossed_edges); @@ -535,8 +493,7 @@ _walk_from_face(Face_const_handle face, // Check if we found a new face (hole) containing p. If not, the current // face contains p. - if (new_face == face) - return make_result(face); + if (new_face == face) return make_result(face); // Continue from the new face (hole). face = new_face; @@ -544,13 +501,16 @@ _walk_from_face(Face_const_handle face, else { // We know that p is not located inside the current face. We therefore // look for an edge on its outer boundary that intersects seg. - new_face = face; - for (outer_ccb_iter = face->outer_ccbs_begin(); - outer_ccb_iter != face->outer_ccbs_end(); ++outer_ccb_iter) - { - he = _intersection_with_ccb(*outer_ccb_iter,seg, p, p_is_left, - crossed_edges,is_on_edge, is_target, - cv_is_contained_in_seg,new_vertex); + auto new_face = face; + for (auto outer_ccb_iter = face->outer_ccbs_begin(); + outer_ccb_iter != face->outer_ccbs_end(); ++outer_ccb_iter) { + bool is_on_edge; + bool is_target; + Vertex_const_handle new_vertex; + Halfedge_const_handle he = + _intersection_with_ccb(*outer_ccb_iter,seg, p, p_is_left, + crossed_edges, is_on_edge, is_target, + cv_is_contained_in_seg, new_vertex); if (he == invalid_he && cv_is_contained_in_seg) { return _deal_with_curve_contained_in_segment(*outer_ccb_iter, p_is_left,p, @@ -585,10 +545,9 @@ _walk_from_face(Face_const_handle face, return default_result(); } -//----------------------------------------------------------------------------- -// Find a halfedge on the given CCB that intersects the given x-monotone -// curve, connecting the current landmark to the query point. -// +/*! finds a halfedge on the given CCB that intersects the given x-monotone + * curve, connecting the current landmark to the query point. + */ template typename Arr_landmarks_point_location::Halfedge_const_handle Arr_landmarks_point_location:: @@ -598,17 +557,15 @@ _intersection_with_ccb(Ccb_halfedge_const_circulator circ, Halfedge_set& crossed_edges, bool& is_on_edge, bool& is_target, bool& cv_is_contained_in_seg, - Vertex_const_handle & new_vertex) const -{ + Vertex_const_handle& new_vertex) const { is_on_edge = false; is_target = false; // Go over the CCB. - typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = - m_traits->is_in_x_range_2_object(); - Ccb_halfedge_const_circulator curr = circ , temp_circ; - const Halfedge_const_handle invalid_he; - Halfedge_const_handle he; + auto is_in_x_range = m_traits->is_in_x_range_2_object(); + Ccb_halfedge_const_circulator curr = circ , temp_circ; + const Halfedge_const_handle invalid_he; + Halfedge_const_handle he; bool cv_and_seg_overlap; do { he = curr; @@ -646,33 +603,28 @@ _intersection_with_ccb(Ccb_halfedge_const_circulator circ, // Check whether the current curve intersects seg an odd number of times. if (_have_odd_intersections(he->curve(), seg, p_is_left, is_on_edge,cv_and_seg_overlap, - cv_is_contained_in_seg) - && !(cv_and_seg_overlap || cv_is_contained_in_seg)) - { + cv_is_contained_in_seg) && + ! (cv_and_seg_overlap || cv_is_contained_in_seg)) { // Check if the query point lies on the current edge, or whether // it lies in its interior. if (is_on_edge) return _in_case_p_is_on_edge(he,crossed_edges,p,is_target); if ((!curr->target()->is_at_open_boundary()) && - is_in_x_range(seg, curr->target()->point())) - { + is_in_x_range(seg, curr->target()->point())) { // if the target point of curr is located on seg // we should walk from it to the query point if (m_traits->compare_y_at_x_2_object() - (curr->target()->point(), seg) == EQUAL) - { + (curr->target()->point(), seg) == EQUAL) { new_vertex = curr->target(); } } else if ((!curr->source()->is_at_open_boundary()) && - is_in_x_range(seg , curr->source()->point() )) - { + is_in_x_range(seg , curr->source()->point())) { // if the source point of curr is located on seg // we should walk from it to the query point if (m_traits->compare_y_at_x_2_object() - (curr->source()->point() , seg) == EQUAL) - { + (curr->source()->point(), seg) == EQUAL) { new_vertex = curr->source(); } } @@ -718,8 +670,7 @@ Arr_landmarks_point_location:: _in_case_p_is_on_edge(Halfedge_const_handle he, Halfedge_set& crossed_edges, const Point_2 & p, - bool & is_target) const -{ + bool & is_target) const { // cv and seg overlap, obviously we crossed it // the assumption is that each edge is crossed at most twice CGAL_assertion_msg(crossed_edges.count(he) < 2, @@ -728,14 +679,12 @@ _in_case_p_is_on_edge(Halfedge_const_handle he, crossed_edges.insert(he->twin()); // Check if p equals one of the edge end-vertices. if (! he->target()->is_at_open_boundary() && - m_traits->compare_xy_2_object()(he->target()->point(), p) == EQUAL) - { + m_traits->compare_xy_2_object()(he->target()->point(), p) == EQUAL) { // p is the target of the current halfedge. is_target = true; } else if (! he->source()->is_at_open_boundary() && - m_traits->compare_xy_2_object()(he->source()->point(), p) == EQUAL) - { + m_traits->compare_xy_2_object()(he->source()->point(), p) == EQUAL) { // Take the twin halfedge, so p equals its target. he = he->twin(); is_target = true; @@ -744,21 +693,17 @@ _in_case_p_is_on_edge(Halfedge_const_handle he, return he; } -//----------------------------------------------------------------------------- -// Check whether the given curve intersects a simple segment, which connects -// the current landmark to the query point, an odd number of times. -// +/*! checks whether the given curve intersects a simple segment, which connects + * the current landmark to the query point, an odd number of times. + */ template bool Arr_landmarks_point_location:: _have_odd_intersections(const X_monotone_curve_2& cv, const X_monotone_curve_2& seg, - bool p_is_left, - bool& p_on_curve, + bool p_is_left, bool& p_on_curve, bool& cv_and_seg_overlap, - bool& cv_is_contained_in_seg) const -{ - typename Traits_adaptor_2::Is_in_x_range_2 is_in_x_range = - m_traits->is_in_x_range_2_object(); + bool& cv_is_contained_in_seg) const { + auto is_in_x_range = m_traits->is_in_x_range_2_object(); p_on_curve = false; cv_and_seg_overlap = false; cv_is_contained_in_seg = false; @@ -776,9 +721,9 @@ _have_odd_intersections(const X_monotone_curve_2& cv, cv_right = m_traits->construct_max_vertex_2_object()(cv); if (cv_left_is_closed && cv_right_is_closed) { if (is_in_x_range(seg,cv_left) && is_in_x_range(seg,cv_right)) { - if ((m_traits->compare_y_at_x_2_object()(cv_left, seg) == EQUAL) && - (m_traits->compare_y_at_x_2_object()(cv_right, seg) == EQUAL)) - { + auto cmp_y_at_x = m_traits->compare_y_at_x_2_object(); + if ((cmp_y_at_x(cv_left, seg) == EQUAL) && + (cmp_y_at_x(cv_right, seg) == EQUAL)) { // cv is contained in seg non of the answer true or false is correct // we must set a special flag to distinguish this case cv_is_contained_in_seg = true; @@ -792,21 +737,18 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // Check if the left endpoint of cv has the same x-coordinate as the // right endpoint of seg. if (m_traits->compare_x_2_object() - (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) - { + (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) { if (! p_is_left && m_traits->compare_xy_2_object() - (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) - { + (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) { p_on_curve = true; return true; } else if (m_traits->is_vertical_2_object()(seg)) { + auto cmp_y_at_x = m_traits->compare_y_at_x_2_object(); // Special treatment for vertical segments. - Comparison_result res_l = - m_traits->compare_y_at_x_2_object()(seg_left, cv); - Comparison_result res_r = - m_traits->compare_y_at_x_2_object()(seg_right, cv); + Comparison_result res_l = cmp_y_at_x(seg_left, cv); + Comparison_result res_r = cmp_y_at_x(seg_right, cv); if ((p_is_left && res_l == EQUAL) || (! p_is_left && res_r == EQUAL)) { p_on_curve = true; return true; @@ -820,22 +762,18 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // Check if the right endpoint of cv has the same x-coordinate as the // left endpoint of seg. if (m_traits->compare_x_2_object() - (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) - { + (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) { if (p_is_left && m_traits->compare_xy_2_object() - (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) - { + (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) { p_on_curve = true; return true; } else if (m_traits->is_vertical_2_object()(seg)) { // Special treatment for vertical segments. - Comparison_result res_l = - m_traits->compare_y_at_x_2_object()(seg_left, cv); - Comparison_result res_r = - m_traits->compare_y_at_x_2_object()(seg_right, cv); - + auto cmp_y_at_x = m_traits->compare_y_at_x_2_object(); + Comparison_result res_l = cmp_y_at_x(seg_left, cv); + Comparison_result res_r = cmp_y_at_x(seg_right, cv); if ((p_is_left && res_l == EQUAL) || (! p_is_left && res_r == EQUAL)) { p_on_curve = true; return true; @@ -846,8 +784,8 @@ _have_odd_intersections(const X_monotone_curve_2& cv, } } // Compare the two left ends of cv and seg. - Comparison_result left_res; - const Arr_parameter_space bx_l = + Comparison_result left_res; + const Arr_parameter_space bx_l = m_traits->parameter_space_in_x_2_object()(cv, ARR_MIN_END); if (bx_l == ARR_LEFT_BOUNDARY) { // The left end of cv lies to the left of seg_left: @@ -858,11 +796,11 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // The left end of cv lies to the right of seg_left. // Compare the left endpoint of cv to seg. left_res = m_traits->compare_y_at_x_2_object() - (m_traits->construct_min_vertex_2_object()(cv), seg); + (m_traits->construct_min_vertex_2_object()(cv), seg); left_res = CGAL::opposite(left_res); } else { - const Arr_parameter_space by_l = + const Arr_parameter_space by_l = m_traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END); if (by_l == ARR_BOTTOM_BOUNDARY) // The left end of cv is at y = -oo, so cv obviously lies above it. @@ -876,8 +814,7 @@ _have_odd_intersections(const X_monotone_curve_2& cv, Comparison_result res = m_traits->compare_xy_2_object()(cv_left, seg_left); if (res != LARGER) { left_res = m_traits->compare_y_at_x_2_object()(seg_left, cv); - if (p_is_left && left_res == EQUAL) - { + if (p_is_left && left_res == EQUAL) { // In this case the query point p, which is the left endpoint of seg, // lies on cv. p_on_curve = true; @@ -904,8 +841,7 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // we must set a special flag to distinguish this case if (is_in_x_range(cv,( p_is_left ? seg_left : seg_right))) if (m_traits->compare_y_at_x_2_object() - ((p_is_left ? seg_left : seg_right), cv) == EQUAL) - { + ((p_is_left ? seg_left : seg_right), cv) == EQUAL) { p_on_curve = true; } cv_and_seg_overlap = true; @@ -913,8 +849,8 @@ _have_odd_intersections(const X_monotone_curve_2& cv, } } // Compare the two right ends of cv and seg. - Comparison_result right_res; - const Arr_parameter_space bx_r = + Comparison_result right_res; + const Arr_parameter_space bx_r = m_traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END); if (bx_r == ARR_RIGHT_BOUNDARY) { // The right end of cv lies to the right of seg_right: @@ -925,11 +861,11 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // The right end of cv lies to the left of seg_right. // Compare the right endpoint of cv to seg. right_res = m_traits->compare_y_at_x_2_object() - (m_traits->construct_max_vertex_2_object()(cv), seg); + (m_traits->construct_max_vertex_2_object()(cv), seg); right_res = CGAL::opposite(right_res); } else { - const Arr_parameter_space by_r = + const Arr_parameter_space by_r = m_traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END); if (by_r == ARR_BOTTOM_BOUNDARY) // The right end of cv is at y = -oo, so cv obviously lies above it. @@ -972,8 +908,7 @@ _have_odd_intersections(const X_monotone_curve_2& cv, // we must set a special flag to distinguish this case if (is_in_x_range(cv, (p_is_left ? seg_left : seg_right))) if (m_traits->compare_y_at_x_2_object() - ((p_is_left ? seg_left : seg_right), cv) == EQUAL) - { + ((p_is_left ? seg_left : seg_right), cv) == EQUAL) { p_on_curve = true; } cv_and_seg_overlap = true; @@ -986,6 +921,6 @@ _have_odd_intersections(const X_monotone_curve_2& cv, return (left_res != right_res); } -} //namespace CGAL +} // namespace CGAL #endif From 54a05c2a1ff68c2c3e068d2b2b6cb05a939f316f Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Sat, 16 Nov 2024 22:12:56 +0200 Subject: [PATCH 079/175] Fixed for arrangement on sphere; cleaned up. --- .../CGAL/Arr_landmarks_point_location.h | 64 +++++++++++++++++++ .../Arr_landmarks_pl_impl.h | 45 ++++++------- 2 files changed, 84 insertions(+), 25 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h index 923009e4456..8db96653d1b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -78,6 +79,16 @@ public: // Support cpp11::result_of using result_type = Result_type; +private: + using Gt2 = Geometry_traits_2; + using Left_side_category = + typename internal::Arr_complete_left_side_category::Category; + using Right_side_category = + typename internal::Arr_complete_right_side_category::Category; + using Left_or_right_sides_category = + typename Arr_two_sides_category::result; + protected: using Traits_adaptor_2 = Arr_traits_basic_adaptor_2; @@ -299,6 +310,59 @@ protected: bool& p_on_curve, bool& cv_and_seg_overlap, bool& cv_is_contained_in_seg) const; + + //! + template + std::pair + construct_segment(const Point_2& p, const Point_2& q, T const& traits, + ...) const { + X_monotone_curve_2 seg = traits.construct_x_monotone_curve_2_object()(p, q); + Comparison_result res = traits.compare_xy_2_object()(p, q); + return std::make_pair(seg, res); + } + + //*! + template + std::pair + construct_segment(const Point_2& p, const Point_2& q, T const& traits, + int) const { + X_monotone_curve_2 seg = traits.construct_x_monotone_curve_2_object()(p, q); + Comparison_result res = traits.compare_endpoints_xy_2_object()(seg); + return std::make_pair(seg, res); + } + + /*! Determines whether the $x$-coordinates of two points are equal. + */ + bool equal_x_2(const Point_2& p, const Point_2& q, + Arr_all_sides_oblivious_tag) const + { return (m_traits->compare_x_2_object()(p, q) == EQUAL); } + + /*! Determines whether the $x$-coordinates of two points are equal. + */ + bool equal_x_2(const Point_2& p, const Point_2& q, + Arr_has_identified_side_tag) const { + auto is_on_y_identification = m_traits->is_on_y_identification_2_object(); + if (is_on_y_identification(p)) { + return is_on_y_identification(q); + } + if (is_on_y_identification(q)) return false; + return (m_traits->compare_x_2_object()(p, q) == EQUAL); + } + + /*! Determines whether the $x$-coordinates of two points are equal. + */ + bool equal_x_2(const Point_2& p, const Point_2& q, + Arr_boundary_cond_tag) const { + auto param_space_in_x = m_traits->parameter_space_in_x_2_object(); + switch (param_space_in_x(p)) { + case ARR_LEFT_BOUNDARY: return (param_space_in_x(q) == ARR_LEFT_BOUNDARY); + case ARR_RIGHT_BOUNDARY: return (param_space_in_x(q) == ARR_LEFT_BOUNDARY); + case ARR_INTERIOR: return (m_traits->compare_x_2_object()(p, q) == EQUAL); + default: CGAL_error(); + } + CGAL_error(); + return false; + } }; } // namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index 7b2020843e8..01cb50c20ae 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -111,17 +111,16 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, const Point_2& p, // Create an x-monotone curve connecting the point associated with the // vertex vp and the query point p. const Point_2& vp = vh->point(); - X_monotone_curve_2 seg = - m_traits->construct_x_monotone_curve_2_object()(vp, p); - const bool seg_dir_right = - (m_traits->compare_xy_2_object()(vp, p) == SMALLER); + X_monotone_curve_2 seg; + Comparison_result res; + std::tie(seg, res) = construct_segment(vp, p, *m_traits, 0); + bool seg_dir_right = (res == SMALLER); Halfedge_around_vertex_const_circulator curr_iter = first; Halfedge_around_vertex_const_circulator next_iter = curr_iter; ++next_iter; auto is_between_cw = m_traits->is_between_cw_2_object(); // Traverse the halfedges around vp until we find the pair of adjacent // halfedges such as seg is located clockwise in between them. - do { bool eq_curr_iter, eq_next_iter; if (is_between_cw(seg, seg_dir_right, curr_iter->curve(), @@ -188,11 +187,10 @@ _find_face_around_vertex(Vertex_const_handle vh, const Point_2& p, // Create an x-monotone curve connecting the point associated with the // vertex vp and the query point p. const Point_2& vp = vh->point(); - X_monotone_curve_2 seg = - m_traits->construct_x_monotone_curve_2_object()(vp, p); - const bool seg_dir_right = - (m_traits->compare_xy_2_object()(vp, p) == SMALLER); - + X_monotone_curve_2 seg; + Comparison_result res; + std::tie(seg, res) = construct_segment(vp, p, *m_traits, 0); + bool seg_dir_right = (res == SMALLER); // Get the first incident halfedge around v and the next halfedge. Halfedge_around_vertex_const_circulator first = vh->incident_halfedges(); Halfedge_around_vertex_const_circulator curr, next; @@ -443,9 +441,10 @@ _walk_from_face(Face_const_handle face, const Point_2& np, const Point_2& p, Halfedge_set& crossed_edges) const { // Construct an x-monotone curve connecting the nearest landmark point np // to the query point p and check which CCB intersects this segment. - X_monotone_curve_2 seg = - m_traits->construct_x_monotone_curve_2_object()(np, p); - const bool p_is_left = (m_traits->compare_xy_2_object()(np, p) == LARGER); + X_monotone_curve_2 seg; + Comparison_result res; + std::tie(seg, res) = construct_segment(np, p, *m_traits, 0); + const bool p_is_left = (res == LARGER); const Halfedge_const_handle invalid_he; const Vertex_const_handle invalid_vertex; @@ -679,12 +678,12 @@ _in_case_p_is_on_edge(Halfedge_const_handle he, crossed_edges.insert(he->twin()); // Check if p equals one of the edge end-vertices. if (! he->target()->is_at_open_boundary() && - m_traits->compare_xy_2_object()(he->target()->point(), p) == EQUAL) { + m_traits->equal_2_object()(he->target()->point(), p)) { // p is the target of the current halfedge. is_target = true; } else if (! he->source()->is_at_open_boundary() && - m_traits->compare_xy_2_object()(he->source()->point(), p) == EQUAL) { + m_traits->equal_2_object()(he->source()->point(), p)) { // Take the twin halfedge, so p equals its target. he = he->twin(); is_target = true; @@ -736,11 +735,9 @@ _have_odd_intersections(const X_monotone_curve_2& cv, if (cv_left_is_closed) { // Check if the left endpoint of cv has the same x-coordinate as the // right endpoint of seg. - if (m_traits->compare_x_2_object() - (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) { - if (! p_is_left && - m_traits->compare_xy_2_object() - (m_traits->construct_min_vertex_2_object()(cv), seg_right) == EQUAL) { + auto min_p = m_traits->construct_min_vertex_2_object()(cv); + if (equal_x_2(min_p, seg_right, Left_or_right_sides_category())) { + if (! p_is_left && m_traits->equal_2_object()(min_p, seg_right)) { p_on_curve = true; return true; } @@ -761,11 +758,9 @@ _have_odd_intersections(const X_monotone_curve_2& cv, if (cv_right_is_closed) { // Check if the right endpoint of cv has the same x-coordinate as the // left endpoint of seg. - if (m_traits->compare_x_2_object() - (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) { - if (p_is_left && - m_traits->compare_xy_2_object() - (m_traits->construct_max_vertex_2_object()(cv), seg_left) == EQUAL) { + auto max_p = m_traits->construct_max_vertex_2_object()(cv); + if (equal_x_2(max_p, seg_left, Left_or_right_sides_category())) { + if (p_is_left && m_traits->equal_2_object()(max_p, seg_left)) { p_on_curve = true; return true; } From 18a542b92d5381e9392b3110e85bdd3367a4ba19 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 16 Dec 2024 18:29:10 +0100 Subject: [PATCH 080/175] add container images for Doxygen --- .devcontainer/doxygen-cgal/Dockerfile | 55 +++++++++++++++++++ .devcontainer/doxygen-cgal/Makefile | 23 ++++++++ .../cgal-NO_ADDITIONAL_DETAILS.patch | 44 +++++++++++++++ .devcontainer/doxygen-cgal/devcontainer.json | 14 +++++ .devcontainer/doxygen-cgal/distrobox.ini | 29 ++++++++++ 5 files changed, 165 insertions(+) create mode 100644 .devcontainer/doxygen-cgal/Dockerfile create mode 100644 .devcontainer/doxygen-cgal/Makefile create mode 100644 .devcontainer/doxygen-cgal/cgal-NO_ADDITIONAL_DETAILS.patch create mode 100644 .devcontainer/doxygen-cgal/devcontainer.json create mode 100644 .devcontainer/doxygen-cgal/distrobox.ini diff --git a/.devcontainer/doxygen-cgal/Dockerfile b/.devcontainer/doxygen-cgal/Dockerfile new file mode 100644 index 00000000000..81cb1f954ce --- /dev/null +++ b/.devcontainer/doxygen-cgal/Dockerfile @@ -0,0 +1,55 @@ +# Use an official Fedora as a parent image for the build stage +FROM fedora:latest AS sources_deps + +# Set environment variables to non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +# Install dependencies +RUN dnf update -y && dnf install -y \ + wget \ + make \ + gcc \ + gcc-c++ \ + patch \ + cmake \ + bison \ + flex \ + unzip \ + python3 \ + && dnf clean all + +# Copy the patch file to the build context +COPY cgal-NO_ADDITIONAL_DETAILS.patch . + +FROM sources_deps AS build + +# Build and install Doxygen from sources +ARG DOXYGEN_VERSION=1.9.6 +ARG MAKEFLAGS=-j$(nproc) +RUN if [ -n "$DEBUG"];then set -x && make --version && ls -lZ /tmp && id; fi \ + && DOXYGEN_VERSION_UNDERSCORE=$(echo ${DOXYGEN_VERSION} | sed 's/\./_/g') \ + && wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_${DOXYGEN_VERSION_UNDERSCORE}.zip \ + && unzip Release_${DOXYGEN_VERSION_UNDERSCORE}.zip \ + && cd doxygen-Release_${DOXYGEN_VERSION_UNDERSCORE} \ + && patch -p1 < ../cgal-NO_ADDITIONAL_DETAILS.patch \ + && mkdir build \ + && cd build \ + && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. \ + && cmake --build . \ + && cmake --install . \ + && mkdir -p /usr/local/share/doc/doxygen && cp ../LICENSE /usr/local/share/doc/doxygen/LICENSE.TXT \ + && cd ../.. \ + && rm -rf doxygen-Release_${DOXYGEN_VERSION_UNDERSCORE} Release_${DOXYGEN_VERSION_UNDERSCORE}.zip + +# Use a smaller base image for the final stage +FROM fedora:latest + +# Install necessary runtime dependencies +RUN set -x \ + && dnf update -y && dnf install -y graphviz 'perl(Getopt::Std)' tex-bibtex cmake python3-lxml python3-pyquery \ + && dnf clean all + +# Copy Doxygen from the build stage +COPY --from=build /usr/local/bin/doxygen /usr/local/bin +COPY --from=build /usr/local/share/doc/doxygen/LICENSE.TXT /usr/local/share/doc/doxygen/LICENSE.TXT +RUN doxygen --version diff --git a/.devcontainer/doxygen-cgal/Makefile b/.devcontainer/doxygen-cgal/Makefile new file mode 100644 index 00000000000..9413173b5a7 --- /dev/null +++ b/.devcontainer/doxygen-cgal/Makefile @@ -0,0 +1,23 @@ +SHELL := /bin/bash +DOXYGEN_VERSIONS := 1.12.0 1.11.0 1.10.0 1.9.8 1.9.7 1.9.6 + +.PHONY: all build-% push-% build push + +all: build + @echo "Use `$(MAKE) push` to push the images to the registry." + +build-%: + @echo "MAKEFLAGS: $(MAKEFLAGS)" + @echo "Building Doxygen version $*..." + if [ "$$(getenforce || true)" == "Enforcing" ]; then Z=:z; else Z=; fi; \ + F="$(MAKEFLAGS)"; F=$${F##*fifo:}; F=$${F%% *}; \ + if [ -p "$$F" ]; then echo "The GNU make FIFO file exists:"; ls -l $$F; VOLUME_ARGS="-v $$F:$$F$$Z"; echo -- $$VOLUME_ARGS; fi; \ + podman build --build-arg DOXYGEN_VERSION=$* --build-arg "MAKEFLAGS=$(MAKEFLAGS)" $$VOLUME_ARGS -t cgal/doxygen:$* . + +push-%: build-% + @echo "Pushing cgal/doxygen:$*..." + podman push cgal/doxygen:$* + +build: $(foreach version,$(DOXYGEN_VERSIONS),build-$(version)) + +push: $(foreach version,$(DOXYGEN_VERSIONS),push-$(version)) diff --git a/.devcontainer/doxygen-cgal/cgal-NO_ADDITIONAL_DETAILS.patch b/.devcontainer/doxygen-cgal/cgal-NO_ADDITIONAL_DETAILS.patch new file mode 100644 index 00000000000..bb6e63b274d --- /dev/null +++ b/.devcontainer/doxygen-cgal/cgal-NO_ADDITIONAL_DETAILS.patch @@ -0,0 +1,44 @@ +diff --git a/src/config.xml b/src/config.xml +index 13910958a6..31f1354e44 100644 +--- a/src/config.xml ++++ b/src/config.xml +@@ -893,6 +893,18 @@ Go to the next section or return to the + \note This will also disable the warnings about undocumented members + that are normally produced when \ref cfg_warnings "WARNINGS" is + set to \c YES. ++]]> ++ ++ ++ ++ ++ +diff --git a/src/memberdef.cpp b/src/memberdef.cpp +index 08d9bf24c5..ab04e994c5 100644 +--- a/src/memberdef.cpp ++++ b/src/memberdef.cpp +@@ -2501,6 +2501,7 @@ bool MemberDefImpl::hasDetailedDescription() const + if (!m_hasDetailedDescriptionCached) + { + bool extractAll = Config_getBool(EXTRACT_ALL); ++ bool xAllNoDetailedSec = Config_getBool(NO_ADDITIONAL_DETAILS); + bool alwaysDetailedSec = Config_getBool(ALWAYS_DETAILED_SEC); + bool repeatBrief = Config_getBool(REPEAT_BRIEF); + bool briefMemberDesc = Config_getBool(BRIEF_MEMBER_DESC); +@@ -2512,7 +2513,7 @@ bool MemberDefImpl::hasDetailedDescription() const + // the member has detailed documentation because the user added some comments + bool docFilter = + // extract all is enabled +- extractAll || ++ (extractAll && !xAllNoDetailedSec) || + // has detailed docs + !documentation().isEmpty() || + // has inbody docs diff --git a/.devcontainer/doxygen-cgal/devcontainer.json b/.devcontainer/doxygen-cgal/devcontainer.json new file mode 100644 index 00000000000..0624727085f --- /dev/null +++ b/.devcontainer/doxygen-cgal/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "CGAL Doxygen Dev Container", + "image": "docker.io/cgal/doxygen:1.12.0", + "features": { + "ghcr.io/devcontainers/features/git:1.3.2": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cmake-tools" + ] + } + }, +} \ No newline at end of file diff --git a/.devcontainer/doxygen-cgal/distrobox.ini b/.devcontainer/doxygen-cgal/distrobox.ini new file mode 100644 index 00000000000..55c7c546481 --- /dev/null +++ b/.devcontainer/doxygen-cgal/distrobox.ini @@ -0,0 +1,29 @@ +[distrobox-doxygen-1.12.0] +image=cgal/doxygen:1.12.0 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.12.0 + +[distrobox-doxygen-1.11.0] +image=cgal/doxygen:1.11.0 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.11.0 + +[distrobox-doxygen-1.10.0] +image=cgal/doxygen:1.10.0 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.10.0 + +[distrobox-doxygen-1.9.8] +image=cgal/doxygen:1.9.8 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.9.8 + +[distrobox-doxygen-1.9.7] +image=cgal/doxygen:1.9.7 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.9.7 + +[distrobox-doxygen-1.9.6] +image=cgal/doxygen:1.9.6 +exported_bins="/usr/local/bin/doxygen /usr/bin/perl /usr/bin/cmake /usr/bin/python3" +exported_bins_path=$HOME/.local/bin-doxygen-1.9.6 From a269cd37a6b86f9e7a2544662fb82a87aab6d937 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 16 Dec 2024 15:17:37 +0100 Subject: [PATCH 081/175] cgal_stylesheet.css must be taken from ../Manual Revert "Merge pull request #8331 from albert-github/feature/bug_cgal_stylesheet" This reverts commit 62de71bcfb38419fbe9cf1279eb53a91b732e220, reversing changes made to 3b4349cfbb8da2370f11ca67d3436b6714b2c86e. --- Documentation/doc/Documentation/Doxyfile.in | 1 + .../doc/resources/1.10.0/BaseDoxyfile.in | 18 ------------------ Documentation/doc/resources/1.10.0/header.html | 1 + .../doc/resources/1.10.0/header_package.html | 1 + .../doc/resources/1.8.13/BaseDoxyfile.in | 18 ------------------ Documentation/doc/resources/1.8.13/header.html | 1 - .../doc/resources/1.8.13/header_package.html | 1 - .../doc/resources/1.9.6/BaseDoxyfile.in | 18 ------------------ Documentation/doc/resources/1.9.6/header.html | 1 - .../doc/resources/1.9.6/header_package.html | 1 - 10 files changed, 3 insertions(+), 58 deletions(-) diff --git a/Documentation/doc/Documentation/Doxyfile.in b/Documentation/doc/Documentation/Doxyfile.in index 1b174bb8635..d3e21f24daa 100644 --- a/Documentation/doc/Documentation/Doxyfile.in +++ b/Documentation/doc/Documentation/Doxyfile.in @@ -19,6 +19,7 @@ FILTER_PATTERNS = *.txt=${CMAKE_BINARY_DIR}/pkglist_filter HTML_EXTRA_FILES += ${CGAL_DOC_RESOURCE_DIR}/hacks.js \ ${CGAL_DOC_RESOURCE_DIR}/menu_version.js \ + ${CGAL_DOC_RESOURCE_DIR}/cgal_stylesheet.css \ ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib \ ${CMAKE_BINARY_DIR}/how_to_cite.html \ ${CGAL_PACKAGE_DOC_DIR}/fig/g-196x196-doc.png diff --git a/Documentation/doc/resources/1.10.0/BaseDoxyfile.in b/Documentation/doc/resources/1.10.0/BaseDoxyfile.in index d37679fa4a5..0cc706e0f5d 100644 --- a/Documentation/doc/resources/1.10.0/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.10.0/BaseDoxyfile.in @@ -486,24 +486,6 @@ HTML_HEADER = ${CGAL_DOC_HEADER_PACKAGE} HTML_FOOTER = ${CGAL_DOC_RESOURCE_DIR}/footer.html -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). -# Note: Since the styling of scrollbars can currently not be overruled in -# Webkit/Chromium, the styling will be left out of the default doxygen.css if -# one or more extra stylesheets have been specified. So if scrollbar -# customization is desired it has to be added explicitly. For an example see the -# documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = ${CGAL_DOC_RESOURCE_DIR}/cgal_stylesheet.css - # Doxygen stores a couple of settings persistently in the browser (via e.g. # cookies). By default these settings apply to all HTML pages generated by # doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store diff --git a/Documentation/doc/resources/1.10.0/header.html b/Documentation/doc/resources/1.10.0/header.html index 3549905fa84..0b1efb0d3c4 100644 --- a/Documentation/doc/resources/1.10.0/header.html +++ b/Documentation/doc/resources/1.10.0/header.html @@ -26,6 +26,7 @@ $search $mathjax $darkmode + $extrastylesheet diff --git a/Documentation/doc/resources/1.10.0/header_package.html b/Documentation/doc/resources/1.10.0/header_package.html index 19b6e358b4c..d39b6ab93dc 100644 --- a/Documentation/doc/resources/1.10.0/header_package.html +++ b/Documentation/doc/resources/1.10.0/header_package.html @@ -43,6 +43,7 @@ + $mathjax $darkmode diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 7fb06630c20..4bd2e290d30 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -477,24 +477,6 @@ HTML_HEADER = ${CGAL_DOC_HEADER_PACKAGE} HTML_FOOTER = ${CGAL_DOC_RESOURCE_DIR}/footer.html -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). -# Note: Since the styling of scrollbars can currently not be overruled in -# Webkit/Chromium, the styling will be left out of the default doxygen.css if -# one or more extra stylesheets have been specified. So if scrollbar -# customization is desired it has to be added explicitly. For an example see the -# documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = ${CGAL_DOC_RESOURCE_DIR}/cgal_stylesheet.css - # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the diff --git a/Documentation/doc/resources/1.8.13/header.html b/Documentation/doc/resources/1.8.13/header.html index 8c8b86f5b9d..3400f24ed80 100644 --- a/Documentation/doc/resources/1.8.13/header.html +++ b/Documentation/doc/resources/1.8.13/header.html @@ -17,7 +17,6 @@ $treeview $search $mathjax - $extrastylesheet diff --git a/Documentation/doc/resources/1.8.13/header_package.html b/Documentation/doc/resources/1.8.13/header_package.html index 544fd3ced7f..4c3cd1e8591 100644 --- a/Documentation/doc/resources/1.8.13/header_package.html +++ b/Documentation/doc/resources/1.8.13/header_package.html @@ -33,7 +33,6 @@ - - $mathjax $darkmode From 5eddbc26aea445444e480f1c2ad40379d60532df Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 16 Dec 2024 18:17:11 +0100 Subject: [PATCH 082/175] fix build with Doxygen 1.10 and later --- Documentation/doc/CMakeLists.txt | 48 ++++++++++++++++--- .../Developer_manual/cmakelist_script.txt | 2 +- .../Developer_manual/developer_manual.txt | 1 + .../Doxygen_for_CGAL.md} | 20 ++++---- Documentation/doc/scripts/pkglist_filter.py | 12 ++--- 5 files changed, 57 insertions(+), 26 deletions(-) rename Documentation/doc/{Customizations.txt => Documentation/Doxygen_for_CGAL.md} (77%) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 52ee7faa48b..b251731cafc 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -24,6 +24,8 @@ else() set(CGAL_ROOT "${CMAKE_SOURCE_DIR}") endif() +cmake_minimum_required(VERSION 3.18..3.29) # for list(SORT ... COMPARE NATURAL) + find_package(Doxygen REQUIRED) find_package(Python3 REQUIRED COMPONENTS Interpreter) @@ -32,7 +34,7 @@ if (NOT Python3_EXECUTABLE) return() endif() -message(STATUS ${Python3_EXECUTABLE}) +message(VERBOSE "Using Python version ${Python3_VERSION}: ${Python3_EXECUTABLE}") if(NOT DOXYGEN_FOUND) message(WARNING "Cannot build the documentation without Doxygen!") @@ -275,7 +277,7 @@ set(CGAL_DOC_DXY_DIR "${CMAKE_BINARY_DIR}/doc_dxy") file(MAKE_DIRECTORY "${CGAL_DOC_DXY_DIR}") #Setting the resource directory depending on the version of doxygen -set(CGAL_DOC_RESOURCE_DIR_DEFAULT "${CMAKE_CURRENT_LIST_DIR}/resources/1.10.0") +set(CGAL_DOC_RESOURCE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/resources") # first look if resources for the specific doxygen version is available, fallback # on the default otherwise @@ -283,12 +285,46 @@ set(CGAL_DOC_RESOURCE_DIR_DEFAULT "${CMAKE_CURRENT_LIST_DIR}/resources/1.10.0") #select only the version number (not the commit hash) string(REPLACE " " ";" DOXYGEN_VERSION ${DOXYGEN_VERSION}) list(GET DOXYGEN_VERSION 0 DOXYGEN_VERSION) +message(VERBOSE "Doxygen version ${DOXYGEN_VERSION}: ${DOXYGEN_EXECUTABLE}") -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") - set(CGAL_DOC_RESOURCE_DIR - "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") +# The Doxygen version is search in that sorted list (to find the index for which the version is less or equal) +set(CGAL_DOXYGEN_RESOURCES_VERSIONS 1.8.13 1.9.6 1.10.0) +list(SORT CGAL_DOXYGEN_RESOURCES_VERSIONS COMPARE NATURAL) + +# The GLOB is here to check that the list in CGAL_DOXYGEN_RESOURCES_VERSIONS is correct. +# CGAL_DOXYGEN_RESOURCES_DIRS is also used below. +file(GLOB CGAL_DOXYGEN_RESOURCES_DIRS + RELATIVE "${CGAL_DOC_RESOURCE_PREFIX_DIR}" + "${CGAL_DOC_RESOURCE_PREFIX_DIR}/*") +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}]") +endif() + +function(CGAL_insert_in_sorted_list list_name value) + set(list ${${list_name}}) + if(NOT value IN_LIST list) + list(APPEND list "${value}") + list(SORT list COMPARE NATURAL) + endif() + 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) else() - set(CGAL_DOC_RESOURCE_DIR "${CGAL_DOC_RESOURCE_DIR_DEFAULT}") + CGAL_insert_in_sorted_list(CGAL_DOXYGEN_RESOURCES_VERSIONS ${DOXYGEN_VERSION}) + list(FIND CGAL_DOXYGEN_RESOURCES_VERSIONS ${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") +else() + message(VERBOSE "Using Doxygen resources from ${CGAL_DOC_RESOURCE_DIR}") endif() set(CGAL_DOC_BIBLIO_DIR "${CMAKE_CURRENT_LIST_DIR}/biblio") diff --git a/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt b/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt index eeae486b236..da9bc70ce2a 100644 --- a/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt +++ b/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt @@ -35,6 +35,6 @@ These options should suffice to create a `CMakeLists.txt` script for most directories containing programs. However, in some special cases, it might still be required to create the script manually, for instance, if some source files/executables need a different linking than -other source files. The Section \subpage devman_create_and_use_a_cmakelist provides more details. +other source files. The Section \ref devman_create_and_use_a_cmakelist provides more details. */ diff --git a/Documentation/doc/Documentation/Developer_manual/developer_manual.txt b/Documentation/doc/Documentation/Developer_manual/developer_manual.txt index a133c654aba..6c3b3f0504a 100644 --- a/Documentation/doc/Documentation/Developer_manual/developer_manual.txt +++ b/Documentation/doc/Documentation/Developer_manual/developer_manual.txt @@ -23,4 +23,5 @@ The developer manual is primarily aimed at \cgal developers, but may also be int - \subpage devman_info - \subpage devman_create_cgal_CMakeLists - \subpage deprecated +- \subpage Doxygen_for_CGAL */ diff --git a/Documentation/doc/Customizations.txt b/Documentation/doc/Documentation/Doxygen_for_CGAL.md similarity index 77% rename from Documentation/doc/Customizations.txt rename to Documentation/doc/Documentation/Doxygen_for_CGAL.md index c1debd91db6..2c13a7cc054 100644 --- a/Documentation/doc/Customizations.txt +++ b/Documentation/doc/Documentation/Doxygen_for_CGAL.md @@ -1,4 +1,4 @@ -# Doxygen for CGAL # +\page Doxygen_for_CGAL Doxygen for CGAL This is the documentation of doxygen hacks that are applied to make the output of Doxygen more suitable to CGAL. It explains the general @@ -14,17 +14,17 @@ hacks that create what you see. ### Package Overview ### The package overview is build by having a special command that is -filtered by the python script pkglist_filter.py. +filtered by the python script `pkglist_filter.py`. -A command has to be of the form \package_listing{PKG_NAME}, where -PKG_NAME cannot contain a closing }. +A command has to be of the form `\package_listing{PKG_NAME}`, where +`PKG_NAME` cannot contain a closing `}`. The command is replaced by the text between the two delimiters -PkgDescBegin and PkgDescEnd in the file ../PKG_NAME/doc/PKG_NAME/PackageDescription.txt +`cgalPkgDescriptionBegin` and `cgalPkgDescriptionEnd` in the file `../PKG_NAME/doc/PKG_NAME/PackageDescription.txt` -If PKG_NAME is of the form A/B the selected file is -../A/doc/B/PackageDescription.txt. This is to support packages like -TDS_2, which don't reside in their own packages in the SCM. +If `PKG_NAME` is of the form `A/B` the selected file is +`../A/doc/B/PackageDescription.txt`. This is to support packages like +`TDS_2`, which don't reside in their own packages in the SCM. ### Footnotes ### @@ -50,13 +50,13 @@ LaTex. This hack fiddles with the internal structures and functions of the treeview to remove the unnecessary intermediate top-level module part. -It assigns the first element of the module array (found in module.js) +It assigns the first element of the module array (found in `module.js`) to the Reference Manual entry. This makes the tree view link go to that group directly instead of the intermediate link. It also removes one level of nesting. Unfortunately this changes the overall tree structure. To adjust for -that we hijack the gotoNode function of navtree.js and *augment* it +that we hijack the `gotoNode` function of `navtree.js` and *augment* it with an additional check for the specific tree level we borked and redirect it. diff --git a/Documentation/doc/scripts/pkglist_filter.py b/Documentation/doc/scripts/pkglist_filter.py index 92208a6f4d9..f6cbff6c7d9 100755 --- a/Documentation/doc/scripts/pkglist_filter.py +++ b/Documentation/doc/scripts/pkglist_filter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import codecs import re @@ -28,16 +28,10 @@ def main(argv): for l in pkgdesc: do_print = do_print or re.match(".*cgalPkgDescriptionBegin.*", l) if(do_print): - if hasattr(sys.stdout, 'buffer'): - sys.stdout.buffer.write(l.encode('utf-8')) #python3 - else: - sys.stdout.write(l.encode('utf-8')) #python2 + sys.stdout.buffer.write(l.encode('utf-8')) do_print = do_print and (not re.match(".*cgalPkgDescriptionEnd.*", l)) else: - if hasattr(sys.stdout, 'buffer'): - sys.stdout.buffer.write(line.encode('utf-8')) #python3 - else: - sys.stdout.write(line.encode('utf-8')) #python2 + sys.stdout.buffer.write(line.encode('utf-8')) if __name__ == "__main__": main(sys.argv) From 08a3f5240d0647eafe56fe5bac8b9b4a6df0924d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Dec 2024 16:02:22 +0100 Subject: [PATCH 083/175] add a few vscode extensions to the dev container --- .devcontainer/doxygen-cgal/devcontainer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/doxygen-cgal/devcontainer.json b/.devcontainer/doxygen-cgal/devcontainer.json index 0624727085f..f1c9f05badb 100644 --- a/.devcontainer/doxygen-cgal/devcontainer.json +++ b/.devcontainer/doxygen-cgal/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "CGAL Doxygen Dev Container", + "name": "CGAL Doxygen Dev Container, version 1.12.0, with CGAL patch", "image": "docker.io/cgal/doxygen:1.12.0", "features": { "ghcr.io/devcontainers/features/git:1.3.2": {} @@ -7,7 +7,9 @@ "customizations": { "vscode": { "extensions": [ - "ms-vscode.cmake-tools" + "ms-vscode.cmake-tools", + "bbenoist.Doxygen", + "ms-vscode.cpptools" ] } }, From 5c70d487a1f817b0c50fcb49b66244789d4823cd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Dec 2024 18:27:13 +0100 Subject: [PATCH 084/175] 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 085/175] 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 086/175] 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 a3d5856c2e386341890b701c52f2f4b7aa68136b Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 17 Dec 2024 22:40:11 +0200 Subject: [PATCH 087/175] Added a note regarding fixes of the Landmark point-location strategy so that it can be applied to arrangements on a sphere --- Installation/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7a159e087bf..f95d719aa56 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -10,6 +10,7 @@ ### [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. +- Fixed the Landmark point-location strategy so that it can be applied to arrangements on a sphere. ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1) From 52e8d15de24e48c6a6a149c72c249c9bb2a4a2d3 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 17 Dec 2024 23:12:04 +0200 Subject: [PATCH 088/175] Enhanced the description of the landmark point-location strategy --- .../Arrangement_on_surface_2.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index ba6f1adb152..64d3604362f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -1438,14 +1438,15 @@ vary according to the user choice.} for answering queries: points or choosing points on a grid, are also available; see the Reference Manual for more details. - The landmark strategy requires that the type of the attached - arrangement be an instance of the `Arrangement_2` class - template, where the `Traits` parameter is substituted by a - geometry-traits class that models the `ArrangementLandmarkTraits_2` - concept, which refines the basic `ArrangementBasicTraits_2` concept; - see Section \ref aos_sssec-tr_landmarks_concept for details. Most - traits classes included in the \ref PkgArrangementOnSurface2 package - are models of this refined concept. + The arrangement attached to the landmark strategy must be either (i) + an instance of the `Arrangement_2` class template, where + the `Traits` parameter is substituted by a geometry-traits class + that models the `ArrangementLandmarkTraits_2` concept, or (ii) an + instance of the `Arrangement_on_surface_2` + class template, where the `GeomTraits` is similarly substituted; + see Section \ref aos_sssec-tr_landmarks_concept for details about + this concept. Most traits classes included in the \ref + PkgArrangementOnSurface2 package are models of this refined concept.
  • `Arr_trapezoid_ric_point_location` implements an improved variant of Mulmuley's point-location algorithm From 820762da524216fe8fa6badb38b25fa18d9d2bd5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 11:00:55 +0100 Subject: [PATCH 089/175] 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 090/175] 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 091/175] 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 98b1fd80637d70c90c67155fae6cf715bbf65f80 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 18 Dec 2024 17:25:02 +0200 Subject: [PATCH 092/175] Removed erroneous and useless construct --- .../CGAL/Arr_point_location/Arr_landmarks_pl_impl.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index 01cb50c20ae..545d4a5ac52 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -23,14 +23,6 @@ namespace CGAL { -// Helper trait to check for the presence of nested Is_on_x_identification_2 -template > -struct has_is_on_x_identification_2 : std::false_type {}; - -// Specialization if the nested type Is_on_x_identification_2 exists -template -struct has_is_on_x_identification_2> : std::true_type {}; - /*! locates the arrangement feature containing the given point. */ template From 604bac4dad628c8956ce37585ce8232ec70bac16 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 18 Dec 2024 17:25:26 +0200 Subject: [PATCH 093/175] Activate the landmark point-location --- .../sgm_point_location.cpp | 42 +++++-------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp index 565f903cddc..8d53c465581 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp @@ -36,13 +36,6 @@ using Trap_pl = CGAL::Arr_trapezoid_ric_point_location; using Geom_traits = Gm::Geometry_traits_2; using Point_2 = Geom_traits::Point_2; -using Point_location_result = CGAL::Arr_point_location_result; -using Query_result = std::pair; - -using Vertex_const_handle = Gm::Vertex_const_handle; -using Halfedge_const_handle = Gm::Halfedge_const_handle; -using Face_const_handle = Gm::Face_const_handle; - int main() { Gm_polyhedron p; p.make_tetrahedron(Point_3(1.0, 0.0, 0.0), Point_3(0.0, 1.0, 0.0), @@ -50,7 +43,7 @@ int main() { Gm gm; Naive_pl naive_pl(gm); - // Landmarks_pl landmarks_pl(gm); + Landmarks_pl landmarks_pl(gm); Walk_pl walk_pl(gm); // Trap_pl trap_pl(gm); @@ -70,30 +63,17 @@ int main() { locate_point(naive_pl, points[1]); locate_point(naive_pl, points[2]); + // locate_point(walk_pl, points[0]); + // locate_point(walk_pl, points[1]); + // locate_point(walk_pl, points[2]); + + locate_point(landmarks_pl, points[0]); + locate_point(landmarks_pl, points[1]); + locate_point(landmarks_pl, points[2]); + // locate_point(trap_pl, points[0]); - - //////// - std::list results; - // The following cause an assertion failure. - // CGAL::locate(gm, &points[0], &points[3], std::back_inserter(results)); - - // Print the results. - for (auto it = results.begin(); it != results.end(); ++it) { - std::cout << "The point (" << it->first << ") is located "; - if (const Face_const_handle* f = - std::get_if(&(it->second))) // inside a face - std::cout << "inside " - << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") - << " face.\n"; - else if (const Halfedge_const_handle* e = - std::get_if(&(it->second))) // on an edge - std::cout << "on an edge: " << (*e)->curve() << std::endl; - else if (const Vertex_const_handle* v = - std::get_if(&(it->second))) // on a vertex - std::cout << "on " - << (((*v)->is_isolated()) ? "an isolated" : "a") - << " vertex: " << (*v)->point() << std::endl; - } + // locate_point(trap_pl, points[1]); + // locate_point(trap_pl, points[2]); return 0; } From 8e5fab0c98479c7383af0207f76d2eb85c96591e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 18 Dec 2024 16:22:18 +0100 Subject: [PATCH 094/175] 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 095/175] 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 096/175] 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 097/175] 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 098/175] 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 099/175] 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 100/175] 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 101/175] 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 102/175] 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 103/175] 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 104/175] 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 105/175] 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 ae81703f6c7f401fd3685ee1d5f224782ce6acd3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 20 Dec 2024 11:56:46 +0000 Subject: [PATCH 106/175] Stream_support: Document that WKT can also handle 3D points --- Stream_support/include/CGAL/IO/WKT.h | 15 +++-- .../test/Stream_support/test_WKT.cpp | 66 ++++++++++++++++++- 2 files changed, 74 insertions(+), 7 deletions(-) diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index 3a3eea129d6..bf53a7b3398 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -156,9 +156,9 @@ bool read_multi_point_WKT(std::istream& in, //! //! The first line starting with LINESTRING in the stream will be used. //! -//! \tparam Linestring must be a model of `RandomAccessRange` of `CGAL::Point_2`, +//! \tparam Linestring must be a model of `RandomAccessRange` of `CGAL::Point_2` or `CGAL::Point_3`, //! and have: -//! - a function `push_back()` that takes a `CGAL::Point_2`. +//! - a function `push_back()` that takes a point. //! - a function `clear()`, //! - a function `resize()` that takes a `size_type` //! - an `operator[]()` that takes a `size_type`. @@ -166,6 +166,7 @@ bool read_multi_point_WKT(std::istream& in, //! \attention Only %Cartesian Kernels with double or float as `FT` are supported. //! //! \see `CGAL::Point_2` +//! \see `CGAL::Point_3` template bool read_linestring_WKT(std::istream& in, LineString& polyline) @@ -209,7 +210,6 @@ bool read_linestring_WKT(std::istream& in, //! //! \attention Only %Cartesian Kernels with double or float as `FT` are supported. //! -//! \see `CGAL::Point_2` template bool read_multi_linestring_WKT(std::istream& in, MultiLineString& mls) @@ -359,11 +359,12 @@ bool read_multi_polygon_WKT(std::istream& in, //! //! \brief writes `point` into a WKT stream. //! -//! \tparam Point is a `CGAL::Point_2` +//! \tparam Point is a `CGAL::Point_2` or `CGAL::Point_3` //! //! \attention Only %Cartesian Kernels with double or float as `FT` are supported. //! //! \see `CGAL::Point_2` +//! \see `CGAL::Point_3` template std::ostream& write_point_WKT(std::ostream& out, const Point& point) @@ -399,11 +400,12 @@ std::ostream& write_polygon_WKT(std::ostream& out, //! //! \brief writes the content of `ls` into a WKT stream. //! -//! \tparam LineString must be a `RandomAccessRange` of `CGAL::Point_2`. +//! \tparam LineString must be a `RandomAccessRange` of `CGAL::Point_2` or `CGAL::Point_3`. //! //! \attention Only %Cartesian Kernels with double or float as `FT` are supported. //! //!\see `CGAL::Point_2` +//!\see `CGAL::Point_3` template std::ostream& write_linestring_WKT(std::ostream& out, LineString ls) @@ -420,11 +422,12 @@ std::ostream& write_linestring_WKT(std::ostream& out, //! //! \brief writes the content of `mp` into a WKT stream. //! -//! \tparam MultiPoint must be a `RandomAccessRange` of `CGAL::Point_2`. +//! \tparam MultiPoint must be a `RandomAccessRange` of `CGAL::Point_2` or `CGAL::Point_3`. //! //! \attention Only %Cartesian Kernels with double or float as `FT` are supported. //! //!\see `CGAL::Point_2` +//!\see `CGAL::Point_2` template std::ostream& write_multi_point_WKT(std::ostream& out, MultiPoint& mp) diff --git a/Stream_support/test/Stream_support/test_WKT.cpp b/Stream_support/test/Stream_support/test_WKT.cpp index 90d9b8da4b2..7af1e011668 100644 --- a/Stream_support/test/Stream_support/test_WKT.cpp +++ b/Stream_support/test/Stream_support/test_WKT.cpp @@ -3,8 +3,8 @@ #include #include - #include +#include #include #include @@ -17,7 +17,69 @@ typedef std::vector MultiPoint typedef std::vector MultiLinestring; typedef std::vector MultiPolygon; + +typedef CGAL::Point_3 Point3; +typedef std::vector Linestring3; +typedef std::vector MultiPoint3; +typedef std::vector MultiLinestring3; //////////////////////////////////////////////////////////////////////////////////////////////////// + +bool test_WKT_3D() +{ + { + Point3 p(1,2,3), q(0,0,0); + std::stringstream ss; + CGAL::IO::write_point_WKT(ss, p); + bool b = CGAL::IO::read_point_WKT(ss, q); + assert(b); + CGAL_USE(b); + assert(p == q); + } + { + Point3 p(1,2,3), q(3,2,1); + MultiPoint3 mp, mq; + mp.push_back(p); + mp.push_back(q); + std::stringstream ss; + CGAL::IO::write_multi_point_WKT(ss, mp); + bool b = CGAL::IO::read_multi_point_WKT(ss, mq); + assert(b); + CGAL_USE(b); + assert(mp == mq); + } + { + Point3 p(1,2,3), q(3,2,1); + Linestring3 mp, mq; + mp.push_back(p); + mp.push_back(q); + std::stringstream ss; + CGAL::IO::write_linestring_WKT(ss, mp); + bool b = CGAL::IO::read_linestring_WKT(ss, mq); + assert(b); + CGAL_USE(b); + assert(mp == mq); + } + { + Point3 p(1,2,3), q(3,2,1), r(4,5,6); + Linestring3 mp, mq; + mp.push_back(p); + mp.push_back(q); + mq.push_back(p); + mq.push_back(r); + MultiLinestring3 mmp, mmq; + mmp.push_back(mp); + mmp.push_back(mq); + std::stringstream ss; + CGAL::IO::write_multi_linestring_WKT(ss, mmp); + bool b = CGAL::IO::read_multi_linestring_WKT(ss, mmq); + assert(b); + CGAL_USE(b); + assert(mmp == mmq); + } + return true; +} + + //////////////////////////////////////////////////////////////////////////////////////////////////// /// Read @@ -273,6 +335,8 @@ int main() assert(ok); ok = test_write_WKT(); assert(ok); + ok = test_WKT_3D(); + assert(ok); return EXIT_SUCCESS; } From aaa6adb7c1a10e3f2bf20098cb7c7ceaf00dd10c Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 25 Dec 2024 15:09:57 +0100 Subject: [PATCH 107/175] In a number of cases the command `@{` (or `\{`) is not closed by a corresponding closing command (`@}`). For the `\=name` command this is apparently not necessary but it is better to have corresponding open and close commands. (also corrected a split in a line that I noticed in Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h) --- .../doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h | 3 ++- .../Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h | 1 + .../Concepts/ArrangementBottomSideTraits_2.h | 1 + .../Concepts/ArrangementContractedBottomTraits_2.h | 1 + .../Concepts/ArrangementContractedLeftTraits_2.h | 1 + .../Concepts/ArrangementContractedRightTraits_2.h | 1 + .../Concepts/ArrangementContractedTopTraits_2.h | 1 + .../Concepts/ArrangementLeftSideTraits_2.h | 1 + .../Concepts/ArrangementOpenBottomTraits_2.h | 1 + .../Concepts/ArrangementOpenLeftTraits_2.h | 1 + .../Concepts/ArrangementOpenRightTraits_2.h | 1 + .../Concepts/ArrangementOpenTopTraits_2.h | 1 + .../Concepts/ArrangementRightSideTraits_2.h | 1 + .../Concepts/ArrangementTopSideTraits_2.h | 1 + .../include/CGAL/Arr_tracing_traits_2.h | 1 + CGAL_Core/include/CGAL/CORE/BigFloat.h | 1 + .../Solver_interface/Concepts/MixedIntegerProgramTraits.h | 6 ++++++ .../Concepts/EdgeCollapseSimplificationVisitor.h | 2 ++ .../doc/Triangulation/Concepts/TriangulationDataStructure.h | 1 + Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h | 1 + 20 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h index 8d8cc6785d4..a68feead26c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h @@ -440,13 +440,14 @@ public: Bbox_2 operator()(const X_monotone_curve_2& xcv) const { return bbox(xcv); } }; - /*! \name Auxiliary Functor definitions, used gor, e.g., the landmarks + /*! \name Auxiliary Functor definitions, used gor, e.g., the landmarks \ * point-location strategy and the drawing function. */ //@{ typedef double Approximate_number_type; typedef CGAL::Cartesian Approximate_kernel; typedef Approximate_kernel::Point_2 Approximate_point_2; + //@} /*! \class Approximate_2 * A functor that approximates a point and an \f$x\f$-monotone curve. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h index 37a7a6c29bd..1db9da8bc82 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h @@ -121,6 +121,7 @@ public: X_monotone_curve_2(const X_monotone_curve_2& xcv, const Point_2& src, const Point_2& tgt) const; + //! @} } /* end Arr_segment_traits_2::Trim_2 */ }; /* end Arr_segment_traits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h index a29b1d33531..8d2682583b8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h @@ -29,6 +29,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h index 09de38a67c5..48563de6d81 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h index 9a06f1e409c..de1940c372b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h index 3f93d80deb2..a36bca2691e 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h index be39ea2b6b1..d4a2d352af4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h index 3b01d80db4f..6f2d1343a85 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h @@ -29,6 +29,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h index c53f51ef056..2298e679738 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h index f1b7d62ca68..b4f1b8d2ee3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h index fa8468d49dc..a5683bc1aff 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h index 455bef4d160..ad852c41ed3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h @@ -33,6 +33,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h index 689d2b7af2d..ed6d2be0c4d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h @@ -29,6 +29,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h index 94614dfc81a..e579a7df9ef 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h @@ -29,6 +29,7 @@ public: /// \name Functor Types /// @{ + /// @} /// \name Accessing Functor Objects /// @{ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index c3f09ef16e9..ffd352badaa 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -212,6 +212,7 @@ public: using X_monotone_curve_2 = typename Base::X_monotone_curve_2; using Curve_2 = typename Base::Curve_2; using Multiplicity = typename Base::Multiplicity; + //@} /*! A functor that compares the \f$x\f$-coordinates of two points. */ class Compare_x_2 { diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat.h b/CGAL_Core/include/CGAL/CORE/BigFloat.h index 5b1bd138bca..671e58d644a 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat.h @@ -600,6 +600,7 @@ inline long longValue(const BigFloat& bf) { return bf.longValue(); } +//@} } //namespace CORE diff --git a/Solver_interface/doc/Solver_interface/Concepts/MixedIntegerProgramTraits.h b/Solver_interface/doc/Solver_interface/Concepts/MixedIntegerProgramTraits.h index b20bbdcb36f..eef6a4cf86b 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/MixedIntegerProgramTraits.h +++ b/Solver_interface/doc/Solver_interface/Concepts/MixedIntegerProgramTraits.h @@ -39,6 +39,8 @@ public: */ MixedIntegerProgramVariable(MixedIntegerProgramTraits* solver, Variable_type type, FT lb =, FT ub, const std::string& name, int idx); + /// @} + /// \name Operations /// @{ @@ -131,6 +133,8 @@ public: */ MixedIntegerProgramLinearConstraint(MixedIntegerProgramTraits* solver, FT lb, FT ub, const std::string& name, int idx); + /// @} + /// \name Operations /// @{ @@ -238,6 +242,8 @@ public: */ MixedIntegerProgramLinearObjective(MixedIntegerProgramTraits* solver, Sense sense); + /// @} + /// \name Operations /// @{ diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h index 0bbb8e88078..7a8476e10f5 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/EdgeCollapseSimplificationVisitor.h @@ -21,6 +21,8 @@ The type of the surface mesh to simplify. Must be a model of the `MutableFaceGra */ typedef Edge_profile::Triangle_mesh TriangleMesh; +/// @} + /// \name Operations /// @{ diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h index 6ab5522df50..7649be08913 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h @@ -870,6 +870,7 @@ a vertex of the `c`. */ int index(Vertex_handle v) const; +/// @} /// \name Internal /// \cgalAdvancedBegin diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index 570114a5b99..14dff71d41f 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -785,6 +785,7 @@ is returned. */ Vertex_handle move(Vertex_handle v, const Point & p); +/// @} /// \name Specialized Modifiers /// The following member functions offer more specialized versions of From 18de530a009f06ef687ab6d2ddb509809833b171 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 26 Dec 2024 11:06:24 +0100 Subject: [PATCH 108/175] Add missing closing grouping commands For consistency also updated Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h --- Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index cff7c59d379..0f63b3c41fa 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -1515,7 +1515,7 @@ public: //@} - /*! \name Auxiliary Functor definitions, used gor, e.g., the landmarks + /*! \name Auxiliary Functor definitions, used gor, e.g., the landmarks \ * point-location strategy and the drawing function. */ //@{ From df1179889cdade9b02774b040bb522ceb6201a4c Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Mon, 30 Dec 2024 00:57:16 +0200 Subject: [PATCH 109/175] Made the Base type public and fixed the Approximate_2 operator that operates on x-monotone curves --- .../include/CGAL/Arr_tracing_traits_2.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h index c3f09ef16e9..5f5f57e7d66 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_tracing_traits_2.h @@ -76,9 +76,9 @@ public: NUMBER_OF_OPERATIONS }; -private: using Base = BaseTraits; +private: //! A set of bits that indicate whether operations should be traced. unsigned long long m_flags; @@ -832,9 +832,16 @@ public: std::cout << "approximate_2" << std::endl << " xcv: " << xcv << ", error: " << error << ", l2r: " << l2r << std::endl; - auto res = m_object(xcv, error, oi, l2r); - std::cout << " result: " << res << std::endl; - return res; + std::list container; + m_object(xcv, error, std::back_inserter(container), l2r); + if (container.empty()) return oi; + + std::size_t i = 0; + for (const auto& point : container) { + std::cout << " result[" << i++ << "]: " << point << std::endl; + *oi++ = point; + } + return oi; } }; From 2e0fbc7a98f892358f9752efa70b5ce43eab2e45 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 6 Jan 2025 12:49:21 +0100 Subject: [PATCH 110/175] Octree doc states requirement of RandomAccessIterator added missing _object types for functors in traits --- Orthtree/include/CGAL/Octree.h | 2 +- Orthtree/include/CGAL/Orthtree.h | 21 ++++---- .../include/CGAL/Orthtree/Split_predicates.h | 2 +- Orthtree/include/CGAL/Orthtree_traits_base.h | 10 +++- Orthtree/include/CGAL/Orthtree_traits_point.h | 52 ++++++++++++++----- 5 files changed, 61 insertions(+), 26 deletions(-) diff --git a/Orthtree/include/CGAL/Octree.h b/Orthtree/include/CGAL/Octree.h index e59a19be46d..b5d3f600d7c 100644 --- a/Orthtree/include/CGAL/Octree.h +++ b/Orthtree/include/CGAL/Octree.h @@ -25,7 +25,7 @@ namespace CGAL { \brief Alias that specializes the `Orthtree` class to a 3D octree storing 3D points. \tparam GeomTraits a model of `Kernel` - \tparam PointRange a model of `Range` whose value type is the key type of `PointMap` + \tparam PointRange a model of `Range` whose value type is the key type of `PointMap` and whose iterator type is a model of `RandomAccessIterator` \tparam PointMap a model of `ReadablePropertyMap` whose value type is `GeomTraits::Point_3` \tparam cubic_nodes Boolean to enforce cubic nodes */ diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 074d90b8bc4..6850afbf472 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -125,7 +125,7 @@ public: /// @{ #ifndef DOXYGEN_RUNNING static inline constexpr bool has_data = Orthtree_impl::has_Node_data::value; - static inline constexpr bool supports_neighbor_search = true;// Orthtree_impl::has_Squared_distance_of_element::value; + static inline constexpr bool supports_neighbor_search = Orthtree_impl::has_Squared_distance_of_element::value; #else static inline constexpr bool has_data = bool_value; ///< `true` if `GeomTraits` is a model of `OrthtreeTraitsWithData` and `false` otherwise. static inline constexpr bool supports_neighbor_search = bool_value; ///< `true` if `GeomTraits` is a model of `CollectionPartitioningOrthtreeTraits` and `false` otherwise. @@ -385,7 +385,8 @@ public: \param max_depth deepest a tree is allowed to be (nodes at this depth will not be split). \param bucket_size maximum number of items a node is allowed to contain. */ - void refine(size_t max_depth = 10, size_t bucket_size = 20) { + template + auto refine(size_t max_depth = 10, size_t bucket_size = 20) -> std::enable_if_t { refine(Orthtrees::Maximum_depth_and_maximum_contained_elements(max_depth, bucket_size)); } @@ -681,10 +682,10 @@ public: \warning Nearest neighbor searches requires `GeomTraits` to be a model of `CollectionPartitioningOrthtreeTraits`. */ - template + template auto nearest_k_neighbors(const Point& query, std::size_t k, - OutputIterator output) const -> std::enable_if_t { + OutputIterator output) const -> std::enable_if_t { Sphere query_sphere(query, (std::numeric_limits::max)()); CGAL_precondition(k > 0); @@ -704,8 +705,8 @@ public: \warning Nearest neighbor searches requires `GeomTraits` to be a model of `CollectionPartitioningOrthtreeTraits`. */ - template - auto neighbors_within_radius(const Sphere& query, OutputIterator output) const -> std::enable_if_t { + template + auto neighbors_within_radius(const Sphere& query, OutputIterator output) const -> std::enable_if_t { return nearest_k_neighbors_within_radius(query, (std::numeric_limits::max)(), output); } @@ -726,12 +727,12 @@ public: \warning Nearest neighbor searches requires `GeomTraits` to be a model of `CollectionPartitioningOrthtreeTraits`. */ - template + template auto nearest_k_neighbors_within_radius( const Sphere& query, std::size_t k, OutputIterator output - ) const -> std::enable_if_t { + ) const -> std::enable_if_t { CGAL_precondition(k > 0); Sphere query_sphere = query; @@ -1298,13 +1299,13 @@ private: // functions : return output; } - template + template auto nearest_k_neighbors_recursive( Sphere& search_bounds, Node_index node, std::vector& results, std::size_t k, - FT epsilon = 0) const -> std::enable_if_t { + FT epsilon = 0) const -> std::enable_if_t { // Check whether the node has children if (is_leaf(node)) { diff --git a/Orthtree/include/CGAL/Orthtree/Split_predicates.h b/Orthtree/include/CGAL/Orthtree/Split_predicates.h index c3b0d929b62..8638387189f 100644 --- a/Orthtree/include/CGAL/Orthtree/Split_predicates.h +++ b/Orthtree/include/CGAL/Orthtree/Split_predicates.h @@ -85,7 +85,7 @@ public: \ingroup PkgOrthtreeSplitPredicates \brief A class used to choose when a node should be split depending on the depth and the number of contained elements. - This predicate makes a note split if it contains more than a + This predicate makes a node split if it contains more than a certain number of items and if its depth is lower than a certain limit. diff --git a/Orthtree/include/CGAL/Orthtree_traits_base.h b/Orthtree/include/CGAL/Orthtree_traits_base.h index 2d1ade67e92..bfe1ff4308e 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_base.h +++ b/Orthtree/include/CGAL/Orthtree_traits_base.h @@ -89,6 +89,8 @@ struct Orthtree_traits_base { using Adjacency = int; /// @} + //using Construct_point_d = Point_d(*)(std::initializer_list args); + auto construct_point_d_object() const { return [](auto... Args) -> Point_d { std::initializer_list args_list{Args...}; @@ -115,7 +117,9 @@ struct Orthtree_traits_base { UP }; - auto construct_point_d_object() const { + using Construct_point_d = Point_d(*)(const FT&, const FT&); + + Construct_point_d construct_point_d_object() const { return [](const FT& x, const FT& y) -> Point_d { return {x, y}; }; @@ -153,7 +157,9 @@ struct Orthtree_traits_base { RIGHT_TOP_FRONT }; - auto construct_point_d_object() const { + using Construct_point_d = Point_d(*)(const FT&, const FT&, const FT&); + + Construct_point_d construct_point_d_object() const { return [](const FT& x, const FT& y, const FT& z) -> Point_d { return {x, y, z}; }; diff --git a/Orthtree/include/CGAL/Orthtree_traits_point.h b/Orthtree/include/CGAL/Orthtree_traits_point.h index f05416b91db..47b277cf3aa 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_point.h +++ b/Orthtree/include/CGAL/Orthtree_traits_point.h @@ -96,11 +96,15 @@ public: using Node_index = typename Base::Node_index; using Node_data_element = typename std::iterator_traits::value_type; + static_assert(std::is_same::iterator_category, std::random_access_iterator_tag>::value); + Orthtree_traits_point( PointRange& points, PointMap point_map = PointMap() ) : m_points(points), m_point_map(point_map) {} + using Construct_root_node_bbox = typename Self::Bbox_d(*)(); + auto construct_root_node_bbox_object() const { return [&]() -> typename Self::Bbox_d { @@ -152,41 +156,65 @@ public: }; } - auto construct_root_node_contents_object() const { - return [&]() -> typename Self::Node_data { - return {m_points.begin(), m_points.end()}; - }; + struct Construct_root_node_contents { + PointRange& m_points; + Construct_root_node_contents(PointRange& points) : m_points(points) {} + typename Self::Node_data operator()() { + return { m_points.begin(), m_points.end() }; + } + }; + + Construct_root_node_contents construct_root_node_contents_object() const { + return Construct_root_node_contents(m_points); } - auto distribute_node_contents_object() const { - return [&](Node_index n, Tree& tree, const typename Self::Point_d& center) { + struct Distribute_node_contents { + const PointMap m_point_map; + Distribute_node_contents(const PointMap& point_map) : m_point_map(point_map) {} + typename void operator()(Node_index n, Tree& tree, const typename Self::Point_d& center) { CGAL_precondition(!tree.is_leaf(n)); reassign_points(tree, m_point_map, n, center, tree.data(n)); }; + }; + + Distribute_node_contents distribute_node_contents_object() const { + return Distribute_node_contents(m_point_map); } - auto construct_sphere_d_object() const { + using Construct_sphere_d = typename Self::Sphere_d(*)(const typename Self::Point_d&, const typename Self::FT&); + + Construct_sphere_d construct_sphere_d_object() const { return [](const typename Self::Point_d& center, const typename Self::FT& squared_radius) -> typename Self::Sphere_d { return typename Self::Sphere_d(center, squared_radius); }; } - auto construct_center_d_object() const { + using Construct_center_d = typename Self::Point_d(*)(const typename Self::Sphere_d&); + + Construct_center_d construct_center_d_object() const { return [](const typename Self::Sphere_d& sphere) -> typename Self::Point_d { return sphere.center(); }; } - auto compute_squared_radius_d_object() const { + using Compute_squared_radius_d = typename Self::FT(*)(const typename Self::Sphere_d&); + + Compute_squared_radius_d compute_squared_radius_d_object() const { return [](const typename Self::Sphere_d& sphere) -> typename Self::FT { return sphere.squared_radius(); }; } - auto squared_distance_of_element_object() const { - return [&](const Node_data_element& index, const typename Self::Point_d& point) -> typename Self::FT { + struct Squared_distance_of_element { + const PointMap m_point_map; + Squared_distance_of_element(const PointMap& point_map) : m_point_map(point_map) {} + typename Self::FT operator()(const Node_data_element& index, const typename Self::Point_d& point) { return CGAL::squared_distance(get(m_point_map, index), point); - }; + }; + }; + + Squared_distance_of_element squared_distance_of_element_object() const { + return Squared_distance_of_element(m_point_map); } PointRange& m_points; From e8aff9cbe5ea8d9795372a0ea090dc80a0a332b5 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 6 Jan 2025 13:53:33 +0100 Subject: [PATCH 111/175] Update Orthtree/include/CGAL/Orthtree_traits_point.h Co-authored-by: Sebastien Loriot --- Orthtree/include/CGAL/Orthtree_traits_point.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orthtree/include/CGAL/Orthtree_traits_point.h b/Orthtree/include/CGAL/Orthtree_traits_point.h index 47b277cf3aa..b1277be1122 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_point.h +++ b/Orthtree/include/CGAL/Orthtree_traits_point.h @@ -96,7 +96,7 @@ public: using Node_index = typename Base::Node_index; using Node_data_element = typename std::iterator_traits::value_type; - static_assert(std::is_same::iterator_category, std::random_access_iterator_tag>::value); + static_assert(std::is_same_v::iterator_category, std::random_access_iterator_tag>); Orthtree_traits_point( PointRange& points, From 01e7864526a8dbf979d645f259915c4a6ba58468 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 6 Jan 2025 16:23:43 +0100 Subject: [PATCH 112/175] fixed type of construct_point_d_object --- Orthtree/include/CGAL/Orthtree_traits_base.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Orthtree/include/CGAL/Orthtree_traits_base.h b/Orthtree/include/CGAL/Orthtree_traits_base.h index bfe1ff4308e..cd0669f3545 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_base.h +++ b/Orthtree/include/CGAL/Orthtree_traits_base.h @@ -89,13 +89,16 @@ struct Orthtree_traits_base { using Adjacency = int; /// @} - //using Construct_point_d = Point_d(*)(std::initializer_list args); + struct Construct_point_d { + template > + typename Point_d operator()(Args ...args) { + std::initializer_list args_list{ args... }; + return Point_d{ static_cast(args_list.size()), args_list.begin(), args_list.end() }; + } + }; - auto construct_point_d_object() const { - return [](auto... Args) -> Point_d { - std::initializer_list args_list{Args...}; - return Point_d{static_cast(args_list.size()), args_list.begin(), args_list.end()}; - }; + Construct_point_d construct_point_d_object() const { + return Construct_point_d(); } }; From e1cc01c34dd5c831c49db05a3cff21ce24adcfc9 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Tue, 7 Jan 2025 09:15:10 +0100 Subject: [PATCH 113/175] removed unnecessary typename --- Orthtree/include/CGAL/Orthtree_traits_base.h | 2 +- Orthtree/include/CGAL/Orthtree_traits_point.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Orthtree/include/CGAL/Orthtree_traits_base.h b/Orthtree/include/CGAL/Orthtree_traits_base.h index cd0669f3545..dc31ba2dd2f 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_base.h +++ b/Orthtree/include/CGAL/Orthtree_traits_base.h @@ -91,7 +91,7 @@ struct Orthtree_traits_base { struct Construct_point_d { template > - typename Point_d operator()(Args ...args) { + Point_d operator()(Args ...args) { std::initializer_list args_list{ args... }; return Point_d{ static_cast(args_list.size()), args_list.begin(), args_list.end() }; } diff --git a/Orthtree/include/CGAL/Orthtree_traits_point.h b/Orthtree/include/CGAL/Orthtree_traits_point.h index b1277be1122..130d6f2a187 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_point.h +++ b/Orthtree/include/CGAL/Orthtree_traits_point.h @@ -171,7 +171,7 @@ public: struct Distribute_node_contents { const PointMap m_point_map; Distribute_node_contents(const PointMap& point_map) : m_point_map(point_map) {} - typename void operator()(Node_index n, Tree& tree, const typename Self::Point_d& center) { + void operator()(Node_index n, Tree& tree, const typename Self::Point_d& center) { CGAL_precondition(!tree.is_leaf(n)); reassign_points(tree, m_point_map, n, center, tree.data(n)); }; From 1e06a8813f783780d8c29d73ccd8e06108e44ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 8 Jan 2025 17:31:21 +0100 Subject: [PATCH 114/175] handle special case when FFG has a non-manifold mesh and not all umbrellas are selected --- .../CGAL/boost/graph/copy_face_graph.h | 30 +++++- BGL/test/BGL/test_Face_filtered_graph.cpp | 99 +++++++++++++++++++ 2 files changed, 125 insertions(+), 4 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index e0d4cbd5b95..bbd7a12708b 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -178,6 +178,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, } // detect if there are some non-manifold umbrellas and fix missing halfedge target pointers + std::map> nm_umbrella_map; typedef typename std::vector::iterator edge_iterator; for (edge_iterator it=new_edges.begin(); it!=new_edges.end(); ++it) { @@ -199,10 +200,19 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, // we recover tm_v using the halfedge associated to the target vertex of // the halfedge in sm corresponding to nh_t. This is working because we // set the vertex halfedge pointer to the "same" halfedges. - tm_vertex_descriptor tm_v = - target( get(hs_to_ht, halfedge(target(get(ht_to_hs, nh_t), sm), sm)), tm); - for(tm_halfedge_descriptor ht : halfedges_around_target(nh_t, tm)) - set_target(ht, tm_v, tm); + + sm_vertex_descriptor vs = target(get(ht_to_hs, nh_t), sm); + sm_halfedge_descriptor hs = halfedge(vs, sm); + if (hs == boost::graph_traits::null_halfedge()) + { // special case for Face_filtered_graph with a non-manifold input with not all umbrellas selected + nm_umbrella_map[vs].push_back(nh_t); + } + else + { + tm_vertex_descriptor tm_v = target( get(hs_to_ht, hs), tm); + for(tm_halfedge_descriptor ht : halfedges_around_target(nh_t, tm)) + set_target(ht, tm_v, tm); + } } nh_t = opposite(nh_t, tm); } @@ -210,6 +220,18 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, break; } } + + for (const auto& vs_and_hts : nm_umbrella_map) + { + sm_vertex_descriptor v_sm = vs_and_hts.first; + tm_vertex_descriptor v_tm = add_vertex(tm); + *v2v++=std::make_pair(v_sm, v_tm); + set_halfedge(v_tm, vs_and_hts.second.front(), tm); + put(tm_vpm, v_tm, conv(get(sm_vpm, v_sm))); + + for (tm_halfedge_descriptor h_tm : vs_and_hts.second) + set_target(h_tm, v_tm, tm); + } } } // end of namespace internal diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index d85c55353a4..1e02729a4ba 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -498,6 +498,103 @@ void test_invalid_selections() assert(!many_umbrellas_fg.is_selection_valid()); } + +void non_manifoldness_test1() +{ + // works out-of-the-box because Face_filtered_graph handles already non-manifold cycles + SM mesh; + SM::Vertex_index v0=add_vertex(mesh); + SM::Vertex_index v1=add_vertex(mesh); + SM::Vertex_index v2=add_vertex(mesh); + SM::Vertex_index v3=add_vertex(mesh); + SM::Vertex_index v4=add_vertex(mesh); + SM::Vertex_index v5=add_vertex(mesh); + SM::Vertex_index v6=add_vertex(mesh); + + SM::Face_index f0=mesh.add_face(v0,v1,v2); + SM::Face_index f1=mesh.add_face(v0,v3,v4); + SM::Face_index f2=mesh.add_face(v0,v5,v6); + SM::Halfedge_index h = halfedge(f0,mesh); + while(target(h, mesh)!=v0) + h=next(h,mesh); + set_halfedge(v0, h, mesh); + + std::vector selection = {f1, f2}; + CGAL::Face_filtered_graph ffg(mesh, selection); + + SM out; + CGAL::copy_face_graph(ffg, out); + + assert(vertices(out).size()==5); + assert(faces(out).size()==2); +} + +void non_manifoldness_test2() +{ + SM mesh; + SM::Vertex_index v0=add_vertex(mesh); + SM::Vertex_index v0b=add_vertex(mesh); + SM::Vertex_index v0t=add_vertex(mesh); + + SM::Vertex_index v1=add_vertex(mesh); + SM::Vertex_index v2=add_vertex(mesh); + SM::Vertex_index v3=add_vertex(mesh); + + SM::Vertex_index v4=add_vertex(mesh); + SM::Vertex_index v5=add_vertex(mesh); + SM::Vertex_index v6=add_vertex(mesh); + + SM::Vertex_index v7=add_vertex(mesh); + SM::Vertex_index v8=add_vertex(mesh); + SM::Vertex_index v9=add_vertex(mesh); + + SM::Face_index f00=mesh.add_face(v1,v2,v0); + SM::Face_index f01=mesh.add_face(v2,v3,v0); + SM::Face_index f02=mesh.add_face(v3,v1,v0); + + SM::Face_index f10=mesh.add_face(v4,v5,v0b); + SM::Face_index f11=mesh.add_face(v5,v6,v0b); + SM::Face_index f12=mesh.add_face(v6,v4,v0b); + + SM::Face_index f20=mesh.add_face(v7,v8,v0t); + SM::Face_index f21=mesh.add_face(v8,v9,v0t); + SM::Face_index f22=mesh.add_face(v9,v7,v0t); + + assert(f00!=SM::Face_index()); + assert(f01!=SM::Face_index()); + assert(f02!=SM::Face_index()); + assert(f10!=SM::Face_index()); + assert(f11!=SM::Face_index()); + assert(f12!=SM::Face_index()); + assert(f20!=SM::Face_index()); + assert(f21!=SM::Face_index()); + assert(f22!=SM::Face_index()); + + #define UPDATE_V(fX, vX) \ + { SM::Halfedge_index h = halfedge(fX,mesh);\ + while(target(h, mesh)!=vX) h=next(h,mesh);\ + set_target(h, v0, mesh); } + + UPDATE_V(f10, v0b) + UPDATE_V(f11, v0b) + UPDATE_V(f12, v0b) + UPDATE_V(f20, v0t) + UPDATE_V(f21, v0t) + UPDATE_V(f22, v0t) + + remove_vertex(v0b, mesh); + remove_vertex(v0t, mesh); + + std::vector selection = {f10, f11, f12, f20, f21, f22}; + CGAL::Face_filtered_graph ffg(mesh, selection); + + SM out; + CGAL::copy_face_graph(ffg, out); + + assert(vertices(out).size()==7); + assert(faces(out).size()==6); +} + int main() { test_graph_range(poly_data()); @@ -511,6 +608,8 @@ int main() #endif test_invalid_selections(); + non_manifoldness_test1(); + non_manifoldness_test2(); // Make a tetrahedron and test the adapter for a patch that only contains 2 faces typedef CGAL::Face_filtered_graph SM_Adapter; From 765fea21345eeca5e0886423453b1903113174a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 9 Jan 2025 10:18:25 +0100 Subject: [PATCH 115/175] use the same generator for reproducible runs --- .../test_tetrahedral_remeshing_of_one_subdomain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp index e6e1f222c61..45632b69d1f 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp @@ -18,7 +18,7 @@ typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3 Remeshing_tria void generate_input_two_subdomains(const std::size_t nbv, Remeshing_triangulation& tr) { - CGAL::Random rng; + CGAL::Random& rng = CGAL::get_default_random(); typedef Remeshing_triangulation::Point Point; typedef Remeshing_triangulation::Cell_handle Cell_handle; From de7c24ad037cfe49bda219ff9111c6e62d534139 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 9 Jan 2025 20:34:12 +0200 Subject: [PATCH 116/175] Pacify msvc; replaced auto with actual type (Isolated_vertex_const_iterator) --- .../CGAL/Arr_point_location/Arr_landmarks_pl_impl.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index 545d4a5ac52..117b8300a62 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -58,14 +58,16 @@ Arr_landmarks_point_location::locate(const Point_2& p) const { out_obj = _walk_from_face(*f, landmark_point, p, crossed_edges); else CGAL_error_msg("lm_location_obj of an unknown type."); - if (const auto* f = std::get_if(&out_obj)) { + if (const auto* fp = std::get_if(&out_obj)) { + const auto& f = *fp; // If we reached here, we did not locate the query point in any of the // holes inside the current face, so we conclude it is contained in this // face. However, we first have to check whether the query point coincides // with any of the isolated vertices contained inside this face. auto equal = m_traits->equal_2_object(); - for (auto iso_verts_it = (*f)->isolated_vertices_begin(); - iso_verts_it != (*f)->isolated_vertices_end(); ++iso_verts_it) { + // Do not use 'auto' to define the iterator, as MSVC2017 complains. + for (Isolated_vertex_const_iterator iso_verts_it = f->isolated_vertices_begin(); + iso_verts_it != f->isolated_vertices_end(); ++iso_verts_it) { if (equal(p, iso_verts_it->point())) { Vertex_const_handle ivh = iso_verts_it; return make_result(ivh); From 8e0ebb9a39ca8e26d7c1809599244fc1070b8445 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 10 Jan 2025 14:27:42 +0100 Subject: [PATCH 117/175] update status of border edges when removing a (degenerate) border face --- .../internal/Isotropic_remeshing/remesh_impl.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 02925a145f2..a40970ed97b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -1692,6 +1692,17 @@ private: // else keep current status for en and eno } + void remove_border_face(const halfedge_descriptor h) + { + CGAL_assertion(is_border(opposite(h, mesh_), mesh_)); + for (halfedge_descriptor hf : halfedges_around_face(h, mesh_)) + { + set_status(hf, MESH_BORDER); //only 1 or 2 of the listed halfedges + //will survive face removal, but status will be correct + } + CGAL::Euler::remove_face(h, mesh_); + } + template bool fix_degenerate_faces(const vertex_descriptor& v, Bimap& short_edges, @@ -1721,7 +1732,7 @@ private: if(is_border(opposite(h, mesh_), mesh_)) { - CGAL::Euler::remove_face(h, mesh_); + remove_border_face(h); continue; } @@ -1732,7 +1743,7 @@ private: if(is_border(hfo, mesh_)) { - CGAL::Euler::remove_face(h, mesh_); + remove_border_face(h); break; } vertex_descriptor vc = target(hf, mesh_); 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 118/175] 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 119/175] 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 120/175] 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 121/175] 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 122/175] 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 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 123/175] 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 124/175] 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 125/175] 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 126/175] 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 127/175] 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 128/175] 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 129/175] 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 130/175] 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 131/175] 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 132/175] 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 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 133/175] 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 134/175] 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 135/175] 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 136/175] 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 137/175] 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 170952b9274a7e14e4f6ad4e2ecb3497db5b4e14 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 15 Jan 2025 14:35:28 +0100 Subject: [PATCH 138/175] FOR 5.6.x ONLY: use ubuntu-22.04 as Github runner `ubuntu-latest` was recently turned from 22.04 to 24.04. And 5.6.x is not ready for that. See the run https://github.com/CGAL/cgal/actions/runs/12787411585/job/35648286539?pr=8688#step:3:46 DO NOT MERGE INTO `6.0.x` or `master`. --- .github/workflows/Remove_labels.yml | 2 +- .github/workflows/build_doc.yml | 2 +- .github/workflows/checks.yml | 2 +- .github/workflows/cmake-all.yml | 4 ++-- .github/workflows/delete_doc.yml | 2 +- .github/workflows/demo.yml | 8 ++++---- .github/workflows/filter_testsuite.yml | 2 +- .github/workflows/list_workflow_last_run.yml | 2 +- .github/workflows/send_email.yml | 2 +- .github/workflows/wiki_notification.yml | 2 +- ccpp.yml | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/Remove_labels.yml b/.github/workflows/Remove_labels.yml index 0624fe7a1df..3a5465b57f1 100644 --- a/.github/workflows/Remove_labels.yml +++ b/.github/workflows/Remove_labels.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: remove_label: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: contains(github.event.pull_request.labels.*.name, 'Tested') name: remove label steps: diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 85158cfc285..b00c8e98e79 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -14,7 +14,7 @@ jobs: contents: read # to fetch code (actions/checkout) pull-requests: write # to create comment - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/github-script@v6 id: get_round diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0af6e276e6e..5dc396a0f17 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,7 +8,7 @@ permissions: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/cmake-all.yml b/.github/workflows/cmake-all.yml index d0507b4d430..6fe8d99f4ed 100644 --- a/.github/workflows/cmake-all.yml +++ b/.github/workflows/cmake-all.yml @@ -8,7 +8,7 @@ permissions: jobs: cmake-testsuite: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -22,7 +22,7 @@ jobs: cmake-testsuite-with-qt5: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/delete_doc.yml b/.github/workflows/delete_doc.yml index 38f5ab445ac..16393b4ee7a 100644 --- a/.github/workflows/delete_doc.yml +++ b/.github/workflows/delete_doc.yml @@ -11,7 +11,7 @@ jobs: permissions: contents: write # for Git to git push - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 123458ebe04..66f390edaa4 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -7,7 +7,7 @@ permissions: jobs: batch_1: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install dependencies @@ -15,7 +15,7 @@ jobs: - name: run1 run: ./.github/test.sh 0 ${{ github.workspace }} batch_2: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install dependencies @@ -23,7 +23,7 @@ jobs: - name: run2 run: ./.github/test.sh 1 ${{ github.workspace }} batch_3: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install dependencies @@ -31,7 +31,7 @@ jobs: - name: run3 run: ./.github/test.sh 2 ${{ github.workspace }} batch_4: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install dependencies diff --git a/.github/workflows/filter_testsuite.yml b/.github/workflows/filter_testsuite.yml index 48e4f39d65c..2ff150710e7 100644 --- a/.github/workflows/filter_testsuite.yml +++ b/.github/workflows/filter_testsuite.yml @@ -12,7 +12,7 @@ jobs: pull-requests: write # to create comment if: (github.event.comment.user.login == 'sloriot' || github.event.comment.user.login == 'lrineau') && contains(github.event.comment.body, '/testme') - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/github-script@v6 id: get_label diff --git a/.github/workflows/list_workflow_last_run.yml b/.github/workflows/list_workflow_last_run.yml index 79b1d2c0634..31b41ad8fb8 100644 --- a/.github/workflows/list_workflow_last_run.yml +++ b/.github/workflows/list_workflow_last_run.yml @@ -7,7 +7,7 @@ GH_TOKEN: ${{ github.token }} jobs: list_workflow: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: messages: ${{ steps.cat_output.outputs.message }} steps: diff --git a/.github/workflows/send_email.yml b/.github/workflows/send_email.yml index cb990eca146..97fe499c32a 100644 --- a/.github/workflows/send_email.yml +++ b/.github/workflows/send_email.yml @@ -19,7 +19,7 @@ on: jobs: send_email: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: install ssh keys run: | diff --git a/.github/workflows/wiki_notification.yml b/.github/workflows/wiki_notification.yml index 456fefa51e3..ae1649ec2e2 100644 --- a/.github/workflows/wiki_notification.yml +++ b/.github/workflows/wiki_notification.yml @@ -4,7 +4,7 @@ on: gollum jobs: prepare_email: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: messages: ${{ steps.set-result.outputs.result }} steps: diff --git a/ccpp.yml b/ccpp.yml index 75bbbee4918..9d5d5b27e59 100644 --- a/ccpp.yml +++ b/ccpp.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: configure all From d5d01a4d32471945c54ef21dda1ae903993754cd Mon Sep 17 00:00:00 2001 From: zfb132 Date: Wed, 15 Jan 2025 23:34:10 +0800 Subject: [PATCH 139/175] refactor: remove duplicate header file inclusion --- .../include/CGAL/Polygon_mesh_processing/connected_components.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index bdca099e32c..252a4086087 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include -#include #include namespace CGAL { From 8fe8a8c9041975d950501be23a43c5aab1ba31ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 16 Jan 2025 11:03:06 +0100 Subject: [PATCH 140/175] Fix compilation of traverser benchmark --- .../segment_traverser_benchmark.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp index 2839ea5e00b..69501904ffe 100644 --- a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp @@ -44,7 +44,7 @@ void bench_segment_traverser(const int nb_queries, typedef CGAL::Triangulation_segment_simplex_iterator_3
      Simplex_traverser; typedef CGAL::Triangulation_segment_cell_iterator_3
      Cell_traverser; typedef typename DT::Point_3 Point_3; - typedef typename DT::Cell Cell; + typedef typename DT::Cell_handle Cell_handle; std::cout << "\nBench :\t " << nb_queries << " queries," << std::endl << "\t in triangulation of size " << nbv << std::endl @@ -83,29 +83,29 @@ void bench_segment_traverser(const int nb_queries, { //Simplex traverser timer_st.start(); - Simplex_traverser st(dt, segments[2*i], segments[2*i + 1]); + Simplex_traverser st(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. unsigned int inf = 0, fin = 0; for (; st != st.end(); ++st) { - Cell c = st.cell(); -// if (dt.is_infinite(c)) ++inf; -// else ++fin; + Cell_handle c = st.get_cell(); + // if (dt.is_infinite(c)) ++inf; + // else ++fin; } timer_st.stop(); //Cell traverser timer_ct.start(); - Cell_traverser ct(dt, segments[2*i], segments[2*i + 1]); + Cell_traverser ct(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. inf = 0, fin = 0; for (; ct != ct.end(); ++ct) { - Cell c = ct.cell(); -// if (dt.is_infinite(c)) ++inf; -// else ++fin; + Cell_handle c = ct.handle(); + // if (dt.is_infinite(c)) ++inf; + // else ++fin; } timer_ct.stop(); } From e1b7c4726edcef250e1ff84579f90ba97e8941f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 16 Jan 2025 13:40:48 +0100 Subject: [PATCH 141/175] Replace boost::optional with std::optional See https://github.com/CGAL/cgal/pull/7526 --- .../internal/peel_slivers.h | 12 +++++++----- .../CGAL/Triangulation_segment_traverser_3.h | 17 +++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h index a4ae96383cd..cbd7d528719 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h @@ -18,6 +18,8 @@ #include #include +#include + namespace CGAL { namespace Tetrahedral_remeshing @@ -70,16 +72,16 @@ std::size_t peel_slivers(C3T3& c3t3, Cell_handle c = c_i.first; const std::array& f_on_surface = c_i.second; - boost::optional patch; + std::optional patch; for (int i = 0; i < 4; ++i) { if (f_on_surface[i]) { Surface_patch_index spi = c3t3.surface_patch_index(c, i); - if (patch != boost::none && patch.get() != spi) + if (patch.has_value() && patch.value() != spi) { //there are 2 different patches - patch = boost::none; + patch = std::nullopt; break; } else @@ -88,7 +90,7 @@ std::size_t peel_slivers(C3T3& c3t3, } } } - if (patch == boost::none) + if (!patch.has_value()) continue; for (int i = 0; i < 4; ++i) @@ -96,7 +98,7 @@ std::size_t peel_slivers(C3T3& c3t3, if (f_on_surface[i]) c3t3.remove_from_complex(c, i); else - c3t3.add_to_complex(c, i, patch.get()); + c3t3.add_to_complex(c, i, patch.value()); } c3t3.remove_from_complex(c); diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 6f25e793fda..d52f68c5646 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -26,7 +26,7 @@ #include #include -#include +#include // If defined, type casting is done statically, // reducing type-safety overhead. @@ -789,8 +789,8 @@ public: } } else { auto facet_opt = shared_facet(get_edge(), e_prev); - if(static_cast(facet_opt)) { - _curr_simplex = *facet_opt; + if(facet_opt.has_value()) { + _curr_simplex = facet_opt.value(); } else { _curr_simplex = shared_cell(get_edge(), e_prev); @@ -1002,7 +1002,7 @@ private: return f1 == f2 || triangulation().mirror_facet(f1) == f2; } - boost::optional shared_vertex(const Edge& e1, const Edge& e2) const + std::optional shared_vertex(const Edge& e1, const Edge& e2) const { Vertex_handle v1a = e1.first->vertex(e1.second); Vertex_handle v1b = e1.first->vertex(e1.third); @@ -1017,14 +1017,15 @@ private: return {}; } - boost::optional shared_facet(const Edge& e1, const Edge& e2) const + std::optional shared_facet(const Edge& e1, const Edge& e2) const { Vertex_handle v2a = e2.first->vertex(e2.second); Vertex_handle v2b = e2.first->vertex(e2.third); auto sv_opt = shared_vertex(e1, e2); - if(!sv_opt) return {}; - Vertex_handle sv = *sv_opt; + if(!sv_opt.has_value()) + return {}; + Vertex_handle sv = sv_opt.value(); Vertex_handle nsv2 = (sv == v2a) ? v2b : v2a; typename Tr::Facet_circulator circ @@ -1091,7 +1092,7 @@ private: } Cell_handle shared_cell(const Edge e1, const Edge e2) const { - auto facet = shared_facet(e1, e2.first->vertex(e2.second)); + Facet facet = shared_facet(e1, e2.first->vertex(e2.second)); return shared_cell(facet, e2.first->vertex(e2.third)); } From f6b935401ee82a36037fa9fecc99a367037dead2 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 16 Jan 2025 19:05:22 +0200 Subject: [PATCH 142/175] Further pacify msvc; replaced auto with actual type (Inner_ccb_const_iterator) --- .../include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index 117b8300a62..74d400cfc33 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -452,7 +452,8 @@ _walk_from_face(Face_const_handle face, const Point_2& np, const Point_2& p, // its holes). cv_is_contained_in_seg = false; auto new_face = face; - for (auto inner_ccb_iter = face->inner_ccbs_begin(); + // Do not use 'auto' to define the iterator, as MSVC2017 complains. + for (Inner_ccb_const_iterator inner_ccb_iter = face->inner_ccbs_begin(); inner_ccb_iter != face->inner_ccbs_end(); ++inner_ccb_iter) { bool is_on_edge; bool is_target; @@ -495,7 +496,8 @@ _walk_from_face(Face_const_handle face, const Point_2& np, const Point_2& p, // We know that p is not located inside the current face. We therefore // look for an edge on its outer boundary that intersects seg. auto new_face = face; - for (auto outer_ccb_iter = face->outer_ccbs_begin(); + // Do not use 'auto' to define the iterator, as MSVC2017 complains. + for (Inner_ccb_const_iterator outer_ccb_iter = face->outer_ccbs_begin(); outer_ccb_iter != face->outer_ccbs_end(); ++outer_ccb_iter) { bool is_on_edge; bool is_target; From 72520db3a86ac7a76454e1b517249636127100c0 Mon Sep 17 00:00:00 2001 From: Mael Date: Fri, 17 Jan 2025 09:15:36 +0100 Subject: [PATCH 143/175] Use std::optional::reset Co-authored-by: Anirudh Lakhanpal <91114837+SharonIV0x86@users.noreply.github.com> --- .../include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h index cbd7d528719..00d0e16f0a1 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/peel_slivers.h @@ -81,7 +81,7 @@ std::size_t peel_slivers(C3T3& c3t3, if (patch.has_value() && patch.value() != spi) { //there are 2 different patches - patch = std::nullopt; + patch.reset(); break; } else From 796a7bd066432c138f5faf33c18d7f6096bc3c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jan 2025 15:09:38 +0100 Subject: [PATCH 144/175] more types --- Scripts/developer_scripts/test_merge_of_branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index 64739b8cac6..26aaaf792b8 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -206,7 +206,7 @@ fi #check no file contains non-utf8 characters echo '.. Checking if non utf-8 characters are used...' -txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|assembler source|Perl script|from flex") +txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|assembler source|Perl script|from flex") if [ -n "${txt_not_utf8}" ]; then echo "The following files have non utf-8 characters:" echo ${txt_not_utf8} From bc64faaab31fd059deb6d45ba797138720ec1a1c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 17 Jan 2025 16:22:24 +0100 Subject: [PATCH 145/175] 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 679cd8cd2387fdda404bbb280406b7c212555f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jan 2025 17:15:49 +0100 Subject: [PATCH 146/175] workaround issue with file command --- Scripts/developer_scripts/test_merge_of_branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index 26aaaf792b8..eb0f9e916ee 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -206,7 +206,7 @@ fi #check no file contains non-utf8 characters echo '.. Checking if non utf-8 characters are used...' -txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|assembler source|Perl script|from flex") +txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|magic|assembler source|Perl script|from flex") if [ -n "${txt_not_utf8}" ]; then echo "The following files have non utf-8 characters:" echo ${txt_not_utf8} From fe88db2bb36672d7edd6353283410982eac0997a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jan 2025 18:46:13 +0100 Subject: [PATCH 147/175] workaround issue with file command --- Scripts/developer_scripts/test_merge_of_branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index cdf1070fa87..f73f1ebb706 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -179,7 +179,7 @@ fi #check no file contains non-utf8 characters echo '.. Checking if non utf-8 characters are used...' -txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|assembler source|Perl script|from flex") +txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|magic|assembler source|Perl script|from flex") if [ -n "${txt_not_utf8}" ]; then echo "The following files have non utf-8 characters:" echo ${txt_not_utf8} From 81076472b17640335657c652f53c67aac381a9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jan 2025 19:05:06 +0100 Subject: [PATCH 148/175] try to fix CI --- .github/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/install.sh b/.github/install.sh index 32b8552aa8f..13e63287364 100755 --- a/.github/install.sh +++ b/.github/install.sh @@ -2,7 +2,7 @@ sudo apt-get update sudo apt-get install -y libmpfr-dev \ libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \ - libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh + libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit5-dev zsh #update cmake to 3.18.4 sudo apt purge --auto-remove cmake cd /tmp From c161fc1ccf10e78b378b6e6770056d05d95e7c52 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 20 Jan 2025 09:48:53 +0100 Subject: [PATCH 149/175] 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 150/175] 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 151/175] 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 152/175] 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 153/175] 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 ebe9c3af98fb37116cc0ffb6982594642c277823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 21 Jan 2025 11:21:57 +0100 Subject: [PATCH 154/175] also report warnings in example and test files --- Testsuite/test/parse-ctest-dashboard-xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Testsuite/test/parse-ctest-dashboard-xml.py b/Testsuite/test/parse-ctest-dashboard-xml.py index 748ada8a48c..e2bf65dc9c4 100644 --- a/Testsuite/test/parse-ctest-dashboard-xml.py +++ b/Testsuite/test/parse-ctest-dashboard-xml.py @@ -78,7 +78,7 @@ for t_id in range(0, len(tests)): warning_pattern=re.compile(r'(.*([^a-zA-Z_,:-])warning)', flags=re.IGNORECASE) w_det=re.compile("warning"); -filter_pattern=re.compile(r'cmake|cgal', flags=re.IGNORECASE); +filter_pattern=re.compile(r'cmake|cgal|.*\.cpp', flags=re.IGNORECASE); with open_file_create_dir(result_file_name.format(dir=os.getcwd(), tester=tester_name, platform=platform_name), 'a+') as results: From 40c8d76834011b0db2a3d58aa55431da28f09900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 21 Jan 2025 11:26:01 +0100 Subject: [PATCH 155/175] remove no longer used scripts --- Scripts/developer_scripts/autotest_cgal | 944 ------------------ .../autotest_cgal_with_cmake | 3 - .../run_testsuite_from_branch_name.sh | 77 -- .../test/collect_cgal_testresults_from_cmake | 283 ------ Testsuite/test/run_testsuite_with_cmake | 263 ----- 5 files changed, 1570 deletions(-) delete mode 100755 Scripts/developer_scripts/autotest_cgal delete mode 100755 Scripts/developer_scripts/autotest_cgal_with_cmake delete mode 100644 Scripts/developer_scripts/run_testsuite_from_branch_name.sh delete mode 100755 Testsuite/test/collect_cgal_testresults_from_cmake delete mode 100755 Testsuite/test/run_testsuite_with_cmake diff --git a/Scripts/developer_scripts/autotest_cgal b/Scripts/developer_scripts/autotest_cgal deleted file mode 100755 index ab124cf51e2..00000000000 --- a/Scripts/developer_scripts/autotest_cgal +++ /dev/null @@ -1,944 +0,0 @@ -#!/bin/bash -# ---------------------------------------------------- -# ---------------------------------------------------- -# autotest_cgal: a script to automagically install and -# test internal CGAL releases -# ---------------------------------------------------- -# You will need -# * GNU wget and ftp -# * or alternatively curl -# -# Furthermore you have to edit .autocgalrc in order to -# cutomize it for your environment. -# In particular you have to change the BUILHOSTS -# variable to contain the names of your hosts and -# set the COMPILERS_ variables to the -# os-compilers descriptions on which you want to run -# the testsuite. -# ---------------------------------------------------- -# ---------------------------------------------------- -# -# $URL$ -# $Id$ - -#sets the umask to 022 & 0777 -umask 022 - -# Warn deprecated use of environment variables to pass on flags -if [ -n "$TESTSUITE_CXXFLAGS" ] ; then - echo "\$TESTSUITE_CXXFLAGS is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_CXX_FLAGS instead" >&2; -fi - -if [ -n "$TESTSUITE_CXXFLAGS_RELEASE" ] ; then - echo "\$TESTSUITE_CXXFLAGS_RELEASE is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_CXX_FLAGS_RELEASE instead" >&2; -fi - -if [ -n "$TESTSUITE_CXXFLAGS_DEBUG" ] ; then - echo "\$TESTSUITE_CXXFLAGS_DEBUG is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_CXX_FLAGS_DEBUG instead" >&2; -fi - -if [ -n "$TESTSUITE_LDFLAGS" ] ; then - echo "\$TESTSUITE_LDFLAGS is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_(MODULE|SHARED|EXE)_LINKER_FLAGS instead" >&2; -fi - -if [ -n "$TESTSUITE_LDFLAGS_RELEASE" ] ; then - echo "\$TESTSUITE_LDFLAGS_RELEASE is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_(MODULE|SHARED|EXE)_LINKER_FLAGS_RELEASE instead" >&2; -fi - -if [ -n "$TESTSUITE_LDFLAGS_DEBUG" ] ; then - echo "\$TESTSUITE_LDFLAGS_DEBUG is deprecated. Please use the CMAKE variable (CMAKE|CGAL)_(MODULE|SHARED|EXE)_LINKER_FLAGS_DEBUG instead" >&2; -fi - -# We want english warning and error messages!! -LANG=C -LC_ALL=C -export LANG -export LC_ALL - -SCP="scp" -WGET="wget" -WGET_OPTS="--no-check-certificate --no-verbose" -CURL="curl" -CURL_OPTS="-k --remote-name --silent --location-trusted" -CGAL_URL="https://cgal.geometryfactory.com/CGAL/Releases" -LATEST_LOCATION="${CGAL_URL}/LATEST" -TAR="tar" -GZIP="gzip" -GUNZIP="gunzip" -COMPRESSOR="${GZIP}" -SENDMAIL="mail" -CGAL_TESTER=`whoami` -CGAL_TESTER_NAME="${CGAL_TESTER}" -CGAL_TESTER_ADDRESS="${CGAL_TESTER}" -CONSOLE_OUTPUT="y" -CGAL_ROOT=`pwd` -UPLOAD_RESULT_DESTINATION="cgaltest@cgaltest.geometryfactory.com:incoming" -BUILD_HOSTS="must_be_set_in_.autocgalrc" -MAIL_ADDRESS="must_be_set_in_.autocgalrc" -MYSHELL="" -REFERENCE_PLATFORMS_DIR="must_be_set_in_.autocgalrc" -ACTUAL_DIR=`pwd` -RSH="rsh" -NICE_OPTIONS="-19" -USE_TARGZ="n" -USE_TARBZ="n" -PLATFORMS="" -PLATFORM="" -USE_REFERENCE_PLATFORMS="" -SHOW_PROGRESS="" - -# ---------------------------------------------------------------------------------------- -# write to logfile -# $1 = logfile -# ---------------------------------------------------------------------------------------- -log() -{ - LOGFILE=${1} - shift - if [ -n "${CONSOLE_OUTPUT}" ]; then - printf "${*} ...\n" - fi - printf "\n-------------------------------------------------------\n" >> "${LOGFILE}" - printf " ${*} ...\n" >> "${LOGFILE}" - printf "\n-------------------------------------------------------\n" >> "${LOGFILE}" -} - -log_done() -{ - if [ -n "${CONSOLE_OUTPUT}" ]; then - printf \ - " done\n-------------------------------------------------------\n" - fi - printf "\n-------------------------------------------------------\n" >> "${1}" - printf " **DONE**\n" >> "${1}" - printf "\n-------------------------------------------------------\n" >> "${1}" -} - -# ---------------------------------------------------------------------------------------- -# produce a string containing the actual date/time -# (used to identify files) -# ---------------------------------------------------------------------------------------- -datestr() -{ - date +%d%m%Y%H%M -} - -# ---------------------------------------------------------------------------------------- -# Print error and exit -# ---------------------------------------------------------------------------------------- -error() -{ - if [ -n "${CONSOLE_OUTPUT}" ]; then - printf "\nERROR: ${*}, exiting.\n" >&2 - fi - printf "\nERROR: ${*}, exiting.\n" >> "${ACTUAL_LOGFILE}" - ${COMPRESSOR} -9f "${ACTUAL_LOGFILE}" - FILENAME="${CGAL_RELEASE_ID}-log`datestr`.gz" - mv "${ACTUAL_LOGFILE}.gz" "${LOGS_DIR}/${FILENAME}" - if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then - for i in ${MAIL_ADDRESS}; do - printf "ERROR\n${LOGS_DIR}/${FILENAME}\n" | \ - ${SENDMAIL} -s "completed autotest" "${i}" - done - fi - rm -rf "$LOCK_FILE"; - exit 1 -} - -# ---------------------------------------------------------------------------------------- -# Return 0 if $1 exists in the list $2, otherwise returns non-zero. -# ---------------------------------------------------------------------------------------- -is_in_list() -{ - ELEMENT=${1} - LIST=${2} - - for E in ${LIST} ; do - if [ "${E}" = "${ELEMENT}" ] ; then - return 0 - fi - done - - return 1 -} - -# ---------------------------------------------------------------------------------------- -# function to print the value of variable $1 -# ---------------------------------------------------------------------------------------- -value_of() -{ - _value=`eval "printf '$'${1}"` - eval "printf \"${_value}\"" -} - -# ---------------------------------------------------------------------------------------- -# Executes a command remotely -# $1 = HOST -# $2 = COMMAND -# ---------------------------------------------------------------------------------------- -remote_command() -{ - if [ "${1}" = "localhost" ]; then - eval $2 - else - printf "** Logging into host ${1} **\n" - ${RSH} ${1} ${MYSHELL} \"${2}\" - fi -} - -# ---------------------------------------------------------------------------------------- -# Downloads the file "LATEST" whose contents indicates which release to test -# ---------------------------------------------------------------------------------------- -download_latest() -{ - if [ -r "LATEST" ]; then - rm -rf LATEST - fi - log "${ACTUAL_LOGFILE}" "getting LATEST" - if [ -n "${USE_CURL}" ]; then - ${CURL} ${CURL_OPTS} "${LATEST_LOCATION}" >> "${ACTUAL_LOGFILE}" 2>&1 - else - ${WGET} ${WGET_OPTS} "${LATEST_LOCATION}" >> "${ACTUAL_LOGFILE}" 2>&1 - fi - if [ ! -f "LATEST" ]; then - error "COULD NOT DOWNLOAD LATEST!" - fi -} - -# ---------------------------------------------------------------------------------------- -# Exits the testsuite if the latest release has been already tested. -# This is tested by comparing files LATEST and RELEASE_NR, where -# RELEASE_NR is a copy of the previous LATEST. -# ---------------------------------------------------------------------------------------- -abort_if_latest_already_tested() -{ - if [ -r "RELEASE_NR" ]; then - cmp LATEST RELEASE_NR >> "${ACTUAL_LOGFILE}" - if [ ! ${?} != 0 ]; then - log "${ACTUAL_LOGFILE}" "This release has already been tested." - rm -f "$LOCK_FILE"; - exit 1; - fi - fi -} - - -# ---------------------------------------------------------------------------------------- -# get CGAL -# ---------------------------------------------------------------------------------------- -get_cgal() -{ - if [ -z "$CGAL_LOCATION" ]; then - for i in `cat LATEST` - do - CGAL_LOCATION="${CGAL_URL}/${i}"; - CGAL_ZIPFILE="${i}"; - done - else - CGAL_ZIPFILE=`echo "$CGAL_LOCATION" | sed 's|.*/||'` - fi - - CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.gz//"` - if [ ! "${CGAL_RELEASE_ID}" = "${CGAL_ZIPFILE}" ]; then - USE_TARGZ="y" - else - CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.bz2//"` - if [ ! "${CGAL_RELEASE_ID}" = "${CGAL_ZIPFILE}" ]; then - USE_TARBZ="y" - fi - fi - - log "${ACTUAL_LOGFILE}" "CGAL_ZIPFILE = ${CGAL_ZIPFILE}" - log "${ACTUAL_LOGFILE}" "CGAL_RELEASE_ID = ${CGAL_RELEASE_ID}" - - log "${ACTUAL_LOGFILE}" "getting CGAL" - rm -f "${CGAL_ZIPFILE}" - if [ -n "${USE_CURL}" ]; then - ${CURL} ${CURL_OPTS} "${CGAL_LOCATION}" >> "${ACTUAL_LOGFILE}" 2>&1 - else - ${WGET} ${WGET_OPTS} "${CGAL_LOCATION}" >> "${ACTUAL_LOGFILE}" 2>&1 - fi - if [ ${?} != 0 ]; then - error "Could not get CGAL" - fi - log_done "${ACTUAL_LOGFILE}" -} - - -# ---------------------------------------------------------------------------------------- -# Unzips and untars the downloaded CGAL release -# ---------------------------------------------------------------------------------------- -unzip_cgal() -{ - cd "${CGAL_ROOT}" - - log "${ACTUAL_LOGFILE}" "unzipping CGAL" - if [ "${USE_TARGZ}" = "y" ]; then - DECOMPRESSOR="${GUNZIP}" - log_done "${ACTUAL_LOGFILE}" - fi - - if [ "${USE_TARBZ}" = "y" ]; then - DECOMPRESSOR="bunzip2" - fi - - log "${ACTUAL_LOGFILE}" "untarring CGAL" - ${DECOMPRESSOR} -c "${CGAL_ZIPFILE}" | ${TAR} xf - >> "${ACTUAL_LOGFILE}" 2>&1 - if [ ${?} != 0 ]; then - error "Could not untar CGAL" - fi - - # check, if CGAL_DIR exists - if [ -d "${CGAL_ROOT}/${CGAL_RELEASE_ID}" ]; then - # Reset CGAL-I symlink - log "${ACTUAL_LOGFILE}" "Resetting CGAL-I symlink to ${CGAL_ROOT}/${CGAL_RELEASE_ID}" - rm -f CGAL-I - ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" CGAL-I - # Reset CGAL-3.x-I symlink - CGAL_RELEASE=`echo "${CGAL_RELEASE_ID}" | sed 's/I\([^-]*\)-.*/I\1/'` - log "${ACTUAL_LOGFILE}" "Resetting ${CGAL_RELEASE} symlink to ${CGAL_ROOT}/${CGAL_RELEASE_ID}" - rm -f "${CGAL_RELEASE}" - ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" "${CGAL_RELEASE}" - else - error "directory ${CGAL_ROOT}/${CGAL_RELEASE_ID} does not exist" - fi - - log_done "${ACTUAL_LOGFILE}" -} - - -# ---------------------------------------------------------------------------------------- -# Uniquely adds $1 to the global, space-separated list $PLATFORMS -# (if it is not in the list already) -# ---------------------------------------------------------------------------------------- -add_to_platforms() -{ - if ! is_in_list "${1}" "${PLATFORMS}" ; then - PLATFORMS="${PLATFORMS} ${1}" - fi -} - -# ---------------------------------------------------------------------------------------- -# Uniquely adds to the global, space-separated list $PLATFORMS all the directories found -# under ${REFERENCE_PLATFORMS_DIR} -# ---------------------------------------------------------------------------------------- -collect_all_reference_platforms() -{ - log "${ACTUAL_LOGFILE}" "Indicated to build on ALL platform folders" - if [ -d "${REFERENCE_PLATFORMS_DIR}" ]; then - cd "${REFERENCE_PLATFORMS_DIR}" - for PLATFORM in * ; do - if [ -d "${PLATFORM}" ]; then - add_to_platforms "${PLATFORM}" - fi - done - else - log "${ACTUAL_LOGFILE}" "WARNING: Invalid reference platforms directory: ${REFERENCE_PLATFORMS_DIR}" - fi -} - -# ---------------------------------------------------------------------------------------- -# Uniquely adds to the global, space-separated list $PLATFORMS all the directories found -# under $1 -# ---------------------------------------------------------------------------------------- -collect_all_current_platforms() -{ - PLATFORMS="" - cd "${1}" - for PLATFORM in * ; do - if [ -d "${PLATFORM}" ]; then - PLATFORMS="${PLATFORMS} ${PLATFORM}" - fi - done -} - -# ---------------------------------------------------------------------------------------- -# Uniquely adds to the global, space-separated list $PLATFORMS all the directory names -# listed in the space-separated list $1 -# NOTE: If any such name is "all", it's NOT added as a platform and the flag -# USE_REFERENCE_PLATFORMS is set instead. -# ---------------------------------------------------------------------------------------- -build_platforms_list() -{ - for LOCAL_PLATFORM in $1; do - if [ "${LOCAL_PLATFORM}" = "all" ] ; then - USE_REFERENCE_PLATFORMS='y' - else - add_to_platforms "${LOCAL_PLATFORM}" - fi - done -} - -# ---------------------------------------------------------------------------------------- -# Sets up the variables indicating the directories to use. -# Crates all platform directories under the current release binary folder. -# ---------------------------------------------------------------------------------------- -setup_dirs() -{ - # dir for the actual release - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` - - CGAL_TEST_DIR=${CGAL_DIR}/test - CGAL_DATA_DIR=${CGAL_DIR}/data - export CGAL_DATA_DIR=$(echo "$CGAL_DATA_DIR" | sed -E 's/\/cygdrive\/([a-z])\//\U\1:\//') - - if [ ! -d "${CGAL_DIR}/cmake" ]; then - mkdir "${CGAL_DIR}/cmake" - log "${ACTUAL_LOGFILE}" "Creating ${CGAL_DIR}/cmake" - fi - - if [ ! -d "${CGAL_DIR}/cmake/platforms" ]; then - mkdir "${CGAL_DIR}/cmake/platforms" - log "${ACTUAL_LOGFILE}" "Creating ${CGAL_DIR}/cmake/platforms" - fi - - export CGAL_RELEASE_DIR="${CGAL_DIR}" - - CGAL_RELEASE_ID=`basename "${CGAL_RELEASE_DIR}"` - - CGAL_BINARY_DIR_BASE=${CGAL_RELEASE_DIR}/cmake/platforms - - log "${ACTUAL_LOGFILE}" "Release to test ${CGAL_RELEASE_DIR}" - log "${ACTUAL_LOGFILE}" "CGAL_RELEASE_ID=${CGAL_RELEASE_ID}" - - if [ ! -r "${LOGS_DIR}" ]; then - mkdir "$LOGS_DIR" - fi - - # - # Collects the list of platform directories to build and test on - # - # The global variable PLATFORMS contains all the platform directories for all hosts - # as indicated in .autocgalrc. - # If .autocgalrc says "all" in any entry for BUILD_ON_* or COMPILERS_*, the platform - # directories existing in the reference release are added to $PLATFORMS - # - PLATFORMS="" - - for HOST in ${BUILD_HOSTS}; do - - build_platforms_list "`value_of BUILD_ON_${HOST}`" - build_platforms_list "`value_of COMPILERS_${HOST}`" - - done - - if [ -n "${USE_REFERENCE_PLATFORMS}" ]; then - collect_all_reference_platforms - fi - - - for PLATFORM in ${PLATFORMS}; do - - CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} - - if [ ! -d "${CGAL_BINARY_DIR}" ]; then - log "${ACTUAL_LOGFILE}" "Creating platform directory ${CGAL_BINARY_DIR}" - mkdir "${CGAL_BINARY_DIR}" - fi - - done -} - - -# ---------------------------------------------------------------------------------------- -# copy stuff from old CGAL installation -# ---------------------------------------------------------------------------------------- -copy_old_stuff() -{ - if [ -d "${REFERENCE_PLATFORMS_DIR}" ]; then - - cd "${CGAL_BINARY_DIR_BASE}" - - for PLATFORM in * ; do - if [ -d "${PLATFORM}" ]; then - - # if the reference platform folder contains a setup script, copy it - if [ -f "${REFERENCE_PLATFORMS_DIR}/${PLATFORM}/setup" ]; then - log "${ACTUAL_LOGFILE}" "Copying reference platform setup script [${REFERENCE_PLATFORMS_DIR}/${PLATFORM}/setup] in [${CGAL_BINARY_DIR_BASE}/${PLATFORM}]" - cp "${REFERENCE_PLATFORMS_DIR}/${PLATFORM}/setup" "${CGAL_BINARY_DIR_BASE}/${PLATFORM}" - - # hack on Windows, where 'cp' does not copy the Windows ACLs - chmod a+r "${CGAL_BINARY_DIR_BASE}/${PLATFORM}/setup" - fi - fi - done - - fi -} - - -# ---------------------------------------------------------------------------------------- -# Builds the CGAL library on the host specified at $1 -# ---------------------------------------------------------------------------------------- -build_cgal_on_host() -{ - HOST=${1} - - PLATFORMS="`value_of BUILD_ON_${HOST}`" - - - if [ -z "${PLATFORMS}" ]; then - PLATFORMS=`value_of COMPILERS_${HOST}` - fi - - if [ "${PLATFORMS}" = "all" ]; then - collect_all_current_platforms "${CGAL_BINARY_DIR_BASE}" - fi - - if [ -n "${PLATFORMS}" ]; then - - for PLATFORM in ${PLATFORMS} ; do - - CGAL_BINARY_DIR="${CGAL_BINARY_DIR_BASE}/${PLATFORM}" - - log "${ACTUAL_LOGFILE}" "Building cgal libs on host ${HOST} and platform ${PLATFORM}\nUnder ${CGAL_BINARY_DIR}\n" - - if [ -f "${CGAL_BINARY_DIR}/localbuildscript" ] ; then - log "${ACTUAL_LOGFILE}" "WARNING! Already built on platform ${PLATFORM}." - else - - if [ -f "${CGAL_BINARY_DIR}/setup" ]; then - cp "${CGAL_BINARY_DIR}/setup" "${CGAL_BINARY_DIR}/localbuildscript" - else - rm -f "${CGAL_BINARY_DIR}/localbuildscript" - fi - - cat >> "${CGAL_BINARY_DIR}/localbuildscript" <> "${CGAL_BINARY_DIR}/localbuildscript" <&1 | tee "${ACTUAL_LOGFILE}.build.${PLATFORM}" - else - remote_command ${HOST} "${CGAL_BINARY_DIR}/localbuildscript" > "${ACTUAL_LOGFILE}.build.${PLATFORM}" 2>&1 - fi - - cp "${ACTUAL_LOGFILE}.build.${PLATFORM}" "${CGAL_BINARY_DIR}/installation.log" - fi - - done - else - error "There are no platform directories under ${CGAL_BINARY_DIR_BASE} to test! " - fi - -} - - -# ---------------------------------------------------------------------------------------- -# builds cgal -# ---------------------------------------------------------------------------------------- -build_cgal() -{ - for HOST in ${BUILD_HOSTS}; do - build_cgal_on_host "${HOST}" - done - - # NOTE: At this point PWD is in the last platform directory where CGAL was built - - log_done "${ACTUAL_LOGFILE}" - cp "${ACTUAL_LOGFILE}" "${CGAL_BINARY_DIR_BASE}/installation.log" - ${COMPRESSOR} -9f "${ACTUAL_LOGFILE}" - mv "${ACTUAL_LOGFILE}.gz" "${LOGS_DIR}/${CGAL_RELEASE_ID}-log`datestr`.gz" -} - -# ---------------------------------------------------------------------------------------- -# Runs the test on the host $1 under the platform folder $2 -# the variable PROCESSORS_electra, where electra is the -# name of the machine, is used to specify the number of -# processors to use -# ---------------------------------------------------------------------------------------- -run_test_on_host_and_platform() -{ - HOST=${1} - PLATFORM=${2} - - NUMBER_OF_PROCESSORS="`value_of PROCESSORS_${HOST}`" - CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} - cd "${CGAL_BINARY_DIR}" - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Testing on host ${HOST} and platform ${PLATFORM}" - if [ "${NUMBER_OF_PROCESSORS}" = "1" ] ; then - MAKE_OPTS="" - else - MAKE_OPTS="-j ${NUMBER_OF_PROCESSORS}" - fi - - if [ -f "${CGAL_BINARY_DIR}/localtestscript" ]; then - log "${ACTUAL_LOGFILE}" "WARNING! Already tested on platform ${PLATFORM}." - else - if [ -f "${CGAL_BINARY_DIR}/setup" ]; then - cp "${CGAL_BINARY_DIR}/setup" "${CGAL_BINARY_DIR}/localtestscript" - else - rm -f "${CGAL_BINARY_DIR}/localtestscript" - fi - - for file in "${CGAL_BINARY_DIR}/localtestscript" "${CGAL_BINARY_DIR}/localtestscript-redo-results-collection"; do - cat >> "$file" <> "${CGAL_BINARY_DIR}/localtestscript" <> "$file" <> "$file" <<'EOF' - for demo_dir in *_Demo; do - echo "pushd ${demo_dir}" - pushd "${demo_dir}" - bash ../cgal_demo_copy_all_dlls_cygwin.sh "${demo_dir}_with_dlls" "" - mv "${demo_dir}_with_dlls" .. - popd - done -EOF -cat >> "$file" <> "${CGAL_BINARY_DIR}/localtestscript" <&1 | tee "${ACTUAL_LOGFILE}.test.${PLATFORM}" - else - remote_command ${HOST} "${CGAL_BINARY_DIR}/localtestscript" > "${ACTUAL_LOGFILE}.test.${PLATFORM}" 2>&1 - fi - - log_done "${ACTUAL_LOGFILE}.test.${PLATFORM}" - - fi -} - -publish_results() -{ - HOST=${1} - PLATFORM=${2} - - # - # collect results and put them on the web - # - cd "${CGAL_TEST_DIR}" - - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "COLLECTING RESULTS ${PLATFORM}-${HOST}" - - # If this file does not exist results collection failed. Fake a results so this fact is itself reported - if [ ! -f "results_${CGAL_TESTER}_${PLATFORM}.txt" ]; then - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Results collection for tester ${CGAL_TESTER} and platform ${PLATFORM} failed!" - echo "Results collection failed!" >> "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${TAR} cf "results_${CGAL_TESTER}_${PLATFORM}.tar" "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${COMPRESSOR} -9f "results_${CGAL_TESTER}_${PLATFORM}.tar" - fi - - ${TAR} cf "test_results-${HOST}_${PLATFORM}.tar" "results_${CGAL_TESTER}_${PLATFORM}.tar.gz" "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${COMPRESSOR} -9f "test_results-${HOST}_${PLATFORM}.tar" - COMPILER=`printf "%s" "$2" | tr -c '[A-Za-z0-9]./[=-=]*_\'\''\":?() ' 'x'` - FILENAME="${CGAL_RELEASE_ID}_${CGAL_TESTER}-test`datestr`-${COMPILER}-cmake.tar.gz" - LOGFILENAME="${CGAL_RELEASE_ID}-log`datestr`-${HOST}.gz" - ${COMPRESSOR} -9f "${ACTUAL_LOGFILE}.test.${PLATFORM}" - mv "${ACTUAL_LOGFILE}.test.${PLATFORM}.gz" "${LOGS_DIR}/${LOGFILENAME}" - - log_done "${ACTUAL_LOGFILE}.test.${PLATFORM}" - - log "${ACTUAL_LOGFILE}" "Test results: ${CGAL_TEST_DIR}/test_results-${HOST}_${PLATFORM}.tar.gz" - - if [ -z "${DO_NOT_UPLOAD}" ]; then - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "PUTTING RESULTS ON THE WEB" - put_on_web "test_results-${HOST}_${PLATFORM}.tar.gz" "${FILENAME}" - if [ -e "demos_${CGAL_TESTER}_${PLATFORM}.tar.gz" ]; then - put_on_web "demos_${CGAL_TESTER}_${PLATFORM}.tar.gz" "demos-${FILENAME}" - fi - log_done "${ACTUAL_LOGFILE}" - fi - - # - # notify the CGAL world - # - if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then - for i in ${MAIL_ADDRESS}; do - echo "Notifying ${i} about autotest finished." - printf "result collection::\n${FILENAME}\n" | ${SENDMAIL} -s "autohandle" ${i} - done - fi -} - -# ---------------------------------------------------------------------------------------- -# Runs the test on the host $1 -# ---------------------------------------------------------------------------------------- -run_test_on_host() -{ - HOST=${1} - - PLATFORMS=`value_of COMPILERS_${HOST}` - - if [ "${PLATFORMS}" = "all" ]; then - collect_all_current_platforms "${CGAL_BINARY_DIR_BASE}" - fi - - for PLATFORM in ${PLATFORMS}; do - run_test_on_host_and_platform "${HOST}" "${PLATFORM}" - publish_results "${HOST}" "${PLATFORM}" - done -} - -# ---------------------------------------------------------------------------------------- -# run the testsuites -# ---------------------------------------------------------------------------------------- -run_test() -{ - log "${ACTUAL_LOGFILE}" "running the testsuites" - if [ -n "${CONSOLE_OUTPUT}" ]; then - printf "\n-------------------------------------------------------\n" - fi - - for HOST in ${BUILD_HOSTS}; do - run_test_on_host ${HOST} & - done -} - -# ---------------------------------------------------------------------------------------- -# function to put result files on the web -# $1 = source filename (full path) -# $2 = target filename (basename only) -# ---------------------------------------------------------------------------------------- -put_on_web() -{ - log "${ACTUAL_LOGFILE}" "Uploading results ${1} to $UPLOAD_RESULT_DESTINATION/$2" - - "$SCP" "${1}" "$UPLOAD_RESULT_DESTINATION/$2" >> "${ACTUAL_LOGFILE}" -} - - - - -# ---------------------------------------------------- -# START OF MAIN BODY -# ---------------------------------------------------- - -# Parse command line arguments -for arg in "$@" -do - case "$arg" in - "-c") - echo "Using latest unzipped release instead of getting a new one from the server" - USE_LATEST_UNZIPPED="y" - ;; - "-l") - echo "Not uploading results to dashboard" - DO_NOT_UPLOAD="y" - ;; - "-n") - # echo "No testsuite will be launched. Installation only." - DO_NOT_TEST="y" - ;; - "-s") - echo "Showing progress." - SHOW_PROGRESS="y" - ;; - "-k") - echo "Compiled test/ directory will be kept." - KEEP_TESTS="y" - ;; - *) - CGAL_LOCATION=$arg - esac -done - -# Load settings -if [ -f "$HOME/.autocgal_with_cmake_rc" ]; then - . "$HOME/.autocgal_with_cmake_rc" -else - if [ -f "$HOME/.autocgalrc" ]; then - . "$HOME/.autocgalrc" - else - echo "CONFIGURATION FILE .autocgal_with_cmake_rc or .autocgalrc NOT FOUND" >&2; - exit 1 - fi -fi - -LOGS_DIR="${CGAL_ROOT}/AUTOTEST_LOGS" -LOCK_FILE="${CGAL_ROOT}/autotest_cgal_with_cmake.lock" -LIST_TEST_PACKAGES="${CGAL_ROOT}/list_test_packages" - -# Setup logfile -ACTUAL_LOGFILE="${CGAL_ROOT}/`basename ${0}`.log" -rm -f "${ACTUAL_LOGFILE}" - -echo "Running `basename ${0}` "'$Revision$' >> "${ACTUAL_LOGFILE}" - -# Sanity checks -if [ "${REFERENCE_PLATFORMS_DIR}" = "must_be_set_in_.autocgalrc" ]; then - error "REFERENCE_PLATFORMS_DIR must be set in .autocaglrc" -fi - -if [ "${BUILD_HOSTS}" = "must_be_set_in_.autocgalrc" ]; then - error "BUILD_HOSTS must be set in .autocgalrc" -else - for i in ${BUILD_HOSTS}; do - TEXT="`value_of COMPILERS_${i}`" - if [ -z "${TEXT}" -a "${i}" != "localhost" ]; then - error "COMPILERS_${i} must be defined in .autocgalrc" - else - TEXT="`value_of PROCESSORS_${i}`" - TEMPVAR="PROCESSORS_${i}" - if [ -z "${TEXT}" ]; then - log "${ACTUAL_LOGFILE}" "\ngiving default 1 values TO PROCESSORS_${i} ..."; - eval $TEMPVAR="1"; - fi - fi - done -fi - -# Make that file writable (lockfile create read-only files -chmod u+w "$LOCK_FILE" -# Put the PID of current process in the lock file -echo $$ > "$LOCK_FILE" - -fi - -# that line makes the script remove the lock file in case of unwanted exit -trap "rm -f \"$LOCK_FILE\"" EXIT HUP INT TERM - -# Notify test started -if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then - for i in ${MAIL_ADDRESS}; do - echo "Notifying ${i} about autotest started." - printf "subject says it all\n" | \ - ${SENDMAIL} -s "Started autotest" ${i} - done -fi - - - -cd "$CGAL_ROOT" - -# Starts the process - -if [ -z "${USE_LATEST_UNZIPPED}" ]; then - if [ -z "$CGAL_LOCATION" ]; then - download_latest - abort_if_latest_already_tested - fi - get_cgal - unzip_cgal -fi - -setup_dirs - -copy_old_stuff - -build_cgal - -if [ "${BUILD_HOSTS}" = "localhost" ]; then - TEXT="`value_of COMPILERS_localhost`" - if [ -z "${DO_NOT_TEST}" ]; then - if [ -z "${TEXT}" ]; then - printf "Skipping testing phase (use the -n option to remove this message).\n" - DO_NOT_TEST="y" - fi - fi -fi - -if [ -z "${DO_NOT_TEST}" ]; then - run_test -fi - -cd "${CGAL_ROOT}" - -if [ -e "LATEST" ]; then - mv LATEST RELEASE_NR -fi - -rm -f "$LOCK_FILE"; - -# EOF - -## Local Variables: -## sh-basic-offset: 2 -## End: diff --git a/Scripts/developer_scripts/autotest_cgal_with_cmake b/Scripts/developer_scripts/autotest_cgal_with_cmake deleted file mode 100755 index bfe9f0addd8..00000000000 --- a/Scripts/developer_scripts/autotest_cgal_with_cmake +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec ${0%_with_cmake} ${1+"$@"} diff --git a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh deleted file mode 100644 index 42843931a36..00000000000 --- a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -#To run: $1 = name of the user -# $2 = name of the branch -# $3 = base ref name (master, 5.1.x, 5.2.x, etc...) -# $4 = number of the PR - - -if uname | grep -q -i cygwin; then - #Is supposed to ignore \r as eol character. - export SHELLOPTS - set -o igncr -fi -source ~/.autofilterrc -( -USER_REPO=$1 -BRANCH_NAME=$2 -BASE_NAME=$3 -PR_NUMBER=$4 - - -cd ${CGAL_GIT_DIR} -if [ ! -d cgal ]; then - git clone https://github.com/CGAL/cgal.git - cd cgal - git remote rename origin cgal - cd .. -fi -cd cgal -git fetch cgal -git remote add $USER_REPO https://github.com/$USER_REPO/cgal.git -git fetch $USER_REPO -git checkout $BRANCH_NAME -git reset --hard $USER_REPO/$BRANCH_NAME -#setup the list_test_packages -TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |grep -E -v /doc |grep -E "\.h"\|"\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |grep -E -v Installation||true) - -LIST_OF_PKGS="" -for PKG in $(ls) ; do - if [ -f $PKG/package_info/$PKG/dependencies ]; then - if [ -n "$(comm -12 <(echo "$TMP_LIST"|sort) <(cat $PKG/package_info/$PKG/dependencies|sort))" ]; then - LIST_OF_PKGS="$LIST_OF_PKGS $PKG" - fi - fi -done -if [ -f ${CGAL_ROOT}/list_test_packages ]; then rm ${CGAL_ROOT}/list_test_packages; fi -if [ "$LIST_OF_PKGS" != "" ]; then - for f in $LIST_OF_PKGS - do - echo "echo \"$f\"" >> ${CGAL_ROOT}/list_test_packages - echo "echo \"${f}_Examples\"" >> ${CGAL_ROOT}/list_test_packages - echo "echo \"${f}_Demo\"" >> ${CGAL_ROOT}/list_test_packages - done -fi -#create the release from the branch -echo " Create release..." -CGAL_VERSION="$(sed -E 's/#define CGAL_VERSION (.*\..*)-dev/\1/' <(grep "#define CGAL_VERSION " Installation/include/CGAL/version.h))-Ic-${PR_NUMBER}" -cmake -DGIT_REPO=${CGAL_GIT_DIR}/cgal -DDESTINATION=${CGAL_ROOT}/CGAL-TEST -DPUBLIC=OFF -DTESTSUITE=ON -DCGAL_VERSION=${CGAL_VERSION} -P ${CGAL_GIT_DIR}/cgal/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake | tee log -echo "done." -DEST=$(sed -E 's/.*CGAL-TEST\/(.*)/\1/' log); - -cd ${CGAL_ROOT} - -if [ -L CGAL-I ]; then rm CGAL-I; fi -ln -s $PWD/CGAL-TEST/$DEST CGAL-I -if [ -d CGAL-I/cmake/platforms ]; then - rm -rf CGAL-I/cmake/platforms/* -fi -echo "starting testsuite..." - -./autotest_cgal -c - -echo "finished." -)>${CGAL_ROOT}/autotest.log2 2>&1 & - -echo "exit." -exit 0 diff --git a/Testsuite/test/collect_cgal_testresults_from_cmake b/Testsuite/test/collect_cgal_testresults_from_cmake deleted file mode 100755 index b8e3370abee..00000000000 --- a/Testsuite/test/collect_cgal_testresults_from_cmake +++ /dev/null @@ -1,283 +0,0 @@ -#!/bin/sh -# collect_cgal_testresults_from_cmake -# =================================== -# collect all files to generate the html page -# containing the testsuite results -# -# to be run in the CGAL/test directory or a local test directory. -# CGAL_TESTER, CGAL_TESTER_NAME, CGAL_TESTER_ADDRESS are environment variables. - - -if [ -z "${CGAL_TEST_PLATFORM}" ]; then - - CGAL_TEST_PLATFORM=`dirname $PWD` - echo "CGAL_TEST_PLATFORM not in the environment, setting it to ${CGAL_TEST_PLATFORM}" -fi - -if [ -z "$1" ] ; then - TEST_DIRECTORIES=`ls` -else - TEST_DIRECTORIES="$*" -fi - -GENERAL_BUILD_LOGFILE='' -PLATFORM_BUILD_LOGFILE='' -TEST_REPORT='' -RESULT_FILE='' - -#print_testresult -# print result on stdout -# print timings on fd3 -print_testresult() -{ - if [ -f skipped ]; then - RESULT="s" - TIMING="0" - elif [ ! -f ErrorOutput_$1 ] ; then - RESULT="?" - TIMING="?" - else - if eval grep ERROR ErrorOutput_$1 > /dev/null ; then - RESULT="n" - else - # grep -q means "quiet": no output, the return code is 0 iff the file - # matches the regular expression. - # grep -i means "case insensitive". - # grep -E means "extended regular expressions". - # All those three options are in the Single Unix Specification version 3 - - # The extended regular expression '[^a-zA-Z_,:-]warning matches any - # string "warning" preceded with a letter that is not a letter or '_' - # or ',' or ':'. That avoids some false positives such as - # '-read_only_relocs,warning' or '-D_CRT_SECURE_NO_WARNINGS', or - # 'QMessageBox::warning'. - if grep -v -F 'CMake Warning at /usr/share/cmake/Modules/FindBoost' CompilerOutput_$1 ProgramOutput.*.$1 | grep -i -E -q '(^|[^a-zA-Z_,:-])warning' - then - if grep -v -F 'CMake Warning at /usr/share/cmake/Modules/FindBoost' CompilerOutput_$1 ProgramOutput.*.$1 | grep -i -E '(^|[^a-zA-Z_,:-])warning' | grep -i -q "include[/\]CGAL\|cmake\|CGAL warning" - then - RESULT="w" - else - RESULT="t" - fi - else - if grep -E -q 'NOTICE: .*(need|require|incompatible|not found).*will not be' CompilerOutput_$1 - then - RESULT="r" - else - RESULT="y" - fi - fi - fi - TIMING=`awk '/^ # Running time: / {print $4}' < ErrorOutput_$1` - fi - echo "$2 $TIMING" >&3 - echo "$2 $RESULT" -} - -parse_flags_and_third_party_choices() -{ - grep -e "^-- USING " ${PLATFORM_BUILD_LOGFILE} >> $RESULT_FILE - echo "------------" >> $RESULT_FILE -} - - -output_main_logs() -{ - [ -e Installation ] || mkdir "Installation" - - INSTALLATION_TEST_REPORT="Installation/$TEST_REPORT" - - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " General Build Log " >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "${GENERAL_BUILD_LOGFILE}" ] ; then - cat "${GENERAL_BUILD_LOGFILE}" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " Platform-specific Build Log " >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "${PLATFORM_BUILD_LOGFILE}" ] ; then - cat "${PLATFORM_BUILD_LOGFILE}" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - if [ -f "$HOME/.autocgal_with_cmake_rc" ] ; then - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " .autocgal_with_cmake_rc" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - cat "$HOME/.autocgal_with_cmake_rc" >> "$INSTALLATION_TEST_REPORT" - else - if [ -f "$HOME/.autocgalrc" ] ; then - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " .autocgalrc" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - cat "$HOME/.autocgalrc" >> "$INSTALLATION_TEST_REPORT" - fi - fi - - if [ -f "../setup" ] ; then - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " setup" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - cat "../setup" >> "$INSTALLATION_TEST_REPORT" - fi - - - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " CMakeCache.txt" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "../CMakeCache.txt" ] ; then - cat "../CMakeCache.txt" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " include/CGAL/compiler_config.h" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "../include/CGAL/compiler_config.h" ] ; then - cat "../include/CGAL/compiler_config.h" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " CGALConfig.cmake" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "../CGALConfig.cmake" ] ; then - cat "../CGALConfig.cmake" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " CMakeError.log" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "../CMakeFiles/CMakeError.log" ] ; then - cat "../CMakeFiles/CMakeError.log" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - - echo "" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo " CMakeOutput.log" >> "$INSTALLATION_TEST_REPORT" - echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" - echo "" >> "$INSTALLATION_TEST_REPORT" - if [ -f "../CMakeFiles/CMakeOutput.log" ] ; then - cat "../CMakeFiles/CMakeOutput.log" >> "$INSTALLATION_TEST_REPORT" - else - echo "Not found!" >> "$INSTALLATION_TEST_REPORT" - fi - -} - -echo "---------------------------------------------------------------" -echo " Collecting results of platform $CGAL_TEST_PLATFORM" -echo "---------------------------------------------------------------" - -CURRENT_DIR=`pwd` -TESTER=${CGAL_TESTER:-${USER:-`whoami`}} -TESTER_NAME="${CGAL_TESTER_NAME:-${TESTER}}" -TESTER_ADDRESS="${CGAL_TESTER_ADDRESS:-${TESTER}}" -TEST_REPORT="TestReport_${TESTER}_${CGAL_TEST_PLATFORM}" -RESULT_FILE="$CURRENT_DIR/results_${TESTER}_${CGAL_TEST_PLATFORM}.txt" -TIMING_FILE="$CURRENT_DIR/timings_${TESTER}_${CGAL_TEST_PLATFORM}.txt" -CGAL_DIR=../../../.. -GENERAL_BUILD_LOGFILE="../../installation.log" -PLATFORM_BUILD_LOGFILE="../installation.log" -rm -f "$RESULT_FILE" "$TIMING_FILE" -touch "$RESULT_FILE" "$TIMING_FILE" -sed -n '/CGAL_VERSION /s/#define //p' < "$CGAL_DIR/include/CGAL/version.h" >> "$RESULT_FILE" -echo "TESTER ${TESTER}" >> "$RESULT_FILE" -echo "TESTER_NAME ${TESTER_NAME}" >> "$RESULT_FILE" -echo "TESTER_ADDRESS ${TESTER_ADDRESS}" >> "$RESULT_FILE" -echo "CGAL_TEST_PLATFORM ${CGAL_TEST_PLATFORM}" >> "$RESULT_FILE" -echo "General installation log file: ${GENERAL_BUILD_LOGFILE}" >> "$RESULT_FILE" -echo "Host-specific installation log file: ${PLATFORM_BUILD_LOGFILE}" >> "$RESULT_FILE" - -output_main_logs - -parse_flags_and_third_party_choices - -for DIR in $TEST_DIRECTORIES ; do - if [ -d "$DIR" ] ; then - echo " $DIR ..." - cd "$DIR" - - print_testresult "$CGAL_TEST_PLATFORM" "$DIR" >> "$RESULT_FILE" 3>>"$TIMING_FILE" - - if [ ! "$DIR" = "Installation" ] ; then - rm -f "${TEST_REPORT}" - touch "$TEST_REPORT" - fi - if [ -f .scm-urls ]; then - echo " Test files from:" >> "$TEST_REPORT" - cat .scm-urls >> "$TEST_REPORT" - echo >> "$TEST_REPORT" - elif [ -f ../../../../../.scm-branch ]; then - cat ../../../../../.scm-branch >> "$TEST_REPORT" - echo >> "$TEST_REPORT" - fi - - if [ ! -f ErrorOutput_${CGAL_TEST_PLATFORM} ] ; then - echo "Error: file $DIR/ErrorOutput_${CGAL_TEST_PLATFORM} does not exist!" - else - cat ErrorOutput_${CGAL_TEST_PLATFORM} >> "$TEST_REPORT" - fi - - if [ ! -f CompilerOutput_${CGAL_TEST_PLATFORM} ] ; then - echo "Error: file $DIR/CompilerOutput_${CGAL_TEST_PLATFORM} does not exist!" - else - cat CompilerOutput_${CGAL_TEST_PLATFORM} >> "$TEST_REPORT" - fi - - if 2>&1 eval ls ProgramOutput.*.${CGAL_TEST_PLATFORM} > /dev/null ; then - PROGRAM_OUTPUT=`ls ProgramOutput.*"$CGAL_TEST_PLATFORM"*` - for FILE in $PROGRAM_OUTPUT ; do - echo >> "$TEST_REPORT" - echo "------------------------------------------------------------------" >> "$TEST_REPORT" - echo "- $FILE" >> "$TEST_REPORT" - echo "------------------------------------------------------------------" >> "$TEST_REPORT" - cat $FILE >> "$TEST_REPORT" - done - fi - - cd .. - fi -done - - -OUTPUT_FILE=results_${TESTER}_${CGAL_TEST_PLATFORM}.tar -rm -f $OUTPUT_FILE $OUTPUT_FILE.gz -tar cf $OUTPUT_FILE results_${TESTER}_${CGAL_TEST_PLATFORM}.txt timings_${TESTER}_${CGAL_TEST_PLATFORM}.txt */"$TEST_REPORT" -echo -echo "compressing ..." -gzip -9f $OUTPUT_FILE -echo "results written to file $OUTPUT_FILE.gz" -echo - - -# Local Variables: -# standard-indent: 2 -# End: diff --git a/Testsuite/test/run_testsuite_with_cmake b/Testsuite/test/run_testsuite_with_cmake deleted file mode 100755 index 17a0b7fcaea..00000000000 --- a/Testsuite/test/run_testsuite_with_cmake +++ /dev/null @@ -1,263 +0,0 @@ -#! /bin/sh -# -# This is the test script for the CGAL-library. -# -# Usage: -# run_testsuite for running the test suite in all subdirectories -# run_testsuite for running the test suite in the listed -# subdirectories -# -# To use this script you have to do two things: -# -# 2) set some additional compiler and or linker flags - -TESTSUITE_CXXFLAGS="" -TESTSUITE_LDFLAGS="" - -CURRENTDIR=`pwd` -ERRORFILE=${CURRENTDIR}/error.txt -if [ -n "$CGAL_TEST_PLATFORM" ]; then - PLATFORM=$CGAL_TEST_PLATFORM -else - PLATFORM=no-platform -fi -if [ -n "${CGAL_TIMEOUT_PROG+x}" ]; then - TIMEOUT=$CGAL_TIMEOUT_PROG -else - TIMEOUT=`which timeout` - [ -z "$TIMEOUT" ] && TIMEOUT=`which gtimeout` -fi - -#clear the error file -rm -f "$ERRORFILE" -touch "$ERRORFILE" - -# On Cygwin, killing bash does not kill jobs it has spawned. This -# function takes a PID as argument and prints the list of children -# processes of this process, including itself. -process_tree() -{ - local pid=$1 - local result= - echo $pid - ps -a | awk '!/^ +PID/ {print $1 " " $2}' | { - while read apid appid; do - if [ "$appid" = "$pid" ]; then - process_tree $apid - fi - done - } -} - -# Wait for process with pid $1. -# Wait for $2 periods of $3 seconds, checking after every period -# if the watched process has finished. -wait_for_process() -{ - pid=$1; - cycles=$2 - period=$3 - while [ $cycles -ne 0 ] - do - cycles=`expr $cycles - 1` -# send SIGCONT to the process and check the exit value of kill. -# If the process still exists, the call to kill succeeds (and the signal is -# ignored). - - kill -CONT $pid 2>kill_output 1>/dev/null; terminated=$? -# But under CYGWIN the exit status is not to be trusted. - if [ $terminated -eq 0 ]; then - if grep -i 'no such process' kill_output; then - terminated=1; - fi - fi - rm -f kill_output - if [ $terminated -eq 0 ] - then - sleep $period - else - cycles=0 - running=0 - fi - done - if [ $terminated -eq 0 ] - then - if false; then -# Send signal Terminate (SIGTERM) to the whole process group. -# First disable the default action (quit) for the current process. - trap true TERM - kill -TERM 0 - trap TERM - else - - # $pid is the PID of the forked shell that launched the command - # in background, in run_local_cgal_test(). If the shell is - # Bash, the Bash manual states that it ignores SIGTERM. - # However, it does not catch SIGHUP. That is why the first - # signal send is SIGHUP. - case "`uname`" in - CYGWIN*) - pids=`process_tree $pid`;; - *) pids=$pid;; - esac - for p in $pids; do kill -HUP $p; done - sleep 10 - # If SIGHUP was not enough, SIGKILL will finish the job, 10s after. - for p in $pids; do kill -KILL $p 2>/dev/null; done - fi - return 1 - fi - return 0 -} - -run_local_cgal_test() -{ - # Workaround an issue on Windows when GNU Make is used for "make -f - # makefile2" but nmake is used after. - MAKEFLAGS= - export MAKEFLAGS - - if [ -n "$TIMEOUT" ]; then - "$TIMEOUT" $(( $TIME_PERIOD * 5 )) ./cgal_test_with_cmake > current_compiler_output 2>&1 - else - ./cgal_test_with_cmake > current_compiler_output 2>&1 - fi - exit_value=$? - if [ $exit_value -ne 0 ] - then - printf "%s\n" "$exit_value" > test_failure - fi - return $exit_value -} - -#test_directory -# test_directory() may call itself once: the second parameter avoids that -# it calls itself infinitely. -test_directory() -{ - cd "$CURRENTDIR" - if [ -d $1 ] ; then - echo "DIRECTORY $1:" - echo - - echo "DIRECTORY $1:" >> "$ERRORFILE" - echo >> "$ERRORFILE" - cd "$1" - - COMPILER_OUTPUT=CompilerOutput_$PLATFORM - rm -f "$COMPILER_OUTPUT" - ERROR_OUTPUT=ErrorOutput_$PLATFORM - rm -f "$ERROR_OUTPUT" - - echo "------------------------------------------------------------------" >> "$COMPILER_OUTPUT" - echo "- Compiler output from platform $PLATFORM" >> "$COMPILER_OUTPUT" - echo "------------------------------------------------------------------" >> "$COMPILER_OUTPUT" - echo >> "$COMPILER_OUTPUT" - - echo "------------------------------------------------------------------" >> "$ERROR_OUTPUT" - echo "- Error output from platform $PLATFORM" >> "$ERROR_OUTPUT" - echo "------------------------------------------------------------------" >> "$ERROR_OUTPUT" - echo >> "$ERROR_OUTPUT" - - if [ -f cgal_test_with_cmake -a -x cgal_test_with_cmake ] ; then - export PLATFORM TESTSUITE_CXXFLAGS TESTSUITE_LDFLAGS - rm -f error.txt - START=`date +%s` - TIME_PERIOD=1200 - if [ "$1" = "Polyhedron_Demo" ]; then - TIME_PERIOD=2400 - fi - if [ -n "$TIMEOUT" ]; then - run_local_cgal_test - return_code=$? - if [ $return_code -eq 124 ]; then - echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERRORFILE" - echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERROR_OUTPUT" - else - if [ -f test_failure ] ; then - exit_failure=`cat test_failure` - rm -f test_failure - echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERRORFILE" - echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERROR_OUTPUT" - fi - fi - else - run_local_cgal_test & - - if wait_for_process "$!" "$TIME_PERIOD" "5" - then - if [ -f test_failure ] ; then - exit_failure=`cat test_failure` - rm -f test_failure - echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERRORFILE" - echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERROR_OUTPUT" - fi - else - echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERRORFILE" - echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERROR_OUTPUT" - fi - fi - STOP=`date +%s` - DURATION=`expr "$STOP" - "$START"` - printf " # Running time: %s (seconds)\n\n" "$DURATION" >> "$ERRORFILE" - printf " # Running time: %s (seconds)\n\n" "$DURATION" >> "$ERROR_OUTPUT" - cat current_compiler_output >> "$COMPILER_OUTPUT" - cat current_compiler_output - rm -f current_compiler_output - - if [ -f error.txt ] ; then - cat error.txt >> "$ERRORFILE" - cat error.txt >> "$ERROR_OUTPUT" - else - echo "ERROR: the script cgal_test_with_cmake failed to generate output" >> "$ERRORFILE" - fi - else - if [ -z "$2" ]; then - create_cgal_test - test_directory "$1" "second_time" - else - echo " Could not execute the script cgal_test_with_cmake in directory $1" - echo "ERROR: could not execute the script $1/cgal_test_with_cmake" >> $ERRORFILE - fi - fi - echo >> "$ERRORFILE" - echo >> "$ERROR_OUTPUT" - fi - echo -} - -run_testsuite() -{ - - echo "---------------------------------------------------------------" - echo "- Testing platform $PLATFORM" - echo "---------------------------------------------------------------" - echo - - echo "---------------------------------------------------------------" >> "$ERRORFILE" - echo "- TEST RESULTS FROM PLATFORM $PLATFORM" >> "$ERRORFILE" - echo "---------------------------------------------------------------" >> "$ERRORFILE" - echo >> "$ERRORFILE" - - case "`uname`" in - CYGWIN*) - PATH=`cygpath "$CGAL_DIR"`/bin:`cygpath "$CGAL_DIR"`/lib:$PATH - export PATH - esac - - for DIR in $TEST_DIRECTORIES ; do - if [ ! -f $DIR/skipped ]; then - test_directory "$DIR" - fi - done -} - -[ x"$1" = x"icons" -o x"$1" = x"resources" ] && exit 0 - -if [ -z "$1" ] ; then - TEST_DIRECTORIES=`ls | grep -E -v 'icons|resources'` -else - TEST_DIRECTORIES="$*" -fi - -run_testsuite From e4adcceaad0dbd96e69a2cb6e04823bb338f0056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 21 Jan 2025 11:30:48 +0100 Subject: [PATCH 156/175] more clean up --- .gitattributes | 1 - .../Developer_manual/Chapter_testing.txt | 2 +- Testsuite/test/makefile2 | 15 --------------- Testsuite/test/testsuite_branch_build.mk | 15 --------------- 4 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 Testsuite/test/makefile2 delete mode 100644 Testsuite/test/testsuite_branch_build.mk diff --git a/.gitattributes b/.gitattributes index 38320ad4f0b..35a89b731c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -44,7 +44,6 @@ Documentation/Doxyfile text eol=lf Documentation/pkglist_filter text eol=lf Installation/update_CHANGES text eol=lf Scripts/developer_scripts/autotest_cgal text eol=lf -Scripts/developer_scripts/autotest_cgal_with_cmake text eol=lf Scripts/developer_scripts/cgal_build text eol=lf Scripts/developer_scripts/cgal_depend text eol=lf Scripts/developer_scripts/cgal_git_update_hooks_for_client text eol=lf diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt index 627d452e1b8..42215c6eef1 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt @@ -46,7 +46,7 @@ Then you need to compile this flat release and set `CGAL_DIR` accordingly as exp To run the test-suite simply do: \code > cd CGAL-I-FOO/test - > ./run_testsuite_with_cmake + > ./run_testsuite_with_ctest \endcode and wait for the results to be written in the file `error.txt`. diff --git a/Testsuite/test/makefile2 b/Testsuite/test/makefile2 deleted file mode 100644 index c1c3dfe4fc1..00000000000 --- a/Testsuite/test/makefile2 +++ /dev/null @@ -1,15 +0,0 @@ -# A GNU makefile which calls run_testsuite_with_cmake over all directories. - -dirs:=$(wildcard */) -targets:=$(addsuffix pink_elephant,$(dirs)) -cleans:=$(addsuffix green_elephant,$(dirs)) - -all: ${targets} - -clean: ${cleans} - -%/pink_elephant: - @+./run_testsuite_with_cmake $* - -%/green_elephant: - @cd $* && $(MAKE) clean diff --git a/Testsuite/test/testsuite_branch_build.mk b/Testsuite/test/testsuite_branch_build.mk deleted file mode 100644 index df517e7e8ab..00000000000 --- a/Testsuite/test/testsuite_branch_build.mk +++ /dev/null @@ -1,15 +0,0 @@ -# A GNU makefile which calls run_testsuite_with_cmake over all directories. - -dirs:=$(wildcard ../../*/test/*/) -targets:=$(addsuffix pink_elephant,$(dirs)) -cleans:=$(addsuffix green_elephant,$(dirs)) - -all: ${targets} - -clean: ${cleans} - -%/pink_elephant: - @+./run_testsuite_with_cmake $* - -%/green_elephant: - @cd $* && $(MAKE) clean From f9b6f0227a84051912b393d430c8a1a77f9594ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 21 Jan 2025 11:31:41 +0100 Subject: [PATCH 157/175] remove no longer used action --- .github/workflows/filter_testsuite.yml | 75 -------------------------- 1 file changed, 75 deletions(-) delete mode 100644 .github/workflows/filter_testsuite.yml diff --git a/.github/workflows/filter_testsuite.yml b/.github/workflows/filter_testsuite.yml deleted file mode 100644 index 2ff150710e7..00000000000 --- a/.github/workflows/filter_testsuite.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Filter Testsuite - -on: - issue_comment: - types: [created] - workflow_dispatch: - -permissions: {} -jobs: - build: - permissions: - pull-requests: write # to create comment - - if: (github.event.comment.user.login == 'sloriot' || github.event.comment.user.login == 'lrineau') && contains(github.event.comment.body, '/testme') - runs-on: ubuntu-22.04 - steps: - - uses: actions/github-script@v6 - id: get_label - with: - result-encoding: string - script: | - //get branch name and username - const pr_url = context.payload.issue.pull_request.url - const pr_content = await github.request(pr_url) - const label = pr_content.data.head.label - const base = pr_content.data.base.ref - console.log(label) - return label+":"+base - - name: Run Testsuite - run: | - mkdir -p ~/.ssh - #ssh key - ( - cat <> ~/.ssh/id_rsa - chmod 600 /home/runner/.ssh/id_rsa - #ssh public key - ( - cat <> ~/.ssh/id_rsa.pub - chmod 644 /home/runner/.ssh/id_rsa.pub - #known hosts - wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_known_hosts -O ~/.ssh/known_hosts - #config file - wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_config -O ~/.ssh/config - #list of hosts - wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_host_list -O ~/ssh_host_list - #ssh command - LABEL="${{ steps.get_label.outputs.result }}" - USER_NAME=$(echo $LABEL | cut -d':' -f 1) - BRANCH_NAME=$(echo $LABEL | cut -d':' -f 2) - BASE=$(echo $LABEL | cut -d':' -f 3) - PR_NUMBER=${{ github.event.issue.number }} - mapfile -t HOSTS < ~/ssh_host_list; - for i in ${!HOSTS[@]}; do - HOST=$(echo ${HOSTS[$i]}|cut -d' ' -f 1 ) - PATH_TO_SCRIPT=$(echo ${HOSTS[$i]}|cut -d' ' -f 2 ) - echo "ssh ${HOST} ${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER" - ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER" - done - - name: Post address - uses: actions/github-script@v6 - with: - script: | - const address = "Testsuite launched. Results will appear on the following page: https://cgal.geometryfactory.com/~cgaltest/test_suite/TESTRESULTS/index.shtml " - github.issues.createComment({ - owner: "CGAL", - repo: "cgal", - issue_number: ${{ github.event.issue.number }}, - body: address - }); From b721064782033be862fce37fbe8c5ec5c198c511 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 21 Jan 2025 15:54:49 +0100 Subject: [PATCH 158/175] fix doc of Triangulation_simplex_3 (the template param is TDS) --- .../CGAL/Triangulation_simplex_3.h | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h index af3a03801b5..17beea514f1 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h @@ -5,7 +5,7 @@ namespace CGAL { \ingroup PkgTriangulation3VertexCellClasses The class `Triangulation_simplex_3` stores a simplex of any dimension -defined by the `Triangulation_3` class. It also defines the +defined by the `TriangulationDataStructure_3` class. It also defines the operator less such that simplices can be stored in a `map` or a `set` of simplices. The simplex is invalidated by any change in the triangulation. @@ -18,7 +18,7 @@ from. \sa `CGAL::Triangulation_3` */ -template< typename Triangulation_3 > +template< typename TriangulationDataStructure_3 > class Triangulation_simplex_3 { public: @@ -29,67 +29,67 @@ public: The simplex class itself. */ -typedef Triangulation_simplex_3 Simplex; +typedef Triangulation_simplex_3 Simplex; /*! */ -typedef Triangulation_3::Vertex_handle Vertex_handle; +typedef TriangulationDataStructure_3::Vertex_handle Vertex_handle; /*! */ -typedef Triangulation_3::Edge Edge; +typedef TriangulationDataStructure_3::Edge Edge; /*! */ -typedef Triangulation_3::Facet Facet; +typedef TriangulationDataStructure_3::Facet Facet; /*! */ -typedef Triangulation_3::Cell_handle Cell_handle; +typedef TriangulationDataStructure_3::Cell_handle Cell_handle; /*! */ -typedef Triangulation_3::Cell_circulator Cell_circulator; +typedef TriangulationDataStructure_3::Cell_circulator Cell_circulator; /*! */ -typedef Triangulation_3::Facet_circulator Facet_circulator; +typedef TriangulationDataStructure_3::Facet_circulator Facet_circulator; /*! */ -typedef Triangulation_3::Edge_iterator Edge_iterator; +typedef TriangulationDataStructure_3::Edge_iterator Edge_iterator; /*! */ -typedef Triangulation_3::Facet_iterator Facet_iterator; +typedef TriangulationDataStructure_3::Facet_iterator Facet_iterator; /*! */ -typedef Triangulation_3::Finite_vertices_iterator Finite_vertices_iterator; +typedef TriangulationDataStructure_3::Finite_vertices_iterator Finite_vertices_iterator; /*! */ -typedef Triangulation_3::Finite_edges_iterator Finite_edges_iterator; +typedef TriangulationDataStructure_3::Finite_edges_iterator Finite_edges_iterator; /*! */ -typedef Triangulation_3::Finite_facets_iterator Finite_facets_iterator; +typedef TriangulationDataStructure_3::Finite_facets_iterator Finite_facets_iterator; /*! */ -typedef Triangulation_3::Finite_cells_iterator Finite_cells_iterator; +typedef TriangulationDataStructure_3::Finite_cells_iterator Finite_cells_iterator; /// @} @@ -188,7 +188,7 @@ Test whether two simplices are equal. */ bool operator==(const -Triangulation_simplex_3 &s1); +Triangulation_simplex_3 &s1); /*! Defines a ordering @@ -196,7 +196,7 @@ on the simplices. This ordering depends on the memory layout and is independent of the geometry. Therefore, the ordering is not intrinsic */ bool operator< (const -Triangulation_simplex_3 &s1); +Triangulation_simplex_3 &s1); /// @} From fbaccdb075aa923ee66ca9eaddd157300f8959ea Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 21 Jan 2025 15:55:25 +0100 Subject: [PATCH 159/175] fix compilation on msvc and use public API --- .../segment_traverser_benchmark.cpp | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp index 69501904ffe..2039138e058 100644 --- a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -30,8 +30,8 @@ #include // Define the kernel. -typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; -typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; +using Epeck = CGAL::Exact_predicates_exact_constructions_kernel; +using Epick = CGAL::Exact_predicates_inexact_constructions_kernel; template @@ -40,11 +40,11 @@ void bench_segment_traverser(const int nb_queries, const double rad, CGAL::Random& rng) { - typedef CGAL::Delaunay_triangulation_3 DT; - typedef CGAL::Triangulation_segment_simplex_iterator_3
      Simplex_traverser; - typedef CGAL::Triangulation_segment_cell_iterator_3
      Cell_traverser; - typedef typename DT::Point_3 Point_3; - typedef typename DT::Cell_handle Cell_handle; + using DT = CGAL::Delaunay_triangulation_3; + using Tds = typename DT::Triangulation_data_structure; + using Point_3 = typename DT::Point_3; + using Cell_handle = typename DT::Cell_handle; + using Simplex_3 = CGAL::Triangulation_simplex_3; std::cout << "\nBench :\t " << nb_queries << " queries," << std::endl << "\t in triangulation of size " << nbv << std::endl @@ -83,29 +83,26 @@ void bench_segment_traverser(const int nb_queries, { //Simplex traverser timer_st.start(); - Simplex_traverser st(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. unsigned int inf = 0, fin = 0; - for (; st != st.end(); ++st) + for (Simplex_3 st : dt.segment_traverser_simplices(segments[2 * i], segments[2 * i + 1])) { - Cell_handle c = st.get_cell(); - // if (dt.is_infinite(c)) ++inf; - // else ++fin; + Cell_handle c = st.incident_cell(); + if (dt.is_infinite(c)) ++inf; + else ++fin; } timer_st.stop(); //Cell traverser timer_ct.start(); - Cell_traverser ct(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. inf = 0, fin = 0; - for (; ct != ct.end(); ++ct) + for (Cell_handle c : dt.segment_traverser_cell_handles(segments[2 * i], segments[2 * i + 1])) { - Cell_handle c = ct.handle(); - // if (dt.is_infinite(c)) ++inf; - // else ++fin; + if (dt.is_infinite(c)) ++inf; + else ++fin; } timer_ct.stop(); } @@ -128,4 +125,6 @@ int main(int argc, char* argv[]) // bench_segment_traverser(nb_queries, nbv, rad, rng); bench_segment_traverser(nb_queries, nbv, rad, rng); + + return EXIT_SUCCESS; } From d8106aab4b6291e8c443ee4538bdf18b4f1ebbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 22 Jan 2025 11:42:50 +0100 Subject: [PATCH 160/175] we now use ctest for testing + extra clean up --- .gitattributes | 2 - .gitignore | 58 - .../cgal_test_with_cmake | 1750 ----------------- .../Developer_manual/Chapter_testing.txt | 47 +- .../test/Installation/cgal_test_with_cmake | 53 - .../bin/cgal_release.py | 84 - .../test/Minkowski_sum_2/cgal_test_with_cmake | 125 -- .../demo/Polyhedron/cgal_test_with_cmake | 235 --- .../cgal_create_release_with_cmake.cmake | 44 +- .../developer_scripts/cgal_test_with_cmake | 16 - Scripts/developer_scripts/create_cgal_test | 214 -- .../create_cgal_test_with_cmake | 3 - .../test/Snap_rounding_2/cgal_test_with_cmake | 4 - .../test/Surface_sweep_2/cgal_test_with_cmake | 3 - 14 files changed, 15 insertions(+), 2623 deletions(-) delete mode 100755 Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake delete mode 100755 Installation/test/Installation/cgal_test_with_cmake delete mode 100644 Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py delete mode 100755 Minkowski_sum_2/test/Minkowski_sum_2/cgal_test_with_cmake delete mode 100755 Polyhedron/demo/Polyhedron/cgal_test_with_cmake delete mode 100755 Scripts/developer_scripts/cgal_test_with_cmake delete mode 100755 Scripts/developer_scripts/create_cgal_test delete mode 100755 Scripts/developer_scripts/create_cgal_test_with_cmake delete mode 100755 Snap_rounding_2/test/Snap_rounding_2/cgal_test_with_cmake delete mode 100755 Surface_sweep_2/test/Surface_sweep_2/cgal_test_with_cmake diff --git a/.gitattributes b/.gitattributes index 35a89b731c1..63b93a24591 100644 --- a/.gitattributes +++ b/.gitattributes @@ -47,7 +47,6 @@ Scripts/developer_scripts/autotest_cgal text eol=lf Scripts/developer_scripts/cgal_build text eol=lf Scripts/developer_scripts/cgal_depend text eol=lf Scripts/developer_scripts/cgal_git_update_hooks_for_client text eol=lf -Scripts/developer_scripts/cgal_test_with_cmake text eol=lf Scripts/developer_scripts/cgal2gml text eol=lf Scripts/developer_scripts/check_library_uses_no_gpl_files text eol=lf Scripts/developer_scripts/check_licenses text eol=lf @@ -55,7 +54,6 @@ Scripts/developer_scripts/check_macro_names text eol=lf Scripts/developer_scripts/check_no_CGAL_USE_without_includes_before text eol=lf Scripts/developer_scripts/check_svn_keywords text eol=lf Scripts/developer_scripts/create_cgal_test text eol=lf -Scripts/developer_scripts/create_cgal_test_with_cmake text eol=lf Scripts/developer_scripts/create_internal_release text eol=lf Scripts/developer_scripts/create_macosx_installer text eol=lf Scripts/developer_scripts/create_new_release text eol=lf diff --git a/.gitignore b/.gitignore index a53ed4269ce..94102f10af8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ AABB_tree/demo/AABB_tree/Makefile AABB_tree/examples/AABB_tree/*.kdev* AABB_tree/examples/AABB_tree/*_example AABB_tree/examples/AABB_tree/Makefile -AABB_tree/examples/AABB_tree/cgal_test_with_cmake AABB_tree/test/AABB_tree/*.kdev* AABB_tree/test/AABB_tree/Makefile AABB_tree/test/AABB_tree/aabb_correctness_triangle_test @@ -18,17 +17,14 @@ AABB_tree/test/AABB_tree/aabb_distance_triangle_test AABB_tree/test/AABB_tree/aabb_intersection_triangle_test AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test AABB_tree/test/AABB_tree/aabb_projection_triangle_test -AABB_tree/test/AABB_tree/cgal_test_with_cmake Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits Algebraic_foundations/test/Algebraic_foundations/Coercion_traits Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits -Algebraic_foundations/test/Algebraic_foundations/cgal_test_with_cmake Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm Algebraic_foundations/test/Algebraic_foundations/ipower -Algebraic_kernel_d/test/Algebraic_kernel_d/cgal_test_with_cmake Algebraic_kernel_d/test/Algebraic_kernel_d/rs_isolator Alpha_shapes_2/demo/Alpha_shapes_2/Makefile Alpha_shapes_2/demo/Alpha_shapes_2/alpha_shapes_2 @@ -37,7 +33,6 @@ Alpha_shapes_2/examples/Alpha_shapes_2/alpha_shapes_2 Alpha_shapes_3/demo/Alpha_shapes_3/Makefile Alpha_shapes_3/demo/Alpha_shapes_3/alpha_shapes_3 Alpha_shapes_3/demo/Alpha_shapes_3/weighted_alpha_shapes_3 -Alpha_shapes_3/test/Alpha_shapes_3/cgal_test_with_cmake Alpha_shapes_3/test/Alpha_shapes_3/test_alpha_shape_3 Alpha_shapes_3/test/Alpha_shapes_3/test_fixed_alpha_shape_3 Alpha_shapes_3/test/Alpha_shapes_3/test_weighted_alpha_shape_3 @@ -60,7 +55,6 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_locatio Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_planar_vertical_decomposition -Arrangement_on_surface_2/examples/Arrangement_on_surface_2/cgal_test_with_cmake Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs @@ -103,30 +97,24 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_fu Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp BGL/examples/BGL_arrangement_2/Makefile -BGL/examples/BGL_arrangement_2/cgal_test_with_cmake BGL/examples/BGL_arrangement_2/dual BGL/examples/BGL_arrangement_2/primal -BGL/test/BGL/cgal_test_with_cmake Boolean_set_operations_2/demo/Boolean_set_operations_2/Makefile Boolean_set_operations_2/demo/Boolean_set_operations_2/boolean_operations_2 Box_intersection_d/test/Box_intersection_d/automated_test Box_intersection_d/test/Box_intersection_d/benchmark.data Box_intersection_d/test/Box_intersection_d/benchmark_box_intersection Box_intersection_d/test/Box_intersection_d/box_grid -Box_intersection_d/test/Box_intersection_d/cgal_test_with_cmake Box_intersection_d/test/Box_intersection_d/random_set_test CGAL_ImageIO/demo/CGALimageIO/Makefile -CGAL_ImageIO/demo/CGALimageIO/cgal_test_with_cmake CGAL_ImageIO/demo/CGALimageIO/image_to_vtk_viewer CGAL_ImageIO/examples/CGALimageIO/Makefile -CGAL_ImageIO/examples/CGALimageIO/cgal_test_with_cmake CGAL_ImageIO/examples/CGALimageIO/convert_raw_image_to_inr CGAL_ImageIO/examples/CGALimageIO/makefile CGAL_ImageIO/examples/CGALimageIO/test_imageio CGAL_ImageIO/src/CGAL_ImageIO/Makefile Circular_kernel_3/demo/Circular_kernel_3/Circular_kernel_3_demo Circular_kernel_3/demo/Circular_kernel_3/Makefile -Circular_kernel_3/test/Circular_kernel_3/cgal_test_with_cmake Circular_kernel_3/test/Circular_kernel_3/test_Exact_spherical_kernel Circular_kernel_3/test/Circular_kernel_3/test_Lazy_Spherical_kernel Circular_kernel_3/test/Circular_kernel_3/test_Lazy_spherical_kernel_basics @@ -137,7 +125,6 @@ Documentation/log/*.* Documentation/output Documentation/tags/*.* Generator/examples/Generator/ball_d -Generator/examples/Generator/cgal_test_with_cmake Generator/examples/Generator/cube_d Generator/examples/Generator/grid_d Generator/examples/Generator/random_convex_set @@ -149,7 +136,6 @@ Generator/examples/Generator/random_segments1 Generator/examples/Generator/random_segments2 Generator/examples/Generator/sphere_d Generator/test/Generator/bug -Generator/test/Generator/cgal_test_with_cmake Generator/test/Generator/random_poly_test Generator/test/Generator/rcs_test Generator/test/Generator/test_combination_enumerator @@ -184,7 +170,6 @@ GraphicsView/src/CGAL_Qt5/*.so GraphicsView/src/CGAL_Qt5/Makefile GraphicsView/src/CGAL_Qt5/moc_*.cxx GraphicsView/src/CGAL_Qt5/qrc_*.cxx -HalfedgeDS/test/HalfedgeDS/cgal_test_with_cmake HalfedgeDS/test/HalfedgeDS/test_hds HalfedgeDS/test/HalfedgeDS/test_hds_decorator Inscribed_areas/test/Inscribed_areas/Makefile @@ -194,11 +179,8 @@ Installation/auxiliary/gdb/python/CGAL/printers.pyc Installation/auxiliary/gdb/test Installation/cmake/modules/*.tmp Installation/test/Installation/cgal_test -/Installation/test/Installation/cgal_test_with_cmake Installation/test/Installation/deprecation_warning -Interpolation/demo/Interpolation/cgal_test_with_cmake Intersections_3/test/Intersections_3/bbox_other_do_intersect_test -Intersections_3/test/Intersections_3/cgal_test_with_cmake Intersections_3/test/Intersections_3/circle_other Intersections_3/test/Intersections_3/line_line Intersections_3/test/Intersections_3/segment_segment @@ -212,7 +194,6 @@ Jet_fitting_3/examples/Jet_fitting_3/Single_estimation Jet_fitting_3/examples/Jet_fitting_3/VC Jet_fitting_3/test/Jet_fitting_3/Makefile Jet_fitting_3/test/Jet_fitting_3/blind_1pt -/Jet_fitting_3/examples/Jet_fitting_3/cgal_test_with_cmake /Jet_fitting_3/examples/Jet_fitting_3/data_ellipe0.003.off.4ogl.txt Kernel_23/test/Kernel_23/Cartesian Kernel_23/test/Kernel_23/Dimension @@ -226,7 +207,6 @@ Kernel_23/test/Kernel_23/Simple_cartesian Kernel_23/test/Kernel_23/Simple_homogeneous Kernel_23/test/Kernel_23/Test_IO.out /Kernel_23/test/Kernel_23/Test-*IO.out -Kernel_23/test/Kernel_23/cgal_test_with_cmake Kernel_23/test/Kernel_23/test_kernel__ Kinetic_data_structures/demo/Kinetic_data_structures/Delaunay_triangulation_2 Kinetic_data_structures/demo/Kinetic_data_structures/Delaunay_triangulation_stable_subset_2 @@ -235,13 +215,11 @@ Kinetic_data_structures/demo/Kinetic_data_structures/KDS_Delaunay_triangulation_ Kinetic_data_structures/demo/Kinetic_data_structures/KDS_generate_data Kinetic_data_structures/demo/Kinetic_data_structures/KDS_gui_2 Kinetic_data_structures/demo/Kinetic_data_structures/Makefile -Kinetic_data_structures/demo/Kinetic_data_structures/cgal_test_with_cmake Kinetic_data_structures/demo/Kinetic_data_structures/generate_data Kinetic_data_structures/demo/Kinetic_data_structures/gui_2 Kinetic_data_structures/test/Kinetic_data_structures/Delaunay_triangulation_2 Kinetic_data_structures/test/Kinetic_data_structures/Delaunay_triangulation_3 Kinetic_data_structures/test/Kinetic_data_structures/active_objects_tables -Kinetic_data_structures/test/Kinetic_data_structures/cgal_test_with_cmake Kinetic_data_structures/test/Kinetic_data_structures/exact_kds Kinetic_data_structures/test/Kinetic_data_structures/instantaneous_kernel Kinetic_data_structures/test/Kinetic_data_structures/numbers @@ -254,8 +232,6 @@ Kinetic_data_structures/test/Kinetic_data_structures/test_KDS_Delaunay_triangula Kinetic_data_structures/test/Kinetic_data_structures/timings Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3.qrc.depends Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo -Linear_cell_complex/demo/Linear_cell_complex/cgal_test_with_cmake -Linear_cell_complex/examples/Linear_cell_complex/cgal_test_with_cmake Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3 Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangulation Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_colored_vertices @@ -303,7 +279,6 @@ Mesh_2/demo/Mesh_2/*.core Mesh_2/demo/Mesh_2/*.moc Mesh_2/demo/Mesh_2/.*.deps Mesh_2/demo/Mesh_2/Makefile -Mesh_2/demo/Mesh_2/cgal_test_with_cmake Mesh_2/demo/Mesh_2/conform Mesh_2/demo/Mesh_2/depends Mesh_2/demo/Mesh_2/filename.edg @@ -315,7 +290,6 @@ Mesh_2/demo/Mesh_2/semantic.cache Mesh_2/doxygen Mesh_2/examples/Mesh_2/*.core Mesh_2/examples/Mesh_2/.*.deps -Mesh_2/examples/Mesh_2/cgal_test_with_cmake Mesh_2/examples/Mesh_2/conform Mesh_2/examples/Mesh_2/conforming Mesh_2/examples/Mesh_2/depends @@ -330,7 +304,6 @@ Mesh_2/test/Mesh_2/*.core Mesh_2/test/Mesh_2/.*.deps Mesh_2/test/Mesh_2/Makefile Mesh_2/test/Mesh_2/bench_double_map -Mesh_2/test/Mesh_2/cgal_test_with_cmake Mesh_2/test/Mesh_2/conform_plus Mesh_2/test/Mesh_2/depends Mesh_2/test/Mesh_2/my_makefile @@ -379,7 +352,6 @@ Mesh_3/examples/Mesh_3/.*.deps Mesh_3/examples/Mesh_3/random-image.inr Mesh_3/examples/Mesh_3/Makefile Mesh_3/examples/Mesh_3/applications -Mesh_3/examples/Mesh_3/cgal_test_with_cmake Mesh_3/examples/Mesh_3/cgal_to_medit Mesh_3/examples/Mesh_3/chair-after.mesh Mesh_3/examples/Mesh_3/chair-after.png @@ -417,7 +389,6 @@ Mesh_3/examples/Mesh_3/test_off /Mesh_3/test/Mesh_3/a.lua /Mesh_3/test/Mesh_3/applications /Mesh_3/test/Mesh_3/*.cgal -/Mesh_3/test/Mesh_3/cgal_test_with_cmake /Mesh_3/test/Mesh_3/cgal_to_medit /Mesh_3/test/Mesh_3/combined_spheres /Mesh_3/test/Mesh_3/combined_spheres-with-sphere-oracle @@ -519,11 +490,9 @@ Min_ellipse_2/.tmp Min_ellipse_2/Makefile Min_ellipse_2/bin Min_ellipse_2/doc_ps -Minkowski_sum_3/test/Minkowski_sum_3/cgal_test_with_cmake Nef_2/test/Nef_2/EPoint-test Nef_2/test/Nef_2/Nef_polyhedron_2-test Nef_2/test/Nef_2/Polynomial-test -Nef_2/test/Nef_2/cgal_test_with_cmake Nef_2/test/Nef_2/nef_2_point_location Nef_3/demo/Nef_3/Makefile Nef_3/examples/Nef_3/Makefile @@ -581,7 +550,6 @@ Number_types/test/Number_types/_test_valid_finite_double Number_types/test/Number_types/_test_valid_finite_float Number_types/test/Number_types/bench_interval Number_types/test/Number_types/cgal_test -Number_types/test/Number_types/cgal_test_with_cmake Number_types/test/Number_types/constant Number_types/test/Number_types/double Number_types/test/Number_types/doubletst @@ -632,7 +600,6 @@ Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/moc_*.cpp Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/ui_*.h Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Periodic_Lloyd_3.qch Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/Test_tds_IO_3 -Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/cgal_test_with_cmake Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_alpha_shape_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_delaunay_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_delaunay_hierarchy_3 @@ -643,7 +610,6 @@ Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_trian Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_H_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_SC_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_SH_3 -Point_set_2/test/Point_set_2/cgal_test_with_cmake Point_set_2/test/Point_set_2/nearest_nb1 Point_set_2/test/Point_set_2/nearest_nb_fcn Point_set_2/test/Point_set_2/range_search_fcn @@ -689,7 +655,6 @@ Point_set_processing_3/test/Point_set_processing_3/smoothing_test /Polygon_mesh_processing/test/Polygon_mesh_processing/elephant-oriented.off /Polygon_mesh_processing/test/Polygon_mesh_processing/elephant-shuffled.off /Polygon_mesh_processing/test/Polygon_mesh_processing/blobby_2cc_no_id.off -/Polygon_mesh_processing/test/Polygon_mesh_processing/cgal_test_with_cmake /Polygon_mesh_processing/test/Polygon_mesh_processing/data/U.polylines.txt.off /Polygon_mesh_processing/test/Polygon_mesh_processing/data/hole1.txt.off /Polygon_mesh_processing/test/Polygon_mesh_processing/data/hole2.txt.off @@ -713,7 +678,6 @@ Polyhedron/demo/Polyhedron/snapshot.* Polyhedron/demo/Polyhedron/ui_*.h Polyhedron/test/Polyhedron/*.kdev* Polyhedron/test/Polyhedron/Makefile -Polyhedron/test/Polyhedron/cgal_test_with_cmake Polyhedron/test/Polyhedron/test_polyhedron Polynomial/test/Polynomial/Exponent_vector Polynomial/test/Polynomial/Interpolator @@ -721,7 +685,6 @@ Polynomial/test/Polynomial/Polynomial_traits_d Polynomial/test/Polynomial/Polynomial_type_generator Polynomial/test/Polynomial/Polynomial_using_core Polynomial/test/Polynomial/Polynomial_using_leda -Polynomial/test/Polynomial/cgal_test_with_cmake Polynomial/test/Polynomial/modular_gcd_utcf_algorithm_M Polynomial/test/Polynomial/modular_gcd_utcf_dfai Polynomial/test/Polynomial/modular_gcd_utcf_pure_wang @@ -751,10 +714,8 @@ Polytope_distance_d/.obj Polytope_distance_d/.tmp Polytope_distance_d/Makefile Polytope_distance_d/bin -Polytope_distance_d/test/Polytope_distance_d/cgal_test_with_cmake Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d_d Principal_component_analysis/test/Principal_component_analysis/bounding_box -Principal_component_analysis/test/Principal_component_analysis/cgal_test_with_cmake Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_circles_2 Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_cuboids_3 Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_2 @@ -779,7 +740,6 @@ Principal_component_analysis/test/Principal_component_analysis/test_linear_least Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_tetrahedra_3 Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_2 Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_3 -/Profiling_tools/test/Profiling_tools/cgal_test_with_cmake /Profiling_tools/test/Profiling_tools/test_memory_sizer /Profiling_tools/test/Profiling_tools/test_timer QP_solver/documentation/Degeneracies.aux @@ -811,7 +771,6 @@ Ridges_3/examples/Ridges_3/Compute_Ridges_Umbilics Ridges_3/examples/Ridges_3/Makefile Ridges_3/test/Ridges_3/Makefile Ridges_3/test/Ridges_3/ridge_test -STL_Extension/test/STL_Extension/cgal_test_with_cmake STL_Extension/test/STL_Extension/test_Cache STL_Extension/test/STL_Extension/test_Compact_container STL_Extension/test/STL_Extension/test_Concatenate_iterator @@ -833,7 +792,6 @@ STL_Extension/test/STL_Extension/test_nth_element STL_Extension/test/STL_Extension/test_stl_extension STL_Extension/test/STL_Extension/test_type_traits STL_Extension/test/STL_Extension/test_vector -SearchStructures/test/RangeSegmentTrees/cgal_test_with_cmake SearchStructures/test/RangeSegmentTrees/test_segment_tree_set_2 Skin_surface_3/.cdtproject Skin_surface_3/.project @@ -844,7 +802,6 @@ Skin_surface_3/test/Skin_surface_3/err.txt Skin_surface_3/test/Skin_surface_3/makefile Skin_surface_3/test/Skin_surface_3/msgs.txt Skin_surface_3/test/Skin_surface_3/subdivision_test -Spatial_sorting/test/Spatial_sorting/cgal_test_with_cmake Stream_lines_2/demo/Stream_lines_2/Makefile Stream_lines_2/demo/Stream_lines_2/streamlines Surface_mesh_parameterization/examples/Surface_mesh_parameterization/*.eps @@ -974,20 +931,15 @@ Triangulation/test/Triangulation/output-pcds* Triangulation/test/Triangulation/pc Triangulation/test/Triangulation/pcds Triangulation/test/Triangulation/torture -/Triangulation/examples/Triangulation/cgal_test_with_cmake -/Triangulation/test/Triangulation/cgal_test_with_cmake /Triangulation/test/Triangulation/output-tds-* -Triangulation_2/cgal_test_with_cmake Triangulation_2/demo/Triangulation_2/Makefile Triangulation_2/demo/Triangulation_2/constrained Triangulation_2/demo/Triangulation_2/constrained_delaunay_triangulation_2 Triangulation_2/demo/Triangulation_2/delaunay_triangulation_2 Triangulation_2/demo/Triangulation_2/regular_triangulation_2 -Triangulation_2/examples/Triangulation_2/cgal_test_with_cmake Triangulation_2/examples/Triangulation_2/regular Triangulation_2/test/Triangulation_2/Makefile Triangulation_2/test/Triangulation_2/T??.triangulation -Triangulation_2/test/Triangulation_2/cgal_test_with_cmake Triangulation_2/test/Triangulation_2/file_tds* Triangulation_2/test/Triangulation_2/makefile Triangulation_2/test/Triangulation_2/test_cdt_degenerate_case @@ -1005,10 +957,8 @@ Triangulation_2/test/Triangulation_2/test_triangulation_2_bis Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits Triangulation_2/test/Triangulation_2/test_triangulation_tds Triangulation_2/test/Triangulation_2/vrml_tds* -Triangulation_3/benchmark/Triangulation_3/cgal_test_with_cmake Triangulation_3/benchmark/Triangulation_3/simple Triangulation_3/examples/Triangulation_3/adding_handles_3 -Triangulation_3/examples/Triangulation_3/cgal_test_with_cmake Triangulation_3/examples/Triangulation_3/color Triangulation_3/examples/Triangulation_3/fast_location_3 Triangulation_3/examples/Triangulation_3/find_conflicts_3 @@ -1034,7 +984,6 @@ Triangulation_3/test/Triangulation_3/Test8_triangulation_IO_3_binary Triangulation_3/test/Triangulation_3/Test??_triangulation_IO_3 Triangulation_3/test/Triangulation_3/Test?_triangulation_IO_3 Triangulation_3/test/Triangulation_3/Test_tds_IO_3 -Triangulation_3/test/Triangulation_3/cgal_test_with_cmake Triangulation_3/test/Triangulation_3/makefile Triangulation_3/test/Triangulation_3/test_delaunay_3 Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3 @@ -1091,7 +1040,6 @@ ProgramOutput* ErrorOutput* CompilerOutput* error.txt -cgal_test_with_cmake.log # File created by the Semantic Bovinator (an Emacs package) semantic.cache @@ -1148,9 +1096,7 @@ Doxyfile gmon.* # Unsorted file names: -/Point_set_processing_3/test/Point_set_processing_3/cgal_test_with_cmake /Point_set_processing_3/test/Point_set_processing_3/read_test -/Nef_S2/test/Nef_S2/cgal_test_with_cmake /Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator /Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_point /Arrangement_on_surface_2/test/Arrangement_on_surface_2/ex_kernel_segment @@ -1198,15 +1144,11 @@ gmon.* /Principal_component_analysis/examples/Principal_component_analysis/barycenter /Principal_component_analysis/examples/Principal_component_analysis/bounding_box /Principal_component_analysis/examples/Principal_component_analysis/centroid -/Principal_component_analysis/examples/Principal_component_analysis/cgal_test_with_cmake /Principal_component_analysis/examples/Principal_component_analysis/linear_least_squares_fitting_points_2 /Principal_component_analysis/examples/Principal_component_analysis/linear_least_squares_fitting_triangles_3 -/Polygon/examples/Polygon/cgal_test_with_cmake -/Polygon/test/Polygon/cgal_test_with_cmake /Polygon/test/Polygon/polytest.ascii /Polygon/test/Polygon/polytest.binary /Polygon/test/Polygon/polytest.pretty -/Stream_support/test/Stream_support/cgal_test_with_cmake /*.html /Snap_rounding_2/test/Snap_rounding_2/data/out Polygonal_surface_reconstruction/examples/build* diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake deleted file mode 100755 index ee92d955c82..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ /dev/null @@ -1,1750 +0,0 @@ -#! /bin/bash - -# This is a script for the CGAL test suite. Such a script must obey -# the following rules: -# -# - the name of the script is cgal_test -# - for every target two one line messages are written to the file 'error.txt' -# the first one indicates if the compilation was successful -# the second one indicates if the execution was successful -# if one of the two was not successful, the line should start with 'ERROR:' -# - running the script should not require any user interaction -# - the script should clean up object files and executables - -# SET PARAMETERS FOR cgal_test - -set -- -cmake -ERRORFILE=error.txt -DO_RUN=y -if [ -z "${MAKE_CMD}" ]; then - MAKE_CMD=make -fi - - -FULL_ERROR_DESCRIPTION_FILE=ProgramOutput.error.txt - -#---------------------------------------------------------------------# -# compile_and_run -#---------------------------------------------------------------------# - -# note that these values shloud match to the values in test_configuration.h file - -CARTESIAN_KERNEL=0 -SIMPLE_CARTESIAN_KERNEL=1 -UNIVARIATE_ALGEBRAIC_KERNEL=2 - -SEGMENT_GEOM_TRAITS=0 -NON_CACHING_SEGMENT_GEOM_TRAITS=1 -POLYLINE_GEOM_TRAITS=2 -NON_CACHING_POLYLINE_GEOM_TRAITS=3 -POLYCURVE_CONIC_GEOM_TRAITS=14 -POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 -POLYCURVE_BEZIER_GEOM_TRAITS=16 -LINEAR_GEOM_TRAITS=4 -CORE_CONIC_GEOM_TRAITS=5 -LINE_ARC_GEOM_TRAITS=6 -CIRCULAR_ARC_GEOM_TRAITS=7 -CIRCULAR_LINE_ARC_GEOM_TRAITS=8 -CIRCLE_SEGMENT_GEOM_TRAITS=9 -BEZIER_GEOM_TRAITS=10 -GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS=11 -RATIONAL_ARC_GEOM_TRAITS=12 -ALGEBRAIC_GEOM_TRAITS=13 -POLYCURVE_CONIC_GEOM_TRAITS=14 -POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 -POLYCURVE_BEZIER_GEOM_TRAITS=16 -FLAT_TORUS_GEOM_TRAITS=17 - -PLANAR_BOUNDED_TOPOL_TRAITS=0 -PLANAR_UNBOUNDED_TOPOL_TRAITS=1 -SPHERICAL_TOPOL_TRAITS=2 - -DOUBLE_NT=0 -MP_FLOAT_NT=1 -GMPZ_NT=2 -LEDA_RAT_NT=3 -QUOTIENT_MP_FLOAT_NT=4 -QUOTIENT_CGAL_GMPZ_NT=5 -CGAL_GMPQ_NT=6 -LAZY_LEDA_RAT_NT=7 -LAZY_CGAL_GMPQ_NT=8 -LAZY_QUOTIENT_MP_FLOAT_NT=9 -LEDA_REAL_NT=10 -CORE_EXPR_NT=11 -LAZY_GMPZ_NT=12 -LEDA_INT_NT=13 -CGAL_GMPZ_NT=14 -CORE_INT_NT=15 -CORE_RAT_NT=16 - -if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. Try to use LEDA instead. - GMPZ_NT=$LEDA_INT_NT - QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT - CGAL_GMPQ_NT=$LEDA_RAT_NT - LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT - LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT - CGAL_GMPZ_NT=$LEDA_INT_NT -fi - -COMPARE=1 -VERTEX=2 -IS_VERTICAL=3 -COMPARE_Y_AT_X=4 -COMPARE_Y_AT_X_LEFT=5 -COMPARE_Y_AT_X_RIGHT=6 -MAKE_X_MONOTONE=7 -INTERSECT=8 -SPLIT=9 -ARE_MERGEABLE=10 -MERGE=11 -ASSERTIONS=12 -CONSTRUCTOR=13 -COMPARE_X_ON_BOUNDARY=16 -COMPARE_X_NEAR_BOUNDARY=17 -COMPARE_Y_NEAR_BOUNDARY=18 -PARAMETER_SPACE_X=19 -PARAMETER_SPACE_Y=20 -X_ON_IDENTIFICATION=21 -Y_ON_IDENTIFICATION=22 -IS_BOUNDED=23 -IS_IN_X_RANGE=24 -COMPARE_Y_POSITION=25 -IS_BETWEEN_CW=26 -COMPARE_CW_AROUND_POINT=27 -PUSH_BACK=28 -PUSH_FRONT=29 -NUMBER_OF_POINTS=32 -COMPARE_ENDPOINTS_XY=33 -CONSTRUCT_OPPOSITE=34 -TRIM=35 - -#---------------------------------------------------------------------# -# configure -#---------------------------------------------------------------------# - -configure() -{ - echo "Configuring... " - rm -rf CMakeCache.txt CMakeFiles/ - if [ -f "$INIT_FILE" ] - then - if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - -DCGAL_CXX_FLAGS:STRING="$CGAL_CXX_FLAGS $TESTSUITE_CXXFLAGS -I../../include" \ - -DCGAL_EXE_LINKER_FLAGS="$CGAL_EXE_LINKER_FLAGS $TESTSUITE_LDFLAGS" \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi - else - echo "cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR=\"$CGAL_DIR\" \ - -DCGAL_CXX_FLAGS:STRING=\"$TESTSUITE_CXXFLAGS -I../../include\" \ - -DCGAL_EXE_LINKER_FLAGS=\"$TESTSUITE_LDFLAGS\" \ - -DCMAKE_BUILD_TYPE=NOTFOUND \ - ." - if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - -DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS -I../../include" \ - -DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \ - -DCMAKE_BUILD_TYPE=NOTFOUND \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi - fi -} - -compile_test_with_flags() -{ - local name=$1; - local type=$2; - local flags=$3; - - echo "Compiling $name $type ... " - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - export TESTSUITE_CXXFLAGS="$flags" - configure - if eval '${MAKE_CMD} VERBOSE=1 -fMakefile \ - $name' ; then - echo " successful compilation of $name $type" >> $ERRORFILE; - SUCCESS="y" - else - echo " ERROR: compilation of $name $type" >> $ERRORFILE; - SUCCESS="" - fi - else - if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ - TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name'; then - echo " successful compilation of $name $type" >> $ERRORFILE; - SUCCESS="y" - else - echo " ERROR: compilation of $name $type" >> $ERRORFILE; - SUCCESS="" - fi - fi -} - -run_test() -{ - # $1 - executable name - - basedata=`basename "$5"` - OUTPUTFILE="ProgramOutput.$1" - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - fi - OUTPUTFILE="$OUTPUTFILE.$PLATFORM" - echo "Executing $1 ($2) ... " - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1" >> $ERRORFILE - else - echo " ERROR: execution of $1" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_test_with_flags() -{ - # $1 - executable name - # $2 - test substring name - - basedata=`basename "$5"` - OUTPUTFILE="ProgramOutput.$1" - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - elif [ -f $1.$2.cmd ] ; then - COMMAND="$COMMAND `cat $1.$2.cmd`" - OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - elif [ -f $1.$2.cin ] ; then - COMMAND="cat $1.$2.cin | $COMMAND" - OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` - fi - OUTPUTFILE="$OUTPUTFILE.$PLATFORM" - echo "Executing $1 ($2) ... " - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1 ($2)" >> $ERRORFILE - else - echo " ERROR: execution of $1 ($2)" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_test_alt() -{ - basedata=`basename "$5"` - OUTPUTFILE=ProgramOutput.$1.`echo $5 | tr '/' '.'`.$6 - #echo ****generating file $OUTPUTFILE - # dirdata=`dirname "$datafile"` - rm -f $OUTPUTFILE - COMMAND="./$1" - echo "Executing $1 $5 $6 ... " - if eval $COMMAND $2 $3 $4 $5 $6 > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $5 $6" >> $ERRORFILE - else - echo " ERROR: execution of $5 $6" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_trapped_test() -{ - #local name=$1; - #local datafile=$2; - - if [ "${OSTYPE}" != "cygwin" ]; then - ulimit -t 1200 - run_test_alt $1 $2 $3 $4 $5 $6 - else - run_test_alt $1 $2 $3 $4 $5 $6 & - WPID=$! - trap "kill -9 $WPID" INT - (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & - SPID=$! - wait $WPID > /dev/null 2>&1 - # RES=$? - kill -9 $SPID > /dev/null 2>&1 - # return $RES - fi -} - -clean_tests() -{ - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - # - # The clean target generated by CMake under cygwin - # always fails for some reason - # - if ! ( uname | grep -q "CYGWIN" ) ; then - make -fMakefile clean - fi - fi - eval "make clean > /dev/null 2>&1" -} - -compile_and_run() -{ - local name=$1; - - echo "Compiling $name ... " - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - if eval '${MAKE_CMD} VERBOSE=1 -fMakefile $1' ; then - echo " successful compilation of $1" >> $ERRORFILE - SUCCESS="y" - else - echo " ERROR: compilation of $1" >> $ERRORFILE - SUCCESS="" - fi - else - SUCCESS="y" - #TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" - TESTSUITE_CXXFLAGS="" - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" - if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ - TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name' ; then - echo " successful compilation of $name" >> $ERRORFILE - else - echo " ERROR: compilation of $name" >> $ERRORFILE - SUCCESS="" - fi - fi - - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - if [ -n "$DO_RUN" ] ; then - if [ -n "${SUCCESS}" ] ; then - run_test $1 - else - echo " ERROR: not executed $1" >> $ERRORFILE - fi - fi - else - if [ -n "${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.$name.$PLATFORM - rm -f $OUTPUTFILE - COMMAND="./$name" - if [ -f $name.cmd ] ; then - COMMAND="$COMMAND `cat $name.cmd`" - fi - if [ -f $name.cin ] ; then - COMMAND="cat $name.cin | $COMMAND" - fi - echo "Executing $name ... " - echo " " - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $name" >> $ERRORFILE - else - echo " ERROR: execution of $name" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi - else - echo " ERROR: not executed $name" >> $ERRORFILE - fi - fi - clean_tests -} - -compile_and_run_trapped_test() -{ - local name=$1; - - if [ "${OSTYPE}" != "cygwin" ]; then - ulimit -t 1200 - compile_and_run $1 - else - compile_and_run $1 & - WPID=$! - trap "kill -9 $WPID" INT - (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & - SPID=$! - wait $WPID > /dev/null 2>&1 - # RES=$? - kill -9 $SPID > /dev/null 2>&1 - # return $RES - fi -} - -execute_commands_old_structure() -{ - -# at first the tests where designed in such way that all the test input was -# in one file, the points, the xcurves, the curves and the execution block -# this function is used to execute the old tests, one may use it when needed -# but you should remember that separating the input into smaller files creates -# much more modular and comfortable test suite - -# the old structure is default, so this function executes all commands -# except the commands that are given as arguments - - - commands_indicator[COMPARE]=1 - commands_indicator[VERTEX]=1 - commands_indicator[IS_VERTICAL]=1 - commands_indicator[COMPARE_Y_AT_X]=1 - commands_indicator[COMPARE_Y_AT_X_LEFT]=1 - commands_indicator[COMPARE_Y_AT_X_RIGHT]=1 - commands_indicator[MAKE_X_MONOTONE]=1 - commands_indicator[INTERSECT]=1 - commands_indicator[SPLIT]=1 - commands_indicator[ARE_MERGEABLE]=1 - commands_indicator[MERGE]=1 - commands_indicator[ASSERTIONS]=1 - commands_indicator[CONSTRUCTOR]=1 - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=0 - fi - let "i+=1" - done - fi - if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/compare.pt data/empty.zero \ - data/empty.zero data/compare $2 - fi - if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/vertex.pt data/$1/vertex.xcv \ - data/empty.zero data/$1/vertex $2 - fi - if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/is_vertical.xcv data/empty.zero \ - data/$1/is_vertical $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x.pt data/$1/compare_y_at_x.xcv \ - data/empty.zero data/$1/compare_y_at_x $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x_left.pt data/$1/compare_y_at_x_left.xcv \ - data/empty.zero data/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x_right.pt data/$1/compare_y_at_x_right.xcv \ - data/empty.zero data/$1/compare_y_at_x_right $2 - fi - if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/make_x_monotone.xcv \ - data/$1/make_x_monotone.cv data/$1/make_x_monotone $2 - fi - if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/intersect.pt data/$1/intersect.xcv \ - data/empty.zero data/$1/intersect $2 - fi - if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/split.pt data/$1/split.xcv \ - data/empty.zero data/$1/split $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/are_mergeable.xcv \ - data/empty.zero data/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/merge.xcv \ - data/empty.zero data/$1/merge $2 - fi - if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/assertions.pt data/$1/assertions.xcv \ - data/empty.zero data/$1/assertions $2 - fi - if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/constructor.xcv \ - data/$1/constructor.cv data/$1/constructor $2 - fi -} - -execute_commands_new_structure() -{ - -# the new design for the tests includes separation of the test input into 4 -# parts: points file, xcurves file, curves file and execution block file. -# one may reuse the input files for the various tests - -# the new structure is not default, so this function executes only -# commands that are given as arguments - - commands_indicator[COMPARE]=0 - commands_indicator[VERTEX]=0 - commands_indicator[IS_VERTICAL]=0 - commands_indicator[COMPARE_Y_AT_X]=0 - commands_indicator[COMPARE_Y_AT_X_LEFT]=0 - commands_indicator[COMPARE_Y_AT_X_RIGHT]=0 - commands_indicator[MAKE_X_MONOTONE]=0 - commands_indicator[INTERSECT]=0 - commands_indicator[SPLIT]=0 - commands_indicator[ARE_MERGEABLE]=0 - commands_indicator[MERGE]=0 - commands_indicator[ASSERTIONS]=0 - commands_indicator[CONSTRUCTOR]=0 - commands_indicator[COMPARE_X_ON_BOUNDARY]=0 - commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 - commands_indicator[PARAMETER_SPACE_X]=0 - commands_indicator[PARAMETER_SPACE_Y]=0 - commands_indicator[EQUAL]=0 - commands_indicator[PUSH_BACK]=0 - commands_indicator[PUSH_FRONT]=0 - commands_indicator[NUMBER_OF_POINTS]=0 - commands_indicator[COMPARE_ENDPOINTS_XY]=0 - commands_indicator[CONSTRUCT_OPPOSITE]=0 - commands_indicator[TRIM]=0 - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=1 - fi - let "i+=1" - done - fi - if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare $2 - fi - if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/vertex $2 - fi - if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/is_vertical $2 - fi - if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_on_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_near_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_near_boundary $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/parameter_space_x $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/parameter_space_y $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_right $2 - fi - if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/make_x_monotone $2 - fi - if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/intersect $2 - fi - if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/split $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/merge $2 - fi - if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/assertions $2 - fi - if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/constructor $2 - fi - if [ ${commands_indicator[$EQUAL]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/equal $2 - fi - if [ ${commands_indicator[$PUSH_BACK]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/push_back $2 - fi - if [ ${commands_indicator[$PUSH_FRONT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/push_front $2 - fi - if [ ${commands_indicator[$NUMBER_OF_POINTS]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/number_of_points $2 - fi - if [ ${commands_indicator[$COMPARE_ENDPOINTS_XY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_endpoints_xy $2 - fi - if [ ${commands_indicator[$CONSTRUCT_OPPOSITE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/construct_opposite $2 - fi - if [ ${commands_indicator[$TRIM]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/trim $2 - fi -} - -execute_commands_traits_adaptor() -{ - -# the new structure is not default, so this function executes only -# commands that are given as arguments - - commands_indicator[PARAMETER_SPACE_X]=0 - commands_indicator[PARAMETER_SPACE_Y]=0 - commands_indicator[COMPARE_X_ON_BOUNDARY]=0 - commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_AT_X_LEFT]=0 - commands_indicator[ARE_MERGEABLE]=0 - commands_indicator[MERGE]=0 - commands_indicator[X_ON_IDENTIFICATION]=0 - commands_indicator[Y_ON_IDENTIFICATION]=0 - commands_indicator[IS_BOUNDED]=0 - commands_indicator[IS_IN_X_RANGE]=0 - commands_indicator[COMPARE_Y_POSITION]=0 - commands_indicator[IS_BETWEEN_CW]=0 - commands_indicator[COMPARE_CW_AROUND_POINT]=0 - - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=1 - fi - let "i+=1" - done - fi - - if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/parameter_space_x $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/parameter_space_y $2 - fi - if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_on_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_near_boundary $2 - fi - - if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_near_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/merge $2 - fi - if [ ${commands_indicator[X_ON_IDENTIFICATION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/x_on_idintification $2 - fi - if [ ${commands_indicator[Y_ON_IDENTIFICATION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/x_on_idintification $2 - fi - if [ ${commands_indicator[IS_BOUNDED]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_bounded $2 - fi - if [ ${commands_indicator[IS_IN_X_RANGE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_in_x_range $2 - fi - if [ ${commands_indicator[COMPARE_Y_POSITION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_position $2 - fi - if [ ${commands_indicator[IS_BETWEEN_CW]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_between_cw $2 - fi - if [ ${commands_indicator[COMPARE_CW_AROUND_POINT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_cw_around_point $2 - fi -} - -#---------------------------------------------------------------------# -# traits adaptor (segments traits) -#---------------------------------------------------------------------# -test_segment_traits_adaptor() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits_adaptor segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor segments segments_traits_adaptor \ - COMPARE_Y_POSITION COMPARE_CW_AROUND_POINT COMPARE_Y_AT_X_LEFT \ - ARE_MERGEABLE MERGE IS_IN_X_RANGE IS_BETWEEN_CW - else - echo " ERROR: not executed test_traits_adaptor segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# traits adaptor (linear traits) -#---------------------------------------------------------------------# -test_linear_traits_adaptor() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits_adaptor linear "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor linear linear_traits_adaptor \ - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ - COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT - else - echo " ERROR: not executed test_traits_adaptor linear_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# traits adaptor (spherical arcs traits) -#---------------------------------------------------------------------# -test_spherical_arcs_traits_adaptor() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - - compile_test_with_flags test_traits_adaptor geodesic_arcs_on_sphere "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor spherical_arcs spherical_arcs_traits_adaptor \ - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ - COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT - else - echo " ERROR: not executed test_traits_adaptor spherical_arcs_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# compile and run test with traits -#---------------------------------------------------------------------# -compile_and_run_with_flags() -{ - local name=$1; - local type=$2; - local flags=$3; - - compile_test_with_flags $name $type "$flags" - if [ -n "${SUCCESS}" ] ; then - if [ -n "$DO_RUN" ] ; then - run_test_with_flags $name $type - fi - else - echo " ERROR: not executed construction of segments" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# construction with segments -#---------------------------------------------------------------------# -test_construction_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_construction segments "$flags" -} - -#---------------------------------------------------------------------# -# construction with linear curves -#---------------------------------------------------------------------# -test_construction_linear_curves() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local topol_traits=$PLANAR_UNBOUNDED_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_construction linear "$flags" -} - -#---------------------------------------------------------------------# -# construction with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_construction_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_construction geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# construction with polylines -#---------------------------------------------------------------------# -test_construction_polylines() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_construction polylines "$flags" -} - -#---------------------------------------------------------------------# -# overlay with segments -#---------------------------------------------------------------------# -test_overlay_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_overlay segments "$flags" -} - -#---------------------------------------------------------------------# -# overlay with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_overlay_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_overlay geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# point location with segments -#---------------------------------------------------------------------# -test_point_location_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -# For backward compatibility -test_point_location_segments_version() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_VERSION=1"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -# For backward compatibility -test_point_location_segments_conversion() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_CONVERSION"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -#---------------------------------------------------------------------# -# point location dynamic with segments -#---------------------------------------------------------------------# -test_point_location_dynamic_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location_dynamic segments "$flags" -} - -#---------------------------------------------------------------------# -# point location with circle segments -#---------------------------------------------------------------------# -test_point_location_circle_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location circle_segments "$flags" -} - -#---------------------------------------------------------------------# -# point location with linear objects -#---------------------------------------------------------------------# -test_point_location_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location linear "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with segments -#---------------------------------------------------------------------# -test_batched_point_location_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_batched_point_location segments "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with linear objects -#---------------------------------------------------------------------# -test_batched_point_location_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_batched_point_location linear "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_batched_point_location_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_batched_point_location geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with segments -#---------------------------------------------------------------------# -test_vertical_decomposition_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_vertical_decomposition segments "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with linear objects -#---------------------------------------------------------------------# -test_vertical_decomposition_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_vertical_decomposition linear "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_vertical_decomposition_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_vertical_decomposition geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# segment traits -#---------------------------------------------------------------------# -test_segment_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure segments segment_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - - execute_commands_new_structure segments segment_traits \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT ARE_MERGEABLE - - run_trapped_test test_traits \ - data/segments/vertex.pt data/segments/xcurves \ - data/empty.zero data/segments/vertex segment_traits - else - echo " ERROR: not executed test_traits segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# non-caching segment traits -#---------------------------------------------------------------------# -test_non_caching_segment_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$NON_CACHING_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits non_caching_segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure segments non_caching_segment_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE ASSERTIONS - - execute_commands_new_structure segments segment_traits \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/segments/vertex.pt data/segments/xcurves \ - data/empty.zero data/segments/vertex non_caching_segment_traits - else - echo " ERROR: not executed test_traits non_caching_segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve conic traits -#---------------------------------------------------------------------# -test_polycurve_conic_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_polycurve_conic_traits not ran" - return - fi - echo polycurve test starting - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_CONIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits conic_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - - # The input arguments for the execute_commands_new_structure, - # 1. polycurve_conics is the directory name in "data" - # 2. polycurve_conic_traits is a string - # Execute_command_new_structure will only run the test on functors provided as the third, fourth and so on arguments. - # To see how the input data directory should be structured for each functor, check the execute_commands_new_structure function in this file. - execute_commands_new_structure polycurves_conics polycurve_conic_traits \ - COMPARE_Y_AT_X \ - INTERSECT \ - EQUAL \ - IS_VERTICAL \ - SPLIT \ - ARE_MERGEABLE \ - COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT \ - MAKE_X_MONOTONE \ - PUSH_BACK \ - PUSH_FRONT \ - NUMBER_OF_POINTS \ - VERTEX \ - CONSTRUCT_OPPOSITE \ - MERGE \ - COMPARE_ENDPOINTS_XY \ - TRIM - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve arc traits -#---------------------------------------------------------------------# -test_polycurve_circular_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_arc_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure polycurves_circular_arcs polycurve_circular_arc_traits \ - COMPARE_Y_AT_X \ - EQUAL \ - IS_VERTICAL \ - SPLIT \ - ARE_MERGEABLE \ - COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT \ - MAKE_X_MONOTONE \ - PUSH_BACK \ - PUSH_FRONT \ - NUMBER_OF_POINTS \ - VERTEX \ - CONSTRUCT_OPPOSITE \ - MERGE \ - COMPARE_ENDPOINTS_XY \ - INTERSECT - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve bezier traits -#---------------------------------------------------------------------# -test_polycurve_bezier_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_polycurve_bezier_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_BEZIER_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits bezier_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure polycurves_bezier test_polycurve_bezier_traits \ - MERGE \ - EQUAL \ - IS_VERTICAL \ - NUMBER_OF_POINTS \ - PUSH_BACK \ - PUSH_FRONT \ - VERTEX \ - ARE_MERGEABLE \ - COMPARE_ENDPOINTS_XY - # TODO (add data for these tests) - # COMPARE_Y_AT_X \ - # SPLIT \ - # COMPARE_Y_AT_X_LEFT \ - # COMPARE_Y_AT_X_RIGHT \ - # MAKE_X_MONOTONE \ - # CONSTRUCT_OPPOSITE \ - - # INTERSECT - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polyline traits -#---------------------------------------------------------------------# -test_polyline_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits test_polylines "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure polylines polyline_traits \ - CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# non-caching polyline traits -#---------------------------------------------------------------------# -test_non_caching_polyline_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$NON_CACHING_POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits non_caching_polylines "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure polylines non_caching_polyline_traits \ - CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - else - echo " ERROR: not executed test_traits non_caching_polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# linear traits -#---------------------------------------------------------------------# -test_linear_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits linear "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure linear/segments linear_traits.segments \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - execute_commands_new_structure linear/segments linear_traits.segments \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/linear/segments/vertex.pt data/linear/segments/xcurves \ - data/empty.zero data/linear/segments/vertex linear_traits.segments - - execute_commands_old_structure linear/rays linear_traits.rays \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - execute_commands_new_structure linear/rays linear_traits.rays \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/linear/rays/vertex.pt data/linear/rays/xcurves \ - data/empty.zero data/linear/rays/vertex linear_traits.rays - - execute_commands_new_structure linear/lines linear_traits.lines \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT INTERSECT \ - SPLIT MERGE \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y \ - COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY COMPARE_Y_NEAR_BOUNDARY - else - echo " ERROR: not executed test_traits linear_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# conic traits -#---------------------------------------------------------------------# -test_conic_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_conic_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CORE_CONIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits conics "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure conics conic_traits \ - INTERSECT SPLIT MERGE COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - - execute_commands_new_structure conics conic_traits \ - INTERSECT SPLIT MERGE - - run_trapped_test test_traits \ - data/conics/compare.pt data/empty.zero \ - data/empty.zero data/conics/compare conic_traits - else - echo " ERROR: not executed test_traits conic_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# "line arcs" (segments) only -#---------------------------------------------------------------------# -test_line_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINE_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits line_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_lines line_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_lines line_arc_traits \ - IS_VERTICAL COMPARE_Y_AT_X - - run_trapped_test test_traits \ - data/circular_lines/compare.pt data/empty.zero \ - data/empty.zero data/circular_lines/compare line_arc_traits - - run_trapped_test test_traits \ - data/circular_lines/vertex.pt data/circular_lines/xcurves \ - data/empty.zero data/circular_lines/vertex line_arc_traits - else - echo " ERROR: not executed test_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circular arcs only -#---------------------------------------------------------------------# -test_circular_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCULAR_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_arcs circular_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_arcs circular_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X - else - echo " ERROR: not executed test_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circular and line arcs -#---------------------------------------------------------------------# -test_circular_line_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCULAR_LINE_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_line_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_line_arcs circular_line_arc_traits \ - VERTEX IS_VERTICAL CONSTRUCTOR COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_line_arcs circular_line_arc_traits \ - IS_VERTICAL COMPARE_Y_AT_X - - run_trapped_test test_traits \ - data/circular_line_arcs/vertex.pt data/circular_line_arcs/xcurves \ - data/empty.zero data/circular_line_arcs/vertex circular_line_arc_traits - else - echo " ERROR: not executed test_traits circular_line_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circle segment traits -#---------------------------------------------------------------------# -test_circle_segments_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circle_segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circle_segments circle_segments_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/vertex circle_segments_traits - run_trapped_test test_traits \ - data/empty.zero data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/is_vertical circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/compare_y_at_x circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.16 \ - data/empty.zero data/circle_segments/compare_y_at_x_left circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.16 \ - data/empty.zero data/circle_segments/compare_y_at_x_right circle_segments_traits - run_trapped_test test_traits \ - data/empty.zero data/circle_segments/constructor.xcv \ - data/empty.zero data/circle_segments/constructor circle_segments_traits - else - echo " ERROR: not executed test_traits circle_segments_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# bezier traits -#---------------------------------------------------------------------# -test_bezier_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_bezier_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$BEZIER_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits Bezier "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure bezier bezier_traits \ - COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT SPLIT \ - CONSTRUCTOR ASSERTIONS ARE_MERGEABLE - else - echo " ERROR: not executed test_traits bezier_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# spherical arc traits -#---------------------------------------------------------------------# -test_spherical_arc_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - - compile_test_with_flags test_traits geodesic_arcs_on_sphere "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure spherical_arcs spherical_arc_traits \ - COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \ - CONSTRUCTOR \ - COMPARE MAKE_X_MONOTONE SPLIT MERGE ASSERTIONS ARE_MERGEABLE - - execute_commands_new_structure spherical_arcs spherical_arc_traits \ - INTERSECT \ - COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY \ - COMPARE_Y_NEAR_BOUNDARY - - run_trapped_test test_traits \ - data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \ - data/empty.zero data/spherical_arcs/compare spherical_arc_traits - else - echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# rational arc traits -#---------------------------------------------------------------------# -test_rational_arc_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_rational_arc_traits not ran" - return - fi - local nt=$CORE_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$RATIONAL_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits rational_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - run_trapped_test test_traits \ - data/compare.pt data/empty.zero \ - data/empty.zero data/compare rational_arc_traits - - execute_commands_new_structure rational_arcs rational_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT SPLIT MERGE \ - COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY COMPARE_Y_NEAR_BOUNDARY - else - echo " ERROR: not executed test_traits rational_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# algebraic traits with GMP/MPFI -#---------------------------------------------------------------------# -test_algebraic_traits_gmp() -{ - #TODO: Adapt - - local nt=$CGAL_GMPZ_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_gmp \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_gmp" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# algebraic traits with LEDA -#---------------------------------------------------------------------# -test_algebraic_traits_leda() -{ - #TODO: Adapt - - local nt=$LEDA_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_leda \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_leda" >> $ERRORFILE - fi - clean_tests -} - - -#---------------------------------------------------------------------# -# algebraic traits with CORE -#---------------------------------------------------------------------# -test_algebraic_traits_core() -{ - #TODO: Adapt - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_algebraic_traits_core not ran" - return - fi - local nt=$CORE_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_core \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_core" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f $ERRORFILE -rm -f $FULL_ERROR_DESCRIPTION_FILE -rm -f ProgramOutput.test_* -touch $ERRORFILE - -#---------------------------------------------------------------------# -# compile and run the tests -#---------------------------------------------------------------------# - - - -if [ $# -ne 0 ] ; then - case $1 in - -cmake) TEST_WITH_CMAKE="TRUE" ;; - *)TEST_WITH_CMAKE="FALSE" ;; - esac -else - TEST_WITH_CMAKE="FALSE" -fi - -echo "Run all tests." - -if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - configure -fi - -if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - compile_and_run construction_test_suite_generator -fi - -test_segment_traits -test_non_caching_segment_traits -test_polyline_traits -test_polycurve_conic_traits -test_polycurve_circular_arc_traits -test_polycurve_bezier_traits -test_non_caching_polyline_traits -test_linear_traits -test_conic_traits - -test_line_arc_traits # "line arcs" (segments) only -test_circular_arc_traits # circular arcs only -test_circular_line_arc_traits # for both - -test_circle_segments_traits -test_bezier_traits - -test_spherical_arc_traits - -test_rational_arc_traits - -test_algebraic_traits_core -test_algebraic_traits_gmp -test_algebraic_traits_leda - -compile_and_run test_data_traits - -compile_and_run test_insertion -compile_and_run test_unbounded_rational_insertion -compile_and_run test_unbounded_rational_direct_insertion -compile_and_run test_rational_function_traits_2 -compile_and_run test_iso_verts - -compile_and_run test_vert_ray_shoot_vert_segments - -test_construction_segments -test_construction_linear_curves -test_construction_spherical_arcs -test_construction_polylines - -test_overlay_segments -test_overlay_spherical_arcs - -test_point_location_segments -test_point_location_segments_version -test_point_location_segments_conversion -test_point_location_circle_segments -test_point_location_linear - -test_point_location_dynamic_segments - -test_batched_point_location_segments -test_batched_point_location_linear -test_batched_point_location_spherical_arcs - -test_vertical_decomposition_segments -test_vertical_decomposition_linear -# test_vertical_decomposition_spherical_arcs - -compile_and_run test_dual -compile_and_run test_do_intersect -compile_and_run test_zone - -compile_and_run test_observer -compile_and_run test_do_equal - -test_segment_traits_adaptor -test_linear_traits_adaptor -test_spherical_arcs_traits_adaptor - -compile_and_run test_removal -compile_and_run test_unbounded_removal -compile_and_run test_spherical_removal - -compile_and_run test_io - -compile_and_run test_sgm - -compile_and_run test_polycurve_intersection - -# if any error occurred then append the full error description file to error file - -if [ -f $FULL_ERROR_DESCRIPTION_FILE ] ; then - echo "******************** appending all error outputs ********************" >> $ERRORFILE - cat $FULL_ERROR_DESCRIPTION_FILE >> $ERRORFILE -fi diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt index 42215c6eef1..fc075c63253 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_testing.txt @@ -8,48 +8,27 @@ Before submitting a change for integration into \cgal it is good style to run the testsuite of the modified package and all packages that could be impacted. -Here is what you need: -- A shell such as bash (install Cygwin, when you are on Windows) -- optional: put `Scripts/scripts` and `Scripts/developer_scripts` on your `PATH` environment variable or - Alternatively, you can call the scripts mentioned below using their full path or a relative path -- define the environment variable `CGAL_DIR`. It should be the directory where you built CGAL. -- optional: define the environment variables for Boost, GMP, and any optional third party lib, e.g. Eigen. -- On Windows: define the environment variable `MAKE_CMD` (put the line `export MAKE_CMD=nmake` in your `$HOME/.bashrc` for VC++) -- On Windows: define the environment variable `CMAKE_GENERATOR` (put the line export CMAKE_GENERATOR='-GNMake Makefiles' in your `$HOME/.bashrc` for VC++) -- go in the directory you want to test -- Run `cgal_test_with_cmake` in the `test` and `examples` directories of the package. This should run CMake, compile and run, and you can see what happened in the generated file `error.txt`. +All examples and tests in CGAL are now compatible with `ctest`. So to test all examples or all tests +of a package, you simply need to configure with `cmake` the examples/tests of the package you want to +test, adding the option `CGAL_ENABLE_TESTING` and setting its value to `ON`. In order to report more +warnings, it is recommended to also add the option `CGAL_DEV_MODE` and to set it to `ON`. +Then a call to the command `ctest` will compile and run the tests/examples. + \section fullTestsuite Running the Whole Testsuite We describe here how to proceed to the testing of a full copy of `master` or any branch by creating a flat release (that is having a layout similar to a release rather than a branch layout with header files gathered by packages). -The creation of the flat release is done using the script `create_internal_release` located in the directory `Scripts/developer_scripts`. -Running the script with no argument will give the complete usage of this script. We only describe one way of using it. +The creation of the flat release is done using the `cmake` script `cgal_create_release_with_cmake.cmake` located in the directory `Scripts/developer_scripts`. +You can run it using the option `-P` of `cmake`: `cmake -P cgal_create_release_with_cmake.cmake`. +For an up-to-date documentation of available options, check the comments at the beginning of the script. -The prerequisite is to have a checkout of the branch we want to test. -In the example, it will be located in ~/Git/cgal/. - -First one goes into a directory where the flat release will be created: -\code -> cd /tmp -\endcode - -Then the script `create_internal_release` is ran: -\code - > create_internal_release -r CGAL-I-FOO -a ~/Git/cgal/ -\endcode - -The directory `CGAL-I-FOO` now contains the flat release of the branch in `~/Git/cgal`. -Then you need to compile this flat release and set `CGAL_DIR` accordingly as explained in the installation manual. - -To run the test-suite simply do: -\code - > cd CGAL-I-FOO/test - > ./run_testsuite_with_ctest -\endcode -and wait for the results to be written in the file `error.txt`. +Then for testing all examples, tests, and demos, in a build directory call `cmake` on the created release +(the path is given by the script if not manually specified) +`cmake -DBUILD_TESTING=ON -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON ../CGAL-X.XX/` +Finally, a call to the command `ctest` will compile and run the tests, examples, and demos. */ diff --git a/Installation/test/Installation/cgal_test_with_cmake b/Installation/test/Installation/cgal_test_with_cmake deleted file mode 100755 index 728cf75d349..00000000000 --- a/Installation/test/Installation/cgal_test_with_cmake +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/sh - -# This is a script for the CGAL test suite. Such a script must obey -# the following rules: -# -# - the name of the script is cgal_test_with_cmake -# - for every target two one line messages are written to the file 'error.txt' -# the first one indicates if the compilation was successful -# the second one indicates if the execution was successful -# if one of the two was not successful, the line should start with 'ERROR:' -# - running the script should not require any user interaction -# - the script should clean up object files and executables - - ERRORFILE=error.txt - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f ../$ERRORFILE -touch ../$ERRORFILE - -#---------------------------------------------------------------------# -# compile_and_run -#---------------------------------------------------------------------# -echo "Configuring... " -mkdir build_dir -cd build_dir -if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_RELEASE_DIR" -DBUILD_TESTING=ON -DWITH_tests=ON \ - ..' ; then - - echo " successful configuration" >> ../$ERRORFILE -else - echo " ERROR: configuration" >> ../$ERRORFILE -fi -cd .. - -#---------------------------------------------------------------------# -# configure, compile and run the tests -#---------------------------------------------------------------------# - -cd build_dir -ctest -L Installation_Tests -VV |tee res.txt -SUCCES="y" -FAILED=$(cat res.txt|grep "\*\*\*Failed") -if [ -z "$FAILED" ]; then - echo " successful run of Installation tests" >> ../$ERRORFILE -else - echo " ERROR: run of Installation tests" >> ../$ERRORFILE - SUCCES="" -fi -cat ../$ERRORFILE diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py deleted file mode 100644 index 50634394094..00000000000 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py +++ /dev/null @@ -1,84 +0,0 @@ -"""Python module to create and publish CGAL releases from a branch""" - -import os - - -class Release: - """class to create a CGAL release from a branch - optionally, the release can be internal - """ - - def __init__(self, branch, internal=False): - self.branch = branch - self.internal = internal - self.cwd = f"$HOME/CGAL/create_internal_release-{self.branch}-branch" - self.repo = f"$HOME/CGAL/branches/CGAL-{self.branch}-branch.git" - self.extra_options = " --public" - - def command(self): - """return the command to create and publish the release""" - return ( - f"PATH=/home/lrineau/bin-cmake3:/bin:/usr/bin:/home/lrineau/bin; cd {self.cwd} &&" - + " /usr/bin/time scl enable rh-git29 -- " - + f"$HOME/bin/create_release {self.repo}{self.extra_options} --do-it" - ) - - def __str__(self): - msg = ( - f"{'internal ' if self.internal else ''}release from {self.branch}\n" - f"cwd: {self.cwd}\nrepo: {self.repo}\n" - f"command:\n{self.command()}" - ) - return msg - - def __call__(self): - if os.system(self.command()) != 0: - raise RuntimeError( - "Error while creating " + - f"{'internal ' if self.internal else ''}release from {self.branch}" - ) - - INTERNAL = True - - -class InternalRelease(Release): - """class to create an internal CGAL release from a branch""" - - def __init__(self, branch): - super().__init__(branch, Release.INTERNAL) - self.extra_options = " --integration" - - -class BetaRelease(Release): - """class to create an internal CGAL release from a branch""" - - def __init__(self, branch, beta_number): - super().__init__(branch, Release.INTERNAL) - self.extra_options = f" --public --beta {beta_number}" - - -integration = InternalRelease("integration") -integration.repo = "$HOME/CGAL/branches/integration.git" -integration.cwd = "$HOME/CGAL/create_internal_release" -master = Release("master") -master.repo = "$HOME/CGAL/branches/master.git" -master.cwd = "$HOME/CGAL/create_internal_release" - - -def beta_release_from_master(beta_number): - """Convenience function to create a beta release from master""" - rel = BetaRelease("master", beta_number) - rel.repo = "$HOME/CGAL/branches/master.git" - rel.cwd = "$HOME/CGAL/create_internal_release" - return rel - - -def release(branch): - """Convenience function to create a release from a branch""" - return Release(branch) - - -if __name__ == "__main__": - print( - "This file is a Python module. Use create_internal_release_of_the_day.py instead." - ) diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/cgal_test_with_cmake b/Minkowski_sum_2/test/Minkowski_sum_2/cgal_test_with_cmake deleted file mode 100755 index 1be7f4c52c1..00000000000 --- a/Minkowski_sum_2/test/Minkowski_sum_2/cgal_test_with_cmake +++ /dev/null @@ -1,125 +0,0 @@ -#! /bin/sh - -# This is a script for the CGAL test suite. Such a script must obey -# the following rules: -# -# - the name of the script is cgal_test_with_cmake -# - for every target two one line messages are written to the file 'error.txt' -# the first one indicates if the compilation was successful -# the second one indicates if the execution was successful -# if one of the two was not successful, the line should start with 'ERROR:' -# - running the script should not require any user interaction -# - the script should clean up object files and executables - - ERRORFILE=error.txt - DO_RUN=y - if [ -z "${MAKE_CMD}" ]; then - MAKE_CMD=make - fi - NEED_CLEAN= - -#---------------------------------------------------------------------# -# configure -#---------------------------------------------------------------------# - -configure() -{ - echo "Configuring... " - - if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -#---------------------------------------------------------------------# -# compile_and_run -#---------------------------------------------------------------------# - -compile_and_run() -{ - echo "Compiling $1 ... " - SUCCESS="y" - - if eval '${MAKE_CMD} VERBOSE=ON -fMakefile $1' ; then - echo " successful compilation of $1" >> $ERRORFILE - else - echo " ERROR: compilation of $1" >> $ERRORFILE - SUCCESS="" - fi - - if [ -n "$DO_RUN" ] ; then - if [ -n "${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.$1.$PLATFORM - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - fi - echo "Executing $1 ... " - echo - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1" >> $ERRORFILE - else - echo " ERROR: execution of $1" >> $ERRORFILE - fi - else - echo " ERROR: not executed $1" >> $ERRORFILE - fi - fi -} - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f $ERRORFILE -touch $ERRORFILE - -#---------------------------------------------------------------------# -# configure, compile and run the tests -#---------------------------------------------------------------------# - -configure - -if [ $# -ne 0 ] ; then - for file in $* ; do - compile_and_run $file - done -else - echo "Run all tests." -if ${MAKE_CMD} -f Makefile help | grep -E "test_approx_offset$" > /dev/null; then - compile_and_run test_approx_offset - NEED_CLEAN=y -fi -if ${MAKE_CMD} -f Makefile help | grep -E "test_exact_offset$" > /dev/null; then - compile_and_run test_exact_offset - NEED_CLEAN=y -fi -if ${MAKE_CMD} -f Makefile help | grep -E "test_minkowski_sum$" > /dev/null; then - compile_and_run test_minkowski_sum - NEED_CLEAN=y -fi -if ${MAKE_CMD} -f Makefile help | grep -E "test_minkowski_sum_with_holes$" > /dev/null; then - compile_and_run test_minkowski_sum_with_holes - NEED_CLEAN=y -fi -fi - -# -# The clean target generated by CMake under cygwin -# always fails for some reason -# -if [ -n "${NEED_CLEAN}" ]; then - if ! ( uname | grep -q "CYGWIN" ) ; then - ${MAKE_CMD} -fMakefile clean - fi -fi diff --git a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake deleted file mode 100755 index 6fea7949176..00000000000 --- a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake +++ /dev/null @@ -1,235 +0,0 @@ -#! /bin/sh - -# This is a script for the CGAL test suite. Such a script must obey -# the following rules: -# -# - the name of the script is cgal_test_with_cmake -# - for every target two one line messages are written to the file 'error.txt' -# the first one indicates if the compilation was successful -# the second one indicates if the execution was successful -# if one of the two was not successful, the line should start with 'ERROR:' -# - running the script should not require any user interaction -# - the script should clean up object files and executables - - ERRORFILE=error.txt - DO_RUN= - if [ -z "${MAKE_CMD}" ]; then - MAKE_CMD=make - fi - NEED_CLEAN= - -#---------------------------------------------------------------------# -# configure -#---------------------------------------------------------------------# - -configure() -{ - echo "Configuring... " - - if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -#---------------------------------------------------------------------# -# compile_and_run -#---------------------------------------------------------------------# - -compile_and_run() -{ - echo "Compiling $1 ... " - SUCCES="y" - - if eval '${MAKE_CMD} VERBOSE=ON -fMakefile $1' ; then - echo " successful compilation of $1" >> $ERRORFILE - else - echo " ERROR: compilation of $1" >> $ERRORFILE - SUCCES="" - fi - - if [ -n "$DO_RUN" ] ; then - if [ -n "${SUCCES}" ] ; then - OUTPUTFILE=ProgramOutput.$1.$PLATFORM - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - fi - echo "Executing $1 ... " - echo - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1" >> $ERRORFILE - else - echo " ERROR: execution of $1" >> $ERRORFILE - fi - else - echo " ERROR: not executed $1" >> $ERRORFILE - fi - fi -} - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f $ERRORFILE -touch $ERRORFILE - -#---------------------------------------------------------------------# -# configure, compile and run the tests -#---------------------------------------------------------------------# - -configure - -if [ $# -ne 0 ] ; then - for file in $* ; do - compile_and_run $file - done -else - echo "Run all tests." - - for target in \ -demo_framework \ -gl_splat \ -point_dialog \ -Polyhedron_3 \ -polyhedron_demo \ -scene_basic_objects \ -scene_color_ramp \ -scene_c2t3_item \ -scene_c3t3_item \ -scene_combinatorial_map_item \ -scene_edit_polyhedron_item \ -scene_image_item \ -scene_implicit_function_item \ -scene_nef_polyhedron_item \ -scene_points_with_normal_item \ -scene_polygon_soup_item \ -scene_polyhedron_item \ -scene_polyhedron_item_decorator \ -scene_polyhedron_and_sm_item_k_ring_selection \ -scene_poly_item_k_ring_selection \ -scene_sm_item_k_ring_selection \ -scene_polyhedron_selection_item \ -scene_polyhedron_shortest_path_item \ -scene_polyhedron_transform_item \ -scene_polylines_item \ -scene_surface_mesh_item \ -scene_textured_polyhedron_item \ -basic_generator_plugin \ -c3t3_io_plugin \ -camera_positions_plugin \ -classification_plugin \ -clip_polyhedron_plugin \ -convex_hull_plugin \ -corefinement_plugin \ -create_bbox_mesh_plugin \ -cut_plugin \ -detect_sharp_edges_plugin \ -detect_sharp_edges_sm_plugin \ -distance_plugin \ -distance_sm_plugin \ -edit_polyhedron_plugin \ -edit_sm_plugin \ -extrude_poly_plugin \ -extrude_sm_plugin \ -fairing_plugin \ -features_detection_plugin \ -gocad_plugin \ -hole_filling_plugin \ -hole_filling_sm_plugin \ -hole_filling_polyline_plugin \ -inside_out_plugin \ -surface_intersection_plugin \ -surface_intersection_sm_plugin \ -io_image_plugin \ -io_implicit_function_plugin \ -isotropic_remeshing_plugin \ -jet_fitting_plugin \ -join_and_split_polyhedra_plugin \ -kernel_plugin \ -mean_curvature_flow_skeleton_plugin \ -mean_curvature_flow_skeleton_sm_plugin \ -merge_point_sets_plugin \ -mesh_2_plugin \ -mesh_3_optimization_plugin \ -mesh_3_plugin \ -mesh_segmentation_plugin \ -mesh_segmentation_sm_plugin \ -mesh_simplification_plugin \ -nef_io_plugin \ -nef_plugin \ -off_plugin \ -off_to_nef_plugin \ -offset_meshing_plugin \ -alpha_wrap_3_plugin \ -orient_soup_plugin \ -parameterization_plugin \ -pca_plugin \ -p_klein_function_plugin \ -ply_to_xyz_plugin \ -point_inside_polyhedron_plugin \ -point_set_average_spacing_plugin \ -point_set_bilateral_smoothing_plugin \ -point_set_from_vertices_plugin \ -point_set_interference_plugin \ -point_set_normal_estimation_plugin \ -point_set_outliers_removal_plugin \ -point_set_selection_plugin \ -point_set_shape_detection_plugin \ -point_set_simplification_plugin \ -point_set_smoothing_plugin \ -point_set_upsampling_plugin \ -point_set_wlop_plugin \ -polyhedron_slicer_plugin \ -polyhedron_stitching_plugin \ -polylines_io_plugin \ -p_sphere_function_plugin \ -p_tanglecube_function_plugin \ -random_perturbation_plugin \ -repair_polyhedron_plugin \ -selection_io_plugin \ -selection_sm_io_plugin \ -selection_plugin \ -selection_sm_plugin \ -self_intersection_plugin \ -shortest_path_plugin \ -surface_mesh_approximation_plugin \ -stl_plugin \ -subdivision_methods_plugin \ -surface_mesh_io_plugin \ -surface_reconstruction_plugin \ -surf_to_sm_io_plugin \ -transform_polyhedron_plugin \ -triangulate_facets_plugin \ -trivial_plugin \ -vtk_plugin \ -xyz_plugin \ -smoothing_plugin \ - all - do - if ${MAKE_CMD} -f Makefile help | grep "$target" > /dev/null; then - compile_and_run "$target" - NEED_CLEAN=y - fi - done -fi - -# -# The clean target generated by CMake under cygwin -# always fails for some reason -# -if [ -n "${NEED_CLEAN}" ]; then - if ! ( uname | grep -q "CYGWIN" ) ; then - ${MAKE_CMD} -fMakefile clean || true - fi -fi diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index 1906d885e48..9feee6d1f71 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -1,4 +1,4 @@ -#option : +#options: # GIT_REPO the path to the Git repository, default is the current working directory # DESTINATION the path where the release is created, default is /tmp # PUBLIC=[ON/OFF] indicates if a public release should be built, default is OFF @@ -201,8 +201,7 @@ foreach(manpage ${MANPAGES}) configure_file(${GIT_REPO}/Installation/${manpage} ${release_dir}/${manpage} @ONLY) endforeach() -# make an extra copy of examples and demos for the testsuite and generate -# create_cgal_test_with_cmake for tests, demos, and examples +# make an extra copy of examples and demos for the testsuite if (TESTSUITE) SET(FMT_ARG "format:SCM branch:%n%H %d%n%nShort log from master:%n") execute_process( @@ -221,23 +220,6 @@ if (TESTSUITE) #append result in .scm-branch file(APPEND ${release_dir}/.scm-branch "${OUT_VAR}") - file(GLOB tests RELATIVE "${release_dir}/test" "${release_dir}/test/*") - foreach(d ${tests}) - if(IS_DIRECTORY "${release_dir}/test/${d}") - if(NOT EXISTS "${release_dir}/test/${d}/cgal_test_with_cmake") - execute_process( - COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake - WORKING_DIRECTORY "${release_dir}/test/${d}" - RESULT_VARIABLE RESULT_VAR - OUTPUT_VARIABLE OUT_VAR - ) - if(NOT "${RESULT_VAR}" STREQUAL "0") - message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}") - endif() - endif() - endif() - endforeach() - file(MAKE_DIRECTORY "${release_dir}/tmp") #copy demo/PKG to test/PKG_Demo file(GLOB demos RELATIVE "${release_dir}/demo" "${release_dir}/demo/*") @@ -250,17 +232,6 @@ if (TESTSUITE) #do the copy in 2 pass since we cannot specify the target name file(COPY "${release_dir}/demo/${d}" DESTINATION "${release_dir}/tmp") file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Demo") - if(NOT EXISTS "${release_dir}/test/${d}_Demo/cgal_test_with_cmake") - execute_process( - COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run - WORKING_DIRECTORY "${release_dir}/test/${d}_Demo" - RESULT_VARIABLE RESULT_VAR - OUTPUT_VARIABLE OUT_VAR - ) - if(NOT "${RESULT_VAR}" STREQUAL "0") - message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}_Demo") - endif() - endif() endif() endif() endforeach() @@ -271,17 +242,6 @@ if (TESTSUITE) #do the copy in 2 pass since we cannot specify the target name file(COPY "${release_dir}/examples/${d}" DESTINATION "${release_dir}/tmp") file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Examples") - if(NOT EXISTS "${release_dir}/test/${d}_Examples/cgal_test_with_cmake") - execute_process( - COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake - WORKING_DIRECTORY "${release_dir}/test/${d}_Examples" - RESULT_VARIABLE RESULT_VAR - OUTPUT_VARIABLE OUT_VAR - ) - if(NOT "${RESULT_VAR}" STREQUAL "0") - message(FATAL_ERROR "Error while running create_cgal_test_with_cmake in ${release_dir}/test/${d}_Examples") - endif() - endif() endif() endforeach() file(REMOVE_RECURSE "${release_dir}/tmp") diff --git a/Scripts/developer_scripts/cgal_test_with_cmake b/Scripts/developer_scripts/cgal_test_with_cmake deleted file mode 100755 index 4a5c94aa7e9..00000000000 --- a/Scripts/developer_scripts/cgal_test_with_cmake +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -dir=${PWD%/*} -dir=${dir##*/} - -if [ "x${dir}" = "xdemo" ]; then - in_demo="--no-run" -fi - -[ ! -e CMakeLists.txt ] && echo "No CMakeLists.txt in current directory, creating it" && cgal_create_cmake_script test - -# If there is already a cgal_test_with_cmake script in the current directory, execute it. -[ ! -x cgal_test_with_cmake ] && echo "No cgal_test_with_cmake in current directory, creating it" && create_cgal_test_with_cmake ${in_demo} - -./cgal_test_with_cmake $@ -cat error.txt diff --git a/Scripts/developer_scripts/create_cgal_test b/Scripts/developer_scripts/create_cgal_test deleted file mode 100755 index e10c3d11dea..00000000000 --- a/Scripts/developer_scripts/create_cgal_test +++ /dev/null @@ -1,214 +0,0 @@ -#! /bin/bash -# -# ============================================================================= -# $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/developer_scripts/create_cgal_test $ -# $Id: create_cgal_test 36975 2007-03-09 22:52:40Z spion $ -# -# author(s) : Wieger Wesselink, Geert-Jan Giezeman -# -# coordinator : Utrecht University -# ============================================================================= -# -# This script creates a cgal_test_with_cmake script with entries for files with a common -# C++ file extension (as mentioned in the g++ man page) in the current test directory. - -VERSION=1.1 - -DO_RUN="y" - -usage() -{ - echo 'Usage : create_cgal_test [--no-run]' - echo - echo ' --help : prints this usage help' - echo ' --no-run : produces a cgal_test_with_cmake script that only does compilation, no execution' - exit -} - -while [ $1 ]; do - case "$1" in - -h|-help|--h|--help) - usage; - ;; - --no-run) - DO_RUN="" - shift; continue - ;; - *) - echo "Unknown option: $1" - usage - ;; - esac -done - - -header() -{ - echo "#---------------------------------------------------------------------#" - echo "# $1" - echo "#---------------------------------------------------------------------#" -} - -create_script() -{ - echo "#! /bin/sh" - echo - echo "# This is a script for the CGAL test suite. Such a script must obey" - echo "# the following rules:" - echo "#" - echo "# - the name of the script is cgal_test_with_cmake" - echo "# - for every target two one line messages are written to the file 'error.txt'" - echo "# the first one indicates if the compilation was successful" - echo "# the second one indicates if the execution was successful" - echo "# if one of the two was not successful, the line should start with 'ERROR:'" - echo "# - running the script should not require any user interaction" - echo "# - the script should clean up object files and executables" - echo -cat << EOF - ERRORFILE=error.txt - DO_RUN=${DO_RUN} - if [ -z "\${MAKE_CMD}" ]; then - MAKE_CMD=make - fi - NEED_CLEAN= - -EOF - header "configure" -cat << 'EOF' - -configure() -{ - echo "Configuring... " - - if eval 'cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - --no-warn-unused-cli \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -EOF - header "compile_and_run " -cat << EOF - -compile_and_run() -{ - if [ -z "\${CGAL_DATA_DIR}" ]; then - if [ -d \${CGAL_DIR}/data ]; then - export CGAL_DATA_DIR=\${CGAL_DIR}/data - else - if [ -d \${CGAL_DIR}/Data/data ]; then - export CGAL_DATA_DIR=\${CGAL_DIR}/Data/data - else - echo "ERROR: Cannot run test script, please set the variable CGAL_DATA_DIR" - exit 1 - fi - fi - fi - - echo "Runs will be using CGAL_DATA_DIR = \${CGAL_DATA_DIR}" - - echo "Compiling \$1 ... " - SUCCESS="y" - - if eval '"\${MAKE_CMD}" VERBOSE=ON -fMakefile \$1' ; then - echo " successful compilation of \$1" >> \$ERRORFILE - else - echo " ERROR: compilation of \$1" >> \$ERRORFILE - SUCCESS="" - fi - - if [ -n "\$DO_RUN" ] ; then - if [ -n "\${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.\$1.\$PLATFORM - rm -f \$OUTPUTFILE - COMMAND="./\$1" - if [ -f \$1.cmd ] ; then - COMMAND="\$COMMAND \`eval echo \$(cat \$1.cmd)\`" - fi - if [ -f \$1.cin ] ; then - COMMAND="cat \$1.cin | \$COMMAND" - fi - echo "Executing \$1 ... " - echo - ulimit -t 3600 2> /dev/null - if eval \$COMMAND > \$OUTPUTFILE 2>&1 ; then - echo " successful execution of \$1" >> \$ERRORFILE - else - echo " ERROR: execution of \$1" >> \$ERRORFILE - fi - else - echo " ERROR: not executed \$1" >> \$ERRORFILE - fi - fi -} - -EOF - header "remove the previous error file" -cat << EOF - -rm -f \$ERRORFILE -touch \$ERRORFILE - -EOF - header "configure, compile and run the tests" -cat << EOF - -configure - -if [ \$# -ne 0 ] ; then - for file in \$* ; do - compile_and_run \$file - done -else - echo "Run all tests." -EOF - - # workaround for Cygwin, to avoid that the 'sort' from - # C:\Windows\system32 is used instead of /usr/bin/sort - PATH=/usr/bin:$PATH - - for file in `ls *.cc *.cp *.cxx *.cpp *.CPP *.c++ *.C 2> /dev/null | sort` ; do - if [ -n "`grep '\' $file`" ] ; then - BASE=`basename $file .cc` - BASE=`basename $BASE .cp` - BASE=`basename $BASE .cxx` - BASE=`basename $BASE .cpp` - BASE=`basename $BASE .CPP` - BASE=`basename $BASE .c++` - BASE=`basename $BASE .C` - cat < cgal_test_with_cmake -chmod 755 cgal_test_with_cmake -echo "created cgal_test_with_cmake, version $VERSION, in $PWD ..." diff --git a/Scripts/developer_scripts/create_cgal_test_with_cmake b/Scripts/developer_scripts/create_cgal_test_with_cmake deleted file mode 100755 index 0b7e222cbd7..00000000000 --- a/Scripts/developer_scripts/create_cgal_test_with_cmake +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec "${0%_with_cmake}" ${1+"$@"} diff --git a/Snap_rounding_2/test/Snap_rounding_2/cgal_test_with_cmake b/Snap_rounding_2/test/Snap_rounding_2/cgal_test_with_cmake deleted file mode 100755 index 8c72a52e332..00000000000 --- a/Snap_rounding_2/test/Snap_rounding_2/cgal_test_with_cmake +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash - -./cgal_test_base -cmake - diff --git a/Surface_sweep_2/test/Surface_sweep_2/cgal_test_with_cmake b/Surface_sweep_2/test/Surface_sweep_2/cgal_test_with_cmake deleted file mode 100755 index 60483af61d6..00000000000 --- a/Surface_sweep_2/test/Surface_sweep_2/cgal_test_with_cmake +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -./cgal_test_base -cmake From 88ed74a1642b572b2504f66fdf8ffd11cbca7ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 22 Jan 2025 14:42:00 +0100 Subject: [PATCH 161/175] script not used --- .../developer_scripts/create_internal_release | 650 ------------------ Scripts/developer_scripts/create_new_release | 8 - 2 files changed, 658 deletions(-) delete mode 100755 Scripts/developer_scripts/create_internal_release diff --git a/Scripts/developer_scripts/create_internal_release b/Scripts/developer_scripts/create_internal_release deleted file mode 100755 index 2db9f7f9ef8..00000000000 --- a/Scripts/developer_scripts/create_internal_release +++ /dev/null @@ -1,650 +0,0 @@ -#!/usr/bin/env perl -#this script generates the internal release - -use warnings; - -use Cwd; -use File::Find; -use Getopt::Std; -use File::Spec; -use File::Temp; -use Archive::Tar; -use Archive::Tar::File; -use File::Copy; -use File::Copy::Recursive qw(dircopy); -use File::Path qw(mkpath); -use POSIX qw(strftime); - -$Getopt::Std::STANDARD_HELP_VERSION = 1; - -package main; -local $VERSION='$Id$'; - -sub HELP_MESSAGE() { - usage() -} - -sub usage() { - print STDERR<<"EOF"; -usage: - $0 (-h|-r) - [-n version number] - [-d releasedir] [-a allpackagesdir] - [-c candidatesdir] - [-l lockfile] - -Exactly one of the options -h or -r must be present. - -h show this message and quit - -r release version to be created - - -n version number (CGAL_VERSION_NR) - -d releasedir, default releasedir is the current dir - -a allpackagesdir, default is releasedir/trunk - -c candidatesdir - -l lockfile, default is releasedir/release_creation.lock - - The version number is stored in VERSION and include/CGAL/version.h. - The RELEASEDIR is the place where the new release will be created. - The ALLPACKAGESDIR is the directory that contains the checked out packages - from the SCM. Could be trunk or some branch. - The LOCKFILE is some file used by lockfile command as a mutex. - -Example of how to use the script: ->svn co svn+ssh://scm.gforge.inria.fr/svn/cgal/trunk ->./create_internal_release -r CGAL-3.3-I-1 -or ->./create_internal_release -r CGAL-3.3-I-7 -d \$HOME -a \$HOME/CGALSVN/trunk -l release_creation.lock - - -EOF -} - - -my $TEMPFILE="TEMPFILE.$$"; - -#----------------------------------------------------# -# Initialisation # -#----------------------------------------------------# - -my ( - $VERSION, - $VERSION_NR, - $LOCKFILE, - $ALLPACKAGESDIR, - $CANDIDATESDIR, - $RELEASEDIR, - $MAINDIR, - $SCRIPTSDIR, - $DEVELSCRIPTSDIR, - $LOCKCMD, -# 'files' is an associative array (hash table in perl language) that maps -# from files names (relative to CGAL_DIR) to the name of the package that -# provided it. - %files, -# 'LISTOFALLPACKAGES' is an associative array that maps from packages names -# to the full path of the working copy that provided it. - %LISTOFALLPACKAGES -); - -%LISTOFALLPACKAGES = (); - -sub termination_signal_handler { - unlink $LOCKFILE; - exit 1; -} - -sub lock() -{ - if (system("$LOCKCMD", "-r", '10', "$LOCKFILE") != 0) { - print STDERR <<"TOTHIER"; -The script could not proceed because -it could not acquire the needed lock on file $LOCKFILE. -TOTHIER - exit 1; - } - $SIG{QUIT} = \&termination_signal_handler; - $SIG{HUP} = \&termination_signal_handler; - $SIG{INT} = \&termination_signal_handler; - $SIG{TERM} = \&termination_signal_handler; -} - -sub unlock() -{ - unlink $LOCKFILE; - $SIG{QUIT} = 'DEFAULT'; - $SIG{HUP} = 'DEFAULT'; - $SIG{INT} = 'DEFAULT'; - $SIG{TERM} = 'DEFAULT'; -} - -sub add_one_package($) { - my ($package) = @_; -} - -sub list_packages($) { - my ($packages_directory) = @_; - opendir PACKAGESDIR, $packages_directory or die; - while (defined($package_name = readdir(PACKAGESDIR))) { - my $package_full_path = File::Spec->catdir($packages_directory, $package_name); - next if $package_name =~ /^\..*$/; - next if (! -d $package_full_path ); - next if ($package_full_path =~ /Maintenance$/); # skip Maintenance package - $LISTOFALLPACKAGES{$package_name} = $packages_directory; - } - closedir(PACKAGESDIR); -} - -sub install_packages() { - my ($filename, $direc, $tmp_package_name); - print "Installing packages ...\n"; - chdir $RELEASEDIR or die; - - if( ! open(LOG_CONFLICTS, ">>&=3") ) { - open(LOG_CONFLICTS, ">&", STDOUT) or die; - } - foreach my $package_name (keys(%LISTOFALLPACKAGES)) { - my $package_comes_from = $LISTOFALLPACKAGES{$package_name}; - my $package_full_path = File::Spec->catdir($package_comes_from, $package_name); - $dont_submit="$package_full_path/dont_submit"; - chdir "$package_comes_from" or die; - @command = ('tar', '-cf', "$RELEASEDIR/temppack.tar", '--exclude=.svn'); - # comment for later: once the tar version installed on - # cgal.geometryfactory.com knows the option --exclude-vcs, use that - # option instead of --exclude=.svn - # -- Laurent Rineau, 2009/12/04 (idea by Sylvain Pion) - if( -f $dont_submit ) { - @command = (@command, "--exclude-from=$dont_submit"); - } - @command = (@command, @global_dont_submit_tar_options); - @command = (@command, "-C", "$package_name", "."); - foreach( @command ) { - print "$_ "; - } - print "\n"; - system(@command); - - # generate the list of header file per package that not in an internal subdirectory. Files start with CGAL - $tempdir = File::Temp->newdir(); - if ( -d "$package_full_path/include" ) { - @filelistcmd = ('tar', '-tf', "$RELEASEDIR/temppack.tar", '--wildcards', "./include/\*\*.h", - "--transform=s/.\\\/include\\\///", '--show-transformed-names', - '--exclude=**/internal', "--index-file=$tempdir/$package_name.txt"); - system(@filelistcmd); - } - - move("$RELEASEDIR/temppack.tar", "$RELEASEDIR/$VERSION/"); - - chdir "$RELEASEDIR/$VERSION" or die; - my $tar = Archive::Tar->new; - open my $TARFILL, "$RELEASEDIR/$VERSION/temppack.tar" or die; - if(! $tar->read($TARFILL)) { - unlink 'temppack.tar'; - next; - } - for( $tar->get_files() ) - { - my $filename = $_->name(); - if( ! $_->is_dir() ) - { - if(exists($files{$_->name()})) - { - print LOG_CONFLICTS "File ", $_->name(), " from package ", $package_name; - print LOG_CONFLICTS " conflicts with one from package ", $files{$_->name()}. "\n"; - } - else - { - $files{$_->name()} = $package_name; - } - } - else { # is_dir() returned true - next if ($filename !~ /^\.\/?$/) and ($filename =~ /^\.\.?\/?$/); - my $package_from_from = $LISTOFALLPACKAGES{$package_name}; - mkpath($filename); -# system("svn info $package_comes_from/$package_name/$filename | grep URL >> $filename/.scm-urls\n"); - } - } - system('tar', '-xf', "temppack.tar"); - if ( -e "$tempdir/$package_name.txt" ) { - if ( -d "$RELEASEDIR/$VERSION/doc/$package_name/" ) { - system("mv", ,"$tempdir/$package_name.txt", "$RELEASEDIR/$VERSION/doc/$package_name/filelist.txt"); - } else { - system("rm", ,"$tempdir/$package_name.txt"); - } - } - -# $tmp_package_name = "temp_${package_name}"; -# system("mv", "$package_name", "$tmp_package_name"); -# opendir packagename, "$tmp_package_name"; -# @fichiers = readdir packagename; -# closedir packagename; -# #shift @fichiers; shift @fichiers; -# foreach $fichier (@fichiers){ -# if ($fichier ne '.' && $fichier ne '..'){ -# system('cp', '-r', "$tmp_package_name/$fichier", "$RELEASEDIR/$VERSION"); -# } -# } -# system('rm', '-rf', "$tmp_package_name"); - } - close(LOG_CONFLICTS); - unlink 'temppack.tar'; - ( -d "$ALLPACKAGESDIR/.git" ) && system("git --git-dir=$ALLPACKAGESDIR/.git --work-tree=$ALLPACKAGESDIR log -n1 '--format=format:SCM branch:%n%H %d%n%nShort log from master:%n' > .scm-branch"); - ( -d "$ALLPACKAGESDIR/.git" ) && system("git --git-dir=$ALLPACKAGESDIR/.git --work-tree=$ALLPACKAGESDIR log --first-parent --format='%h %s%n parents: %p%n' cgal/master.. >> .scm-branch"); - # foreach my $file (sort keys(%files)) { - # print "$files{$file}: $file\n"; - # } -} - - -#-----------------------------------------------------------------------# -# set the version information in VERSION and include/CGAL/version.h # -#-----------------------------------------------------------------------# - -sub create_version_file() -{ -#if VERSION starts with CGAL-, we remove "CGAL-" from version -#the $newver variable will store the right version - if ($VERSION =~ /CGAL-(.*)/) { - $newver = $1; - } else { - $newver = $VERSION; - } - - # Create VERSION file - chdir "$RELEASEDIR/$VERSION" or die; - open(TEMPFILE, ">tempfile") or die; - print TEMPFILE "$newver"; - close TEMPFILE || die "Error closing temporary file: $!\n"; - move("tempfile", 'VERSION'); - - # Create include/CGAL/version.h file - chdir "$RELEASEDIR/$VERSION/include/CGAL" or die; - open(TEMPFILE, ">tempfile") or die; - - my $RELEASE_DATE = strftime "%Y%m%d", localtime; -# TODO : add `svnversion` Revision. - - print TEMPFILE << 'EOF'; -// Copyright (c) 2006 Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// SPDX-License-Identifier: LGPL-3.0-or-later -// -// Author(s) : - - -// This file is automatically created by create_internal_release. -// Do not edit manually. - -#ifndef CGAL_VERSION_H -#define CGAL_VERSION_H - -#define CGAL_xstr(s) #s -#define CGAL_str(s) CGAL_xstr(s) - -EOF - print TEMPFILE "#define CGAL_VERSION $newver\n"; - print TEMPFILE "#define CGAL_VERSION_NR $VERSION_NR\n"; - print TEMPFILE "#define CGAL_SVN_REVISION 0\n"; - print TEMPFILE "#define CGAL_GIT_HASH 0\n"; - print TEMPFILE "#define CGAL_RELEASE_DATE $RELEASE_DATE\n"; - -print TEMPFILE << 'EOF'; -#define CGAL_VERSION_STR CGAL_str(CGAL_VERSION) - -#endif -EOF - - close TEMPFILE || die "Error closing temporary file: $!\n"; - move("tempfile", 'version.h'); - chdir '../..' or die; -} - -#---------------------------------------------------------------# -# CreateExampleTestDirs -#---------------------------------------------------------------# - -sub CreateExampleTestDirs() -{ - my $DIR; - chdir "$RELEASEDIR/$VERSION" or die; - chdir 'examples' or return; - print "Creating $VERSION/test/example directories ...\n"; - foreach $DIR (glob("*")) { - if ( -d $DIR ) { - print "Creating test/${DIR}_Examples ...\n"; - dircopy("$DIR", "../test/${DIR}_Examples"); - } - } - chdir '..'; -} - - -#---------------------------------------------------------------# -# CreateDemoTestDirs -#---------------------------------------------------------------# - -sub CreateDemoTestDirs() -{ - my $DIR; - chdir "$RELEASEDIR/$VERSION" or die; - chdir 'demo' or return; - print "Creating $VERSION/test/demo directories ...\n"; - foreach $DIR (glob("*")) { - if ( -d $DIR) { - if( ("$DIR" ne "icons") && ("$DIR" ne "resources") ) { - print "Creating test/${DIR}_Demo ...\n"; - dircopy("$DIR", "../test/${DIR}_Demo"); - } - else { - print "Creating test/${DIR}...\n"; - dircopy("$DIR", "../test/${DIR}"); - } - } - } - chdir '..'; -} - - -#---------------------------------------------------------------# -# make_testscripts and generate makefiles in test and examples -#---------------------------------------------------------------# - -sub make_testscripts() -{ - my ($DIR, $BASEDIR); - chdir "$RELEASEDIR/$VERSION" or die; - $BASEDIR = cwd(); - print "Creating and checking makefiles ...\n"; - - chdir 'test'; - foreach $DIR (glob("*")) { - if ( (-d $DIR) && ("$DIR" ne "icons") && ("$DIR" ne "resources") ) { - chdir $DIR; - if ( -f 'Makefile') { - rename 'Makefile', 'makefile'; - } - if ( -f 'makefile' ) { - open MAKEFILE, "makefile"; - open NEW_MAKEFILE, ">makefile.new"; - while () { - s/\.o\b/\$(OBJ_EXT)/g; - s/-g\b/\$(DEBUG_OPT)/g; - print NEW_MAKEFILE $_; - } - close NEW_MAKEFILE; - close MAKEFILE; - rename("makefile.new","makefile"); - } else { - my $options = '-t'; - if ( -f 'cgal_create_makefile_options') { - if (open(OPTIONS, "; - chomp; - if (/^[\w\s-]+$/) { $options = $_; - } else { - print STDERR "Rejected cgal_create_makefile_options in $DIR\n"; - } - close OPTIONS; - } - } - system("$SCRIPTSDIR/cgal_create_makefile", $options) == 0 or die "Execution of $SCRIPTSDIR/cgal_create_makefile failed"; - } - if ( ! -f 'cgal_test' ) { - $_ = $DIR; - # chomp; - if (/_Demo$/) { - system("$DEVELSCRIPTSDIR/create_cgal_test", "--no-run") == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test --no-run failed"; - } else { - system("$DEVELSCRIPTSDIR/create_cgal_test") == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test failed"; - } - } - chdir '..'; - } - } - chdir $BASEDIR; - chdir 'examples'; - - print "Creating makefiles in examples\n"; - foreach $DIR (glob("*")) { - if ( -d $DIR ) { - chdir $DIR; - if ( -f 'Makefile') { - rename 'Makefile', 'makefile'; - } - if ( -f 'makefile' ) { - open MAKEFILE, "makefile"; - open NEW_MAKEFILE, ">makefile.new"; - while () { - s/\.o\b/\$(OBJ_EXT)/g; - s/-g\b/\$(DEBUG_OPT)/g; - print NEW_MAKEFILE $_; - } - close NEW_MAKEFILE; - close MAKEFILE; - rename("makefile.new","makefile"); - } else { - my $options = '-d'; - if ( -f 'cgal_create_makefile_options') { - if (open(OPTIONS, "; - chomp; - if (/^[\w\s-]+$/) { $options = $_; - } else { - print STDERR "Rejected cgal_create_makefile_options in $DIR\n"; - } - close OPTIONS; - } - } - system("$SCRIPTSDIR/cgal_create_makefile", $options) == 0 or die "Execution of $SCRIPTSDIR/cgal_create_makefile failed"; - } - chdir '..'; - } - } - chdir $BASEDIR; -} - - -#---------------------------------------------------------------# -# Generates a CMakeLists.txt in every subdirectory -# of the current directory if none already exists -#---------------------------------------------------------------# - -sub generate_cmake_scripts -{ - my $options = $_[0]; - - foreach $DIR (glob("*")) - { - if ( (-d $DIR) && ("$DIR" ne "icons") && ("$DIR" ne "resources") ) - { - chdir $DIR; - - if ( ! -f 'CMakeLists.txt' ) - { - $_ = $DIR; - - if ( -f 'cgal_create_cmake_script_options') - { - if (open(OPTIONS, "; - chomp; - if (/^[\w\s-]+$/) - { - $options = $_; - } - else - { - print STDERR "Rejected cgal_create_cmake_script_options in $DIR\n"; - } - close OPTIONS; - } - } - system("\"$SCRIPTSDIR/cgal_create_cmake_script\" $options") == 0 or die "Execution of \"$SCRIPTSDIR/cgal_create_cmake_script $options\" failed"; - } - - chdir '..'; - } - } -} - -sub generate_cgal_test_with_cmake -{ - foreach $DIR (glob("*")) - { - if ( (-d $DIR) && ("$DIR" ne "icons") && ("$DIR" ne "resources") ) - { - chdir $DIR; - if ( ! -f 'cgal_test_with_cmake' ) - { - $_ = $DIR; - my $options = (/_Demo$/) ? '--no-run' : '' ; - - system("$DEVELSCRIPTSDIR/create_cgal_test_with_cmake", $options) == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test_with_cmake $options failed in directory $DIR"; - } - chdir '..'; - } - } -} - -sub make_testscripts_for_cmake -{ - my ($DIR, $BASEDIR); - chdir "$RELEASEDIR/$VERSION" or die; - $BASEDIR = cwd(); - - chdir 'test'; - - print "Creating test scripts\n"; - generate_cgal_test_with_cmake(); - - print "Creating cmake scripts in test\n"; - generate_cmake_scripts('test'); - - chdir $BASEDIR; - chdir 'examples'; - - print "Creating cmake scripts in examples\n"; - generate_cmake_scripts('example'); - - chdir $BASEDIR; - chdir 'demo'; - - print "Creating cmake scripts in demo\n"; - generate_cmake_scripts('demo'); - - chdir $BASEDIR; -} - - -#----------------------------------------------------# -# Main entry point # -#----------------------------------------------------# - - -sub main(){ - - $RELEASEDIR=cwd(); - $ALLPACKAGESDIR="$RELEASEDIR/trunk"; - $LOCKFILE="$RELEASEDIR/release_creation.lock"; - $LOCKCMD='lockfile'; - - our ($opt_h, $opt_r, $opt_a, $opt_c, $opt_d, $opt_l, $opt_p, $opt_s, $opt_n); - - if(! getopts('hr:a:c:d:l:p:s:n:') || $::opt_h ) { - usage(); - die "\n"; - } - if ($::opt_d){ - $RELEASEDIR = $::opt_d; - $ALLPACKAGESDIR = "$RELEASEDIR/trunk"; - $LOCKFILE="$RELEASEDIR/release_creation.lock"; - } - - if ($::opt_r){ - $VERSION = $::opt_r; - if ($::opt_n){ - $VERSION_NR = $::opt_n; - } else { - $VERSION_NR = $VERSION; - } - } else { - usage(); - die "\n"; - } - if ($::opt_a){ - $ALLPACKAGESDIR = File::Spec->rel2abs( $::opt_a ) ; - } - if ($::opt_c){ - $CANDIDATESDIR = File::Spec->rel2abs( $::opt_c ) ; - } - if ($::opt_l){ - $LOCKFILE = $::opt_l; - } - $SCRIPTSDIR="$ALLPACKAGESDIR/Scripts/scripts"; - $DEVELSCRIPTSDIR="$ALLPACKAGESDIR/Scripts/developer_scripts"; - $global_dont_submit="$ALLPACKAGESDIR/Maintenance/release_building/global_dont_submit"; - @global_dont_submit_tar_options = (); - if (open(GLOBAL_DONT_SUBMIT, "<", $global_dont_submit) ) { - while() { - chomp; - @global_dont_submit_tar_options = (@global_dont_submit_tar_options, "--exclude=$_"); - } - close(GLOBAL_DONT_SUBMIT); - } - print "Initializing variables ...\n"; - print " Release dir: $RELEASEDIR\n"; - print " All packages dir: $ALLPACKAGESDIR\n"; - if($CANDIDATESDIR) { - print " Candidates packages dir: $CANDIDATESDIR\n"; - } - print " Scripts dir: $SCRIPTSDIR\n"; - print " Developer Scripts dir: $DEVELSCRIPTSDIR\n"; - print " Lockfile: $LOCKFILE\n"; - umask(002); - chdir $RELEASEDIR or die; - if (! -d $VERSION){ - print "Creating release directory ${VERSION} ...\n"; - mkdir($VERSION, 0775); - } else { - print "$VERSION already exists in $RELEASEDIR\n"; - print "Please remove it first\n"; - exit 1; - } - lock; - - list_packages($ALLPACKAGESDIR); - if($CANDIDATESDIR) { - list_packages($CANDIDATESDIR); - } - install_packages(); - - CreateDemoTestDirs(); - CreateExampleTestDirs(); - create_version_file(); - #make_testscripts(); - make_testscripts_for_cmake(); - - unlock; -} - -main(); - -# Set the indent level of perl-mode, in Emacs. -# For that file it is mostly 2, so let's choose 2. -### Local Variables: -### perl-indent-level: 2 -### End: diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 2b0e0f2ff2b..cdf6d497a27 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -4,14 +4,6 @@ # # Radu Ursu, Sylvain Pion, 2004-2006. -# TODO : -# - Cleanup the public/internal separation: -# - have CGAL_VERSION_NR be not affected by the internal version -# - have CGAL_REVISION be the revision (replacing the internal number) -# - The public release case should pass the info to create_internal_release. -# [new] : create_internal_release should not know about internal/public mode. -# - Merge [some parts] into ./create_internal_release ? - DO_PUBLIC="" # Also build the public versions DO_IT="" # Real mode (copy to HTTP server), versus local testing DO_NOT_TAG="" # If set, do not call tag 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 162/175] 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 e36065c77307b1e7d9239ae497b424bd9c777fb7 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 20 Jan 2025 15:03:46 +0100 Subject: [PATCH 163/175] Correct icon sizes Correct icon sizes --- Documentation/doc/resources/1.10.0/cgal_stylesheet.css | 6 +++--- Documentation/doc/resources/1.8.13/cgal_stylesheet.css | 6 +++--- Documentation/doc/resources/1.9.6/cgal_stylesheet.css | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/doc/resources/1.10.0/cgal_stylesheet.css b/Documentation/doc/resources/1.10.0/cgal_stylesheet.css index 71fe3a10aff..d7d2a77ba35 100644 --- a/Documentation/doc/resources/1.10.0/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.10.0/cgal_stylesheet.css @@ -52,7 +52,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #FF0000; @@ -67,7 +67,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #0000FF; @@ -82,7 +82,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #67489A; diff --git a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css index ab870f9aa05..1a37400d58f 100644 --- a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css @@ -6,7 +6,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #FF0000; @@ -21,7 +21,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #0000FF; @@ -36,7 +36,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #67489A; diff --git a/Documentation/doc/resources/1.9.6/cgal_stylesheet.css b/Documentation/doc/resources/1.9.6/cgal_stylesheet.css index 71fe3a10aff..d7d2a77ba35 100644 --- a/Documentation/doc/resources/1.9.6/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.9.6/cgal_stylesheet.css @@ -52,7 +52,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #FF0000; @@ -67,7 +67,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #0000FF; @@ -82,7 +82,7 @@ h2 { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 14px; + height: 22px; width: 16px; display: inline-block; background-color: #67489A; From 3aa58ef5fb8104eea0bce9fa5cb972fc492f4782 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 23 Jan 2025 11:53:36 +0100 Subject: [PATCH 164/175] Update Documentation/doc/resources/1.8.13/cgal_stylesheet.css Looks like it is not necesary for the 1.8.13 version Co-authored-by: Sebastien Loriot --- Documentation/doc/resources/1.8.13/cgal_stylesheet.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css index 1a37400d58f..8a8cc9f4d1f 100644 --- a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css @@ -6,7 +6,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 22px; + height: 14px; width: 16px; display: inline-block; background-color: #FF0000; From 8a5cbddf72e21e29245f261211bac1b0c02962ff Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 23 Jan 2025 11:53:46 +0100 Subject: [PATCH 165/175] Update Documentation/doc/resources/1.8.13/cgal_stylesheet.css Co-authored-by: Sebastien Loriot --- Documentation/doc/resources/1.8.13/cgal_stylesheet.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css index 8a8cc9f4d1f..63ec5183078 100644 --- a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css @@ -21,7 +21,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 22px; + height: 14px; width: 16px; display: inline-block; background-color: #0000FF; From 8824b917ae57d2737403e0ddaf440eac998e7358 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 23 Jan 2025 11:53:54 +0100 Subject: [PATCH 166/175] Update Documentation/doc/resources/1.8.13/cgal_stylesheet.css Co-authored-by: Sebastien Loriot --- Documentation/doc/resources/1.8.13/cgal_stylesheet.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css index 63ec5183078..ab870f9aa05 100644 --- a/Documentation/doc/resources/1.8.13/cgal_stylesheet.css +++ b/Documentation/doc/resources/1.8.13/cgal_stylesheet.css @@ -36,7 +36,7 @@ body, table, div, p, dl { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; - height: 22px; + height: 14px; width: 16px; display: inline-block; background-color: #67489A; 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 167/175] 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 168/175] 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 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 169/175] 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 f7a57a6c41a289e4905c29761304b8b38dbaf946 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 17 Jan 2025 10:16:08 +0000 Subject: [PATCH 170/175] 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 171/175] 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 172/175] 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 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 173/175] 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 e5001d1a507d49eef048a322a66dea951a7345f7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 4 Feb 2025 14:32:37 +0100 Subject: [PATCH 174/175] 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 175/175] 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,