Have squared_distance(Point_3, Point_3) call its functor.

This commit is contained in:
Sylvain Pion
2006-08-04 12:41:56 +00:00
parent c7f1f68b40
commit fcbacc1284
2 changed files with 13 additions and 7 deletions
@@ -212,7 +212,8 @@ namespace CommonKernelFunctors {
template <typename K>
class Compute_squared_distance_3
{
typedef typename K::FT FT;
typedef typename K::FT FT;
typedef typename K::Point_3 Point_3;
public:
typedef FT result_type;
typedef Arity_tag< 2 > Arity;
@@ -222,6 +223,14 @@ namespace CommonKernelFunctors {
FT
operator()( const T1& t1, const T2& t2) const
{ return CGALi::squared_distance(t1, t2, K()); }
FT
operator()( const Point_3& pt1, const Point_3& pt2) const
{
typedef typename K::Vector_3 Vector_3;
Vector_3 vec = pt2 - pt1;
return vec*vec;
}
};
template <typename K>