Hazen Babcock ha scritto:
> Hezekiah M. Carty wrote:
>> On Thursday, July 23, 2009, Hazen Babcock <hbabc...@mac.com> wrote:
>>> Should we add a function that returns the current pen width? Or does
>>> such a function already exist?
>>>
>>> How about the index of the current color?
>>>
>>> -Hazen
>> I think that each of these functions would be useful.  I wrote short C
>> stubs for the OCaml bindings to get the current line width and current
>> color index from each of color palette 0 and 1 from plsc, specifically
>> for the purpose of creating a plot legend function.
> 
> I'm inclined to add at least a function to get the current pen width and 
> the current plcol0 index.
> 
> Any objections to this expansion of the API? Any objections to adding 
> getters in the future for all other PLplot setters? How about the 
> save/unsave feature as suggested by Steve?
> 
> The schedule would probably be to add the pen width and plcol0 functions 
> before the next release and then add the rest after the 5.10 release.
> 
> -Hazen


Just a comment on these getter/setter functions: since, as far as I 
understand, the biggest obstacle to plplot development is the 
propagation of new function to all language bindings, wouldn't it be 
wiser to make a progressive switch to a more "encapsulated" API style, 
like providing a single getter and setter set of functions with a char 
argument specifying what to get or set, and the value (or pointer to 
array of values) to set or pointer to value(s) to be get, one per 
supported type? This would allow to add new settable parameters without 
API change and for languages supporting function overloading or dynamic 
typing (I can think of f90, C++, python), this would probably reduce to 
just a single getter and a single setter function.

I mean something like this, at your choice:
PLINT fontpar[3];
PLINT fontfamily, fontstyle, fontweight;
/* either: */
plgetint("font", fontpar);
/* or */
plgetint("font_family", &fontfamily);
plgetint("font_style", &fontstyle);
plgetint("font_weight", &fontweight);

The current get/set could be left as legacy functions in order not to 
break the existing applications.

I understand it is easy to give advices when you are not an active 
developer... I just hope this can help your job,
        best regards, Davide

-- 
============================= Davide Cesari ============================
Servizio IdroMeteorologico ARPA Emilia Romagna
Area Modellistica Numerica e Radarmeteorologia
  Phone/Fax: +39 051525926/+39 0516497501
  E-mail:    dces...@arpa.emr.it
  Home page: http://www.webalice.it/o.drofa/davide/
  Address:   ARPA-SIM, Viale Silvani 6, 40122 Bologna, Italy
========================================================================

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to