From: Alan W. I. <ir...@be...> - 2004-02-12 00:48:26
|
On 2004-02-11 11:47-0000 Andrew Ross wrote: > > Just to update you, I've commited another patch to add a fill option to > the new plsarrow function. x22c.c now demostrate this too. There is also > now an equivalent C++ example x22.cc. A minor issue is the colours. For example, I believe red labels and box and yellow vectors on a black background would look better than the current red on black. The other issue is the API. The last time this was discussed on list, the definitive comment was Maurice's, I believe. ************* It would be a whole different API. Right now we have: void plarrows(PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy) I'd change this to input 2 quantities (Ax_ij, Ay_ij) using the usual function evaluator approach. I think a single function pointer but different client data for each is sufficient. I'd drop the dx,dy stuff and instead have it do a pre-pass to determine what the maximum vector length should be so that vectors don't overlap, taking into account possible coordinate transformations. Then the internal entry point would look something like: plvecf_int(PLFLT (*plf2eval) (PLINT, PLINT, PLPointer), PLPointer plf2eval_data1, PLPointer plf2eval_data2, PLINT (*defined) (PLFLT, PLFLT, PLPointer), PLPointer defined_data, PLINT nx, PLINT ny, PLFLT scale, void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data); where defined() here includes the new client data pointer syntax. It'd need a nice front-end to it with a suitably picked function evaluator similar to in pl*cont* and pl*shade*. Looks like some work. ************* To substantially simplify this, I would drop the defined part of it (which I brought up in the first place for the previous thread). Right now we don't have "defined" API for plcont, and I really don't think we need it for this API. But we do need the overall function evaluator stuff. Somebody will immediately want to be plotting vector fields for polar coordinates or irregularly shaped x,y regions, and plcont handles those cases with ease because of its function evaluator approach. Andrew, I have got to say that your example 22 already looks pretty good so I hope we can settle the API issue then extend that and example 22 (with colour changes and possibly adding a page with a vector field for polar coordinates) to all the language interfaces. I would be willing to do all of that latter project for python, java, fortran, and tcl, but I would leave to you doing the internal changes to implement the function evaluator approach along the lines of what Maurice suggested and also the required changes to the C++ interface and x22.cc. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |