Continue with Wrapper

This commit is contained in:
Marc Glisse 2011-05-13 16:05:15 +00:00
parent 9ec30b773c
commit a873c26099
8 changed files with 468 additions and 35 deletions

View File

@ -2,6 +2,7 @@
#define CGAL_KERNEL_D_CARTESIAN_LA_BASE_H #define CGAL_KERNEL_D_CARTESIAN_LA_BASE_H
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Origin.h>
#include <CGAL/representation_tags.h> #include <CGAL/representation_tags.h>
#include <CGAL/functor_tags.h> #include <CGAL/functor_tags.h>
@ -20,6 +21,7 @@ template < typename FT_, typename Dim_>
struct Cartesian_LA_base_d : public Dimension_base<Dim_> struct Cartesian_LA_base_d : public Dimension_base<Dim_>
{ {
typedef FT_ FT; typedef FT_ FT;
typedef FT_ RT;
typedef Cartesian_LA_base_d<FT_,Dim_> Self; typedef Cartesian_LA_base_d<FT_,Dim_> Self;
typedef Cartesian_tag Rep_tag; typedef Cartesian_tag Rep_tag;
typedef Cartesian_tag Kernel_tag; typedef Cartesian_tag Kernel_tag;
@ -74,10 +76,10 @@ struct Cartesian_LA_base_d : public Dimension_base<Dim_>
typedef Null_functor type; typedef Null_functor type;
}; };
template<int i> struct Construct<Construct_vector_tag,i> { template<int i> struct Construct<Construct_vector_tag,i> {
typedef CartesianDVectorBase::Construct_LA_vector<Self> type; typedef CartesianDVectorBase::Construct_LA_vector<Self,Null_vector> type;
}; };
template<int i> struct Construct<Construct_point_tag,i> { template<int i> struct Construct<Construct_point_tag,i> {
typedef CartesianDVectorBase::Construct_LA_vector<Self> type; typedef CartesianDVectorBase::Construct_LA_vector<Self,Origin> type;
}; };
template<int i> struct Construct<Construct_point_cartesian_const_iterator_tag,i> { template<int i> struct Construct<Construct_point_cartesian_const_iterator_tag,i> {
typedef CartesianDVectorBase::Construct_cartesian_const_iterator<Self> type; typedef CartesianDVectorBase::Construct_cartesian_const_iterator<Self> type;

View File

@ -30,7 +30,7 @@ BOOST_PP_REPEAT_FROM_TO(2, 11, CODE, _ )
} }
#endif #endif
template<class R_> struct Construct_LA_vector template<class R_,class Zero_> struct Construct_LA_vector
#ifndef CGAL_CXX0X #ifndef CGAL_CXX0X
: internal::Construct_LA_vector_<R_,R_::Default_ambient_dimension::value> : internal::Construct_LA_vector_<R_,R_::Default_ambient_dimension::value>
#endif #endif
@ -48,6 +48,9 @@ template<class R_> struct Construct_LA_vector
result_type operator()()const{ result_type operator()()const{
return typename Constructor::Dimension()(dim); return typename Constructor::Dimension()(dim);
} }
result_type operator()(Zero_ const&)const{
return typename Constructor::Dimension()(dim);
}
result_type operator()(result_type const& v)const{ result_type operator()(result_type const& v)const{
return v; return v;
} }
@ -109,7 +112,9 @@ template<class R_> struct Compute_cartesian_coordinate {
#ifdef CGAL_CXX0X #ifdef CGAL_CXX0X
typedef decltype(std::declval<const first_argument_type>()[0]) result_type; typedef decltype(std::declval<const first_argument_type>()[0]) result_type;
#else #else
typedef FT result_type; // FT const& doesn't work with some LA typedef FT const& result_type;
// FT const& doesn't work with some LA (Eigen2 for instance) so we
// should use plain FT or find a way to detect this.
#endif #endif
result_type operator()(first_argument_type const& v,int i)const{ result_type operator()(first_argument_type const& v,int i)const{

View File

@ -0,0 +1,54 @@
#ifndef CGAL_KERNEL_D_CARTESIAN_WRAP_H
#define CGAL_KERNEL_D_CARTESIAN_WRAP_H
#include <CGAL/basic.h>
#include <CGAL/Kernel_d/Wrapper/Point_d.h>
#include <CGAL/Kernel_d/Wrapper/Vector_d.h>
#include <CGAL/Kernel_d/Wrapper/Segment_d.h>
namespace CGAL {
template < typename Base_ >
struct Cartesian_wrap : public Base_
{
CGAL_CONSTEXPR Cartesian_wrap(){}
CGAL_CONSTEXPR Cartesian_wrap(int d):Base_(d){}
typedef Base_ Kernel_base;
typedef Cartesian_wrap Self;
template <class T,bool=false> struct map_type;
#define CGAL_Kernel_obj(X) typedef X##_d<Cartesian_wrap> X; \
template<bool b> struct map_type<X##_tag,b> { typedef X type; };
#include <CGAL/Kernel_d/interface_macros.h>
//TODO: adapt all functors
//TODO: safely apply .rep() to the arguments (and transforming_iterator)
template<class T,int i=0> struct Construct {
typedef typename Kernel_base::template Construct<T>::type B;
struct type {
typedef typename map_result_tag<T>::type result_tag;
typedef typename map_kernel_obj<Self,result_tag>::type result_type;
#ifdef CGAL_CXX0X
template<class...U> result_type operator()(U&&...u)const{
return result_type(Eval_functor(),B(),std::forward<U>(u)...);
}
#else
#define CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> result_type \
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
return result_type(Eval_functor(),B(),BOOST_PP_ENUM_PARAMS(N,u)); \
}
BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_)
#endif
};
};
template<int i> struct Construct<Construct_point_cartesian_const_iterator_tag,i> {
typedef typename Kernel_base::template Construct<Construct_point_cartesian_const_iterator_tag>::type type;
};
template<int i> struct Construct<Construct_vector_cartesian_const_iterator_tag,i> {
typedef typename Kernel_base::template Construct<Construct_vector_cartesian_const_iterator_tag>::type type;
};
};
} //namespace CGAL
#endif // CGAL_KERNEL_D_CARTESIAN_WRAP_H

View File

@ -0,0 +1,245 @@
#ifndef CGAL_WRAPPER_POINT_D_H
#define CGAL_WRAPPER_POINT_D_H
#include <CGAL/Origin.h>
#include <CGAL/Kernel/mpl.h>
#include <CGAL/representation_tags.h>
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <CGAL/Kernel/Return_base_tag.h>
#include <CGAL/Dimension.h>
#ifndef CGAL_CXX0X
#include <boost/preprocessor/repetition.hpp>
#endif
#include <boost/utility/result_of.hpp>
namespace CGAL {
template <class R_>
class Point_d : public R_::Kernel_base::Point
{
typedef typename R_::RT RT_;
typedef typename R_::FT FT_;
typedef typename R_::Kernel_base Kbase;
typedef typename R_::Vector Vector_;
typedef typename Kbase::template Construct<Construct_point_tag>::type CPBase;
typedef typename Kbase::template Compute<Compute_cartesian_coordinate_tag>::type CCBase;
typedef Point_d Self;
BOOST_STATIC_ASSERT((boost::is_same<Self, typename R_::Point>::value));
public:
typedef typename R_::Default_ambient_dimension Ambient_dimension;
typedef Dimension_tag<0> Feature_dimension;
typedef typename R_::Point_cartesian_const_iterator Cartesian_const_iterator;
typedef typename Kbase::Point Rep;
const Rep& rep() const
{
return *this;
}
Rep& rep()
{
return *this;
}
typedef R_ R;
#ifdef CGAL_CXX0X
template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Point_d> >::value>::type> explicit Point_d(U&&...u)
: Rep(CPBase()(std::forward<U>(u)...)){}
// // called from Construct_point_d
// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
// : Rep(Eval_functor(), std::forward<U>(u)...){}
template<class F,class...U> explicit Point_d(Eval_functor&&,F&&f,U&&...u)
: Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
#if 0
// the new standard may make this necessary
Point_d(Point_d const&)=default;
Point_d(Point_d &);//=default;
Point_d(Point_d &&)=default;
#endif
// try not to use these
Point_d(Rep const& v) : Rep(v) {}
Point_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
Point_d(Rep&& v) : Rep(std::move(v)) {}
// this one should be implicit
Point_d(Origin const& v)
: Rep(CPBase()(v)) {}
Point_d(Origin& v)
: Rep(CPBase()(v)) {}
Point_d(Origin&& v)
: Rep(CPBase()(std::move(v))) {}
#else
Point_d() : Rep(CPBase()()) {}
Point_d(Rep const& v) : Rep(v) {} // try not to use it
#define CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
explicit Point_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(CPBase()( \
BOOST_PP_ENUM_PARAMS(N,t))) {} \
\
template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
Point_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
/*
template<BOOST_PP_ENUM_PARAMS(N,class T)> \
Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
*/
BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_)
#undef CODE
// this one should be implicit
Point_d(Null_vector const& v)
: Rep(CPBase()(v)) {}
#endif
typename boost::result_of<CCBase(Rep,int)>::type cartesian(int i)const{
return CCBase()(rep(),i);
}
/*
Direction_d direction() const
{
return R().construct_direction_d_object()(*this);
}
Vector_d transform(const Aff_transformation_d &t) const
{
return t.transform(*this);
}
Vector_d operator/(const RT& c) const
{
return R().construct_divided_vector_d_object()(*this,c);
}
Vector_d operator/(const typename First_if_different<FT_,RT>::Type & c) const
{
return R().construct_divided_vector_d_object()(*this,c);
}
typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
x() const
{
return R().compute_x_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_y_3, Vector_3>::type
y() const
{
return R().compute_y_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_z_3, Vector_3>::type
z() const
{
return R().compute_z_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_hx_3, Vector_3>::type
hx() const
{
return R().compute_hx_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_hy_3, Vector_3>::type
hy() const
{
return R().compute_hy_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_hz_3, Vector_3>::type
hz() const
{
return R().compute_hz_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
hw() const
{
return R().compute_hw_3_object()(*this);
}
typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
cartesian(int i) const
{
CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) );
if (i==0) return x();
if (i==1) return y();
return z();
}
typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
homogeneous(int i) const
{
CGAL_kernel_precondition( (i >= 0) || (i <= 3) );
if (i==0) return hx();
if (i==1) return hy();
if (i==2) return hz();
return hw();
}
int dimension() const // bad idea?
{
return rep.dimension();
}
typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
operator[](int i) const
{
return cartesian(i);
}
Cartesian_const_iterator cartesian_begin() const
{
return typename R::Construct_cartesian_const_iterator_3()(*this);
}
Cartesian_const_iterator cartesian_end() const
{
return typename R::Construct_cartesian_const_iterator_3()(*this,3);
}
typename Qualified_result_of<typename R::Compute_squared_length_3, Vector_3>::type
squared_length() const
{
return R().compute_squared_length_3_object()(*this);
}
*/
};
#if 0
template <class R_> Point_d<R_>::Point_d(Point_d &)=default;
#endif
//TODO: IO
//template <class R_>
//Vector_d<R_> operator+(const Vector_d<R_>& v,const Vector_d<R_>& w) const
//{
// return typename R::template Construct<Construct_sum_of_vectors_tag>::type()(v,w);
//}
//
//template <class R_>
//Vector_d<R_> operator-(const Vector_d<R_>& v,const Vector_d<R_>& w) const
//{
// return typename R::template Construct<Construct_difference_of_vectors_tag>::type()(v,w);
//}
} //namespace CGAL
#endif // CGAL_WRAPPER_POINT_D_H

View File

@ -0,0 +1,111 @@
#ifndef CGAL_WRAPPER_SEGMENT_D_H
#define CGAL_WRAPPER_SEGMENT_D_H
#include <CGAL/Origin.h>
#include <CGAL/Kernel/mpl.h>
#include <CGAL/representation_tags.h>
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <CGAL/Kernel/Return_base_tag.h>
#include <CGAL/Dimension.h>
#ifndef CGAL_CXX0X
#include <boost/preprocessor/repetition.hpp>
#endif
#include <boost/utility/result_of.hpp>
namespace CGAL {
template <class R_>
class Segment_d : public R_::Kernel_base::Segment
{
typedef typename R_::RT RT_;
typedef typename R_::FT FT_;
typedef typename R_::Kernel_base Kbase;
typedef typename R_::Point Point_;
typedef typename Kbase::template Construct<Construct_point_tag>::type CPBase;
typedef typename Kbase::template Construct<Construct_segment_tag>::type CSBase;
typedef typename Kbase::template Construct<Construct_segment_extremity_tag>::type CSEBase;
typedef Segment_d Self;
BOOST_STATIC_ASSERT((boost::is_same<Self, typename R_::Segment>::value));
public:
typedef typename R_::Default_ambient_dimension Ambient_dimension;
typedef Dimension_tag<1> Feature_dimension;
typedef typename Kbase::Segment Rep;
const Rep& rep() const
{
return *this;
}
Rep& rep()
{
return *this;
}
typedef R_ R;
#ifdef CGAL_CXX0X
template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Segment_d> >::value>::type> explicit Segment_d(U&&...u)
: Rep(CSBase()(std::forward<U>(u)...)){}
// // called from Construct_point_d
// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
// : Rep(Eval_functor(), std::forward<U>(u)...){}
template<class F,class...U> explicit Segment_d(Eval_functor&&,F&&f,U&&...u)
: Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
#if 0
// the new standard may make this necessary
Point_d(Point_d const&)=default;
Point_d(Point_d &);//=default;
Point_d(Point_d &&)=default;
#endif
// try not to use these
Segment_d(Rep const& v) : Rep(v) {}
Segment_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
Segment_d(Rep&& v) : Rep(std::move(v)) {}
#else
Segment_d() : Rep(CSBase()()) {}
Segment_d(Rep const& v) : Rep(v) {} // try not to use it
#define CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
explicit Segment_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(CSBase()( \
BOOST_PP_ENUM_PARAMS(N,t))) {} \
\
template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
Segment_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
/*
template<BOOST_PP_ENUM_PARAMS(N,class T)> \
Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
*/
BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_)
#undef CODE
#endif
//TODO: if CSEBase returns a reference to a base point, cast it to a
//reference to a wrapper point. Ugly but should be safe.
Point_ source()const{
return Point_(Eval_functor(),CSEBase(),rep(),0);
}
Point_ target()const{
return Point_(Eval_functor(),CSEBase(),rep(),1);
}
};
} //namespace CGAL
#endif // CGAL_WRAPPER_SEGMENT_D_H

View File

@ -92,9 +92,11 @@ public:
template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \ template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
Vector_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \ Vector_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {} : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
// template<BOOST_PP_ENUM_PARAMS(N,class T)> \ /*
// Vector_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \ template<BOOST_PP_ENUM_PARAMS(N,class T)> \
// : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {} Vector_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
: Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
*/
BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_) BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_)
#undef CODE #undef CODE
@ -231,15 +233,15 @@ template <class R_> Vector_d<R_>::Vector_d(Vector_d &)=default;
//TODO: IO //TODO: IO
template <class R_> template <class R_>
Vector_d<R_> operator+(const Vector_d<R_>& v,const Vector_d<R_>& w) const Vector_d<R_> operator+(const Vector_d<R_>& v,const Vector_d<R_>& w)
{ {
return typename R::template Construct<Construct_sum_of_vectors_tag>::type()(v,w); return typename R_::template Construct<Construct_sum_of_vectors_tag>::type()(v,w);
} }
template <class R_> template <class R_>
Vector_d<R_> operator-(const Vector_d<R_>& v,const Vector_d<R_>& w) const Vector_d<R_> operator-(const Vector_d<R_>& v,const Vector_d<R_>& w)
{ {
return typename R::template Construct<Construct_difference_of_vectors_tag>::type()(v,w); return typename R_::template Construct<Construct_difference_of_vectors_tag>::type()(v,w);
} }
} //namespace CGAL } //namespace CGAL

View File

@ -3,28 +3,36 @@
namespace CGAL { namespace CGAL {
class Null_type {~Null_type();}; // no such object should be created class Null_type {~Null_type();}; // no such object should be created
struct Vector_tag {}; template<class,class>struct map_kernel_obj{typedef Null_type type;};
struct Point_tag {}; #define DECL_OBJ(X) struct X##_tag {}; \
struct Segment_tag {}; template<class K>struct map_kernel_obj<K,X##_tag>{typedef typename K::X type;}
struct Line_tag {}; DECL_OBJ(Vector);
struct Direction_tag {}; DECL_OBJ(Point);
struct Ray_tag {}; DECL_OBJ(Segment);
struct Bbox_tag {}; DECL_OBJ(Line);
DECL_OBJ(Direction);
DECL_OBJ(Ray);
DECL_OBJ(Bbox);
#undef DECL_OBJ
struct Construct_vector_tag {};
struct Construct_point_tag {};
struct Construct_segment_tag {};
struct Construct_line_tag {};
struct Construct_direction_tag {};
struct Construct_ray_tag {};
//struct Construct_cartesian_const_iterator_tag {};
struct Construct_point_cartesian_const_iterator_tag {}; struct Construct_point_cartesian_const_iterator_tag {};
struct Construct_vector_cartesian_const_iterator_tag {}; struct Construct_vector_cartesian_const_iterator_tag {};
struct Construct_midpoint_tag {};
struct Construct_segment_extremity_tag {}; template<class T>struct map_result_tag{typedef Null_type type;};
struct Construct_sum_of_vectors_tag {}; #define DECL_CONSTRUCT(X,Y) struct X##_tag {}; \
struct Construct_difference_of_vectors_tag {}; template<>struct map_result_tag<X##_tag>{typedef Y##_tag type;}
struct Construct_opposite_vector_tag {}; DECL_CONSTRUCT(Construct_vector,Vector);
DECL_CONSTRUCT(Construct_point,Point);
DECL_CONSTRUCT(Construct_segment,Segment);
DECL_CONSTRUCT(Construct_line,Line);
DECL_CONSTRUCT(Construct_direction,Direction);
DECL_CONSTRUCT(Construct_ray,Ray);
DECL_CONSTRUCT(Construct_midpoint,Point);
DECL_CONSTRUCT(Construct_segment_extremity,Point);
DECL_CONSTRUCT(Construct_sum_of_vectors,Vector);
DECL_CONSTRUCT(Construct_difference_of_vectors,Vector);
DECL_CONSTRUCT(Construct_opposite_vector,Vector);
#undef DECL_CONSTRUCT
struct Compute_cartesian_coordinate_tag {}; struct Compute_cartesian_coordinate_tag {};
struct Compute_homogeneous_coordinate_tag {}; struct Compute_homogeneous_coordinate_tag {};

View File

@ -4,6 +4,7 @@
#include <CGAL/Kernel_d/Cartesian_filter_NT.h> #include <CGAL/Kernel_d/Cartesian_filter_NT.h>
#include <CGAL/Kernel_d/Cartesian_filter_K.h> #include <CGAL/Kernel_d/Cartesian_filter_K.h>
#include <CGAL/Kernel_d/Lazy_cartesian.h> #include <CGAL/Kernel_d/Lazy_cartesian.h>
#include <CGAL/Kernel_d/Wrapper/Cartesian_wrap.h>
#include <CGAL/Gmpq.h> #include <CGAL/Gmpq.h>
#include <CGAL/Interval_nt.h> #include <CGAL/Interval_nt.h>
#include <iostream> #include <iostream>
@ -11,13 +12,18 @@ typedef CGAL::Cartesian_base_d<double,CGAL::Dimension_tag<2> > K0;
typedef CGAL::Cartesian_base_d<CGAL::Interval_nt_advanced,CGAL::Dimension_tag<2> > KA; typedef CGAL::Cartesian_base_d<CGAL::Interval_nt_advanced,CGAL::Dimension_tag<2> > KA;
typedef CGAL::Cartesian_base_d<CGAL::Gmpq,CGAL::Dimension_tag<2> > KE; typedef CGAL::Cartesian_base_d<CGAL::Gmpq,CGAL::Dimension_tag<2> > KE;
#if 0 #if 0
typedef K0 K1; typedef K0 K2;
#elif 0 #elif 0
typedef CGAL::Cartesian_filter_NT<K0> K1; typedef CGAL::Cartesian_filter_NT<K0> K2;
#elif 0
typedef CGAL::Cartesian_filter_K<K0,KA,KE> K1;
#elif 1 #elif 1
struct K1: CGAL::Lazy_cartesian<KE,KA,CGAL::CartesianD_converter<KE,KA>,K1>{}; typedef CGAL::Cartesian_filter_K<K0,KA,KE> K2;
#elif 1
struct K2: CGAL::Lazy_cartesian<KE,KA,CGAL::CartesianD_converter<KE,KA>,K2>{};
#endif
#if 1
typedef K2 K1;
#elif 1
typedef CGAL::Cartesian_wrap<K2> K1;
#endif #endif
typedef K1::Point P; typedef K1::Point P;
typedef K1::Vector V; typedef K1::Vector V;