From 6c4cd29fb1a4bc6beaceb4de93c511b61c30a5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 9 Oct 2014 10:27:39 +0200 Subject: [PATCH] bug fix in projection traits, Angle_3 != Angle_2 when z is taken into account --- .../CGAL/internal/Projection_traits_3.h | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/internal/Projection_traits_3.h index 54aec350bef..f1ad42789ca 100644 --- a/Kernel_23/include/CGAL/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/internal/Projection_traits_3.h @@ -408,6 +408,25 @@ public: } }; +template +struct Angle_projected_3{ + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + CGAL::Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r) const + { + return CGAL::angle(project(p), project(q), project(r)); + } +}; + template < class R, int dim > class Projection_traits_3 { public: @@ -425,7 +444,7 @@ public: typedef typename Projector::Compare_x_2 Compare_x_2; typedef typename Projector::Compare_y_2 Compare_y_2; typedef Orientation_projected_3 Orientation_2; - typedef typename Rp::Angle_3 Angle_2; + typedef Angle_projected_3 Angle_2; typedef Side_of_oriented_circle_projected_3 Side_of_oriented_circle_2; typedef Less_signed_distance_to_line_projected_3 Less_signed_distance_to_line_2; typedef Side_of_bounded_circle_projected_3 Side_of_bounded_circle_2;