From 98b24e6fcb1fb2e45fbf9e1d453022847fd2da65 Mon Sep 17 00:00:00 2001 From: Eric Berberich Date: Mon, 17 Dec 2007 10:51:55 +0000 Subject: [PATCH] improved operator<< --- .../Curved_kernel_via_analysis_2/Point_2.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 0667a709844..e6f9d93ebbe 100755 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -116,6 +116,11 @@ class Point_2_rep // befriending the handle friend class Point_2; + + friend std::ostream& operator << <>( + std::ostream&, + const Point_2&); + }; //! \brief class defines a point on a generic curve @@ -372,10 +377,7 @@ std::ostream& operator <<(std::ostream& os, switch(::CGAL::get_mode(os)) { case ::CGAL::IO::PRETTY: os << "point@" << pt.id() << "("; - if(pt.location() != CGAL::ARR_BOTTOM_BOUNDARY && - pt.location() != CGAL::ARR_TOP_BOUNDARY) { - os << "sup@" << pt.curve().id(); - } + os << "sup@" << pt.curve().id(); os << " "; pt._dump_boundary_type(os); os << "; "; @@ -392,8 +394,7 @@ std::ostream& operator <<(std::ostream& os, os << ", "; if (pt.location() != CGAL::ARR_BOTTOM_BOUNDARY && pt.location() != CGAL::ARR_TOP_BOUNDARY) { - os << "y=n/a, "; // TODO give y-coordinate - os << "ARCNO=" << pt.arcno(); + os << "y=n/a"; // TODO give y-coordinate } else { if (pt.location() == CGAL::ARR_BOTTOM_BOUNDARY) { os << "y=-oo"; @@ -401,6 +402,12 @@ std::ostream& operator <<(std::ostream& os, os << "y=+oo"; } } + os << ", "; + if (pt.ptr()->_m_xy || pt.ptr()->_m_arc_rep != NULL) { + os << "ARCNO=" << pt.arcno(); + } else { + os << "VERT" << pt.arcno(); + } os << ")"; break; case ::CGAL::IO::BINARY: