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);
+ }
+ }
}
+#ifdef X11_SUPPORT
void Universe::draw(SimpleWindow *window) {
- for(int n = 0; n < _nb_polygons; n++) if(_polygons[n]) _polygons[n]->draw(window);
- for(int n = 0; n < _nb_polygons; n++) if(_polygons[n]) _polygons[n]->draw_contours(window);
+ for(int n = 0; n < _nb_polygons; n++) {
+ if(_polygons[n]) {
+ _polygons[n]->draw(window);
+ }
+ }
+
+ for(int n = 0; n < _nb_polygons; n++) {
+ if(_polygons[n]) {
+ _polygons[n]->draw_contours(window);
+ }
+ }
+}
+#endif
+
+#ifdef CAIRO_SUPPORT
+void Universe::draw(cairo_t *context_resource) {
+ for(int n = 0; n < _nb_polygons; n++) {
+ if(_polygons[n]) {
+ _polygons[n]->draw(context_resource);
+ }
+ }
+
+ for(int n = 0; n < _nb_polygons; n++) {
+ if(_polygons[n]) {
+ _polygons[n]->draw_contours(context_resource);
+ }
+ }
}
+#endif
void Universe::apply_collision_forces(scalar_t dt) {
const int nb_axis = 2;