From: <hez...@us...> - 2009-10-06 18:45:52
|
Revision: 10517 http://plplot.svn.sourceforge.net/plplot/?rev=10517&view=rev Author: hezekiahcarty Date: 2009-10-06 18:45:37 +0000 (Tue, 06 Oct 2009) Log Message: ----------- OCaml's plshade, plshades and plpoly3 all take bool values when appropriate This is an API change for these three functions! The rest of the OCaml PLplot API uses OCaml's bool for function parameters which are PLBOOL in the C API. A small error in bindings/ocaml/plplot_core.idl had them mapped to int rather than bool for a few functions. Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/examples/ocaml/x15.ml trunk/examples/ocaml/x16.ml trunk/examples/ocaml/x18.ml trunk/examples/ocaml/x21.ml trunk/examples/ocaml/x30.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/bindings/ocaml/plplot.mli 2009-10-06 18:45:37 UTC (rev 10517) @@ -768,13 +768,13 @@ float -> float -> float -> - float -> int -> float -> int -> int -> int -> int -> int -> int -> unit + float -> int -> float -> int -> int -> int -> int -> int -> bool -> unit = "camlidl_plplot_core_ml_plshade_bytecode" "camlidl_plplot_core_ml_plshade" external plshades : float array array -> float -> - float -> float -> float -> float array -> int -> int -> int -> int -> unit + float -> float -> float -> float array -> int -> int -> int -> bool -> unit = "camlidl_plplot_core_ml_plshades_bytecode" "camlidl_plplot_core_ml_plshades" external plimagefr : @@ -792,7 +792,7 @@ = "camlidl_plplot_core_ml_plmeridians_bytecode" "camlidl_plplot_core_ml_plmeridians" external plpoly3 : - float array -> float array -> float array -> int array -> int -> unit + float array -> float array -> float array -> bool array -> bool -> unit = "camlidl_plplot_core_ml_plpoly3" external pltr0 : float -> float -> float * float = "camlidl_plplot_core_ml_pltr0" Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/bindings/ocaml/plplot_core.idl 2009-10-06 18:45:37 UTC (rev 10517) @@ -72,7 +72,7 @@ // properly #define PLINT int #define PLFLT double -#define PLBOOL int +#define PLBOOL boolean [mlname(plcont)] void ml_plcont( [size_is(nx,ny)] PLFLT **f, PLINT nx, PLINT ny, Modified: trunk/examples/ocaml/x15.ml =================================================================== --- trunk/examples/ocaml/x15.ml 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/examples/ocaml/x15.ml 2009-10-06 18:45:37 UTC (rev 10517) @@ -68,7 +68,7 @@ z (-1.0) 1.0 (-1.0) 1.0 shade_min shade_max sh_cmap sh_color sh_width - min_color min_width max_color max_width 1; + min_color min_width max_color max_width true; plcol0 1; plbox "bcnst" 0.0 0 "bcnstv" 0.0 0; @@ -122,7 +122,7 @@ z (-1.0) 1.0 (-1.0) 1.0 shade_min shade_max sh_cmap sh_color sh_width - min_color min_width max_color max_width 1; + min_color min_width max_color max_width true; done; plcol0 1; Modified: trunk/examples/ocaml/x16.ml =================================================================== --- trunk/examples/ocaml/x16.ml 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/examples/ocaml/x16.ml 2009-10-06 18:45:37 UTC (rev 10517) @@ -131,7 +131,7 @@ plpsty 0; - plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width 1; + plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width true; plcol0 1; plbox "bcnst" 0.0 0 "bcnstv" 0.0 0; @@ -151,7 +151,7 @@ plpsty 0; plset_pltr (fun x y -> pltr1 x y xg1 yg1); - plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width 1; + plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width true; plcol0 1; plbox "bcnst" 0.0 0 "bcnstv" 0.0 0; @@ -171,7 +171,8 @@ plpsty 0; plset_pltr (fun x y -> pltr2 x y xg2 yg2); - plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width 0; + plshades + z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width false; plcol0 1; plbox "bcnst" 0.0 0 "bcnstv" 0.0 0; @@ -192,7 +193,7 @@ plpsty 0; - plshades z (-1.0) 1.0 (-1.) 1.0 shedge fill_width 2 3 0; + plshades z (-1.0) 1.0 (-1.) 1.0 shedge fill_width 2 3 false; plcol0 1; plbox "bcnst" 0.0 0 "bcnstv" 0.0 0; @@ -211,7 +212,8 @@ plpsty 0; plset_defined zdefined; - plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width 0; + plshades + z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width false; plunset_defined (); plcol0 1; @@ -252,7 +254,8 @@ in (* Now we can shade the interior region. *) - plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width 0; + plshades + z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width false; (* Now we can draw the perimeter. (If do before, shade stuff may overlap.) *) let px = Array.make perimeterpts 0.0 in Modified: trunk/examples/ocaml/x18.ml =================================================================== --- trunk/examples/ocaml/x18.ml 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/examples/ocaml/x18.ml 2009-10-06 18:45:37 UTC (rev 10517) @@ -15,10 +15,10 @@ let pi = atan 1.0 *. 4.0 let test_poly k = - let draw = [| [|1; 1; 1; 1|]; - [|1; 0; 1; 0|]; - [|0; 1; 0; 1|]; - [|1; 1; 0; 0|] |] in + let draw = [| [| true; true; true; true|]; + [| true; false; true; false|]; + [|false; true; false; true|]; + [| true; true; false; false|] |] in let two_pi = 2.0 *. pi in @@ -62,7 +62,7 @@ y.(4) <- sin (phi j) *. sin (theta i); z.(4) <- cos (phi j); - plpoly3 x y z draw.(k) 1; + plpoly3 x y z draw.(k) true; done done; Modified: trunk/examples/ocaml/x21.ml =================================================================== --- trunk/examples/ocaml/x21.ml 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/examples/ocaml/x21.ml 2009-10-06 18:45:37 UTC (rev 10517) @@ -208,7 +208,7 @@ plenv0 xm xM ym yM 2 0; plcol0 15; pllab "X" "Y" title.(alg - 1); - plshades zg xm xM ym yM clev 1 0 1 1; + plshades zg xm xM ym yM clev 1 0 1 true; plcol0 2; ) else ( Modified: trunk/examples/ocaml/x30.ml =================================================================== --- trunk/examples/ocaml/x30.ml 2009-10-05 21:39:29 UTC (rev 10516) +++ trunk/examples/ocaml/x30.ml 2009-10-06 18:45:37 UTC (rev 10517) @@ -135,9 +135,9 @@ (* Set the color levels array. These levels are also between 0.0 and 1.0 *) let clevel = Array.init 101 (fun i -> 0.01 *. float_of_int i) in - (* Draw the shade plot with zmin = 0.0, zmax = 1.0 and x and y coordinate ranges - such that it fills the entire plotting area. *) - plshades z 0.0 1.0 0.0 1.0 clevel 0 (-1) 2 1; + (* Draw the shade plot with zmin = 0.0, zmax = 1.0 and x and y coordinate + ranges such that it fills the entire plotting area. *) + plshades z 0.0 1.0 0.0 1.0 clevel 0 (-1) 2 true; plend (); () This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |