Largest Empty Iso Rectangle: Ignore points on the border

This commit is contained in:
Andreas Fabri 2023-01-27 13:37:34 +00:00
parent e4097e8fd9
commit 9dbf5c87a6
3 changed files with 6 additions and 5 deletions

View File

@ -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);
/*!

View File

@ -1,8 +1,7 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Iso_rectangle_2.h>
#include <CGAL/Largest_empty_iso_rectangle_2.h>
#include <fstream>
#include <iostream>
typedef double Number_Type;
typedef CGAL::Simple_cartesian<Number_Type> K;

View File

@ -762,7 +762,7 @@ bool
Largest_empty_iso_rectangle_2<T>::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);
}