From: <jb...@us...> - 2010-06-01 09:03:59
|
Revision: 11048 http://plplot.svn.sourceforge.net/plplot/?rev=11048&view=rev Author: jbauck Date: 2010-06-01 09:03:53 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Update Ada examples 6 and 7 to match changes in C examples of around 2010 April. Modified Paths: -------------- trunk/examples/ada/x06a.adb.cmake trunk/examples/ada/x07a.adb.cmake trunk/examples/ada/xthick06a.adb.cmake trunk/examples/ada/xthick07a.adb.cmake Modified: trunk/examples/ada/x06a.adb.cmake =================================================================== --- trunk/examples/ada/x06a.adb.cmake 2010-06-01 08:49:36 UTC (rev 11047) +++ trunk/examples/ada/x06a.adb.cmake 2010-06-01 09:03:53 UTC (rev 11048) @@ -2,7 +2,7 @@ -- Displays the entire "plpoin" symbol (font) set. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2010 Jerry Bauck -- This file is part of PLplot. @@ -39,7 +39,7 @@ procedure x06a is - k : Integer; + k, maxfont : Integer; x, y : Real_Vector(1 .. 1); begin @@ -49,41 +49,57 @@ -- Initialize plplot plinit; - pladv(0); + for Kind_Font in 0 .. 1 loop + plfontld(Kind_Font); + if Kind_Font = 0 then + maxfont := 1; + else + maxfont := 4; + end if; - -- Set up viewport and window - plcol0(2); - plvpor(0.1, 1.0, 0.1, 0.9); - plwind(0.0, 1.0, 0.0, 1.3); + for font in 0 .. maxfont - 1 loop + plfont(font + 1); + pladv(0); - -- Draw the grid using plbox - plbox("bcg", 0.1, 0, "bcg", 0.1, 0); + -- Set up viewport and window + plcol0(2); + plvpor(0.1, 1.0, 0.1, 0.9); + plwind(0.0, 1.0, 0.0, 1.3); - -- Write the digits below the frame - plcol0(15); - for i in 0 .. 9 loop - plmtex("b", 1.5, (0.1 * Long_Float(i) + 0.05), 0.5, Trim(Integer'image(i), Left)); - end loop; + -- Draw the grid using plbox + plbox("bcg", 0.1, 0, "bcg", 0.1, 0); - k := 0; - for i in 0 .. 12 loop + -- Write the digits below the frame + plcol0(15); + for i in 0 .. 9 loop + plmtex("b", 1.5, (0.1 * Long_Float(i) + 0.05), 0.5, Trim(Integer'image(i), Left)); + end loop; - -- Write the digits to the left of the frame - plmtex("lv", 1.0, (1.0 - (2.0 * Long_Float(i) + 1.0) / 26.0), 1.0, Trim(Integer'image(10 * i), Left)); - for j in 0 .. 9 loop - x(1) := 0.1 * Long_Float(j) + 0.05; - y(1) := 1.25 - 0.1 * Long_Float(i); + k := 0; + for i in 0 .. 12 loop - -- Display the symbols (plpoin expects that x and y are arrays so - -- pass pointers) - if k < 128 then - plpoin(x, y, k); + -- Write the digits to the left of the frame + plmtex("lv", 1.0, (1.0 - (2.0 * Long_Float(i) + 1.0) / 26.0), 1.0, Trim(Integer'image(10 * i), Left)); + for j in 0 .. 9 loop + x(1) := 0.1 * Long_Float(j) + 0.05; + y(1) := 1.25 - 0.1 * Long_Float(i); + + -- Display the symbols (plpoin expects that x and y are arrays so + -- pass pointers) + if k < 128 then + plpoin(x, y, k); + end if; + k := k + 1; + end loop; + end loop; + + if Kind_Font = 0 then + plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)"); + else + plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)"); end if; - k := k + 1; - end loop; - end loop; - - plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols"); + end loop; -- font + end loop; -- Kind_Font plend; end x06a; Modified: trunk/examples/ada/x07a.adb.cmake =================================================================== --- trunk/examples/ada/x07a.adb.cmake 2010-06-01 08:49:36 UTC (rev 11047) +++ trunk/examples/ada/x07a.adb.cmake 2010-06-01 09:03:53 UTC (rev 11048) @@ -2,7 +2,7 @@ -- Font demo. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2010 Jerry Bauck -- This file is part of PLplot. @@ -41,8 +41,8 @@ k : Integer; x, y : Real_Vector(1 .. 1); - base : array(0 .. 16) of Integer := (0, 200, 500, 600, 700, 800, 900, 2000, - 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900); + base : array(0 .. 19) of Integer := (0, 100, 0, 100, 200, 500, 600, 700, 800, + 900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900); begin -- Parse and process command line arguments @@ -51,8 +51,11 @@ -- Initialize plplot plinit; - plfontld(1); - for l in 0 .. 16 loop + plfontld(0); + for l in 0 .. 19 loop + if l = 2 then + plfontld(1); + end if; pladv(0); -- Set up viewport and window @@ -84,7 +87,11 @@ end loop; end loop; - plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols"); + if l < 2 then + plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)"); + else + plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)"); + end if; end loop; plend; Modified: trunk/examples/ada/xthick06a.adb.cmake =================================================================== --- trunk/examples/ada/xthick06a.adb.cmake 2010-06-01 08:49:36 UTC (rev 11047) +++ trunk/examples/ada/xthick06a.adb.cmake 2010-06-01 09:03:53 UTC (rev 11048) @@ -2,7 +2,7 @@ -- Displays the entire "Draw_Points" symbol (font) set. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2010 Jerry Bauck -- This file is part of PLplot. @@ -39,7 +39,7 @@ procedure xthick06a is - k : Integer; + k, maxfont : Integer; x, y : Real_Vector(1 .. 1); begin @@ -49,41 +49,57 @@ -- Initialize plplot Initialize_PLplot; - Advance_To_Subpage(Next_Subpage); + for Kind_Font in 0 .. 1 loop + Set_Characer_Set(Kind_Font); + if Kind_Font = 0 then + maxfont := 1; + else + maxfont := 4; + end if; - -- Set up viewport and window - Set_Pen_Color(2); - Set_Viewport_Normalized(0.1, 1.0, 0.1, 0.9); - Set_Viewport_World(0.0, 1.0, 0.0, 1.3); + for font in 0 .. maxfont - 1 loop + Set_Font_Style(font + 1); + Advance_To_Subpage(Next_Subpage); - -- Draw the grid using Box_Around_Viewport - Box_Around_Viewport("bcg", 0.1, 0, "bcg", 0.1, 0); + -- Set up viewport and window + Set_Pen_Color(2); + Set_Viewport_Normalized(0.1, 1.0, 0.1, 0.9); + Set_Viewport_World(0.0, 1.0, 0.0, 1.3); - -- Write the digits below the frame - Set_Pen_Color(15); - for i in 0 .. 9 loop - Write_Text_Viewport("b", 1.5, (0.1 * Long_Float(i) + 0.05), 0.5, Trim(Integer'image(i), Left)); - end loop; + -- Draw the grid using Box_Around_Viewport + Box_Around_Viewport("bcg", 0.1, 0, "bcg", 0.1, 0); - k := 0; - for i in 0 .. 12 loop + -- Write the digits below the frame + Set_Pen_Color(15); + for i in 0 .. 9 loop + Write_Text_Viewport("b", 1.5, (0.1 * Long_Float(i) + 0.05), 0.5, Trim(Integer'image(i), Left)); + end loop; - -- Write the digits to the left of the frame - Write_Text_Viewport("lv", 1.0, (1.0 - (2.0 * Long_Float(i) + 1.0) / 26.0), 1.0, Trim(Integer'image(10 * i), Left)); - for j in 0 .. 9 loop - x(1) := 0.1 * Long_Float(j) + 0.05; - y(1) := 1.25 - 0.1 * Long_Float(i); + k := 0; + for i in 0 .. 12 loop - -- Display the symbols (Draw_Points expects that x and y are arrays so - -- pass pointers) - if k < 128 then - Draw_Points(x, y, k); + -- Write the digits to the left of the frame + Write_Text_Viewport("lv", 1.0, (1.0 - (2.0 * Long_Float(i) + 1.0) / 26.0), 1.0, Trim(Integer'image(10 * i), Left)); + for j in 0 .. 9 loop + x(1) := 0.1 * Long_Float(j) + 0.05; + y(1) := 1.25 - 0.1 * Long_Float(i); + + -- Display the symbols (Draw_Points expects that x and y are arrays so + -- pass pointers) + if k < 128 then + Draw_Points(x, y, k); + end if; + k := k + 1; + end loop; + end loop; + + if Kind_Font = 0 then + Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)"); + else + Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)"); end if; - k := k + 1; - end loop; - end loop; - - Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols"); + end loop; -- font + end loop; -- Kind_Font End_PLplot; end xthick06a; Modified: trunk/examples/ada/xthick07a.adb.cmake =================================================================== --- trunk/examples/ada/xthick07a.adb.cmake 2010-06-01 08:49:36 UTC (rev 11047) +++ trunk/examples/ada/xthick07a.adb.cmake 2010-06-01 09:03:53 UTC (rev 11048) @@ -2,7 +2,7 @@ -- Font demo. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2010 Jerry Bauck -- This file is part of PLplot. @@ -41,8 +41,8 @@ k : Integer; x, y : Real_Vector(1 .. 1); - base : array(0 .. 16) of Integer := (0, 200, 500, 600, 700, 800, 900, 2000, - 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900); + base : array(0 .. 19) of Integer := (0, 100, 0, 100, 200, 500, 600, 700, 800, + 900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900); begin -- Parse and process command line arguments @@ -51,8 +51,11 @@ -- Initialize plplot Initialize_PLplot; - Set_Characer_Set(1); - for l in 0 .. 16 loop + Set_Characer_Set(0); + for l in 0 .. 19 loop + if l = 2 then + Set_Characer_Set(1); + end if; Advance_To_Subpage(Next_Subpage); -- Set up viewport and window @@ -84,7 +87,11 @@ end loop; end loop; - Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols"); + if l < 2 then + Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)"); + else + Write_Text_Viewport("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)"); + end if; end loop; End_PLplot; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |