From f07b47e1e282cca0f7ec14401f69246b89aa15d8 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 24 Aug 2021 18:04:50 +0200 Subject: [PATCH 01/13] fix mismatch between two definitions of Mesher_level_conflict_status that were in different namespaces (CGAL and CGAL::Mesh_3) --- Mesh_3/include/CGAL/Mesh_3/Mesher_level.h | 11 +---------- Mesher_level/include/CGAL/Mesher_level.h | 10 +++++++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index b0c7e357c96..fc2727797d1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -23,6 +23,7 @@ #include #endif +#include #include #ifdef CGAL_CONCURRENT_MESH_3_PROFILING @@ -40,16 +41,6 @@ namespace CGAL { namespace Mesh_3 { -enum Mesher_level_conflict_status { - NO_CONFLICT = 0 - , CONFLICT_BUT_ELEMENT_CAN_BE_RECONSIDERED - , CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED - , THE_FACET_TO_REFINE_IS_NOT_IN_ITS_CONFLICT_ZONE - , ELEMENT_WAS_A_ZOMBIE - , COULD_NOT_LOCK_ZONE - , COULD_NOT_LOCK_ELEMENT -}; - /************************************************ * * Null_mesher_level class diff --git a/Mesher_level/include/CGAL/Mesher_level.h b/Mesher_level/include/CGAL/Mesher_level.h index af20ffcca0b..7d8de6fffb4 100644 --- a/Mesher_level/include/CGAL/Mesher_level.h +++ b/Mesher_level/include/CGAL/Mesher_level.h @@ -18,9 +18,13 @@ namespace CGAL { enum Mesher_level_conflict_status { - NO_CONFLICT = 0, - CONFLICT_BUT_ELEMENT_CAN_BE_RECONSIDERED, - CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED + NO_CONFLICT = 0 + , CONFLICT_BUT_ELEMENT_CAN_BE_RECONSIDERED + , CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED + , THE_FACET_TO_REFINE_IS_NOT_IN_ITS_CONFLICT_ZONE + , ELEMENT_WAS_A_ZOMBIE + , COULD_NOT_LOCK_ZONE + , COULD_NOT_LOCK_ELEMENT }; struct Null_mesher_level { From a885f9b782219c894b4880be5eb78f006931625e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 13:02:11 +0200 Subject: [PATCH 02/13] rename Counter to avoid conflict with type defined in msvc 2022 --- Profiling_tools/include/CGAL/Profile_counter.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Profiling_tools/include/CGAL/Profile_counter.h b/Profiling_tools/include/CGAL/Profile_counter.h index 537d7640bee..518ccbc43eb 100644 --- a/Profiling_tools/include/CGAL/Profile_counter.h +++ b/Profiling_tools/include/CGAL/Profile_counter.h @@ -121,9 +121,9 @@ struct Profile_histogram_counter { private: #ifdef CGAL_CONCURRENT_PROFILE - typedef tbb::concurrent_hash_map Counters; + typedef tbb::concurrent_hash_map CounterMap; #else - typedef std::map Counters; + typedef std::map CounterMap; #endif public: @@ -133,7 +133,7 @@ public: void operator()(unsigned i) { #ifdef CGAL_CONCURRENT_PROFILE - Counters::accessor a; + CounterMap::accessor a; counters.insert(a, i); ++a->second; #else @@ -144,7 +144,7 @@ public: ~Profile_histogram_counter() { unsigned total=0; - for (Counters::const_iterator it=counters.begin(), end=counters.end(); + for (CounterMap::const_iterator it=counters.begin(), end=counters.end(); it != end; ++it) { std::cerr << "[CGAL::Profile_histogram_counter] " << s; std::cerr << " [ " << std::setw(10) << internal::dot_it(it->first) << " : " @@ -158,7 +158,7 @@ public: } private: - Counters counters; + CounterMap counters; const std::string s; }; From ee8531d600f6ce4cc2c70c51bba160567a243ea4 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 15:25:40 +0200 Subject: [PATCH 03/13] boost/iterator.hpp is deprecated --- Mesh_3/benchmark/Mesh_3/StdAfx.h | 2 +- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index 7f3c5f93ca7..d741868c4e8 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -13,6 +13,7 @@ #include #include #include +#include // Windows #include @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index dba4dc93fb8..697e0f90665 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -20,7 +20,7 @@ #ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP #define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP -#include +#include #include #include From 18663784910564d5562d2533907db7aeaeb4e8f6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 16:44:11 +0200 Subject: [PATCH 04/13] fix warning : enum * float is deprecated --- .../CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 842abf61081..fd268aa6ed8 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -2113,8 +2113,10 @@ insert_balls(const Vertex_handle& vp, curve_index, d_sign) << ")\n"; #endif + const FT sgn = (d_sign == CGAL::POSITIVE) ? 1. + : (d_sign == CGAL::NEGATIVE ? -1. : 0.); const Bare_point new_point = - domain_.construct_point_on_curve(vpp, curve_index, d_sign * d / 2); + domain_.construct_point_on_curve(vpp, curve_index, sgn * d / 2); const int dim = 1; // new_point is on edge const Index index = domain_.index_from_curve_index(curve_index); const FT point_weight = CGAL::square(size_(new_point, dim, index)); From 392730fe6871169bc9c311c8fe63687b25c9fa76 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 16:53:00 +0200 Subject: [PATCH 05/13] boost/iterator.hpp is deprecated in favor of --- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index 697e0f90665..f77be5433dd 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include From fb9d9da2d59625675f93de4098d150f62687a200 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Aug 2021 15:57:02 +0200 Subject: [PATCH 06/13] fix ambiguity with C++20 The compilation error was test_edge_collapse_Polyhedron_3.cpp(309,1): error C2872: 'format': ambiguous symbol --- .../test_edge_collapse_Polyhedron_3.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index ca29638a015..7c641c5eb69 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -306,12 +306,12 @@ public : virtual void OnCollected(const Profile& aProfile, const boost::optional& aCost) const { - TEST_TRACE(str (format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost))); + TEST_TRACE(str (boost::format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost))); } virtual void OnCollapsing(const Profile& aProfile, const boost::optional& aP) const { - TEST_TRACE(str (format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP))); + TEST_TRACE(str (boost::format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP))); //mBefore = create_edge_link(aProfile); } @@ -323,10 +323,10 @@ public : { SurfaceSP lAfter = create_vertex_link(aProfile, aV); - write(mBefore, str(format("%1%.step-%2%-before.off") % mTestCase % mStep)); - write(lAfter , str(format("%1%.step-%2%-after.off") % mTestCase % mStep)); + write(mBefore, str(boost::format("%1%.step-%2%-before.off") % mTestCase % mStep)); + write(lAfter , str(boost::format("%1%.step-%2%-after.off") % mTestCase % mStep)); - REPORT_ERROR(str(format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2))); + REPORT_ERROR(str(boost::format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2))); } ++mStep; From 68fa89da66c2385f37023ab27e0068583df6ade1 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 15:25:40 +0200 Subject: [PATCH 07/13] boost/iterator.hpp is deprecated --- Mesh_3/benchmark/Mesh_3/StdAfx.h | 2 +- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index 7f3c5f93ca7..d741868c4e8 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -13,6 +13,7 @@ #include #include #include +#include // Windows #include @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index dba4dc93fb8..697e0f90665 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -20,7 +20,7 @@ #ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP #define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP -#include +#include #include #include From f49cb741c4d70b95fcc5d8ba253b279008f110db Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 16:44:11 +0200 Subject: [PATCH 08/13] fix warning : enum * float is deprecated --- .../CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 842abf61081..fd268aa6ed8 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -2113,8 +2113,10 @@ insert_balls(const Vertex_handle& vp, curve_index, d_sign) << ")\n"; #endif + const FT sgn = (d_sign == CGAL::POSITIVE) ? 1. + : (d_sign == CGAL::NEGATIVE ? -1. : 0.); const Bare_point new_point = - domain_.construct_point_on_curve(vpp, curve_index, d_sign * d / 2); + domain_.construct_point_on_curve(vpp, curve_index, sgn * d / 2); const int dim = 1; // new_point is on edge const Index index = domain_.index_from_curve_index(curve_index); const FT point_weight = CGAL::square(size_(new_point, dim, index)); From e697702c621346792670cbd93e5981161b2f55bf Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 25 Aug 2021 16:53:00 +0200 Subject: [PATCH 09/13] boost/iterator.hpp is deprecated in favor of --- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index 697e0f90665..f77be5433dd 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include From ad6969d67aee1c7da1646cd188c1d644c961b04a Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Aug 2021 15:57:02 +0200 Subject: [PATCH 10/13] fix ambiguity with C++20 The compilation error was test_edge_collapse_Polyhedron_3.cpp(309,1): error C2872: 'format': ambiguous symbol --- .../test_edge_collapse_Polyhedron_3.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index ca29638a015..7c641c5eb69 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -306,12 +306,12 @@ public : virtual void OnCollected(const Profile& aProfile, const boost::optional& aCost) const { - TEST_TRACE(str (format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost))); + TEST_TRACE(str (boost::format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost))); } virtual void OnCollapsing(const Profile& aProfile, const boost::optional& aP) const { - TEST_TRACE(str (format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP))); + TEST_TRACE(str (boost::format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP))); //mBefore = create_edge_link(aProfile); } @@ -323,10 +323,10 @@ public : { SurfaceSP lAfter = create_vertex_link(aProfile, aV); - write(mBefore, str(format("%1%.step-%2%-before.off") % mTestCase % mStep)); - write(lAfter , str(format("%1%.step-%2%-after.off") % mTestCase % mStep)); + write(mBefore, str(boost::format("%1%.step-%2%-before.off") % mTestCase % mStep)); + write(lAfter , str(boost::format("%1%.step-%2%-after.off") % mTestCase % mStep)); - REPORT_ERROR(str(format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2))); + REPORT_ERROR(str(boost::format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2))); } ++mStep; From 3b4004b2ce893f1d9a302e4a63597bfd383126cf Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Aug 2021 16:45:48 +0200 Subject: [PATCH 11/13] fix duplicate include --- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index f77be5433dd..334edd074bc 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -20,7 +20,7 @@ #ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP #define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP -#include +#include #include #include From 959c17af43fe4b0bd0dd2689def91b79fdcd2814 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 26 Aug 2021 17:32:19 +0200 Subject: [PATCH 12/13] fix duplicate input --- STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index f77be5433dd..6d45ed56617 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -20,8 +20,6 @@ #ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP #define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP -#include - #include #include From f11cd9098a1cdb830573ff23b506d309f33f0602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 3 Sep 2021 09:30:05 +0200 Subject: [PATCH 13/13] restore include statement --- .../include/CGAL/internal/boost/array_binary_tree.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp index 6d45ed56617..3e1fa963176 100644 --- a/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp +++ b/STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp @@ -20,9 +20,10 @@ #ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP #define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP +#include #include -#include +#include #include namespace CGAL { namespace internal {