Merge remote-tracking branch 'cgal/releases/CGAL-4.9-branch'

This commit is contained in:
Sébastien Loriot 2017-01-26 18:38:17 +01:00
commit 64f7f5892e
4 changed files with 45 additions and 20 deletions

View File

@ -180,6 +180,12 @@ struct CK2_Intersection_traits<CK, typename CK::Circle_2, typename CK::Line_2> :
public CK2_Intersection_traits<CK, typename CK::Line_2, typename CK::Circle_2>
{};
template<typename CK>
struct CK2_Intersection_traits<CK, typename CK::Line_2, typename CK::Line_2>
{
typedef typename Intersection_traits<CK, typename CK::Line_2, typename CK::Line_2>::result_type type;
};
} //end of namespace CGAL
#else

View File

@ -635,6 +635,15 @@ namespace CircularFunctors {
OutputIterator res) const
{ return CircularFunctors::intersect_2<CK> (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 >

View File

@ -567,9 +567,6 @@ namespace CircularFunctors {
const typename CK::Circular_arc_2 &c,
OutputIterator res )
{
typedef std::vector<CGAL::Object > 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<CGAL::Object > solutions_container;
typedef std::vector<typename CK2_Intersection_traits<CK, typename CK::Line_2, typename CK::Circle_2>::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<Circular_arc_point_2, unsigned>
*result = CGAL::object_cast
<std::pair<Circular_arc_point_2, unsigned> > (&(*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<CK>(l,result->first,true) &&
has_on<CK>(c,result->first,true)) {
it != solutions.end(); ++it)
{
#if CGAL_INTERSECTION_VERSION < 2
if(const std::pair<typename CK::Circular_arc_point_2, unsigned>* 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<CK, typename CK::Line_arc_2> vis1(&l);
Has_on_visitor<CK, typename CK::Circular_arc_2> vis2(&c);
if(vis1(*p) && vis2(*p))
*res++ = *it;
}
}
#else
if (has_on<CK>(l,result->first,true) &&
has_on<CK>(c,result->first,true)) {
#else
if(boost::apply_visitor(Has_on_visitor<CK, typename CK::Line_arc_2>(&l), *it) &&
boost::apply_visitor(Has_on_visitor<CK, typename CK::Circular_arc_2>(&c), *it) )
{
*res++ = *it;
}
#endif
#endif
}
return res;
}

View File

@ -89,6 +89,13 @@ intersection(const Line_2 <K> &c1, const Circle_2 <K> &c2, OutputIterator res)
return typename K::Intersect_2()(c1, c2, res);
}
template < class OutputIterator, class K >
OutputIterator
intersection(const Line_2 <K> &c1, const Line_2 <K> &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)