From: <jb...@us...> - 2009-01-13 10:25:01
|
Revision: 9295 http://plplot.svn.sourceforge.net/plplot/?rev=9295&view=rev Author: jbauck Date: 2009-01-13 10:24:55 +0000 (Tue, 13 Jan 2009) Log Message: ----------- In the Ada examples, changed the last argument of Set_Color_Map_1_Piecewise and plscmap1l to be a properly-dimensioned array rather than a length-1 array. Modified Paths: -------------- trunk/doc/docbook/src/ada.xml trunk/examples/ada/x11a.adb.cmake trunk/examples/ada/x12a.adb.cmake trunk/examples/ada/x15a.adb.cmake trunk/examples/ada/x20a.adb.cmake trunk/examples/ada/x21a.adb.cmake trunk/examples/ada/xthick11a.adb.cmake trunk/examples/ada/xthick12a.adb.cmake trunk/examples/ada/xthick15a.adb.cmake trunk/examples/ada/xthick20a.adb.cmake trunk/examples/ada/xthick21a.adb.cmake Modified: trunk/doc/docbook/src/ada.xml =================================================================== --- trunk/doc/docbook/src/ada.xml 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/doc/docbook/src/ada.xml 2009-01-13 10:24:55 UTC (rev 9295) @@ -291,13 +291,14 @@ <para> This is the only place in the PLplot bindings where a C subprogram calls an Ada subprogram while passing an array. If the array is unconstrained, there is no guarantee that it will work because C has no way of telling Ada what offset to use for the beginning of the array. But passing a constrained array is acceptable with the downside that the array size must be fixed within the bindings as being large enough to handle any situation; currently, it is sized as <literal>0 .. 2000</literal>. See Example 19 for how this is handled in by the user program. The constrained array is called <literal>Map_Form_Constrained_Array</literal>.</para> </sect1> - <sect1 id="ada_known_issues"> - <title>Known Issues</title> + <sect1 id="ada_known_variances"> + <title>Known Variances</title> <!-- 200:'Normal' --><para><emphasis role="bold"> 9.1 Stripchart labelling</emphasis></para> <para> In Example 17, all of the stripchart labels are the same regardless of the fact that the calling program sets them to be different. This is likely to affect user programs in the same manner.</para> <para><emphasis role="bold"> 9.2 Documentation</emphasis></para> <para> In numerous places in the documentation, a feature is listed or described as "C only." Many of these features are actually available in Ada. For example, in <literal>Contour_Plot</literal> (<literal>plcont</literal> in the traditional binding), the transformation from array indices to world coordinates is mentioned as "C only" but is actually available in Ada.</para> - + <para><emphasis role="bold"> 9.3 API</emphasis></para> + <para> The C documentation for <literal>plscmap1l</literal> (<literal>Set_Color_Map_1_Piecewise</literal> in the thick binding) states that if the last argument is a null pointer, the behavior is as though a proper-length array of all <literal>False</literal> values was passed. In Ada, the last parameter should always be an array of Boolean of the same length as the other array arguments.</para> </sect1> <sect1 id="ada_compilation_notes"> <title>Compilation notes</title> Modified: trunk/examples/ada/x11a.adb.cmake =================================================================== --- trunk/examples/ada/x11a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/x11a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -56,7 +56,7 @@ clevel : Real_Vector(0 .. LEVELS - 1); zmin, zmax, step : Long_Float; - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); procedure cmap1_init is i, h, l, s : Real_Vector(0 .. 1); @@ -74,7 +74,7 @@ s(1) := 0.8; plscmap1n(256); - plscmap1l(HLS, i, h, l, s, A_Boolean); + plscmap1l(HLS, i, h, l, s, Reverse_Flag); end cmap1_init; @@ -87,8 +87,6 @@ -- Initialize plplot plinit; - - A_Boolean(1) := False; for i in x'range loop x(i) := 3.0 * Long_Float(i - XPTS / 2) / Long_Float(XPTS / 2); Modified: trunk/examples/ada/x12a.adb.cmake =================================================================== --- trunk/examples/ada/x12a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/x12a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -48,12 +48,11 @@ procedure x12a is y0 : Real_Vector (0 .. 9); - pos : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 0.75, 1.0); - red : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 1.0, 1.0); - green : Real_Vector (0 .. 4) := (1.0, 0.5, 0.5, 0.5, 1.0); - blue : Real_Vector (0 .. 4) := (1.0, 1.0, 0.5, 0.25, 0.0); - A_Boolean :Boolean_Array_1D(0 .. 4) := (False, False, False, False, False); + r : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 1.0, 1.0); + g : Real_Vector (0 .. 4) := (1.0, 0.5, 0.5, 0.5, 1.0); + b : Real_Vector (0 .. 4) := (1.0, 1.0, 0.5, 0.25, 0.0); + Reverse_Flag : Boolean_Array_1D (0 .. 4) := (False, False, False, False, False); procedure plfbox (x0, y0 : Long_Float) is x, y : Real_Vector (0 ..3); @@ -101,10 +100,9 @@ y0(8) := 12.0; y0(9) := 3.0; - plscmap1l(RGB, pos, red, green, blue, A_Boolean); + plscmap1l(RGB, pos, r, g, b, Reverse_Flag); for i in y0'range loop - -- plcol0(i + 1); plcol1(Long_Float(i)/9.0); plpsty(0); plfbox((1980.0 + Long_Float(i)), y0(i)); Modified: trunk/examples/ada/x15a.adb.cmake =================================================================== --- trunk/examples/ada/x15a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/x15a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -53,10 +53,8 @@ ---------------------------------------------------------------------------- procedure cmap1_init2 is i, h, l, s : Real_Vector(0 .. 3); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 3) := (False, False, False, False); begin - A_Boolean(1) := False; -- Don't reverse direction of control points - -- Set control points. i(0) := 0.0; -- left boundary i(1) := 0.45; -- just before center @@ -81,7 +79,7 @@ s(2) := 0.5; -- center s(3) := 1.0; -- high - plscmap1l(HLS, i, h, l, s, A_Boolean); + plscmap1l(HLS, i, h, l, s, Reverse_Flag); end cmap1_init2; ---------------------------------------------------------------------------- Modified: trunk/examples/ada/x20a.adb.cmake =================================================================== --- trunk/examples/ada/x20a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/x20a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -217,7 +217,7 @@ -- Set gray colormap. procedure gray_cmap(num_col : Integer) is r, g, b, pos : Real_Vector(0 .. 1); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); begin r(0) := 0.0; g(0) := 0.0; @@ -231,8 +231,7 @@ pos(1) := 1.0; plscmap1n(num_col); - A_Boolean(1) := False; - plscmap1l(RGB, pos, r, g, b, A_Boolean); + plscmap1l(RGB, pos, r, g, b, Reverse_Flag); end gray_cmap; Modified: trunk/examples/ada/x21a.adb.cmake =================================================================== --- trunk/examples/ada/x21a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/x21a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -85,10 +85,8 @@ procedure cmap1_init is i, h, l, s : Real_Vector(0 .. 1); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); begin - A_Boolean(1) := False; -- Don't reverse direction of control points - i(0) := 0.0; -- left boundary i(1) := 1.0; -- right boundary @@ -102,7 +100,7 @@ s(1) := 0.8; plscmap1n(256); - plscmap1l(HLS, i, h, l, s, A_Boolean); + plscmap1l(HLS, i, h, l, s, Reverse_Flag); end cmap1_init; Modified: trunk/examples/ada/xthick11a.adb.cmake =================================================================== --- trunk/examples/ada/xthick11a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/xthick11a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -56,7 +56,7 @@ clevel : Real_Vector(0 .. LEVELS - 1); zmin, zmax, step : Long_Float; - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); procedure cmap1_init is i, h, l, s : Real_Vector(0 .. 1); @@ -74,7 +74,7 @@ s(1) := 0.8; Set_Number_Of_Colors_In_Color_Map_1(256); - Set_Color_Map_1_Piecewise(HLS, i, h, l, s, A_Boolean); + Set_Color_Map_1_Piecewise(HLS, i, h, l, s, Reverse_Flag); end cmap1_init; @@ -87,8 +87,6 @@ -- Initialize plplot Initialize_PLplot; - - A_Boolean(1) := False; for i in x'range loop x(i) := 3.0 * Long_Float(i - XPTS / 2) / Long_Float(XPTS / 2); Modified: trunk/examples/ada/xthick12a.adb.cmake =================================================================== --- trunk/examples/ada/xthick12a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/xthick12a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -47,12 +47,11 @@ procedure xthick12a is y0 : Real_Vector (0 .. 9); - pos : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 0.75, 1.0); - r : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 1.0, 1.0); - g : Real_Vector (0 .. 4) := (1.0, 0.5, 0.5, 0.5, 1.0); - b : Real_Vector (0 .. 4) := (1.0, 1.0, 0.5, 0.25, 0.0); - A_Boolean :Boolean_Array_1D(0 .. 4) := (False, False, False, False, False); + r : Real_Vector (0 .. 4) := (0.0, 0.25, 0.5, 1.0, 1.0); + g : Real_Vector (0 .. 4) := (1.0, 0.5, 0.5, 0.5, 1.0); + b : Real_Vector (0 .. 4) := (1.0, 1.0, 0.5, 0.25, 0.0); + Reverse_Flag : Boolean_Array_1D (0 .. 4) := (False, False, False, False, False); procedure plfbox (x0, y0 : Long_Float) is x, y : Real_Vector (0 ..3); @@ -100,11 +99,10 @@ y0(8) := 12.0; y0(9) := 3.0; - Set_Color_Map_1_Piecewise(RGB, pos, r, g, b, A_Boolean); + Set_Color_Map_1_Piecewise(RGB, pos, r, g, b, Reverse_Flag); for i in y0'range loop - --Set_Pen_Color(i + 1); - Set_Color_Map_1(Long_Float(i)/9.0); + Set_Color_Map_1(Long_Float(i)/9.0); Select_Fill_Pattern(0); plfbox((1980.0 + Long_Float(i)), y0(i)); Write_Text_World(1980.0 + Long_Float(i) + 0.5, y0(i) + 1.0, 1.0, 0.0, 0.5, Trim(Integer'image(Integer(y0(i))), Left)); Modified: trunk/examples/ada/xthick15a.adb.cmake =================================================================== --- trunk/examples/ada/xthick15a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/xthick15a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -53,10 +53,8 @@ ---------------------------------------------------------------------------- procedure cmap1_init2 is i, h, l, s : Real_Vector(0 .. 3); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 3) := (False, False, False, False); begin - A_Boolean(1) := False; -- Don't reverse direction of control points - -- Set control points. i(0) := 0.0; -- left boundary i(1) := 0.45; -- just before center @@ -81,7 +79,7 @@ s(2) := 0.5; -- center s(3) := 1.0; -- high - Set_Color_Map_1_Piecewise(HLS, i, h, l, s, A_Boolean); + Set_Color_Map_1_Piecewise(HLS, i, h, l, s, Reverse_Flag); end cmap1_init2; ---------------------------------------------------------------------------- Modified: trunk/examples/ada/xthick20a.adb.cmake =================================================================== --- trunk/examples/ada/xthick20a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/xthick20a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -217,7 +217,7 @@ -- Set gray colormap. procedure gray_cmap(num_col : Integer) is r, g, b, pos : Real_Vector(0 .. 1); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); begin r(0) := 0.0; g(0) := 0.0; @@ -231,8 +231,7 @@ pos(1) := 1.0; Set_Number_Of_Colors_In_Color_Map_1(num_col); - A_Boolean(1) := False; - Set_Color_Map_1_Piecewise(RGB, pos, r, g, b, A_Boolean); + Set_Color_Map_1_Piecewise(RGB, pos, r, g, b, Reverse_Flag); end gray_cmap; Modified: trunk/examples/ada/xthick21a.adb.cmake =================================================================== --- trunk/examples/ada/xthick21a.adb.cmake 2009-01-11 12:06:27 UTC (rev 9294) +++ trunk/examples/ada/xthick21a.adb.cmake 2009-01-13 10:24:55 UTC (rev 9295) @@ -85,10 +85,8 @@ procedure cmap1_init is i, h, l, s : Real_Vector(0 .. 1); - A_Boolean : Boolean_Array_1D(1 .. 1); + Reverse_Flag : Boolean_Array_1D(0 .. 1) := (False, False); begin - A_Boolean(1) := False; -- Don't reverse direction of control points - i(0) := 0.0; -- left boundary i(1) := 1.0; -- right boundary @@ -102,7 +100,7 @@ s(1) := 0.8; Set_Number_Of_Colors_In_Color_Map_1(256); - Set_Color_Map_1_Piecewise(HLS, i, h, l, s, A_Boolean); + Set_Color_Map_1_Piecewise(HLS, i, h, l, s, Reverse_Flag); end cmap1_init; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |