// ====================================================================== // // Copyright (c) 1997 The CGAL Consortium // // This software and related documentation is part of an INTERNAL release // of the Computational Geometry Algorithms Library (CGAL). It is not // intended for general use. // // ---------------------------------------------------------------------- // // release : // release_date : 1999, October 01 // // file : include/CGAL/bops_dcel_out.h // package : bops (2.2) // source : include/CGAL/bops_dcel_out.h // revision : $Revision$ // revision_date : $Date$ // author(s) : Wolfgang Freiseisen // // coordinator : RISC Linz // (Wolfgang Freiseisen ) // // // ====================================================================== #ifndef DCEL_OUT_H #define DCEL_OUT_H #include CGAL_BEGIN_NAMESPACE #ifdef CGAL__DCEL_DEFS_H std::ostream& operator<<(std::ostream& o, const _Dcel_Color& c) { o << int(c); return o; } #endif #ifdef CGAL__DCEL_VERTEX_H template std::ostream& operator<<(std::ostream& o, const _Dcel_vertex_type* e) { if( e != NULL ) o << 'v' << (*e).index(); else o << "nil"; return o; } #endif #ifdef CGAL__DCEL_FACE_H template std::ostream& operator<<(std::ostream& o, const _Dcel_face_type* e) { if( e != NULL ) o << 'f' << (*e).index(); else o << "nil"; return o; } #endif #ifdef CGAL__DCEL_EDGE_H template std::ostream& operator<<(std::ostream& o, const _Dcel_edge_type* e) { if( e != NULL ) o << '[' << (*e).index() << ']'; else o << "nil"; return o; } #endif #ifdef CGAL__DCEL_VERTEX_H template std::ostream& operator<<(std::ostream& o, const _Dcel_vertex_type& vertex) { o << "V(" << vertex.index() << ", d" << vertex.degree() << ", c" << vertex.color() << ", HV=" << vertex.header() << ", pt=" << vertex.point() << ')'; return o; } #endif #ifdef CGAL__DCEL_FACE_H template std::ostream& operator<<(std::ostream& o, const _Dcel_face_type& face) { o << "F(" << face.index() << ", c" << face.color() << ", HF=" << face.header() << ')'; return o; } #endif #ifdef CGAL__DCEL_EDGE_H template std::ostream& operator<<(std::ostream& o, const _Dcel_edge_type& edge) { #ifdef CGAL__DCEL_DEBUG_ON_ALL o << "{ c=" << edge.color() << ", "; if( edge.V1() == NULL ) o << "nil"; else o << (_Dcel_vertex_type)*(edge.V1()); o << ", "; if( edge.V2() == NULL ) o << "nil"; else o << (_Dcel_vertex_type)*(edge.V2()); o << ", "; if( edge.F1() == NULL ) o << "nil"; else o << (_Dcel_face_type)*(edge.F1()); o << ", "; if( edge.F2() == NULL ) o << "nil"; else o << (_Dcel_face_type)*(edge.F2()); o << ", " << edge.P1() << ", " << edge.P2(); o << '}'; #else o << "{ " << edge.index() << ": c" << edge.color() << ", " << edge.V1() << ", " << edge.V2() << ", " << edge.F1() << ", " << edge.F2() << ", " << edge.P1() << ", " << edge.P2() << '}'; #endif return o; } #endif template std::ostream& operator<<(std::ostream& o, std::pair p){ o << p.first << ' ' << p.second; return o; } template std::ostream& print( std::ostream& o, char* text, Iterator begin, Iterator end) { Iterator it; int i= 0; for( it= begin; it != end; it++ ) o << text << '[' << i++ << "]= " << *it << endl; return o; } CGAL_END_NAMESPACE #endif // DCEL_OUT_H