From: <jb...@us...> - 2010-02-23 06:38:43
|
Revision: 10811 http://plplot.svn.sourceforge.net/plplot/?rev=10811&view=rev Author: jbauck Date: 2010-02-23 06:38:37 +0000 (Tue, 23 Feb 2010) Log Message: ----------- Fix minor bugs in formerly commented-out lines which exercise the "defined" feature of plshade. Since the option "exclude" is not parsed by the command line parser in these Ada examples as it is in the C example, this code can be reached only by editing the source to make exclude := True. When this is done, the Poscript output matches that of the C output when it is run with "exclude" passed from the command line, e.g., x16c -exclude Modified Paths: -------------- trunk/examples/ada/x16a.adb.cmake trunk/examples/ada/xthick16a.adb.cmake Modified: trunk/examples/ada/x16a.adb.cmake =================================================================== --- trunk/examples/ada/x16a.adb.cmake 2010-02-22 12:50:48 UTC (rev 10810) +++ trunk/examples/ada/x16a.adb.cmake 2010-02-23 06:38:37 UTC (rev 10811) @@ -88,6 +88,9 @@ -- Masking function + function zdefined(x, y : Long_Float) return Integer; + pragma Convention(C, zdefined); + function zdefined(x, y : Long_Float) return Integer is z : Long_Float := sqrt(x * x + y * y); begin @@ -264,36 +267,36 @@ -- Plot using 2d coordinate transform and exclusion - -- Ada note: This "exclusion" part should work if exclude is set to True. + -- Ada note: This "exclusion" part works if exclude is set to True. -- In the C original example, the setting of exclude was handled by the -- the input parser which handling is not implemented in this Ada example. --- exclude := True; --- if exclude then --- --- -- Load colour palettes. --- plspal0("cmap0_black_on_white.pal"); --- plspal1("cmap1_gray.pal", 1); --- --- -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. --- plscmap0n(3); --- --- pladv(0); --- plvpor(0.1, 0.9, 0.1, 0.9); --- plwind(-1.0, 1.0, -1.0, 1.0); --- --- plpsty(0); --- --- plshades(z, zdefined'Unrestricted_Access, -1.0, 1.0, -1.0, 1.0, --- shedge, fill_width, --- cont_color, cont_width, --- plfill'access, False, pltr2'access, cgrid2'Address); --- --- plcol0(1); --- plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); --- --- pllab("distance", "altitude", "Bogon density with exclusion"); --- end if; + exclude := False; + if exclude then + -- Load colour palettes. + plspal0("cmap0_black_on_white.pal"); + plspal1("cmap1_gray.pal", True); + + -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. + plscmap0n(3); + + pladv(0); + plvpor(0.1, 0.9, 0.1, 0.9); + plwind(-1.0, 1.0, -1.0, 1.0); + + plpsty(0); + + plshades(z, zdefined'Unrestricted_Access, -1.0, 1.0, -1.0, 1.0, + shedge, fill_width, + cont_color, cont_width, + plfill'access, False, pltr2'access, cgrid2'Address); + + plcol0(1); + plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); + + pllab("distance", "altitude", "Bogon density with exclusion"); + end if; + -- Example with polar coordinates. -- Load colour palettes. Modified: trunk/examples/ada/xthick16a.adb.cmake =================================================================== --- trunk/examples/ada/xthick16a.adb.cmake 2010-02-22 12:50:48 UTC (rev 10810) +++ trunk/examples/ada/xthick16a.adb.cmake 2010-02-23 06:38:37 UTC (rev 10811) @@ -88,6 +88,9 @@ -- Masking function + function zdefined(x, y : Long_Float) return Integer; + pragma Convention(C, zdefined); + function zdefined(x, y : Long_Float) return Integer is z : Long_Float := sqrt(x * x + y * y); begin @@ -264,36 +267,36 @@ -- Plot using 2d coordinate transform and exclusion - -- Ada note: This "exclusion" part should work if exclude is set to True. + -- Ada note: This "exclusion" part works if exclude is set to True. -- In the C original example, the setting of exclude was handled by the -- the input parser which handling is not implemented in this Ada example. --- exclude := True; --- if exclude then --- --- -- Load colour palettes. --- Set_Color_Map_0_From_File("cmap0_black_on_white.pal"); --- Set_Color_Map_1_From_File("cmap1_gray.pal", True); --- --- -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. --- Set_Number_Of_Colors_Map_0(3); --- --- Advance_To_Subpage(Next_Subpage); --- Set_Viewport_Normalized(0.1, 0.9, 0.1, 0.9); --- Set_Viewport_World(-1.0, 1.0, -1.0, 1.0); --- --- Select_Fill_Pattern(0); --- --- Shade_Regions(z, zdefined'Unrestricted_Access, -1.0, 1.0, -1.0, 1.0, --- shedge, fill_width, --- cont_color, cont_width, --- Fill_Polygon'access, False, Plot_Transformation_2'access, cgrid2'Address); --- --- Set_Pen_Color(Red); --- Box_Around_Viewport("bcnst", 0.0, 0, "bcnstv", 0.0, 0); --- --- Write_Labels("distance", "altitude", "Bogon density with exclusion"); --- end if; + exclude := False; + if exclude then + -- Load colour palettes. + Set_Color_Map_0_From_File("cmap0_black_on_white.pal"); + Set_Color_Map_1_From_File("cmap1_gray.pal", True); + + -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. + Set_Number_Of_Colors_Map_0(3); + + Advance_To_Subpage(Next_Subpage); + Set_Viewport_Normalized(0.1, 0.9, 0.1, 0.9); + Set_Viewport_World(-1.0, 1.0, -1.0, 1.0); + + Select_Fill_Pattern(0); + + Shade_Regions(z, zdefined'Unrestricted_Access, -1.0, 1.0, -1.0, 1.0, + shedge, fill_width, + cont_color, cont_width, + Fill_Polygon'access, False, Plot_Transformation_2'access, cgrid2'Address); + + Set_Pen_Color(Red); + Box_Around_Viewport("bcnst", 0.0, 0, "bcnstv", 0.0, 0); + + Write_Labels("distance", "altitude", "Bogon density with exclusion"); + end if; + -- Example with polar coordinates. -- Load colour palettes. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |