From 6a27761f4fae07fcfd9f2e98fa868c3f09e84a5f Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Sat, 13 Mar 2021 16:52:11 +0000 Subject: [PATCH] Add homogeneous/cartesian specialisations --- Nef_3/include/CGAL/Nef_3/bounded_side_3.h | 43 +++++++++++++++++++---- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/bounded_side_3.h b/Nef_3/include/CGAL/Nef_3/bounded_side_3.h index a20ac42f9488..a34ed350fd47 100644 --- a/Nef_3/include/CGAL/Nef_3/bounded_side_3.h +++ b/Nef_3/include/CGAL/Nef_3/bounded_side_3.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #undef CGAL_NEF_DEBUG @@ -30,20 +31,50 @@ namespace CGAL { template -Point_2 point_3_get_x_y_point_2(const Point_3& p) { +Point_2 point_3_get_x_y_point_2(const Point_3& p, const Homogeneous_tag&) { return( Point_2(p.hx(), p.hy(), p.hw()) ); } template -Point_2 point_3_get_y_z_point_2(const Point_3& p) { +Point_2 point_3_get_y_z_point_2(const Point_3& p, const Homogeneous_tag&) { return( Point_2(p.hy(), p.hz(), p.hw()) ); } template -Point_2 point_3_get_z_x_point_2(const Point_3& p) { +Point_2 point_3_get_z_x_point_2(const Point_3& p, const Homogeneous_tag&) { return( Point_2(p.hz(), p.hx(), p.hw()) ); } +template +Point_2 point_3_get_x_y_point_2(const Point_3& p, const Cartesian_tag&) { + return( Point_2(p.x(), p.y()) ); +} + +template +Point_2 point_3_get_y_z_point_2(const Point_3& p, const Cartesian_tag&) { + return( Point_2(p.y(), p.z()) ); +} + +template +Point_2 point_3_get_z_x_point_2(const Point_3& p, const Cartesian_tag&) { + return( Point_2(p.z(), p.x()) ); +} + +template +Point_2 point_3_get_x_y_point_2(const Point_3& p) { + return point_3_get_x_y_point_2(p,typename R::Kernel_tag()); +} + +template +Point_2 point_3_get_y_z_point_2(const Point_3& p) { + return point_3_get_y_z_point_2(p,typename R::Kernel_tag()); +} + +template +Point_2 point_3_get_z_x_point_2(const Point_3& p) { + return point_3_get_z_x_point_2(p,typename R::Kernel_tag()); +} + template Bounded_side bounded_side_3(IteratorForward first, IteratorForward last, @@ -87,11 +118,11 @@ Bounded_side bounded_side_3(IteratorForward first, Point_2 (*t)(const Point_3&); if(dir == 0){ - t = &point_3_get_y_z_point_2< Point_2, Point_3>; + t = &point_3_get_y_z_point_2< Point_2, Point_3, R>; }else if(dir == 1){ - t = &point_3_get_z_x_point_2< Point_2, Point_3>; + t = &point_3_get_z_x_point_2< Point_2, Point_3, R>; }else{ - t = &point_3_get_x_y_point_2< Point_2, Point_3>; + t = &point_3_get_x_y_point_2< Point_2, Point_3, R>; } std::vector< Point_2> points;