#ifndef CGAL_KD_KO_CONVERTER_H #define CGAL_KD_KO_CONVERTER_H #include #include // First_if_different namespace CGAL { template struct KO_converter; //TODO: It would probably be better if this was a Misc Functor in K1. template struct KO_converter{ typedef typename K1::template Type::type argument_type; typedef typename K2::template Type::type result_type; template result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const { typename K1::template Functor::type i(k1); typename K2::template Functor >::type cp(k2); return cp(conv(i(p,Begin_tag())),conv(i(p,End_tag()))); } }; template struct KO_converter{ typedef typename K1::template Type::type K1_Vector; typedef typename K1::template Type< Point_tag>::type K1_Point; // can't use vector without at least a placeholder point because of this typedef typename First_if_different::Type argument_type; typedef typename K2::template Type::type result_type; template result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& v) const { typename K1::template Functor::type i(k1); typename K2::template Functor >::type cp(k2); return cp(conv(i(v,Begin_tag())),conv(i(v,End_tag()))); } }; template struct KO_converter{ typedef typename K1::template Type::type argument_type; typedef typename K2::template Type::type result_type; template result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& s) const { typename K1::template Functor::type f(k1); typename K2::template Functor >::type cs(k2); return cs(conv(f(s,0)),conv(f(s,1))); } }; } #endif