Add operators for segment and triangle types in Construct_projected_point_3

the original implementation comes from the AABB-tree package
This commit is contained in:
Sébastien Loriot
2016-09-01 16:04:55 +02:00
parent 641d5d51ef
commit c751ab4310
7 changed files with 152 additions and 216 deletions
@@ -29,6 +29,8 @@
#include <CGAL/Cartesian/function_objects.h>
#include <CGAL/Kernel/Return_base_tag.h>
#include <CGAL/predicates/sign_of_determinant.h>
#include <CGAL/Kernel/nearest_point_segment_3.h>
#include <CGAL/Kernel/nearest_point_triangle_3.h>
namespace CGAL {
@@ -3151,6 +3153,8 @@ namespace HomogeneousKernelFunctors {
typedef typename K::Plane_3 Plane_3;
typedef typename K::Line_3 Line_3;
typedef typename K::Vector_3 Vector_3;
typedef typename K::Triangle_3 Triangle_3;
typedef typename K::Segment_3 Segment_3;
public:
typedef Point_3 result_type;
@@ -3179,6 +3183,14 @@ namespace HomogeneousKernelFunctors {
Point_3
operator()( const Plane_3& h, const Point_3& p ) const
{ return h.rep().projection(p); }
Point_3
operator()( const Triangle_3& t, const Point_3& p ) const
{ return internal::nearest_point_3(p,t,K()); }
Point_3
operator()( const Segment_3& s, const Point_3& p ) const
{ return internal::nearest_point_3(p,s,K()); }
};
template <class K>