Karim Belabas on Mon, 12 Sep 2005 19:51:32 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: object-oriented graphic engine

* Bill Allombert [2005-08-26 14:18]:
> I would like to propose a rewrite of the graphic code in
> an object-oriented fashion to avoid duplication.
> This one follow more closely the RectObj code.
> and a function:
> void gen_rectdraw0(struct plot_eng *eng, void *data, long *w, long *x,
> long *y, long lw, double xs, double ys);
> The attached patch implement gen_rectdraw0 and use it for the X11
> display.
> Once this patch is accepted, we should use gen_rectdraw0 for the
> other graphic output.

After implementing PostScript and FLTK output using the proposed engine,
I committed your patch, with a few necessary modifications.

In particular, I included a PARI_plot * in your plot_eng struct, in order
not to depend on the global variable pari_plot_engine [ this breaks for
PostScript since the method refers to 2 different PARI_plot contexts ]

NB: the global variable pari_plot_engine and assorted macros are now only
used in plotgnuplot.c and should be removed.

I didn't update gnuplot and Qt since they don't work on my laptop, and I'd
have to reinstall them to test the result. They should be doable, if
slightly more complicated.

> A possible change would be to handle color using a new atom (set color)
> instead of hard-coding colors in each nodes.

I second that.

Thanks for the patch !

Karim Belabas                  Tel: (+33) (0)1 69 15 57 48
Universite Bordeaux 1          Fax: (+33) (0)1 69 15 60 19
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]