#include #include "R2Contour.h" static void printVertices( std::ostream& s, const std::vector& vertices ); std::ostream& operator<<(std::ostream& s, const R2Polyline& l) { s << "R2Polyline(" << std::endl; printVertices(s, static_cast&>(l)); return s; } std::ostream& operator<<(std::ostream& s, const R2Contour& c) { s << "R2Contour(" << std::endl; printVertices(s, static_cast&>(c)); return s; } static void printVertices( std::ostream& s, const std::vector& vertices ) { for (size_t i = 0; i < vertices.size(); ++i) { if (i == 0) { s << " "; } else if (i%5 == 0) { s << "," << std::endl << " "; } else { s << ", "; } s << vertices[i]; } s << std::endl << ")" << std::endl; }