X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=polygon.cc;h=1b8b3629e3d2e15d65b3e9e3c321f12f4a16723f;hb=762714b0bd3e8db3e57ef1e29bcf2adfefe7e5a5;hp=6f980bd36be3d9b4438b62bf31dfe81044417e13;hpb=2e613b166590300fdc80bb324903ded4a0cb0403;p=universe.git diff --git a/polygon.cc b/polygon.cc index 6f980bd..1b8b362 100644 --- a/polygon.cc +++ b/polygon.cc @@ -47,12 +47,8 @@ Polygon *Polygon::clone() { return new Polygon(_mass, _red, _green, _blue, _relative_x, _relative_y, _nb_vertices); } -void Polygon::print_fig(ostream &os) { - os << "2 2 0 1 0 7 50 -1 20 0.000 0 0 -1 0 0 " << _nb_vertices + 1 << endl; - os << " "; - for(int n = 0; n < _nb_vertices; n++) os << " " << int(_x[n]*10) << " " << int(_y[n]*10); - os << " " << int(_x[0]*10) << " " << int(_y[0]*10); - os << endl; +void Polygon::print_fig(XFigTracer *tracer) { + tracer->draw_polygon(_nb_vertices, _x, _y); } void Polygon::draw(SimpleWindow *window) {