diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h index 771df899a17..2ce605e7082 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h @@ -180,6 +180,12 @@ struct CK2_Intersection_traits : public CK2_Intersection_traits {}; +template +struct CK2_Intersection_traits +{ + typedef typename Intersection_traits::result_type type; +}; + } //end of namespace CGAL #else diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h index 096fd844a32..6f439d0af96 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h @@ -635,6 +635,15 @@ namespace CircularFunctors { OutputIterator res) const { return CircularFunctors::intersect_2 (l,la,res); } + template < class OutputIterator > + OutputIterator + operator()(const Line & l1, const Line & l2, + OutputIterator res) const + { + *res++=typename CK::Linear_kernel::Intersect_2()(l1, l2); + return res; + } + }; template < class CK > diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index 3cbc97187fb..31381ab58e0 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -567,9 +567,6 @@ namespace CircularFunctors { const typename CK::Circular_arc_2 &c, OutputIterator res ) { - typedef std::vector solutions_container; - typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; - #if defined(CGAL_CK_EXPLOIT_IDENTITY) || \ defined(CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES) typedef typename CK::Line_arc_2 Line_arc_2; @@ -677,7 +674,8 @@ namespace CircularFunctors { } #endif // CGAL_CK_EXPLOIT_IDENTITY - typedef std::vector solutions_container; + typedef std::vector::type> + solutions_container; solutions_container solutions; #ifdef CGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES @@ -697,25 +695,30 @@ namespace CircularFunctors { } #endif + for (typename solutions_container::iterator it = solutions.begin(); - it != solutions.end(); ++it) { - const std::pair - *result = CGAL::object_cast - > (&(*it)); -#ifdef CGAL_CK_TEST_BBOX_BEFORE_HAS_ON - Bbox_2 rb = result->first.bbox(); - if(do_overlap(l.bbox(), rb) && do_overlap(c.bbox(),rb)){ - if (has_on(l,result->first,true) && - has_on(c,result->first,true)) { - *res++ = *it; - } - } -#else - if (has_on(l,result->first,true) && - has_on(c,result->first,true)) { + it != solutions.end(); ++it) + { + #if CGAL_INTERSECTION_VERSION < 2 + if(const std::pair* p = + object_cast< std::pair< typename CK::Circular_arc_point_2, unsigned> >(& (*it))) + { + #ifdef CGAL_CK_TEST_BBOX_BEFORE_HAS_ON + Bbox_2 rb = p->first.bbox(); + if(!do_overlap(l.bbox(), rb) || !do_overlap(c.bbox(),rb)) continue; + #endif + Has_on_visitor vis1(&l); + Has_on_visitor vis2(&c); + if(vis1(*p) && vis2(*p)) + *res++ = *it; + } + #else + if(boost::apply_visitor(Has_on_visitor(&l), *it) && + boost::apply_visitor(Has_on_visitor(&c), *it) ) + { *res++ = *it; } -#endif + #endif } return res; } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h index 0bdb68b38c2..b3cf5495407 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_intersections.h @@ -89,6 +89,13 @@ intersection(const Line_2 &c1, const Circle_2 &c2, OutputIterator res) return typename K::Intersect_2()(c1, c2, res); } +template < class OutputIterator, class K > +OutputIterator +intersection(const Line_2 &c1, const Line_2 &c2, OutputIterator res) +{ + return typename K::Intersect_2()(c1, c2, res); +} + CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Circular_arc_2, Circular_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Line_arc_2) CGAL_CIRCULAR_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_(Line_arc_2, Circle_2)