diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h index 9c5d2658657..be0824bc821 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h @@ -81,13 +81,13 @@ public: Object obj = R().intersect_3_object()(s1, s2); // s1,s2 must intersect CGAL_kernel_precondition(!(obj.is_empty())); - typename R::Circle_3 circle; - typename R::Point_3 point; - if(assign(circle, obj)) - base = Rep(circle.diametral_sphere(), circle.supporting_plane()); + const typename R::Circle_3* circle_ptr=object_cast(&obj); + if(circle_ptr!=NULL) + base = Rep(circle_ptr->diametral_sphere(), circle_ptr->supporting_plane()); else { - assign(point, obj); - CircleC3 circle = CircleC3(point, FT(0), Vector_3(FT(1),FT(0),FT(0))); + const typename R::Point_3* point=object_cast(&obj); + CGAL_kernel_precondition(point!=NULL); + CircleC3 circle = CircleC3(*point, FT(0), Vector_3(FT(1),FT(0),FT(0))); base = Rep(circle.diametral_sphere(), circle.supporting_plane()); } } @@ -98,13 +98,13 @@ public: Object obj = R().intersect_3_object()(p, s); // s1,s2 must intersect CGAL_kernel_precondition(!(obj.is_empty())); - typename R::Circle_3 circle; - typename R::Point_3 point; - if(assign(circle, obj)) - base = Rep(circle.diametral_sphere(), circle.supporting_plane()); + const typename R::Circle_3* circle_ptr=object_cast(&obj); + if(circle_ptr!=NULL) + base = Rep(circle_ptr->diametral_sphere(), circle_ptr->supporting_plane()); else { - assign(point, obj); - CircleC3 circle = CircleC3(point, FT(0), Vector_3(FT(1),FT(0),FT(0))); + const typename R::Point_3* point=object_cast(&obj); + CGAL_kernel_precondition(point!=NULL); + CircleC3 circle = CircleC3(*point, FT(0), Vector_3(FT(1),FT(0),FT(0))); base = Rep(circle.diametral_sphere(), circle.supporting_plane()); } }