From: <jb...@us...> - 2009-08-21 20:16:28
|
Revision: 10314 http://plplot.svn.sourceforge.net/plplot/?rev=10314&view=rev Author: jbauck Date: 2009-08-21 20:16:22 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Update Ada bindings and examples 16 for new color map API using plspal0 and plspal1. Modified Paths: -------------- trunk/bindings/ada/plplot.adb.cmake trunk/bindings/ada/plplot.ads.cmake trunk/bindings/ada/plplot_thin.ads.cmake trunk/bindings/ada/plplot_traditional.adb.cmake trunk/bindings/ada/plplot_traditional.ads.cmake trunk/examples/ada/x16a.adb.cmake trunk/examples/ada/xthick16a.adb.cmake Modified: trunk/bindings/ada/plplot.adb.cmake =================================================================== --- trunk/bindings/ada/plplot.adb.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/bindings/ada/plplot.adb.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -2734,6 +2734,30 @@ end Set_Page_Parameters; + -- Set the colors for color table 0 from a cmap0 file. + -- plspal0 + procedure Set_Color_Map_0_From_File(Color_File_Name : String) is + begin + plspal0(To_C(Color_File_Name, True)); + end Set_Color_Map_0_From_File; + + + -- Set the colors for color table 1 from a cmap1 file. + -- plspal1 + procedure Set_Color_Map_1_From_File(Color_File_Name : String; Interpolate : Boolean) is + + PL_Interpolate : PLBOOL; + + begin + if Interpolate then + PL_Interpolate := PLtrue; + else + PL_Interpolate := PLfalse; + end if; + plspal1(To_C(Color_File_Name, True), PL_Interpolate); + end Set_Color_Map_1_From_File; + + -- Set the pause (on end-of-page) status -- plspause procedure Set_Pause(Pause : Boolean) is Modified: trunk/bindings/ada/plplot.ads.cmake =================================================================== --- trunk/bindings/ada/plplot.ads.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/bindings/ada/plplot.ads.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -1628,6 +1628,16 @@ x_Offset, y_Offset : Integer); + -- Set the colors for color table 0 from a cmap0 file. + -- plspal0 + procedure Set_Color_Map_0_From_File(Color_File_Name : String); + + + -- Set the colors for color table 1 from a cmap1 file. + -- plspal1 + procedure Set_Color_Map_1_From_File(Color_File_Name : String; Interpolate : Boolean); + + -- Set the pause (on end-of-page) status -- plspause procedure Set_Pause(Pause : Boolean); Modified: trunk/bindings/ada/plplot_thin.ads.cmake =================================================================== --- trunk/bindings/ada/plplot_thin.ads.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/bindings/ada/plplot_thin.ads.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -1454,6 +1454,19 @@ pragma Import(C, plspage, "c_plspage"); + -- Set the colors for color table 0 from a cmap0 file. + + procedure + plspal0(filename : char_array); + pragma Import(C, plspal0, "c_plspal0"); + + + -- Set the colors for color table 1 from a cmap1 file. + procedure + plspal1(filename : char_array; interpolate : PLBOOL); + pragma Import(C, plspal1, "c_plspal1"); + + -- Set the pause (on end-of-page) status procedure Modified: trunk/bindings/ada/plplot_traditional.adb.cmake =================================================================== --- trunk/bindings/ada/plplot_traditional.adb.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/bindings/ada/plplot_traditional.adb.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -2605,6 +2605,28 @@ end plspage; + -- Set the colors for color table 0 from a cmap0 file. + procedure plspal0(Color_File_Name : String) is + begin + PLplot_Thin.plspal0(To_C(Color_File_Name, True)); + end plspal0; + + + -- Set the colors for color table 1 from a cmap1 file. + procedure plspal1(Color_File_Name : String; Interpolate : Boolean) is + + PL_Interpolate : PLBOOL; + + begin + if Interpolate then + PL_Interpolate := PLtrue; + else + PL_Interpolate := PLfalse; + end if; + PLplot_Thin.plspal1(To_C(Color_File_Name, True), PL_Interpolate); + end plspal1; + + -- Set the pause (on end-of-page) status procedure plspause(Pause : Boolean) is Modified: trunk/bindings/ada/plplot_traditional.ads.cmake =================================================================== --- trunk/bindings/ada/plplot_traditional.ads.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/bindings/ada/plplot_traditional.ads.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -1498,6 +1498,14 @@ x_Offset, y_Offset : Integer); + -- Set the colors for color table 0 from a cmap0 file. + procedure plspal0(Color_File_Name : String); + + + -- Set the colors for color table 1 from a cmap1 file. + procedure plspal1(Color_File_Name : String; Interpolate : Boolean); + + -- Set the pause (on end-of-page) status procedure plspause(Pause : Boolean); Modified: trunk/examples/ada/x16a.adb.cmake =================================================================== --- trunk/examples/ada/x16a.adb.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/examples/ada/x16a.adb.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -104,9 +104,13 @@ -- Does several shade plots using different coordinate mappings. ---------------------------------------------------------------------------- - -- Parse and process command line arguments + -- Parse and process command line arguments. plparseopts(PL_PARSE_FULL); + -- 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); @@ -178,6 +182,14 @@ pllab("distance", "altitude", "Bogon density"); -- Plot using 1d coordinate transform + + -- Load colour palettes + plspal0("cmap0_black_on_white.pal"); + plspal1("cmap1_blue_yellow.pal", True); + + -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. + plscmap0n(3); + pladv(0); -- page 2 plvpor(0.1, 0.9, 0.1, 0.9); plwind(-1.0, 1.0, -1.0, 1.0); @@ -196,6 +208,14 @@ pllab("distance", "altitude", "Bogon density"); -- Plot using 2d coordinate transform + + -- Load colour palettes + plspal0("cmap0_black_on_white.pal"); + plspal1("cmap1_blue_red.pal", True); + + -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. + plscmap0n(3); + pladv(0); -- page 3 plvpor(0.1, 0.9, 0.1, 0.9); plwind(-1.0, 1.0, -1.0, 1.0); @@ -215,6 +235,14 @@ pllab("distance", "altitude", "Bogon density, with streamlines"); -- Plot using 2d coordinate transform + + -- Load colour palettes + plspal0(""); + plspal1("", True); + + -- Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display. + plscmap0n(3); + pladv(0); -- page 4 plvpor(0.1, 0.9, 0.1, 0.9); plwind(-1.0, 1.0, -1.0, 1.0); @@ -241,6 +269,14 @@ -- 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); @@ -259,6 +295,14 @@ -- end if; -- Example with polar coordinates. + + -- 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); -- page 5 plvpor(0.1, 0.9, 0.1, 0.9); plwind(-1.0, 1.0, -1.0, 1.0); Modified: trunk/examples/ada/xthick16a.adb.cmake =================================================================== --- trunk/examples/ada/xthick16a.adb.cmake 2009-08-21 14:14:02 UTC (rev 10313) +++ trunk/examples/ada/xthick16a.adb.cmake 2009-08-21 20:16:22 UTC (rev 10314) @@ -107,6 +107,10 @@ -- Parse and process command line arguments Parse_Command_Line_Arguments(Parse_Full); + -- 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); @@ -178,6 +182,14 @@ Write_Labels("distance", "altitude", "Bogon density"); -- Plot using 1d coordinate transform + + -- Load colour palettes + Set_Color_Map_0_From_File("cmap0_black_on_white.pal"); + Set_Color_Map_1_From_File("cmap1_blue_yellow.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); @@ -196,6 +208,14 @@ Write_Labels("distance", "altitude", "Bogon density"); -- Plot using 2d coordinate transform + + -- Load colour palettes + Set_Color_Map_0_From_File("cmap0_black_on_white.pal"); + Set_Color_Map_1_From_File("cmap1_blue_red.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); @@ -215,6 +235,14 @@ Write_Labels("distance", "altitude", "Bogon density, with streamlines"); -- Plot using 2d coordinate transform + + -- Load colour palettes + Set_Color_Map_0_From_File(""); + Set_Color_Map_1_From_File("", 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); @@ -241,6 +269,14 @@ -- 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); @@ -259,6 +295,14 @@ -- end if; -- Example with polar coordinates. + + -- 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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |