From 8ff4f7793d0046c46bfbd3bf1f6e936a569ca463 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 23 Apr 2020 13:26:03 +0200 Subject: [PATCH 1/5] Use std::size_t to avoid integer overflow --- .../internal/Rich_grid.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h index d1cbc5485cf..67c0d1d7e8f 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h @@ -195,15 +195,19 @@ void Rich_grid::init(std::vector > &vert, radius = _radius; - x_side = (unsigned int)ceil((bbox.xmax() - bbox.xmin()) / radius); - y_side = (unsigned int)ceil((bbox.ymax() - bbox.ymin()) / radius); - z_side = (unsigned int)ceil((bbox.zmax() - bbox.zmin()) / radius); + std::size_t x_size = (std::size_t)ceil((bbox.xmax() - bbox.xmin()) / radius); + std::size_t y_size = (std::size_t)ceil((bbox.ymax() - bbox.ymin()) / radius); + std::size_t z_size = (std::size_t)ceil((bbox.zmax() - bbox.zmin()) / radius); - x_side = (x_side > 0) ? x_side : 1; - y_side = (y_side > 0) ? y_side : 1; - z_side = (z_side > 0) ? z_side : 1; + x_size = (x_size > 0) ? x_size : 1; + y_size = (y_size > 0) ? y_size : 1; + z_size = (z_size > 0) ? z_size : 1; - indices.resize(x_side * y_side * z_side + 1, -1); + indices.resize(x_size * y_size * z_size + 1, -1); + + x_side = int(x_size); + y_side = int(y_size); + z_side = int(z_size); std::sort(rich_points.begin(), rich_points.end(), Z_Sort()); From 428e47ebb6a9ff98f1064c46fb3c0cd3406439b9 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 23 Apr 2020 13:26:16 +0200 Subject: [PATCH 2/5] Fix bbox initialization --- .../include/CGAL/edge_aware_upsample_point_set.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 09dbfce95bf..c76c2ae065e 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -388,7 +388,7 @@ edge_aware_upsample_point_set( // copy rich point set std::vector rich_point_set(number_of_input); - CGAL::Bbox_3 bbox(0., 0., 0., 0., 0., 0.); + CGAL::Bbox_3 bbox; typename PointRange::const_iterator it = begin; // point iterator for(unsigned int i = 0; it != end; ++it, ++i) From f4af887bd04986e60f7c07b0606013162088614d Mon Sep 17 00:00:00 2001 From: Alexander Kobel Date: Thu, 23 Apr 2020 11:52:20 +0200 Subject: [PATCH 3/5] Make f square-free in Construct_curve_2 (fix #2224) Documentation in Curve_analysis_2 suggests that this was intended behavior, but not added. --- .../CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index b1a9cd95ca3..28b26273996 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -427,7 +427,11 @@ public: Curve_analysis_2 operator() (const Polynomial_2& f) const { - return _m_kernel->curve_cache_2()(f); + if (_m_kernel->is_square_free_2_object()(f)) { + return _m_kernel->curve_cache_2()(f); + } else { + return _m_kernel->curve_cache_2()(_m_kernel->make_square_free_2_object()(f)); + } } protected: From 52bcf27c0a07963b86e68be8b14562aa959db9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 24 Apr 2020 18:43:31 +0200 Subject: [PATCH 4/5] Remove wrapper around removed function estimate_geodesic_distance() --- .../Heat_method_3/Surface_mesh_geodesic_distances_3.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 5f9e7879219..e9a0d73eda3 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -897,16 +897,6 @@ public: base().clear_sources(); } - /** - * get estimated distance from the current source set to a vertex `vd`. - * \warning The return type is `double` even when used with an exact kernel. - */ - double - estimate_geodesic_distance(vertex_descriptor vd) const - { - return base().estimate_geodesic_distance(vd); - } - /** * returns the source set. */ @@ -916,7 +906,6 @@ public: return base().sources(); } - /** * fills the distance property map with the estimated geodesic distance of each vertex to the closest source vertex. * \tparam VertexDistanceMap a property map model of `WritablePropertyMap` From 487e31548123baae20bca92a3dad325ac50ddab5 Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 27 Apr 2020 12:07:12 +0200 Subject: [PATCH 5/5] Remove non-disableable output --- .../Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 25e410932f9..0e01d9dbdb7 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -342,7 +342,6 @@ private: //then go back to top of the stack } } - std::cout<< a << " edges were flipped: " << std::endl; }