From: <ai...@us...> - 2009-02-03 06:32:33
|
Revision: 9441 http://plplot.svn.sourceforge.net/plplot/?rev=9441&view=rev Author: airwin Date: 2009-02-03 06:32:28 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Propagate x14 change to ocaml and perl/PDL. Modified Paths: -------------- trunk/examples/ocaml/x14.ml trunk/examples/perl/x14.pl Modified: trunk/examples/ocaml/x14.ml =================================================================== --- trunk/examples/ocaml/x14.ml 2009-02-03 02:38:39 UTC (rev 9440) +++ trunk/examples/ocaml/x14.ml 2009-02-03 06:32:28 UTC (rev 9441) @@ -229,13 +229,20 @@ let driver = plgdev () in let fam, num, bmax = plgfam () in + + (* If valid geometry specified on command line, use it for both streams. *) + let xp0, yp0, xleng0, yleng0, xoff0, yoff0 = plgpage () in + let valid_geometry = ( xleng0 > 0 && yleng0 > 0 ) in printf "Demo of multiple output streams via the %s driver.\n" driver; printf "Running with the second stream as slave to the first.\n"; printf "\n"; (* Set up first stream *) - ignore (plsetopt "geometry" geometry_master); + if valid_geometry then + plspage xp0 yp0 xleng0 yleng0 xoff0 yoff0 + else + ignore (plsetopt "geometry" geometry_master); plsdev driver; plssub 2 2; @@ -244,8 +251,12 @@ (* Start next stream *) plsstrm 1; + if valid_geometry then + plspage xp0 yp0 xleng0 yleng0 xoff0 yoff0 + else + ignore (plsetopt "geometry" geometry_slave); + (* Turn off pause to make this a slave (must follow master) *) - ignore (plsetopt "geometry" geometry_slave); plspause false; plsdev driver; plsfam fam num bmax; Modified: trunk/examples/perl/x14.pl =================================================================== --- trunk/examples/perl/x14.pl 2009-02-03 02:38:39 UTC (rev 9440) +++ trunk/examples/perl/x14.pl 2009-02-03 06:32:28 UTC (rev 9441) @@ -63,9 +63,24 @@ . "Running with the second stream as slave to the first.\n" . "\n"); + # If valid geometry specified on command line, use it for both streams. + my ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0) = plgpage (); + printf("%s %i, %i\n", "xleng0, yleng0 = ", $xleng0, $yleng0); + my $valid_geometry; + if ($xleng0 > 0 && $yleng0 > 0) { + $valid_geometry = 1; + } else { + $valid_geometry = 0; + } + printf("%s %i\n", "valid_geometry = ", $valid_geometry); + # Set up first stream - plsetopt ("geometry", $geometry_master); + if ($valid_geometry) { + plspage ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0); + } else { + plsetopt ("geometry", $geometry_master); + } plsdev ($driver); plssub (2, 2); @@ -75,9 +90,14 @@ plsstrm (1); + if ($valid_geometry) { + plspage ($xp0, $yp0, $xleng0, $yleng0, $xoff0, $yoff0); + } else { + plsetopt ("geometry", $geometry_slave); + } + # Turn off pause to make this a slave (must follow master) - plsetopt ("geometry", $geometry_slave); plspause (0); plsdev ($driver); plsfam ($fam, $num, $bmax); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |