X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=universe.cc;h=48d8efc288cd661a65b8264f32d377a9d160e0b0;hb=3e51d77116e49ba279a6cbbf1dbbc893c4117eb4;hp=8d8aa7157a7d58a542dab1de11cc4356f3d36dcf;hpb=ba46b057f3e2613a86f2dea7fa8022990482c735;p=universe.git diff --git a/universe.cc b/universe.cc index 8d8aa71..48d8efc 100644 --- a/universe.cc +++ b/universe.cc @@ -1,19 +1,8 @@ -//////////////////////////////////////////////////////////////////////////////// -// This program is free software; you can redistribute it and/or // -// modify it under the terms of the GNU General Public License // -// version 2 as published by the Free Software Foundation. // -// // -// This program is distributed in the hope that it will be useful, but // -// WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // -// General Public License for more details. // -// // -// Written and (C) by François Fleuret // -// Contact for comments & bug reports // -//////////////////////////////////////////////////////////////////////////////// - -// $Id: universe.cc,v 1.88 2007-06-16 13:51:54 fleuret Exp $ +// Written and (C) by Francois Fleuret +// Contact for comments & bug reports + +#include #include "universe.h" @@ -46,7 +35,7 @@ void Universe::add_polygon(Polygon *p) { } _polygons[_nb_polygons++] = p; } else { - cerr << "To many polygons!" << endl; + cerr << "Too many polygons!" << endl; exit(1); } } @@ -127,17 +116,17 @@ Polygon *Universe::pick_polygon(scalar_t x, scalar_t y) { return 0; } -void Universe::print_fig(ostream &os) { - os << "#FIG 3.2" << endl; - os << "Portrait" << endl; - os << "Center" << endl; - os << "Metric" << endl; - os << "A4 " << endl; - os << "100.00" << endl; - os << "Single" << endl; - os << "-2" << endl; - os << "1200 2" << endl; - for(int n = 0; n < _nb_polygons; n++) if(_polygons[n]) _polygons[n]->print_fig(os); +void Universe::print_xfig(XFigTracer *tracer) { + for(int n = 0; n < _nb_polygons; n++) { + if(_polygons[n]) { + _polygons[n]->color_xfig(tracer); + } + } + for(int n = 0; n < _nb_polygons; n++) { + if(_polygons[n]) { + _polygons[n]->print_xfig(tracer); + } + } } void Universe::draw(SimpleWindow *window) {