From ff079642b66eddb9f06bd306585657150e1b23b0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 6 Dec 2024 14:15:05 +0000 Subject: [PATCH] Add two curves to dD examples (we get an assertion) --- .../examples/Frechet_distance/Frechet_distance_d.cpp | 9 ++++++--- Kernel_23/include/CGAL/Bbox.h | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp b/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp index 8acde5a1db2..1726b42c21d 100644 --- a/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp +++ b/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp @@ -10,9 +10,12 @@ using Kernel = CGAL::Epick_d>; using Traits = CGAL::Frechet_distance_traits_d; using Point = Traits::Point_d; -int main(int argc, char* argv[]) +int main(int , char*) { - std::vector A, B; - bool res = CGAL::is_Frechet_distance_larger(A, B, 0.001); + std::array A = { Point(0,0,0,0), Point(1,0,0,0), Point(1,1,0,1),Point(1,1,1,0)}; + std::array B = { Point(0,0,0,0), Point(1,0,0,1), Point(1,1,0,0),Point(1,1,1,1)}; + + std::pair res = CGAL::approximate_Frechet_distance(A, B, 0.000001); + std::cout << "The Frechet distance between the polylines is between " << res.first << " and " << res.second << std::endl; return 0; } diff --git a/Kernel_23/include/CGAL/Bbox.h b/Kernel_23/include/CGAL/Bbox.h index b0fd9df0647..9210af5441f 100644 --- a/Kernel_23/include/CGAL/Bbox.h +++ b/Kernel_23/include/CGAL/Bbox.h @@ -175,6 +175,13 @@ std::istream& operator>>(std::istream& in, Impl::Bbox& bbox) return in; } +template +Bbox, T> operator+(Bbox, T> bbox, const Bbox, T>& other) +{ + bbox += other; + return bbox; +} + } // namespace CGAL