From 19954c5d73acd3ca72d4e42ff68dd4af370cf5fb Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 22 Jan 2025 12:37:35 +0200 Subject: [PATCH 1/4] Fixed compiler complain about missing return value --- .../CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h index e1accd107315..b60903509410 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h @@ -251,7 +251,7 @@ class Arr_basic_insertion_traits_2 { // vertex to the extended point. if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point())) return (Point_2(base_p, vh)); - else return (Point_2(base_p)); + return (Point_2(base_p)); } }; @@ -308,7 +308,7 @@ class Arr_basic_insertion_traits_2 { // vertex to the extended point. if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point())) return (Point_2(base_p, vh)); - else return (Point_2(base_p)); + return (Point_2(base_p)); } }; From 5706cbd85ff62fe3f6c986c04fa4b24229cfe90c Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 22 Jan 2025 12:43:19 +0200 Subject: [PATCH 2/4] Cleaned up --- .../include/CGAL/Arr_dcel_base.h | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index f38156da2afa..0e986fc78bbf 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -40,24 +40,24 @@ namespace CGAL { inline void* _clean_pointer(const void* p) { - static_assert(sizeof(void*) == sizeof(size_t)); - const size_t mask = ~1; - const size_t val = (reinterpret_cast(p) & mask); + static_assert(sizeof(void*) == sizeof(std::size_t)); + const std::size_t mask = ~1; + const std::size_t val = (reinterpret_cast(p) & mask); return (reinterpret_cast(val)); } inline void* _set_lsb(const void* p) { - const size_t mask = 1; - const size_t val = (reinterpret_cast(p) | mask); + const std::size_t mask = 1; + const std::size_t val = (reinterpret_cast(p) | mask); return (reinterpret_cast( val)); } inline bool _is_lsb_set(const void* p) { - const size_t mask = 1; - const size_t val = reinterpret_cast(p); + const std::size_t mask = 1; + const std::size_t val = reinterpret_cast(p); return ((val & mask) != 0); } @@ -565,7 +565,7 @@ class Arr_face : public F, Outer_ccb_const_iterator; /*! obtains the number of outer CCBs the face has. */ - size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); } + std::size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); } /*! obtains an iterator for the first outer CCB of the face. */ Outer_ccb_iterator outer_ccbs_begin() { return (this->outer_ccbs.begin()); } @@ -601,7 +601,7 @@ class Arr_face : public F, typedef Inner_ccb_const_iterator Hole_const_iterator; /*! obtains the number of inner CCBs the face has. */ - size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); } + std::size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); } /*! obtains an iterator for the first inner CCB of the face. */ Inner_ccb_iterator inner_ccbs_begin() { return (this->inner_ccbs.begin()); } @@ -646,7 +646,7 @@ class Arr_face : public F, } // Backward compatibility: - size_t number_of_holes() const { return number_of_inner_ccbs(); } + std::size_t number_of_holes() const { return number_of_inner_ccbs(); } Hole_iterator holes_begin() { return inner_ccbs_begin(); } Hole_iterator holes_end() { return inner_ccbs_end(); } Hole_const_iterator holes_begin() const { return inner_ccbs_begin(); } @@ -669,7 +669,7 @@ class Arr_face : public F, Isolated_vertex_const_iterator; /*! obtains the number of isloated vertices inside the face. */ - size_t number_of_isolated_vertices() const + std::size_t number_of_isolated_vertices() const { return (this->iso_verts.size()); } /*! obtains an iterator for the first isloated vertex inside the face. */ @@ -986,13 +986,13 @@ class Arr_dcel_base { typedef In_place_list Inner_ccb_list; typedef In_place_list Iso_vert_list; - typedef std::allocator_traits Allocator_traits; - typedef typename Allocator_traits::template rebind_alloc Vertex_allocator; - typedef typename Allocator_traits::template rebind_alloc Halfedge_allocator; - typedef typename Allocator_traits::template rebind_alloc Face_allocator; - typedef typename Allocator_traits::template rebind_alloc Outer_ccb_allocator; - typedef typename Allocator_traits::template rebind_alloc Inner_ccb_allocator; - typedef typename Allocator_traits::template rebind_alloc Iso_vert_allocator; + typedef std::allocator_traits Allocator_traits; + typedef typename Allocator_traits::template rebind_alloc Vertex_allocator; + typedef typename Allocator_traits::template rebind_alloc Halfedge_allocator; + typedef typename Allocator_traits::template rebind_alloc Face_allocator; + typedef typename Allocator_traits::template rebind_alloc Outer_ccb_allocator; + typedef typename Allocator_traits::template rebind_alloc Inner_ccb_allocator; + typedef typename Allocator_traits::template rebind_alloc Iso_vert_allocator; public: typedef typename Halfedge_list::size_type Size; @@ -1002,7 +1002,6 @@ class Arr_dcel_base { typedef std::bidirectional_iterator_tag iterator_category; protected: - Vertex_list vertices; // The vertices container. Halfedge_list halfedges; // The halfedges container. Face_list faces; // The faces container. From 39192337bdd307f2cc446a6e89dc06aa8116332b Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 22 Jan 2025 12:43:33 +0200 Subject: [PATCH 3/4] Fixed extending DCEL records for arrangements with history (and similar derivations of Arrangement_2). --- .../include/CGAL/Arr_extended_dcel.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h index da68eb331bee..0f9b28f3cddc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h @@ -61,8 +61,10 @@ class Arr_extended_vertex : public VertexBase { template struct rebind { - using Point_2 = Point_; - using other = typename Vertex_base::template rebind; + using Pnt = Point_; + using Rebind_vertex_base = typename Vertex_base::template rebind; + using Other_vertex_base = typename Rebind_vertex_base::other; + using other = Arr_extended_vertex; }; }; @@ -101,8 +103,10 @@ class Arr_extended_halfedge : public HalfedgeBase { template struct rebind { - using X_monotonote_curve_2 = XMonotoneCurve; - using other = typename Halfedge_base::template rebind; + using Xcv = XMonotoneCurve; + using Rebind_halfedge_base = typename Halfedge_base::template rebind; + using Other_halfedge_base = typename Rebind_halfedge_base::other; + using other = Arr_extended_halfedge; }; }; From 898f933d285c70446e872f3f46e4daef25ca8195 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 22 Jan 2025 13:26:41 +0200 Subject: [PATCH 4/4] Added a comment about a fix of a bug in the Arrangement_on_surface_2 package --- Installation/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index f95d719aa56b..bfb5d37f939b 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -11,6 +11,7 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. - Fixed the Landmark point-location strategy so that it can be applied to arrangements on a sphere. +- Fixed a bug in the extensions of vertex and halfedge types of the DCEL when used to instantiate Arrangement_with_history_2 or similar arrangement classes that derive from Arrangement_2. ## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1)