#include <cmath>
#include "misc.h"
+#include "canvas.h"
#include "polygon.h"
#ifdef X11_SUPPORT
#include "simple_window.h"
#endif
-#ifdef CAIRO_SUPPORT
-#include <cairo.h>
-#endif
-
using namespace std;
class Universe {
- scalar_t _xmax, _ymax;
+ scalar_t _width, _height;
public:
int _nb_max_polygons, _nb_polygons;
Polygon **_polygons;
- inline scalar_t width() { return _xmax; }
- inline scalar_t height() { return _ymax; }
+ inline scalar_t width() { return _width; }
+ inline scalar_t height() { return _height; }
- Universe(int nb_max_polygons, scalar_t xmax, scalar_t ymax);
+ Universe(int nb_max_polygons, scalar_t width, scalar_t height);
// The destructor deletes all the added polygons
~Universe();
- void initialize(Polygon *p);
+ void initialize_polygon(Polygon *p);
void clear();
void add_polygon(Polygon *p);
bool collide(Polygon *p);
Polygon *pick_polygon(scalar_t x, scalar_t y);
+#ifdef XFIG_SUPPORT
void print_xfig(XFigTracer *tracer);
+#endif
#ifdef X11_SUPPORT
void draw(SimpleWindow *window);
#endif
-#ifdef CAIRO_SUPPORT
- void draw(cairo_t *context_resource);
-#endif
+ void draw(Canvas *canvas);
};
#endif