Skip to content

Commit

Permalink
Add homogeneous/cartesian specialisations
Browse files Browse the repository at this point in the history
  • Loading branch information
GilesBathgate committed Mar 13, 2021
1 parent 54b55e0 commit 6a27761
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions Nef_3/include/CGAL/Nef_3/bounded_side_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <CGAL/basic.h>
#include <CGAL/Polygon_2_algorithms.h>
#include <CGAL/Iterator_project.h>
#include <CGAL/representation_tags.h>
#include <vector>

#undef CGAL_NEF_DEBUG
Expand All @@ -30,20 +31,50 @@
namespace CGAL {

template <class Point_2, class Point_3>
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 <class Point_2, class Point_3>
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 <class Point_2, class Point_3>
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 <class Point_2, class Point_3>
Point_2 point_3_get_x_y_point_2(const Point_3& p, const Cartesian_tag&) {
return( Point_2(p.x(), p.y()) );
}

template <class Point_2, class Point_3>
Point_2 point_3_get_y_z_point_2(const Point_3& p, const Cartesian_tag&) {
return( Point_2(p.y(), p.z()) );
}

template <class Point_2, class Point_3>
Point_2 point_3_get_z_x_point_2(const Point_3& p, const Cartesian_tag&) {
return( Point_2(p.z(), p.x()) );
}

template <class Point_2, class Point_3, class R>
Point_2 point_3_get_x_y_point_2(const Point_3& p) {
return point_3_get_x_y_point_2<Point_2,Point_3>(p,typename R::Kernel_tag());
}

template <class Point_2, class Point_3, class R>
Point_2 point_3_get_y_z_point_2(const Point_3& p) {
return point_3_get_y_z_point_2<Point_2,Point_3>(p,typename R::Kernel_tag());
}

template <class Point_2, class Point_3, class R>
Point_2 point_3_get_z_x_point_2(const Point_3& p) {
return point_3_get_z_x_point_2<Point_2,Point_3>(p,typename R::Kernel_tag());
}

template <class IteratorForward, class R>
Bounded_side bounded_side_3(IteratorForward first,
IteratorForward last,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6a27761

Please sign in to comment.