From: <and...@us...> - 2008-08-15 19:32:59
|
Revision: 8663 http://plplot.svn.sourceforge.net/plplot/?rev=8663&view=rev Author: andrewross Date: 2008-08-15 19:33:06 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Add pltr? functions to ocaml bindings. N.B. Currently untested. Modified Paths: -------------- trunk/bindings/ocaml/plplot.idl trunk/bindings/ocaml/plplot_impl.c Modified: trunk/bindings/ocaml/plplot.idl =================================================================== --- trunk/bindings/ocaml/plplot.idl 2008-08-15 02:58:19 UTC (rev 8662) +++ trunk/bindings/ocaml/plplot.idl 2008-08-15 19:33:06 UTC (rev 8663) @@ -65,6 +65,20 @@ PLFLT dlong, PLFLT dlat, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat); +// The following are for the pltr functions +[mlname(pltr0)] void ml_pltr0( + PLFLT x, PLFLT y, [out] PLFLT *tx, [out] PLFLT *ty); + +[mlname(pltr1)] void ml_pltr1( + PLFLT x, PLFLT y, [out] PLFLT *tx, [out] PLFLT *ty, + PLINT nxg, PLINT nyg, + [in, size_is(nxg)] PLFLT *xg, [in, size_is(nyg)] PLFLT *yg); + +[mlname(pltr2)] void ml_pltr2( + PLFLT x, PLFLT y, [out] PLFLT *tx, [out] PLFLT *ty, + PLINT nxg, PLINT nyg, + [in, size_is(nxg, nyg)] PLFLT **xg, [in, size_is(nxg, nyg)] PLFLT **yg); + // XXX The following are non-standard functions which help retrieve some extra // information from PLplot. int plg_current_col0(void); Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2008-08-15 02:58:19 UTC (rev 8662) +++ trunk/bindings/ocaml/plplot_impl.c 2008-08-15 19:33:06 UTC (rev 8663) @@ -439,8 +439,31 @@ CAMLreturn( Val_int(result) ); } +/* pltr* function implementations */ +void ml_pltr0(double x, double y, double* tx, double* ty) { + pltr0(x, y, tx, ty, NULL); +} +void ml_pltr1(double x, double y, double* tx, double* ty, + double nxg, double nyg, double* xg, double* yg) { + PLcGrid grid; + grid.xg = xg; + grid.yg = yg; + grid.nx = nxg; + grid.ny = nyg; + pltr1(x, y, tx, ty, (PLPointer)&grid); +} +void ml_pltr2(double x, double y, double* tx, double* ty, + double nxg, double nyg, double** xg, double** yg) { + PLcGrid2 grid; + grid.xg = xg; + grid.yg = yg; + grid.nx = nxg; + grid.ny = nyg; + pltr2(x, y, tx, ty, (PLPointer)&grid); +} + /* XXX Non-core functions follow XXX */ /** * The following functions are here for (my?) convenience. As far as I can This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |