From 62dd84a76005d122ab067e48ad557025ae242e36 Mon Sep 17 00:00:00 2001 From: Pedro Machado Manhaes de Castro Date: Sat, 12 Aug 2006 16:26:56 +0000 Subject: [PATCH] Split_3 + do_overlap --- ...nternal_function_has_on_spherical_kernel.h | 66 ++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h index c3b79407f7e..23c1da903ec 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h @@ -185,7 +185,71 @@ namespace CGAL { return non_oriented_equal(l, la.supporting_line()); } - // TO DO + + template< class SK> + inline + Sign + compute_sign_of_cross_product(const typename SK::Root_of_2 &x1, + const typename SK::Root_of_2 &y1, + const typename SK::Root_of_2 &z1, + const typename SK::Root_of_2 &x2, + const typename SK::Root_of_2 &y2, + const typename SK::Root_of_2 &z2) { + typedef typename SK::Root_of_2 Root_of_2; + const Root_of_2 cx = y1 * z2 - z1 * y2; + const Root_of_2 cy = z1 * x2 - x1 * z2; + const Root_of_2 cz = x1 * y2 - y1 * x2; + if(!is_zero(cx)) return sign(cx); + if(!is_zero(cy)) return sign(cy); + return sign(cz); + } + + template< class SK> + inline + Sign + compute_sign_of_cross_product(const typename SK::FT &x1, + const typename SK::FT &y1, + const typename SK::FT &z1, + const typename SK::FT &x2, + const typename SK::FT &y2, + const typename SK::FT &z2) { + typedef typename SK::FT FT; + const FT cx = y1 * z2 - z1 * y2; + const FT cy = z1 * x2 - x1 * z2; + const FT cz = x1 * y2 - y1 * x2; + if(!is_zero(cx)) return sign(cx); + if(!is_zero(cy)) return sign(cy); + return sign(cz); + } + + template< class SK> + inline + Sign + compute_sign_of_cross_product(const typename SK::Circular_arc_point_3 &p1, + const typename SK::Circular_arc_point_3 &p2, + const typename SK::Point_3 &c) { + return compute_sign_of_cross_product(p1.x()-c.x(), + p1.y()-c.y(), + p1.z()-c.z(), + p2.x()-c.x(), + p2.y()-c.y(), + p2.z()-c.z()); + } + + template< class SK> + inline + Sign + compute_sign_of_cross_product(const typename SK::Point_3 &p1, + const typename SK::Point_3 &p2, + const typename SK::Point_3 &c) { + return compute_sign_of_cross_product(p1.x()-c.x(), + p1.y()-c.y(), + p1.z()-c.z(), + p2.x()-c.x(), + p2.y()-c.y(), + p2.z()-c.z()); + } + template inline bool