#ifndef CGAL_KERNEL_D_CARTESIAN_CONVERTER_H #define CGAL_KERNEL_D_CARTESIAN_CONVERTER_H #include #include #include #include #include #include #include #include namespace CGAL { template class CartesianD_converter { typedef typename K1::FT FT1; typedef typename K2::FT FT2; typedef NT_converter NTc; NTc c; // TODO: store a K1 and a K2 and have a suitable constructor public: Origin operator()(Origin const&o)const{return o;} Null_vector operator()(Null_vector const&v)const{return v;} FT2 operator()(FT1 const&x)const{return c(x);} //RT2 operator()(typename First_if_different::Type const&x)const{return cr(x);} template transforming_iterator,It>::type> operator()(It const& it)const { return make_transforming_iterator(it,c); } typename K2::Point operator()(typename K1::Point const& p){ typename K1::template Construct::type i; return K2::template Construct::type()(operator()(i.begin(p)),operator()(i.end(p))); } typename K2::Vector operator()(typename First_if_different::Type const& p){ typename K1::template Construct::type i; return K2::template Construct::type()(operator()(i.begin(p)),operator()(i.end(p))); } typename K2::Object_2 operator()(const typename K1::Object_2 &obj) const { #define CGAL_Kernel_obj(X) \ if (const typename K1::X * ptr = object_cast(&obj)) \ return make_object(operator()(*ptr)); #include /* if (const std::vector * ptr = object_cast >(&obj)) { std::vector res ( operator()(ptr->begin()), operator()(ptr->end()) ); return make_object(res); } */ CGAL_error_msg("Cartesiand_converter is unable to determine what is wrapped in the Object"); return Object(); } }; } //namespace CGAL #endif // CGAL_KERNEL_D_CARTESIAN_CONVERTER_H