diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index f206cb53971..4c8fb0134c3 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -148,6 +148,11 @@ public: return CPI()(rep(),End_tag()); } + int dimension() const { + typedef typename Get_functor::type PDBase; + return PDBase()(rep()); + } + /* Direction_d direction() const { @@ -230,27 +235,6 @@ public: return hw(); } - int dimension() const // bad idea? - { - return rep.dimension(); - } - - typename Qualified_result_of::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::type squared_length() const { @@ -267,18 +251,19 @@ template Point_d::Point_d(Point_d &)=default; template std::ostream& operator <<(std::ostream& os, const Point_d& p) { - std::vector coords; - typename R_::Cartesian_const_iterator_d + typedef typename R_::Kernel_base Kbase; + typedef typename Get_functor >::type CPI; + // Should just be "auto"... + typename CGAL::decay::Rep,Begin_tag) + >::type>::type b = p.cartesian_begin(), e = p.cartesian_end(); + os << p.dimension(); for(; b != e; ++b){ - coords.push_back(*b); + os << " " << *b; } - os << coords.size(); - for(std::size_t i=0; i < coords.size(); i++){ - os << " " << coords[i]; - } - return os << std::flush; + return os; } //template diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp index 11c2e3ff1ad..ddf5a165608 100644 --- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp +++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp @@ -12,6 +12,7 @@ #include #include #include +#include //typedef CGAL::Cartesian_base_d > K0; //typedef CGAL::Cartesian_base_d > KA; @@ -554,6 +555,10 @@ void test3(){ assert(ifsos(fozn, tz+0, tz+3, tz[4]) == CGAL::ON_NEGATIVE_SIDE); assert(ifsos(fozp, tz+0, tz+3, tz[5]) == CGAL::ON_NEGATIVE_SIDE); assert(ifsos(fozn, tz+0, tz+3, tz[5]) == CGAL::ON_POSITIVE_SIDE); + P showit=cp(1,2,4); + std::ostringstream output; + output << showit; + assert(output.str()=="3 1 2 4"); } template struct CGAL::Epick_d >; template struct CGAL::Epick_d >;