diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h index 5df79996e48..c047a36474c 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h @@ -29,29 +29,29 @@ #include namespace CGAL { - -template -bool do_intersect(const CGAL::Bbox_2& a, - const Point_2& b) -{ - Point_2 bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax()); - - Iso_rectangle_2 ic(bl,tr); - return K().do_intersect_2_object()(ic, b); -} - - -template -bool do_intersect(const Point_2& a, - const CGAL::Bbox_2& b) -{ - return do_intersect(b,a); -} - namespace Intersections { - namespace internal { +template +inline bool do_intersect(const Bbox_2 &bbox, + const Point_2 &pt, + const K& k) +{ + Point_2 bl(bbox.xmin(), bbox.ymin()), + tr(bbox.xmax(), bbox.ymax()); + Iso_rectangle_2 ic(bl,tr); + + return k.do_intersect_2_object()(ic, pt); +} + +template +inline bool do_intersect(const Point_2 &pt, + const Bbox_2& bbox, + const K& k) +{ + return do_intersect(bbox, pt, k); +} + template typename CGAL::Intersection_traits::result_type intersection(const Point_2& a, @@ -77,6 +77,20 @@ intersection(const CGAL::Bbox_2& b, } // namespace internal } // namespace Intersections +template +bool do_intersect(const CGAL::Bbox_2& a, + const Point_2& b) +{ + return Intersections::internal::do_intersect(a,b,K()); +} + +template +bool do_intersect(const Point_2& a, + const CGAL::Bbox_2& b) +{ + return Intersections::internal::do_intersect(b,a,K()); +} + template typename CGAL::Intersection_traits >::result_type intersection(const Bbox_2& b, @@ -92,6 +106,7 @@ typename CGAL::Intersection_traits >::result_type { return Intersections::internal::intersection(b,a,K()); } + } // namespace CGAL #endif // CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H