mirror of https://github.com/CGAL/cgal
Circular_kernel_2 and Circular_kernel_3 now use CGAL_INTERSECTION_VERSION for backwards compatability
This commit is contained in:
parent
c2bfb68112
commit
a4e6d57cff
|
|
@ -184,7 +184,7 @@ namespace internal {
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = boost::get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(&(*it));
|
||||
result = CGAL::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
if ( result->second == 2 ){ // double solution
|
||||
_begin = result->first;
|
||||
_end = result->first;
|
||||
|
|
@ -195,7 +195,7 @@ namespace internal {
|
|||
_end = result->first;
|
||||
if (!(b_1 && b_2)) {
|
||||
++it;
|
||||
result = boost::get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(&(*it));
|
||||
result = CGAL::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
if (!b_1)
|
||||
_begin = result->first;
|
||||
if (!b_2)
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ public:
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = boost::get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(&(*it));
|
||||
result = CGAL::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
// get must have succeeded
|
||||
if ( result->second == 2 ) // double solution
|
||||
return result->first;
|
||||
if (b) return result->first;
|
||||
++it;
|
||||
result = boost::get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(&(*it));
|
||||
result = CGAL::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
return result->first;
|
||||
}
|
||||
|
||||
|
|
@ -133,11 +133,11 @@ public:
|
|||
v = CGAL::internal::intersection(support, l1, CK());
|
||||
CGAL_assertion(v);
|
||||
|
||||
const Point_2 *pt = boost::get<Point_2>(&*v);
|
||||
const Point_2 *pt = CGAL::internal::intersect_get<Point_2>(v);
|
||||
CGAL_assertion(pt != NULL);
|
||||
_begin = Circular_arc_point_2(*pt);
|
||||
v = CGAL::internal::intersection(support, l2, CK());
|
||||
const Point_2 *pt2 = boost::get<Point_2>(&*v);
|
||||
const Point_2 *pt2 = CGAL::internal::intersect_get<Point_2>(v);
|
||||
CGAL_assertion(pt2 != NULL);
|
||||
_end = Circular_arc_point_2(*pt2);
|
||||
reset_flags();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h>
|
||||
#include <CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h>
|
||||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace CircularFunctors {
|
||||
|
|
@ -519,6 +520,10 @@ namespace CircularFunctors {
|
|||
|
||||
using CK::Linear_kernel::Intersect_2::operator();
|
||||
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
typedef typename CK::Linear_kernel::Intersect_2::result_type result_type;
|
||||
#endif
|
||||
|
||||
template < class OutputIterator >
|
||||
OutputIterator
|
||||
operator()(const Line & c1, const Circle & c2,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ circle_intersect( const typename CK::Circle_2 & c1,
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = boost::get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (&(*it));
|
||||
result = internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
|
||||
if ( result->second == 2 ) // double solution
|
||||
return result->first;
|
||||
|
|
@ -55,7 +55,7 @@ circle_intersect( const typename CK::Circle_2 & c1,
|
|||
return result->first;
|
||||
|
||||
++it;
|
||||
result = boost::get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (&(*it));
|
||||
result = internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
|
||||
return result->first;
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ namespace CircularFunctors {
|
|||
Equation e2 = CircularFunctors::get_equation<CK>(c2);
|
||||
|
||||
if (e1 == e2) {
|
||||
*res++ = result_type(e1);
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Circle_2, typename CK::Circle_2>(e1);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -148,8 +148,9 @@ namespace CircularFunctors {
|
|||
for ( typename solutions_container::iterator it = solutions.begin();
|
||||
it != solutions.end(); ++it )
|
||||
{
|
||||
*res++ = result_type(std::make_pair(Circular_arc_point_2(it->first),
|
||||
it->second ));
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Circle_2, typename CK::Circle_2>
|
||||
(std::make_pair(Circular_arc_point_2(it->first),
|
||||
it->second ));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -642,11 +642,13 @@ namespace CircularFunctors {
|
|||
|
||||
if(sqr1_eq_sqr2 && c1_eq_c2) {
|
||||
if(a1.is_full()) {
|
||||
*res++ = result_type(a2);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(a2);
|
||||
//return res;
|
||||
}
|
||||
else if(a2.is_full()) {
|
||||
*res++ = result_type(a1);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(a1);
|
||||
//return res;
|
||||
} else {
|
||||
bool t2_in_a1 = has_on<CK>(a1,a2.target(),true);
|
||||
|
|
@ -659,60 +661,75 @@ namespace CircularFunctors {
|
|||
CircularFunctors::compare_xy<CK>(a1.source(), a2.source());
|
||||
if(comp < 0) {
|
||||
if(a1.source() == a2.target()) {
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a1.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
}
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
}
|
||||
} else if (comp > 0) {
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
}
|
||||
if(a1.source() == a2.target()) {
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a1.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
}
|
||||
} else {
|
||||
*res++ = result_type(a1);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(a1);
|
||||
}
|
||||
} else {
|
||||
*res++ = result_type(a2);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(a2);
|
||||
//return res;
|
||||
}
|
||||
}
|
||||
else if(t2_in_a1) {
|
||||
if(a1.source() == a2.target())
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a1.source(),1u));
|
||||
else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
} //return res;
|
||||
} else if(s2_in_a1) {
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_2 & arc =
|
||||
Circular_arc_2(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(arc);
|
||||
} //return res;
|
||||
} else if(has_on<CK>(a2,a1.source(),true)) {
|
||||
*res++ = result_type(a1);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(a1);
|
||||
//return res;
|
||||
}
|
||||
//return res;
|
||||
|
|
@ -750,13 +767,15 @@ namespace CircularFunctors {
|
|||
if(do_overlap(a1.bbox(), rb) && do_overlap(a2.bbox(),rb)){
|
||||
if (has_on<CK>(a1,result->first,true) &&
|
||||
has_on<CK>(a2,result->first,true)) {
|
||||
*res++ = result_type(*result);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(*result);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (has_on<CK>(a1,result->first,true) &&
|
||||
has_on<CK>(a2,result->first,true)) {
|
||||
*res++ = result_type(*result);
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Circular_arc_2,
|
||||
typename CK::Circular_arc_2 >(*result);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ namespace CircularFunctors {
|
|||
for ( typename solutions_container::iterator it = solutions.begin();
|
||||
it != solutions.end(); ++it )
|
||||
{
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_2, typename CK::Circle_2>
|
||||
(std::make_pair(Circular_arc_point_2(it->first), it->second ));
|
||||
}
|
||||
|
||||
|
|
@ -437,8 +437,8 @@ namespace CircularFunctors {
|
|||
}
|
||||
if(a1s_a2s || a1s_a2t || a1t_a2s || a1t_a2t) {
|
||||
if(! LinearFunctors::non_oriented_equal<CK>(a1.supporting_line(),a2.supporting_line())){
|
||||
if(a1s_a2s || a1s_a2t) *res++ = result_type(std::make_pair(a1.source(), 1u));
|
||||
if(a1t_a2s || a1t_a2t) *res++ = result_type(std::make_pair(a1.target(), 1u));
|
||||
if(a1s_a2s || a1s_a2t) *res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>(std::make_pair(a1.source(), 1u));
|
||||
if(a1t_a2s || a1t_a2t) *res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>(std::make_pair(a1.target(), 1u));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -450,15 +450,15 @@ namespace CircularFunctors {
|
|||
int comparison = compare_xy(a2.left(),a1.right());
|
||||
if(comparison < 0){
|
||||
if(compare_xy(a1.right(),a2.right()) <= 0){
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
(Line_arc_2(a1.supporting_line(), a2.left(), a1.right() ));
|
||||
} else{
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
(Line_arc_2(a1.supporting_line(), a2.left(), a2.right() ));
|
||||
}
|
||||
}
|
||||
else if (comparison == 0){
|
||||
*res++ =result_type
|
||||
*res++ =CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
( std::make_pair(a2.left(),1u));
|
||||
}
|
||||
return res;
|
||||
|
|
@ -467,16 +467,16 @@ namespace CircularFunctors {
|
|||
int comparison = compare_xy(a1.left(),a2.right());
|
||||
if(comparison < 0){
|
||||
if(compare_xy(a1.right(),a2.right()) <= 0){
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
(Line_arc_2(a1.supporting_line(), a1.left(), a1.right() ));
|
||||
}
|
||||
else{
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
(Line_arc_2(a1.supporting_line(), a1.left(), a2.right() ));
|
||||
}
|
||||
}
|
||||
else if (comparison == 0){
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>
|
||||
( std::make_pair(a1.left(),1u));
|
||||
}
|
||||
return res;
|
||||
|
|
@ -487,7 +487,7 @@ namespace CircularFunctors {
|
|||
v = CGAL::internal::intersection(a1.supporting_line(), a2.supporting_line(), CK());
|
||||
if(!v) return res;
|
||||
|
||||
const Point_2 *pt = boost::get<Point_2>(&*v);
|
||||
const Point_2 *pt = CGAL::internal::intersect_get<Point_2>(v);
|
||||
if(pt == NULL) return res;
|
||||
Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt);
|
||||
// (Root_for_circles_2_2(Root_of_2(pt->x()),Root_of_2(pt->y())));
|
||||
|
|
@ -496,7 +496,7 @@ namespace CircularFunctors {
|
|||
CircularFunctors::compare_xy<CK>(intersect_point, a1.target())) &&
|
||||
(CircularFunctors::compare_xy<CK>(intersect_point, a2.source()) !=
|
||||
CircularFunctors::compare_xy<CK>(intersect_point, a2.target())))
|
||||
*res++ = result_type(std::make_pair(intersect_point, 1u));
|
||||
*res++ = CGAL::internal::intersection_return<CK, typename CK::Line_arc_2, typename CK::Line_arc_2>(std::make_pair(intersect_point, 1u));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
@ -525,8 +525,18 @@ namespace CircularFunctors {
|
|||
|
||||
for (typename solutions_container::iterator it = solutions.begin();
|
||||
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))) {
|
||||
Has_on_visitor<CK, typename CK::Line_arc_2> vis(&l);
|
||||
if(vis(*p)) {
|
||||
*res++ = *it;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(boost::apply_visitor(Has_on_visitor<CK, typename CK::Line_arc_2>(&l), *it))
|
||||
*res++ = *it;
|
||||
#endif
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
@ -796,8 +806,18 @@ namespace CircularFunctors {
|
|||
|
||||
for (typename solutions_container::const_iterator it = solutions.begin();
|
||||
it != solutions.end(); ++it) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const std::pair<Circular_arc_point_2, unsigned>* p =
|
||||
object_cast<std::pair<Circular_arc_point_2, unsigned> >(& (*it)) ) {
|
||||
Has_on_visitor<CK, Circular_arc_2> vis(&c);
|
||||
if(vis(*p)) {
|
||||
*res++ = *it;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(boost::apply_visitor(Has_on_visitor<CK, Circular_arc_2>(&c), *it))
|
||||
*res++ = *it;
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1167,8 +1167,10 @@ template < class SK > \
|
|||
|
||||
public:
|
||||
|
||||
typedef typename SK::Object_3 Object_3;
|
||||
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
typedef typename CK::Linear_kernel::Intersect_2::result_type result_type;
|
||||
#endif
|
||||
|
||||
using SK::Linear_kernel::Intersect_3::operator();
|
||||
|
||||
template < class OutputIterator >
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ namespace CGAL {
|
|||
intersect_3<SK>(circle,plane,std::back_inserter(inters));
|
||||
CGAL_kernel_precondition(inters.size()==2);
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0]);
|
||||
pt[1]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[1]);
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -96,12 +96,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
|
|
@ -134,12 +134,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
|
|
@ -173,12 +173,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(c,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(c,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(c,sol2.first,true))
|
||||
|
|
@ -200,7 +200,7 @@ namespace CGAL {
|
|||
typename SK::Plane_3>::result_type> solutions_container;
|
||||
typedef std::pair<Circular_arc_point_3, unsigned> Solution;
|
||||
if(SK().has_on_3_object()(p,ca.supporting_circle())) {
|
||||
*res++ = result_type(ca);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Plane_3, typename SK::Circular_arc_3>(ca);
|
||||
}
|
||||
solutions_container solutions;
|
||||
|
||||
|
|
@ -208,16 +208,16 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = result_type(sol);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Plane_3, typename SK::Circular_arc_3>(sol);
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = result_type(sol1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Plane_3, typename SK::Circular_arc_3>(sol1);
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
*res++ = result_type(sol2);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Plane_3, typename SK::Circular_arc_3>(sol2);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -240,13 +240,13 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true) &&
|
||||
SK().has_on_3_object()(la,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true) &&
|
||||
SK().has_on_3_object()(la,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -273,11 +273,13 @@ namespace CGAL {
|
|||
|
||||
if(non_oriented_equal<SK>(a1.supporting_circle(), a2.supporting_circle())) {
|
||||
if(a1.rep().is_full()) {
|
||||
*res++ = result_type(a2);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(a2);
|
||||
//return res;
|
||||
}
|
||||
else if(a2.rep().is_full()) {
|
||||
*res++ = result_type(a1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(a1);
|
||||
//return res;
|
||||
} else {
|
||||
bool t2_in_a1 = SK().has_on_3_object()(a1,a2.target(),true);
|
||||
|
|
@ -290,58 +292,73 @@ namespace CGAL {
|
|||
SK().compare_xyz_3_object()(a1.source(), a2.source());
|
||||
if(comp < 0) {
|
||||
if(a1.source() == a2.target()) {
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a1.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
}
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
}
|
||||
} else if(comp > 0) {
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
}
|
||||
if(a1.source() == a2.target()) {
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a1.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
}
|
||||
} else {
|
||||
*res++ = result_type(a1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(a1);
|
||||
}
|
||||
} else {
|
||||
*res++ = result_type(a2);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(a2);
|
||||
}
|
||||
} else if(t2_in_a1) {
|
||||
if(a1.source() == a2.target())
|
||||
*res++ = result_type(std::make_pair(a1.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a1.source(),1u));
|
||||
else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a1.source(),a2.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
} //return res;
|
||||
} else if(s2_in_a1) {
|
||||
if(a2.source() == a1.target()) {
|
||||
*res++ = result_type(std::make_pair(a2.source(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(std::make_pair(a2.source(),1u));
|
||||
} else {
|
||||
const Circular_arc_3 & arc =
|
||||
Circular_arc_3(a1.supporting_circle(),a2.source(),a1.target());
|
||||
*res++ = result_type(arc);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(arc);
|
||||
}
|
||||
} else if(SK().has_on_3_object()(a2,a1.source(),true)) {
|
||||
*res++ = result_type(a1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, typename SK::Circular_arc_3,
|
||||
typename SK::Circular_arc_3>(a1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -351,13 +368,13 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(a1,sol.first,true) &&
|
||||
SK().has_on_3_object()(a2,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*boost::get<Solution>(&solutions[0]);
|
||||
const Solution& sol2=*boost::get<Solution>(&solutions[1]);
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(a1,sol1.first,true) &&
|
||||
SK().has_on_3_object()(a2,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -473,8 +490,8 @@ namespace CGAL {
|
|||
//one endpoint is extremal: just split the arc
|
||||
if (nb_extrem==1){
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0]);
|
||||
pt[1]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[1]);
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
const typename SK::Circular_arc_point_3& midpt=(arc.source()==pt[0]->first || arc.target()==pt[0]->first)?pt[1]->first:pt[0]->first;
|
||||
|
|
@ -488,7 +505,7 @@ namespace CGAL {
|
|||
//only one intersection points
|
||||
if (inters.size()==1){
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* midpt=NULL;
|
||||
midpt=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0]);
|
||||
midpt=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
CGAL_kernel_precondition(midpt!=NULL);
|
||||
*out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),midpt->first);
|
||||
*out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),midpt->first,arc.target());
|
||||
|
|
@ -497,8 +514,8 @@ namespace CGAL {
|
|||
|
||||
//three arcs are defined by two intersection points
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0]);
|
||||
pt[1]=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[1]);
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
|
||||
|
|
@ -581,14 +598,16 @@ namespace CGAL {
|
|||
CGAL_kernel_precondition(!inters.empty());
|
||||
if (inters.size()==1){
|
||||
const typename SK::Circular_arc_point_3& pt=
|
||||
boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0])->first;
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
return pt;
|
||||
}
|
||||
|
||||
CGAL_kernel_precondition(classify_circle_3<SK>(arc.supporting_circle(),sphere)!=NORMAL);
|
||||
|
||||
const typename SK::Circular_arc_point_3& pts1=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[0])->first;
|
||||
const typename SK::Circular_arc_point_3& pts2=boost::get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(&inters[1])->first;
|
||||
const typename SK::Circular_arc_point_3& pts1 =
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
const typename SK::Circular_arc_point_3& pts2 =
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1])->first;
|
||||
|
||||
|
||||
//either a polar (1 pole + 1 pt) or a threaded circle (2 pts with theta-coord = +/- pi)
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@ namespace CGAL {
|
|||
if(!o)
|
||||
return res;
|
||||
|
||||
if(const Point_3* inters_p = boost::get<Point_3>(&(*o))) {
|
||||
if(const Point_3* inters_p = CGAL::internal::intersect_get<Point_3>(o)) {
|
||||
Circular_arc_point_3 p = *inters_p;
|
||||
if(!SK().has_on_3_object()(l1,p,true)) return res;
|
||||
if(!SK().has_on_3_object()(l2,p,true)) return res;
|
||||
*res++ = result_type(std::make_pair(p,1u));
|
||||
} else if(const Line_3* inters_l = boost::get<Line_3>(&(*o))) {
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>(std::make_pair(p,1u));
|
||||
} else if(const Line_3* inters_l = CGAL::internal::intersect_get<Line_3>(o)) {
|
||||
if(SK().compare_xyz_3_object()(l1.lower_xyz_extremity(),
|
||||
l2.lower_xyz_extremity()) < 0) {
|
||||
int comparison =
|
||||
|
|
@ -108,15 +108,15 @@ namespace CGAL {
|
|||
if(comparison < 0) {
|
||||
if(SK().compare_xyz_3_object()(l1.higher_xyz_extremity(),
|
||||
l2.higher_xyz_extremity()) <= 0) {
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>
|
||||
(Line_arc_3(l1.supporting_line(),
|
||||
l2.lower_xyz_extremity(),
|
||||
l1.higher_xyz_extremity()));
|
||||
} else {
|
||||
*res++ = result_type(l2);
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>(l2);
|
||||
}
|
||||
} else if (comparison == 0) {
|
||||
*res++ = result_type(std::make_pair(l2.lower_xyz_extremity(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>(std::make_pair(l2.lower_xyz_extremity(),1u));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -126,16 +126,16 @@ namespace CGAL {
|
|||
if(comparison < 0) {
|
||||
if(SK().compare_xyz_3_object()(l1.higher_xyz_extremity(),
|
||||
l2.higher_xyz_extremity()) <= 0) {
|
||||
*res++ = result_type(l1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>(l1);
|
||||
} else {
|
||||
*res++ = result_type
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>
|
||||
(Line_arc_3(l1.supporting_line(),
|
||||
l1.lower_xyz_extremity(),
|
||||
l2.higher_xyz_extremity() ));
|
||||
}
|
||||
}
|
||||
else if (comparison == 0){
|
||||
*res++ = result_type(std::make_pair(l1.lower_xyz_extremity(),1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_arc_3, Line_arc_3>(std::make_pair(l1.lower_xyz_extremity(),1u));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -160,12 +160,12 @@ namespace CGAL {
|
|||
if(!o)
|
||||
return res;
|
||||
|
||||
if(const Line_3* inters_l = boost::get<Line_3>(&*o)) {
|
||||
*res++ = result_type(la);
|
||||
} else if(const Point_3* inters_p = boost::get<Point_3>(&*o)) {
|
||||
if(const Line_3* inters_l = CGAL::internal::intersect_get<Line_3>(o)) {
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_3, Line_arc_3>(la);
|
||||
} else if(const Point_3* inters_p = CGAL::internal::intersect_get<Point_3>(o)) {
|
||||
Circular_arc_point_3 p = *inters_p;
|
||||
if(!SK().has_on_3_object()(la,p,true)) return res;
|
||||
*res++ = result_type(std::make_pair(p,1u));
|
||||
*res++ = CGAL::internal::intersection_return<SK, Line_3, Line_arc_3>(std::make_pair(p,1u));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
@ -188,12 +188,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution* sol = boost::get<Solution>(&solutions[0]);
|
||||
const Solution* sol = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(l,(*sol).first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution* sol1 = boost::get<Solution>(&solutions[0]);
|
||||
const Solution* sol2 = boost::get<Solution>(&solutions[1]);
|
||||
const Solution* sol1 = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
|
||||
if(SK().has_on_3_object()(l,(*sol1).first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -218,12 +218,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution* sol = boost::get<Solution>(&solutions[0]);
|
||||
const Solution* sol = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(l,(*sol).first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution* sol1 = boost::get<Solution>(&solutions[0]);
|
||||
const Solution* sol2 = boost::get<Solution>(&solutions[1]);
|
||||
const Solution* sol1 = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(l,(*sol1).first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(l,(*sol2).first,true))
|
||||
|
|
@ -249,7 +249,7 @@ namespace CGAL {
|
|||
|
||||
if(!o)
|
||||
return res;
|
||||
if(sol = boost::get<Point_3>(&*o)) {
|
||||
if(sol = CGAL::internal::intersect_get<Point_3>(o)) {
|
||||
if(!SK().has_on_3_object()(l,*sol)) return res;
|
||||
Circular_arc_point_3 point = sol;
|
||||
*res++ = result_type(std::make_pair(point,1u));
|
||||
|
|
|
|||
|
|
@ -203,9 +203,18 @@ namespace CGAL {
|
|||
// we need to pass the result_type, to hack around the fact that
|
||||
// object doesn't support operator=(const T&) and so we keep backwards compatibility
|
||||
template<typename SK, typename RT>
|
||||
RT pair_transform(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) {
|
||||
return RT(std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second));
|
||||
}
|
||||
struct pair_transform {
|
||||
RT operator()(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) {
|
||||
return RT(std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second));
|
||||
}
|
||||
};
|
||||
|
||||
template<typename SK>
|
||||
struct pair_transform<SK, CGAL::Object> {
|
||||
CGAL::Object operator()(const std::pair< typename SK::Root_for_spheres_2_3, unsigned >& p) {
|
||||
return CGAL::make_object(std::make_pair(typename SK::Circular_arc_point_3(p.first), p.second));
|
||||
}
|
||||
};
|
||||
|
||||
// obscure trick: calculate the regular intersection between two
|
||||
// objects, throw it away if empty, else check if the result was a
|
||||
|
|
@ -218,6 +227,7 @@ namespace CGAL {
|
|||
Point_conversion_visitor(const OutputIterator& it) : it(it) {}
|
||||
template<typename T>
|
||||
OutputIterator operator()(const T& t) { *it++ = RT(t); return it; }
|
||||
|
||||
OutputIterator operator()(const typename SK::Point_3& p) {
|
||||
// 2 multiplicities
|
||||
*it++ = RT(std::make_pair(typename SK::Circular_arc_point_3(p), 2u));
|
||||
|
|
@ -250,7 +260,7 @@ namespace CGAL {
|
|||
solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions));
|
||||
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
// The special 3 object functions
|
||||
|
|
@ -276,25 +286,43 @@ namespace CGAL {
|
|||
CGAL_kernel_precondition(!s2.is_degenerate());
|
||||
CGAL_kernel_precondition(!s3.is_degenerate());
|
||||
if(non_oriented_equal<SK>(s1,s2) && non_oriented_equal<SK>(s2,s3)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
*res++ = make_object(s1);
|
||||
#else
|
||||
*res++ = result_type(s1);
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
if(non_oriented_equal<SK>(s1,s2)) {
|
||||
if(typename IT<SK, Sphere_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(s1, s3)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const Point_3* p = object_cast<Point_3>(&v) )
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u));
|
||||
else
|
||||
*res++ = v;
|
||||
#else
|
||||
internal::Point_conversion_visitor<SK, result_type, OutputIterator> visitor(res);
|
||||
return boost::apply_visitor(visitor,
|
||||
*v);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if(non_oriented_equal<SK>(s1,s3) || non_oriented_equal<SK>(s2,s3)) {
|
||||
if(typename IT<SK, Sphere_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(s1, s2)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const Point_3* p = object_cast<Point_3>(&v) )
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u));
|
||||
else
|
||||
*res++ = v;
|
||||
#else
|
||||
internal::Point_conversion_visitor<SK, result_type, OutputIterator> visitor(res);
|
||||
return boost::apply_visitor(
|
||||
visitor,
|
||||
*v);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -302,15 +330,23 @@ namespace CGAL {
|
|||
typename IT<SK, Sphere_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(s1, s2);
|
||||
if(!v) return res;
|
||||
if(const Point_3* p = boost::get<Point_3>(&*v)) {
|
||||
if(const Point_3* p = CGAL::internal::intersect_get<Point_3>(v)) {
|
||||
if(SK().has_on_3_object()(s3, *p)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p),2u));
|
||||
#else
|
||||
*res++ = result_type(std::make_pair(Circular_arc_point_3(*p),2u));
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if(const Circle_3* c = boost::get<Circle_3>(&*v)) {
|
||||
if(const Circle_3* c = CGAL::internal::intersect_get<Circle_3>(v)) {
|
||||
if(SK().has_on_3_object()(s3, *c)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
*res++ = make_object(*c);
|
||||
#else
|
||||
*res++ = result_type(*c);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -324,7 +360,7 @@ namespace CGAL {
|
|||
algebraic_solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions));
|
||||
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
template < class SK, class OutputIterator >
|
||||
|
|
@ -349,10 +385,17 @@ namespace CGAL {
|
|||
if(non_oriented_equal<SK>(s1,s2)) {
|
||||
if(typename IT<SK, Plane_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(p, s1)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const typename SK::Point_3* p = CGAL::object_cast<typename SK::Point_3>(&v) )
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u));
|
||||
else
|
||||
*res++ = v;
|
||||
#else
|
||||
internal::Point_conversion_visitor<SK, result_type, OutputIterator> visitor(res);
|
||||
return boost::apply_visitor(
|
||||
visitor,
|
||||
*v);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -360,10 +403,17 @@ namespace CGAL {
|
|||
if(non_oriented_equal<SK>(p,radical_p)) {
|
||||
if(typename IT<SK, Plane_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(p, s1)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const typename SK::Point_3* p = CGAL::object_cast<typename SK::Point_3>(&v) )
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u));
|
||||
else
|
||||
*res++ = v;
|
||||
#else
|
||||
internal::Point_conversion_visitor<SK, result_type, OutputIterator> visitor(res);
|
||||
return boost::apply_visitor(
|
||||
visitor,
|
||||
*v);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -374,7 +424,7 @@ namespace CGAL {
|
|||
algebraic_solutions_container;
|
||||
algebraic_solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions));
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
template < class SK, class OutputIterator >
|
||||
|
|
@ -399,10 +449,17 @@ namespace CGAL {
|
|||
if(non_oriented_equal<SK>(p1,p2)) {
|
||||
if(typename IT<SK, Plane_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(p1, s)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
if( const typename SK::Point_3* p = CGAL::object_cast<typename SK::Point_3>(&v) )
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u));
|
||||
else
|
||||
*res++ = v;
|
||||
#else
|
||||
internal::Point_conversion_visitor<SK, result_type, OutputIterator> visitor(res);
|
||||
return boost::apply_visitor(
|
||||
visitor,
|
||||
*v);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -413,7 +470,7 @@ namespace CGAL {
|
|||
algebraic_solutions_container;
|
||||
algebraic_solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, e3, std::back_inserter(solutions));
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
template < class SK, class OutputIterator >
|
||||
|
|
@ -449,7 +506,7 @@ namespace CGAL {
|
|||
::result_type result_type;
|
||||
|
||||
if(non_oriented_equal<SK>(c1,c2)) {
|
||||
*res++ = result_type(c1);
|
||||
*res++ = CGAL::internal::intersection_return<SK, Circle_3, Circle_3>(c1);
|
||||
return res;
|
||||
}
|
||||
Equation_circle e1 = get_equation<SK>(c1);
|
||||
|
|
@ -458,7 +515,7 @@ namespace CGAL {
|
|||
algebraic_solutions_container;
|
||||
algebraic_solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions));
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
template < class SK, class OutputIterator >
|
||||
|
|
@ -481,7 +538,7 @@ namespace CGAL {
|
|||
algebraic_solutions_container;
|
||||
algebraic_solutions_container solutions;
|
||||
Algebraic_kernel().solve_object()(e1, e2, std::back_inserter(solutions));
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>);
|
||||
return std::transform(solutions.begin(), solutions.end(), res, internal::pair_transform<SK, result_type>());
|
||||
}
|
||||
|
||||
// At the moment we dont need those functions
|
||||
|
|
|
|||
|
|
@ -85,9 +85,13 @@ struct IT : public Intersection_traits<K, A, B> {};
|
|||
// The version to cover ternary intersections of the Spherical_kernel
|
||||
template<typename K>
|
||||
struct Intersection_traits_spherical {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
typedef CGAL::Object result_type;
|
||||
#else
|
||||
typedef boost::variant<
|
||||
typename K::Circle_3, typename K::Plane_3, typename K::Sphere_3, std::pair< typename K::Circular_arc_point_3, unsigned > >
|
||||
result_type;
|
||||
#endif
|
||||
};
|
||||
|
||||
template<typename K>
|
||||
|
|
|
|||
Loading…
Reference in New Issue