Cleaned up a bit. SimpleWindow now embed the cairo fields to allow proper deallocatio...
[universe.git] / polygon.h
index d7caa9d..46eda3e 100644 (file)
--- a/polygon.h
+++ b/polygon.h
@@ -1,23 +1,17 @@
 
 
-////////////////////////////////////////////////////////////////////////////////
-// 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 <francois.fleuret@epfl.ch> for comments & bug reports              //
-////////////////////////////////////////////////////////////////////////////////
+// Written and (C) by Francois Fleuret
+// Contact <francois.fleuret@idiap.ch> for comments & bug reports
 
 #ifndef POLYGON_H
 #define POLYGON_H
 
 #include "misc.h"
 #include "simple_window.h"
 
 #ifndef POLYGON_H
 #define POLYGON_H
 
 #include "misc.h"
 #include "simple_window.h"
+#include "xfig_tracer.h"
+
+#ifdef CAIRO_SUPPORT
+#include <cairo.h>
+#endif
 
 class Polygon {
   struct Triangle {
 
 class Polygon {
   struct Triangle {
@@ -76,9 +70,17 @@ public:
 
   Polygon *clone();
 
 
   Polygon *clone();
 
-  void print_fig(ostream &os);
+  void color_xfig(XFigTracer *tracer);
+  void print_xfig(XFigTracer *tracer);
+
   void draw(SimpleWindow *window);
   void draw_contours(SimpleWindow *window);
   void draw(SimpleWindow *window);
   void draw_contours(SimpleWindow *window);
+
+#ifdef CAIRO_SUPPORT
+  void draw(cairo_t* context_resource);
+  void draw_contours(cairo_t* context_resource);
+#endif
+
   void set_vertex(int k, scalar_t x, scalar_t y);
   void set_position(scalar_t center_x, scalar_t center_y, scalar_t theta);
   void set_speed(scalar_t dcenter_x, scalar_t dcenter_y, scalar_t dtheta);
   void set_vertex(int k, scalar_t x, scalar_t y);
   void set_position(scalar_t center_x, scalar_t center_y, scalar_t theta);
   void set_speed(scalar_t dcenter_x, scalar_t dcenter_y, scalar_t dtheta);