From 9dbf5c87a607ecd42cafa138c9208f626e7d2c63 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 27 Jan 2023 13:37:34 +0000 Subject: [PATCH] Largest Empty Iso Rectangle: Ignore points on the border --- .../Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h | 6 ++++-- .../examples/Inscribed_areas/largest_empty_rectangle.cpp | 3 +-- .../include/CGAL/Largest_empty_iso_rectangle_2.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h b/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h index f11af4ccdf1..080fc203bfb 100644 --- a/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h +++ b/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h @@ -142,9 +142,11 @@ Iso_rectangle_2 get_bounding_box(); /// @{ /*! -Inserts point `p` in the point set, if it is not already in the set. +Inserts point `p` in the point set, if it is not already in the set +and on the bounded side of the bounding rectangle. +\note Points on the boundary can be ignored as they lead to the same result. */ -void +bool insert(const Point_2& p); /*! diff --git a/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp b/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp index 5128e958d84..bbf8989b7b8 100644 --- a/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp +++ b/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp @@ -1,8 +1,7 @@ #include -#include #include -#include +#include typedef double Number_Type; typedef CGAL::Simple_cartesian K; diff --git a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h index 382c80e2c0b..b82f038bae1 100644 --- a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h +++ b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h @@ -762,7 +762,7 @@ bool Largest_empty_iso_rectangle_2::insert(const Point_2& _p) { // check that the point is inside the bounding box - if(bbox_p.has_on_unbounded_side(_p)) { + if(! bbox_p.has_on_bounded_side(_p)) { return(false); }