1-- Thick Ada binding to PLplot
2
3-- Copyright (C) 2006-2013 Jerry Bauck
4
5-- This file is part of PLplot.
6
7-- PLplot is free software; you can redistribute it and/or modify
8-- it under the terms of the GNU Library General Public License as published
9-- by the Free Software Foundation; either version 2 of the License, or
10-- (at your option) any later version.
11
12-- PLplot is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15-- GNU Library General Public License for more details.
16
17-- You should have received a copy of the GNU Library General Public License
18-- along with PLplot; if not, write to the Free Software
19-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21with
22    PLplot_Thin,
23    PLplot_Auxiliary,
24    System,
25    Interfaces.C.Pointers,
26    Ada.Strings.Unbounded,
27    Ada.Strings.Maps;
28use
29    PLplot_Thin,
30    PLplot_Auxiliary,
31    Ada.Strings.Unbounded;
32
33package PLplot_Standard is
34
35    -- Used with Set_Device_Window_Parameters.
36    PL_NOTSET : Long_Float renames PLplot_Thin.PL_NOTSET;
37
38    -- "Rename" some useful types from the thin binding.
39    subtype Boolean_Array_1D is PLplot_Thin.Boolean_Array_1D;
40    subtype Integer_Array_1D is PLplot_Thin.Integer_Array_1D;
41
42    -- "Rename" some types mainly used for contour plots and the like so that
43    -- user programs can see them without with-ing PLplot_thin. It might be
44    -- good to remove "use PLplot_Thin" for clarity since it is used in only
45    -- a few places.
46    subtype PL_Pointer                 is Plplot_Thin.PL_Pointer;
47    -- The following deprecated spelling is not used anywhere in the Ada bindings
48    -- or examples but is provided for backwards compatibility.
49    subtype PLpointer                  is Plplot_Thin.PLpointer; -- DEPRECATED
50    subtype Unsigned_Int               is Interfaces.C.unsigned;
51    subtype Transformation_Data_Type   is Plplot_Thin.Transformation_Data_Type;
52    subtype Transformation_Data_Type_2 is Plplot_Thin.Transformation_Data_Type_2;
53    subtype Graphics_Input_Record_Type is Plplot_Thin.PLGraphicsIn;
54
55    -- "Rename" the unicode type for characters.
56    subtype Unicode is PLplot_Thin.PLUNICODE;
57
58    -- Rename Plplot_Thin.plfill so that a pointer to it can be passed to
59    -- procedures such as Shade_Region and Shade_Regions and called with C
60    -- conventions. Note that Plplot_Thin.plfill is already in C so that it does
61    -- not have to be re-written like e.g. pltr1 was for plcont. The Ada
62    -- procedure Fill_Polygon in this package can't be used because it does not carry
63    -- the array dimensions which will be needed by the time it is finally
64    -- called deep within the plplot calling chain; this is why the version
65    -- from this package (PLplot_Traditional) can't be used. Thus, this also
66    -- overloads the name Fill_Polygon. It might never occur to the Ada programmer
67    -- that this is happening, which is good.
68    -- Suppress these warnings compatibly with pre-4.3 GNAT:
69    --    "foreign caller must pass bounds explicitly"
70    --    "type of argument ""plfill.x"" is unconstrained array"
71    --    "type of argument ""plfill.y"" is unconstrained array"
72    pragma Warnings(Off);
73    procedure Fill_Polygon(length : Integer; x, y : Real_Vector) renames PLplot_Thin.plfill;
74    pragma Warnings(On);
75
76    -- Make Mask_Function_Pointer_Type available to the user so that s/he doesn't
77    -- have to "with" PLplot_Thin. Note that it is also used herein.
78    subtype Mask_Function_Pointer_Type is PLplot_Thin.Mask_Function_Pointer_Type;
79
80    -- "Rename" callback for map functions plmap and plmeridians.
81    subtype Map_Form_Function_Pointer_Type is Plplot_Thin.Map_Form_Function_Pointer_Type;
82
83    -- "Rename" the necessarily constrained array for mapping longitudes and latitudes.
84    subtype Map_Form_Constrained_Array is PLplot_Thin.Map_Form_Constrained_Array;
85
86    -- This is a fixed-length string for use with custom label procedures
87    -- in Custom_Label_Procedure_Pointer_Type, and plslabelfunc (Set_Custom_Label).
88    -- This length, 0 .. 40, is hardwired in the PLplot C code; this type will
89    -- fail if that length is ever changed.
90    Max_Label_String_Length : Integer renames PLplot_Thin.Max_Label_String_Length;
91    subtype Label_String_Type is PLplot_Thin.Label_String_Type;
92
93    -- "Rename" callback for custom label functions.
94    subtype Custom_Label_Procedure_Pointer_Type is
95        PLplot_Thin.Custom_Label_Procedure_Pointer_Type;
96
97    -- "Rename" callback for custom coordinate transform procedure.
98    subtype Coordinate_Transform_Procedure_Pointer_Type is
99        PLplot_Thin.Coordinate_Transform_Procedure_Pointer_Type;
100
101--------------------------------------------------------------------------------
102--        Types and constants for thick binding                               --
103--------------------------------------------------------------------------------
104
105    -- Default dummy arrays for various plotters which take multiple inputs.
106    subtype Length_One_Real_Vector is Real_Vector(1..1);
107    Dont_Plot_This : Length_One_Real_Vector := (1..1 => Long_Float'small);
108
109    -- Default colors for Color Map 0.
110    -- These are hard-wired to the current colors of color map 0; if that
111    -- color map has been changed, then these colors will return surprising
112    -- results. Color map 0 can always be restored to its default state using
113    -- Restore_Default_Snapshot_Of_Color_Map_0.
114    subtype Plot_Color_Type is Natural; -- Remember that user can expand color map 0.
115    Black      : constant Plot_Color_Type := 0;
116    Red        : constant Plot_Color_Type := 1;
117    Yellow     : constant Plot_Color_Type := 2;
118    Green      : constant Plot_Color_Type := 3;
119    Aquamarine : constant Plot_Color_Type := 4;
120    Pink       : constant Plot_Color_Type := 5;
121    Wheat      : constant Plot_Color_Type := 6;
122    Grey       : constant Plot_Color_Type := 7;
123    Brown      : constant Plot_Color_Type := 8;
124    Blue       : constant Plot_Color_Type := 9;
125    BlueViolet : constant Plot_Color_Type := 10;
126    Cyan       : constant Plot_Color_Type := 11;
127    Turquoise  : constant Plot_Color_Type := 12;
128    Magenta    : constant Plot_Color_Type := 13;
129    Salmon     : constant Plot_Color_Type := 14;
130    White      : constant Plot_Color_Type := 15;
131
132
133    Max_Lines_For_Multiplot : constant := 5;
134
135    -- Pre-defined line styles, e.g., continuous, dashed, etc.
136    -- fixme Discover actual line types and make up names for them. PLplot API uses integers.
137    subtype Line_Style_Type is Integer range 1..8;
138
139    -- Arrays for various line appearances.
140    type Color_Array_Type      is array (1..Max_Lines_For_Multiplot) of Plot_Color_Type;
141    Default_Color_Array : Color_Array_Type := (Red, Blue, Green, Salmon, BlueViolet);
142
143    type Line_Width_Array_Type is array (1..Max_Lines_For_Multiplot) of Long_Float;
144    Default_Line_Width_Array : Line_Width_Array_Type := (1.0, 1.0, 1.0, 1.0, 1.0);
145
146    type Line_Style_Array_Type is array (1..Max_Lines_For_Multiplot) of Line_Style_Type;
147    Default_Line_Style_Array : Line_Style_Array_Type := (1, 1, 1, 1, 1);
148
149    -- Things for label strings
150    Default_Label_String : constant Unbounded_String := To_Unbounded_String("");
151    type Label_String_Array_Type is array (1..Max_Lines_For_Multiplot) of Unbounded_String;
152    Default_Label_String_Array : Label_String_Array_Type := (others => Default_Label_String);
153
154    -- Things for stripcharts
155    Maximum_Number_Of_Stripcharts : Integer := 4; -- Limited by PLplot designers.
156    type Stripchart_Label_String_Array_Type is array (1 .. Maximum_Number_Of_Stripcharts) of Unbounded_String;
157
158    -- Things for legends
159    -- The user program must declare one of these with definite bounds, one
160    -- element for each legend label.
161    type Legend_String_Array_Type is array (Integer range <>) of Unbounded_String;
162
163    --Flags used for position argument of both pllegend and plcolorbar
164    -- (duplicated from plplot_thin.ads)
165    PL_Position_Left     : constant Legend_Colorbar_Position_Type := 1;
166    PL_Position_Right    : constant Legend_Colorbar_Position_Type := 2;
167    PL_Position_Top      : constant Legend_Colorbar_Position_Type := 4;
168    PL_Position_Bottom   : constant Legend_Colorbar_Position_Type := 8;
169    PL_Position_Inside   : constant Legend_Colorbar_Position_Type := 16;
170    PL_Position_Outside  : constant Legend_Colorbar_Position_Type := 32;
171    PL_Position_Viewport : constant Legend_Colorbar_Position_Type := 64;
172    PL_Position_Subpage  : constant Legend_Colorbar_Position_Type := 128;
173
174    --Renamed flags used for position argument of both pllegend and plcolorbar
175    Legend_Position_Left     : constant Legend_Colorbar_Position_Type := PL_Position_Left;
176    Legend_Position_Right    : constant Legend_Colorbar_Position_Type := PL_Position_Right;
177    Legend_Position_Top      : constant Legend_Colorbar_Position_Type := PL_Position_Top;
178    Legend_Position_Bottom   : constant Legend_Colorbar_Position_Type := PL_Position_Bottom;
179    Legend_Position_Inside   : constant Legend_Colorbar_Position_Type := PL_Position_Inside;
180    Legend_Position_Outside  : constant Legend_Colorbar_Position_Type := PL_Position_Outside;
181    Legend_Position_Viewport : constant Legend_Colorbar_Position_Type := PL_Position_Viewport;
182    Legend_Position_Subpage  : constant Legend_Colorbar_Position_Type := PL_Position_Subpage;
183
184    -- Flags for pllegend (duplicated from plplot_thin.ads)
185    PL_Legend_None         : constant Legend_Flag_Type := 1;
186    PL_Legend_Color_Box    : constant Legend_Flag_Type := 2;
187    PL_Legend_Line         : constant Legend_Flag_Type := 4;
188    PL_Legend_Symbol       : constant Legend_Flag_Type := 8;
189    PL_Legend_Text_Left    : constant Legend_Flag_Type := 16;
190    PL_Legend_Background   : constant Legend_Flag_Type := 32;
191    PL_Legend_Bounding_Box : constant Legend_Flag_Type := 64;
192    PL_Legend_Row_Major    : constant Legend_Flag_Type := 128;
193
194    -- Renamed flags for pllegend
195    Legend_None         : constant Legend_Flag_Type := PL_Legend_None;
196    Legend_Color_Box    : constant Legend_Flag_Type := PL_Legend_Color_Box;
197    Legend_Line         : constant Legend_Flag_Type := PL_Legend_Line;
198    Legend_Symbol       : constant Legend_Flag_Type := PL_Legend_Symbol;
199    Legend_Text_Left    : constant Legend_Flag_Type := PL_Legend_Text_Left;
200    Legend_Background   : constant Legend_Flag_Type := PL_Legend_Background;
201    Legend_Bounding_Box : constant Legend_Flag_Type := PL_Legend_Bounding_Box;
202    Legend_Row_Major    : constant Legend_Flag_Type := PL_Legend_Row_Major;
203
204    -- Flags for plcolorbar (duplicated from plplot_thin.ads)
205    PL_Colorbar_Label_Left    : constant Colorbar_Flag_Type := 1;
206    PL_Colorbar_Label_Right   : constant Colorbar_Flag_Type := 2;
207    PL_Colorbar_Label_Top     : constant Colorbar_Flag_Type := 4;
208    PL_Colorbar_Label_Bottom  : constant Colorbar_Flag_Type := 8;
209    PL_Colorbar_Image         : constant Colorbar_Flag_Type := 16;
210    PL_Colorbar_Shade         : constant Colorbar_Flag_Type := 32;
211    PL_Colorbar_Gradient      : constant Colorbar_Flag_Type := 64;
212    PL_Colorbar_Cap_None      : constant Colorbar_Flag_Type := 128;
213    PL_Colorbar_Cap_Low       : constant Colorbar_Flag_Type := 256;
214    PL_Colorbar_Cap_High      : constant Colorbar_Flag_Type := 512;
215    PL_Colorbar_Shade_Label   : constant Colorbar_Flag_Type := 1024;
216    PL_Colorbar_Orient_Right  : constant Colorbar_Flag_Type := 2048;
217    PL_Colorbar_Orient_Top    : constant Colorbar_Flag_Type := 4096;
218    PL_Colorbar_Orient_Left   : constant Colorbar_Flag_Type := 8192;
219    PL_Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := 16384;
220    PL_Colorbar_Background    : constant Colorbar_Flag_Type := 32768;
221    PL_Colorbar_Bounding_Box  : constant Colorbar_Flag_Type := 65536;
222
223    -- Renamed flags for plcolorbar
224    Colorbar_Label_Left    : constant Colorbar_Flag_Type := PL_Colorbar_Label_Left;
225    Colorbar_Label_Right   : constant Colorbar_Flag_Type := PL_Colorbar_Label_Right;
226    Colorbar_Label_Top     : constant Colorbar_Flag_Type := PL_Colorbar_Label_Top;
227    Colorbar_Label_Bottom  : constant Colorbar_Flag_Type := PL_Colorbar_Label_Bottom;
228    Colorbar_Image         : constant Colorbar_Flag_Type := PL_Colorbar_Image;
229    Colorbar_Shade         : constant Colorbar_Flag_Type := PL_Colorbar_Shade;
230    Colorbar_Gradient      : constant Colorbar_Flag_Type := PL_Colorbar_Gradient;
231    Colorbar_Cap_None      : constant Colorbar_Flag_Type := PL_Colorbar_Cap_None;
232    Colorbar_Cap_Low       : constant Colorbar_Flag_Type := PL_Colorbar_Cap_Low;
233    Colorbar_Cap_High      : constant Colorbar_Flag_Type := PL_Colorbar_Cap_High;
234    Colorbar_Shade_Label   : constant Colorbar_Flag_Type := PL_Colorbar_Shade_Label;
235    Colorbar_Orient_Right  : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Right;
236    Colorbar_Orient_Top    : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Top;
237    Colorbar_Orient_Left   : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Left;
238    Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Bottom;
239    Colorbar_Background    : constant Colorbar_Flag_Type := PL_Colorbar_Background;
240    Colorbar_Bounding_Box  : constant Colorbar_Flag_Type := PL_Colorbar_Bounding_Box;
241
242    -- Justification for plots
243    subtype Justification_Type is Integer range -1..2;
244    User_Justified       : constant Justification_Type := -1;
245    Not_Justified        : constant Justification_Type := 0;
246    Justified            : constant Justification_Type := 1;
247    Justified_Square_Box : constant Justification_Type := 2;
248
249    -- Axis styles
250    subtype Axis_Style_Type is Integer range -2..73; -- Not all values are used. fix this in docs
251
252    No_Box            : constant Axis_Style_Type := -2;
253    Box               : constant Axis_Style_Type := -1;
254
255    Linear_Box_Plus   : constant Axis_Style_Type := 0;
256    Linear_Zero_Axes  : constant Axis_Style_Type := 1;
257    Linear_Major_Grid : constant Axis_Style_Type := 2;
258    Linear_Minor_Grid : constant Axis_Style_Type := 3;
259
260    Log_X_Box_Plus    : constant Axis_Style_Type := 10;
261    Log_X_Zero_Axes   : constant Axis_Style_Type := 11;
262    Log_X_Major_Grid  : constant Axis_Style_Type := 12;
263    Log_X_Minor_Grid  : constant Axis_Style_Type := 13;
264
265    Log_Y_Box_Plus    : constant Axis_Style_Type := 20;
266    Log_Y_Zero_Axes   : constant Axis_Style_Type := 21;
267    Log_Y_Major_Grid  : constant Axis_Style_Type := 22;
268    Log_Y_Minor_Grid  : constant Axis_Style_Type := 23;
269
270    Log_XY_Box_Plus   : constant Axis_Style_Type := 30;
271    Log_XY_Zero_Axes  : constant Axis_Style_Type := 31;
272    Log_XY_Major_Grid : constant Axis_Style_Type := 32;
273    Log_XY_Minor_Grid : constant Axis_Style_Type := 33;
274
275    Date_Time_X_Linear_Box_Plus    : constant Axis_Style_Type := 40;
276    Date_Time_X_Linear_Zero_Axes   : constant Axis_Style_Type := 41;
277    Date_Time_X_Linear_Major_Grid  : constant Axis_Style_Type := 42;
278    Date_Time_X_Linear_Minor_Grid  : constant Axis_Style_Type := 43;
279
280    Date_Time_Y_Linear_Box_Plus    : constant Axis_Style_Type := 50;
281    Date_Time_Y_Linear_Zero_Axes   : constant Axis_Style_Type := 51;
282    Date_Time_Y_Linear_Major_Grid  : constant Axis_Style_Type := 52;
283    Date_Time_Y_Linear_Minor_Grid  : constant Axis_Style_Type := 53;
284
285    Date_Time_XY_Linear_Box_Plus   : constant Axis_Style_Type := 60;
286    Date_Time_XY_Linear_Zero_Axes  : constant Axis_Style_Type := 61;
287    Date_Time_XY_Linear_Major_Grid : constant Axis_Style_Type := 62;
288    Date_Time_XY_Linear_Minor_Grid : constant Axis_Style_Type := 63;
289
290    Custom_Labels_Linear_Box_Plus   : constant Axis_Style_Type := 70;
291    Custom_Labels_Linear_Zero_Axes  : constant Axis_Style_Type := 71;
292    Custom_Labels_Linear_Major_Grid : constant Axis_Style_Type := 72;
293    Custom_Labels_Linear_Minor_Grid : constant Axis_Style_Type := 73;
294
295    -- Integer constrained to 0..255
296    subtype Integer_0_255_Type is Integer range 0 .. 255;
297    type Integer_0_255_Array is array (Integer range <>) of Integer_0_255_Type;
298
299    -- Long_Float constrained to 0.0 .. 1.0.
300    subtype Long_Float_0_1_Type is Long_Float range 0.0 .. 1.0;
301
302    -- Escape characters for text strings
303    Escape_Character_Set : Ada.Strings.Maps.Character_Set;
304
305    -- Generic font styles
306    subtype Font_Style_Type is Integer range 1..4;
307    Normal_Font : constant Font_Style_Type := 1;
308    Roman_Font  : constant Font_Style_Type := 2;
309    Italic_Font : constant Font_Style_Type := 3;
310    Script_Font : constant Font_Style_Type := 4;
311    -- Bold_Font?
312
313    -- Character sets
314    subtype Character_Set_Type is Integer range 0..1;
315    Standard_Character_Set : constant Character_Set_Type := 0;
316    Extended_Character_Set : constant Character_Set_Type := 1;
317
318    -- Plot orientation
319    type Orientation_Type is (Landscape, Portrait);
320
321    -- Constant for several procedures which don't change a parameter if used
322    Unchanged : constant Integer := 0;
323
324    -- Pre-defined fill patterns
325    subtype Fill_Pattern_Type is Integer range 0..8; -- Guessing; not documented
326
327    -- Modes for parsing command line arguments.
328    Parse_Partial    : constant Parse_Mode_Type := 0;   -- For backward compatibility
329    Parse_Full       : constant Parse_Mode_Type := 1;   -- Process fully & exit if error
330    Parse_Quiet      : constant Parse_Mode_Type := 2;   -- Don't issue messages
331    Parse_No_Delete  : constant Parse_Mode_Type := 4;   -- Don't delete options after processing
332    Parse_Show_All   : constant Parse_Mode_Type := 8;   -- Show invisible options
333    Parse_Override   : constant Parse_Mode_Type := 16;  -- Obsolete
334    Parse_No_Program : constant Parse_Mode_Type := 32;  -- Program name NOT in *argv[0]..
335    Parse_No_Dash    : constant Parse_Mode_Type := 64;  -- Set if leading dash NOT required
336    Parse_Skip       : constant Parse_Mode_Type := 128; -- Skip over unrecognized args
337
338    -- FCI (font characterization integer) related constants.
339    FCI_Mark                : constant Integer := 16#10000000#;
340    FCI_Impossible          : constant Integer := 16#00000000#;
341    FCI_Hexdigit_Mask       : constant Integer := 16#f#;
342    FCI_Hexpower_Mask       : constant Integer := 16#7#;
343    FCI_Hexpower_Impossible : constant Integer := 16#f#;
344    -- These define hexpower values corresponding to each font attribute.
345    FCI_Family : constant Integer := 16#0#;
346    FCI_Style  : constant Integer := 16#1#;
347    FCI_Weight : constant Integer := 16#2#;
348    -- These are legal values for font family attribute
349    FCI_Sans   : constant Integer := 16#0#;
350    FCI_Serif  : constant Integer := 16#1#;
351    FCI_Mono   : constant Integer := 16#2#;
352    FCI_Script : constant Integer := 16#3#;
353    FCI_Symbol : constant Integer := 16#4#;
354    -- These are legal values for font style attribute
355    FCI_Upright : constant Integer := 16#0#;
356    FCI_Italic  : constant Integer := 16#1#;
357    FCI_Oblique : constant Integer := 16#2#;
358    -- These are legal values for font weight attribute
359    FCI_Medium : constant Integer := 16#0#;
360    FCI_Bold   : constant Integer := 16#1#;
361
362    -- Descriptions of map outlines for continents, countries, and US states.
363    type Map_Type is (Continents, USA_and_States, Continents_and_Countries, USA_States_and_Continents);
364
365    -- definitions for the opt argument in plot3dc() and plsurf3d()
366    -- DRAW_LINEX *must* be 1 and DRAW_LINEY *must* be 2, because of legacy code!
367    -- fix this Why is there no type declared for these?
368    No_3D_Options             : constant Integer := 0;   -- None of the options
369    Lines_Parallel_To_X       : constant Integer := 1;   -- draw lines parallel to the X axis
370    Lines_Parallel_To_Y       : constant Integer := 2;   -- draw lines parallel to the Y axis
371    Lines_Parallel_To_X_And_Y : constant Integer := 3;   -- draw lines parallel to both the X and Y axis
372    Magnitude_Color           : constant Integer := 4;   -- draw the mesh with a color dependent of the magnitude
373    Base_Contour              : constant Integer := 8;   -- draw contour plot at bottom xy plane
374    Top_Contour               : constant Integer := 16;  -- draw contour plot at top xy plane
375    Surface_Contour           : constant Integer := 32;  -- draw contour plot at surface
376    Sides                     : constant Integer := 64;  -- draw sides
377    Facets                    : constant Integer := 128; -- draw outline for each square that makes up the surface
378    Meshed                    : constant Integer := 256; -- draw mesh
379
380    subtype Gridding_Algorithm_Type is Integer range 1..6;
381
382    -- Type of gridding algorithm for plgriddata()
383    -- "Long form" gridding algorithm names
384    Grid_Bivariate_Cubic_Spline_Approximation               : constant Gridding_Algorithm_Type := 1; -- GRID_CSA
385    Grid_Delaunay_Triangulation_Linear_Interpolation        : constant Gridding_Algorithm_Type := 2; -- GRID_DTLI
386    Grid_Natural_Neighbors_Interpolation                    : constant Gridding_Algorithm_Type := 3; -- GRID_NNI
387    Grid_Nearest_Neighbors_Inverse_Distance_Weighted        : constant Gridding_Algorithm_Type := 4; -- GRID_NNIDW
388    Grid_Nearest_Neighbors_Linear_Interpolation             : constant Gridding_Algorithm_Type := 5; -- GRID_NNLI
389    Grid_Nearest_Neighbors_Around_Inverse_Distance_Weighted : constant Gridding_Algorithm_Type := 6; -- GRID_NNAIDW
390
391    -- Axis label tags
392    x_axis : constant Integer := 1; -- The x-axis
393    y_axis : constant Integer := 2; -- The y-axis
394    z_axis : constant Integer := 3; -- The z-axis
395
396--------------------------------------------------------------------------------
397-- Constants copied from PLplot_Thin.ads so that it doesn't have to be seen.  --
398-- These are replicated herein with other names. Either name may be used,     --
399-- e.g., Parse_Full is the same as PL_PARSE_FULL.                             --
400--------------------------------------------------------------------------------
401
402    -- Modes for parsing command line arguments (redux).
403    PL_PARSE_PARTIAL   : constant Parse_Mode_Type := 16#0000#; -- For backward compatibility
404    PL_PARSE_FULL      : constant Parse_Mode_Type := 16#0001#; -- Process fully & exit if error
405    PL_PARSE_QUIET     : constant Parse_Mode_Type := 16#0002#; -- Don't issue messages
406    PL_PARSE_NODELETE  : constant Parse_Mode_Type := 16#0004#; -- Don't delete options after processing
407    PL_PARSE_SHOWALL   : constant Parse_Mode_Type := 16#0008#; -- Show invisible options
408    PL_PARSE_OVERRIDE  : constant Parse_Mode_Type := 16#0010#; -- Obsolete
409    PL_PARSE_NOPROGRAM : constant Parse_Mode_Type := 16#0020#; -- Program name NOT in *argv[0]..
410    PL_PARSE_NODASH    : constant Parse_Mode_Type := 16#0040#; -- Set if leading dash NOT required
411    PL_PARSE_SKIP      : constant Parse_Mode_Type := 16#0080#; -- Skip over unrecognized args
412
413    -- FCI (font characterization integer) related constants.
414    PL_FCI_MARK                : constant Integer := 16#10000000#;
415    PL_FCI_IMPOSSIBLE          : constant Integer := 16#00000000#;
416    PL_FCI_HEXDIGIT_MASK       : constant Integer := 16#f#;
417    PL_FCI_HEXPOWER_MASK       : constant Integer := 16#7#;
418    PL_FCI_HEXPOWER_IMPOSSIBLE : constant Integer := 16#f#;
419    -- These define hexpower values corresponding to each font attribute.
420    PL_FCI_FAMILY : constant Integer := 16#0#;
421    PL_FCI_STYLE  : constant Integer := 16#1#;
422    PL_FCI_WEIGHT : constant Integer := 16#2#;
423    -- These are legal values for font family attribute
424    PL_FCI_SANS   : constant Integer := 16#0#;
425    PL_FCI_SERIF  : constant Integer := 16#1#;
426    PL_FCI_MONO   : constant Integer := 16#2#;
427    PL_FCI_SCRIPT : constant Integer := 16#3#;
428    PL_FCI_SYMBOL : constant Integer := 16#4#;
429    -- These are legal values for font style attribute
430    PL_FCI_UPRIGHT : constant Integer := 16#0#;
431    PL_FCI_ITALIC  : constant Integer := 16#1#;
432    PL_FCI_OBLIQUE : constant Integer := 16#2#;
433    -- These are legal values for font weight attribute
434    PL_FCI_MEDIUM : constant Integer := 16#0#;
435    PL_FCI_BOLD   : constant Integer := 16#1#;
436
437    -- Definitions for the opt argument in plot3dc() and plsurf3d()
438    DRAW_LINEX  : constant Integer := 1;   -- draw lines parallel to the X axis
439    DRAW_LINEY  : constant Integer := 2;   -- draw lines parallel to the Y axis
440    DRAW_LINEXY : constant Integer := 3;   -- draw lines parallel to both the X and Y axis
441    MAG_COLOR   : constant Integer := 4;   -- draw the mesh with a color dependent of the magnitude
442    BASE_CONT   : constant Integer := 8;   -- draw contour plot at bottom xy plane
443    TOP_CONT    : constant Integer := 16;  -- draw contour plot at top xy plane
444    SURF_CONT   : constant Integer := 32;  -- draw contour plot at surface
445    DRAW_SIDES  : constant Integer := 64;  -- draw sides
446    FACETED     : constant Integer := 128; -- draw outline for each square that makes up the surface
447    MESH        : constant Integer := 256; -- draw mesh
448
449    -- Type of gridding algorithm for plgriddata()
450    GRID_CSA    : constant Gridding_Algorithm_Type := 1;
451    GRID_DTLI   : constant Gridding_Algorithm_Type := 2;
452    GRID_NNI    : constant Gridding_Algorithm_Type := 3;
453    GRID_NNIDW  : constant Gridding_Algorithm_Type := 4;
454    GRID_NNLI   : constant Gridding_Algorithm_Type := 5;
455    GRID_NNAIDW : constant Gridding_Algorithm_Type := 6;
456
457    -- Axis label tags
458    -- "PLplot style" names
459    -- This version for custom labels in plslabelfunc. Compare with e.g. "x_axis" above.
460    PL_X_AXIS : constant Integer := 1; -- The x-axis
461    PL_Y_AXIS : constant Integer := 2; -- The y-axis
462    PL_Z_AXIS : constant Integer := 3; -- The z-axis
463    -- "Ada style" names
464    Label_X_Axis : constant Integer := 1; -- The x-axis
465    Label_Y_Axis : constant Integer := 2; -- The y-axis
466    Label_Z_Axis : constant Integer := 3; -- The z-axis
467
468--------------------------------------------------------------------------------
469
470
471    -- fix this Why is there no style here?
472    -- Flags for the opt argument in plhist                                   --
473    Histogram_Default         : constant Integer := 0;
474    Histogram_Noscaling       : constant Integer := 1;
475    Histogram_Ignore_Outliers : constant Integer := 2;
476    Histogram_Noexpand        : constant Integer := 8;
477    Histogram_Noempty         : constant Integer := 16;
478
479
480    -- Flags for the opt argument in plbin                                    --
481    Bin_Default   : constant Integer := 0;
482    Bin_Centered  : constant Integer := 1;
483    Bin_Noexpand  : constant Integer := 2;
484    Bin_Noempty   : constant Integer := 4;
485
486
487--------------------------------------------------------------------------------
488-- A convenient string function                                               --
489--------------------------------------------------------------------------------
490
491    -- Short name for To_Unbounded_String
492    function TUB(arg : String) return Ada.Strings.Unbounded.Unbounded_String renames Ada.Strings.Unbounded.To_Unbounded_String;
493
494
495--------------------------------------------------------------------------------
496--        High-Level subroutines for thick binding                            --
497--------------------------------------------------------------------------------
498
499    -- When asked to draw white lines on black background, do it.
500    -- This is the default.
501    procedure Draw_On_Black;
502
503
504    -- When asked to draw black lines on white background, reverse black and white.
505    -- This might look better on anti-aliased displays.
506    procedure Draw_On_White;
507
508
509    -- Plotter for up to five x-y pairs and settable axis style, plot
510    -- line colors, widths, and styles, justification, zoom, and labels.
511    -- Can be used directly or as part of a "simple" plotter
512    -- such as those that follow or are made by the user.
513    procedure Multiplot_Pairs
514       (x1            : Real_Vector     := Dont_Plot_This;
515        y1            : Real_Vector     := Dont_Plot_This;
516        x2            : Real_Vector     := Dont_Plot_This;
517        y2            : Real_Vector     := Dont_Plot_This;
518        x3            : Real_Vector     := Dont_Plot_This;
519        y3            : Real_Vector     := Dont_Plot_This;
520        x4            : Real_Vector     := Dont_Plot_This;
521        y4            : Real_Vector     := Dont_Plot_This;
522        x5            : Real_Vector     := Dont_Plot_This;
523        y5            : Real_Vector     := Dont_Plot_This;
524        X_Labels      : Label_String_Array_Type := Default_Label_String_Array;
525        Y_Labels      : Label_String_Array_Type := Default_Label_String_Array;
526        Title_Labels  : Label_String_Array_Type := Default_Label_String_Array;
527        Axis_Style    : Axis_Style_Type         := Linear_Box_Plus;
528        Colors        : Color_Array_Type        := Default_Color_Array;
529        Line_Widths   : Line_Width_Array_Type   := Default_Line_Width_Array;
530        Line_Styles   : Line_Style_Array_Type   := Default_Line_Style_Array;
531        Justification : Justification_Type      := Not_Justified;
532        x_Min_Zoom    : Long_Float              := Long_Float'small;
533        x_Max_Zoom    : Long_Float              := Long_Float'large;
534        y_Min_Zoom    : Long_Float              := Long_Float'small;
535        y_Max_Zoom    : Long_Float              := Long_Float'large);
536
537
538--------- Simple plotters requiring minimal arguments -----
539
540
541    -- Quick plotter requires no x-axis as input; makes x up from indices of first of multiple y's.
542    procedure Quick_Plot
543       (y1 : Real_Vector := Dont_Plot_This;
544        y2 : Real_Vector := Dont_Plot_This;
545        y3 : Real_Vector := Dont_Plot_This;
546        y4 : Real_Vector := Dont_Plot_This;
547        y5 : Real_Vector := Dont_Plot_This;
548        X_Label     : String := To_String(Default_Label_String);
549        Y_Label     : String := To_String(Default_Label_String);
550        Title_Label : String := To_String(Default_Label_String));
551
552
553    -- fix this Add x, y, title labels; make default " " or see predefined default.
554    -- Simple plotter for single x array and multiple y arrays
555    procedure Simple_Plot
556       (x  : Real_Vector;
557        y1 : Real_Vector := Dont_Plot_This;
558        y2 : Real_Vector := Dont_Plot_This;
559        y3 : Real_Vector := Dont_Plot_This;
560        y4 : Real_Vector := Dont_Plot_This;
561        y5 : Real_Vector := Dont_Plot_This;
562        X_Label     : String := To_String(Default_Label_String);
563        Y_Label     : String := To_String(Default_Label_String);
564        Title_Label : String := To_String(Default_Label_String));
565
566
567    -- Simple log x plotter for single x array and multiple y arrays
568    procedure Simple_Plot_Log_X
569       (x  : Real_Vector;
570        y1 : Real_Vector := Dont_Plot_This;
571        y2 : Real_Vector := Dont_Plot_This;
572        y3 : Real_Vector := Dont_Plot_This;
573        y4 : Real_Vector := Dont_Plot_This;
574        y5 : Real_Vector := Dont_Plot_This;
575        X_Label     : String := To_String(Default_Label_String);
576        Y_Label     : String := To_String(Default_Label_String);
577        Title_Label : String := To_String(Default_Label_String);
578        Log_Base : Long_Float := 10.0); -- Should this default to e?
579
580
581    -- Simple log y plotter for multiple x arrays and single y array
582    procedure Simple_Plot_Log_Y
583       (x1 : Real_Vector := Dont_Plot_This;
584        y  : Real_Vector := Dont_Plot_This; -- Beware of argument order.
585        x2 : Real_Vector := Dont_Plot_This;
586        x3 : Real_Vector := Dont_Plot_This;
587        x4 : Real_Vector := Dont_Plot_This;
588        x5 : Real_Vector := Dont_Plot_This;
589        X_Label     : String := To_String(Default_Label_String);
590        Y_Label     : String := To_String(Default_Label_String);
591        Title_Label : String := To_String(Default_Label_String);
592        Log_Base : Long_Float := 10.0); -- Should this default to e?
593
594
595    -- Simple log x - log y plotter
596    procedure Simple_Plot_Log_XY
597       (x, y        : Real_Vector;
598        X_Label     : String := To_String(Default_Label_String);
599        Y_Label     : String := To_String(Default_Label_String);
600        Title_Label : String := To_String(Default_Label_String);
601        x_Log_Base, y_Log_Base : Long_Float := 10.0); -- Should this default to e?
602
603
604    -- Simple plotter for multiple x-y arrays specified pairwise.
605    procedure Simple_Plot_Pairs
606       (x1 : Real_Vector := Dont_Plot_This;
607        y1 : Real_Vector := Dont_Plot_This;
608        x2 : Real_Vector := Dont_Plot_This;
609        y2 : Real_Vector := Dont_Plot_This;
610        x3 : Real_Vector := Dont_Plot_This;
611        y3 : Real_Vector := Dont_Plot_This;
612        x4 : Real_Vector := Dont_Plot_This;
613        y4 : Real_Vector := Dont_Plot_This;
614        x5 : Real_Vector := Dont_Plot_This;
615        y5 : Real_Vector := Dont_Plot_This;
616        X_Label     : String := To_String(Default_Label_String);
617        Y_Label     : String := To_String(Default_Label_String);
618        Title_Label : String := To_String(Default_Label_String));
619
620
621--------- Plotter requiring somewhat more arguments ------
622
623    -- Single plotter with flexible attributes
624    -- Similar to Multiplot_Pairs except single trace and no attribute arrays.
625    procedure Single_Plot
626       (x, y          : Real_Vector;
627        X_Label       : String             := To_String(Default_Label_String);
628        Y_Label       : String             := To_String(Default_Label_String);
629        Title_Label   : String             := To_String(Default_Label_String);
630        Axis_Style    : Axis_Style_Type    := Linear_Major_Grid;
631        Color         : Plot_Color_Type    := Red;
632        Line_Width    : Long_Float         := 1.0;
633        Line_Style    : Line_Style_Type    := 1;
634        Justification : Justification_Type := Not_Justified;
635        x_Min_Zoom    : Long_Float         := Long_Float'small;
636        x_Max_Zoom    : Long_Float         := Long_Float'large;
637        y_Min_Zoom    : Long_Float         := Long_Float'small;
638        y_Max_Zoom    : Long_Float         := Long_Float'large);
639
640
641--------- Simple Contour Plotter ------
642
643    procedure Simple_Contour
644       (z             : Real_Matrix;
645        Number_Levels : Integer := 10;
646        X_Label       : String  := To_String(Default_Label_String);
647        Y_Label       : String  := To_String(Default_Label_String);
648        Title_Label   : String  := To_String(Default_Label_String));
649
650
651--------- Simple 3D Mesh Plotter ------
652
653    procedure Simple_Mesh_3D
654       (x, y     : Real_Vector; -- data definition points
655        z        : Real_Matrix; -- z(x, y) = z(x(i), y(j))
656        x_Min    : Long_Float := 0.0;  -- user coordinate limits
657        x_Max    : Long_Float := 0.0;  -- If x_Min = x_Max = 0.0 then plot
658        y_Min    : Long_Float := 0.0;  -- x-limits are found automatically.
659        y_Max    : Long_Float := 0.0;  -- Ditto y_Min and y_Max.
660        Altitude : Long_Float := 30.0; -- viewing elevation angle in degrees
661        Azimuth  : Long_Float := 30.0; -- viewing azimuth in degrees
662        X_Label  : String := "x";
663        Y_Label  : String := "y";
664        Z_Label  : String := "z");
665
666
667--------- Simple 3D Surface Plotter ------
668
669    procedure Simple_Surface_3D
670       (x, y     : Real_Vector; -- data definition points
671        z        : Real_Matrix; -- z(x, y) = z(x(i), y(j))
672        x_Min    : Long_Float := 0.0;  -- user coordinate limits
673        x_Max    : Long_Float := 0.0;  -- If x_Min = x_Max = 0.0 then plot
674        y_Min    : Long_Float := 0.0;  -- x-limits are found automatically.
675        y_Max    : Long_Float := 0.0;  -- Ditto y_Min and y_Max.
676        Altitude : Long_Float := 30.0; -- viewing elevation angle in degrees
677        Azimuth  : Long_Float := 30.0; -- viewing azimuth in degrees
678        X_Label  : String := "x";
679        Y_Label  : String := "y";
680        Z_Label  : String := "z");
681
682
683--------- Simple color table manipulatons -----
684
685    -- Things for manipulating color map 0 --
686
687    -- Current default number of colors provided by PLplot. There is no way to
688    -- get this number under program control. The actual number can be set by
689    -- the user with Set_Number_Of_Colors_Map_0.
690    Number_Of_Default_Colors : constant Integer := 16;
691
692    -- The default color map 0 is captured at initialization of PLplot.adb with
693    -- a call to Make_Snapshot_Of_Color_Map_0 stored here.
694    Default_Red_Components   : Integer_Array_1D(0 .. Number_Of_Default_Colors - 1);
695    Default_Green_Components : Integer_Array_1D(0 .. Number_Of_Default_Colors - 1);
696    Default_Blue_Components  : Integer_Array_1D(0 .. Number_Of_Default_Colors - 1);
697
698
699    -- Make a snapshot of color map 0 for possible later full or partial restoration.
700    -- This is automatically called at package initialization with results stored
701    -- in Default_Red_Components, Default_Green_Components, Default_Blue_Components.
702    procedure Make_Snapshot_Of_Color_Map_0
703       (Reds, Greens, Blues : out Integer_Array_1D);
704
705
706    -- Restore an arbitray snapshot of color map 0.
707    procedure Restore_Snapshot_Of_Color_Map_0
708       (Reds, Greens, Blues : Integer_Array_1D);
709
710
711    -- Restore the default colors of color map 0 taken as a snapshot at initialization.
712    procedure Restore_Default_Snapshot_Of_Color_Map_0;
713
714
715    -- Functions which correspond to the default colors of color map 0. Calling
716    -- one of these (1) resets the corresponding slot in color map 0 to its
717    -- default value, and (2) returns the correct integer value for the default
718    -- color specified. Thus, using Set_Pen_Color(Reset_Red) instead of
719    -- Set_Pen_Color(Red) guarantees that the color will be set to Red even if
720    -- there have been prior manipulations of color 1.
721
722    function Reset_Black return Integer;
723
724    function Reset_Red return Integer;
725
726    function Reset_Yellow return Integer;
727
728    function Reset_Green return Integer;
729
730    function Reset_Aquamarine return Integer;
731
732    function Reset_Pink return Integer;
733
734    function Reset_Wheat return Integer;
735
736    function Reset_Grey return Integer;
737
738    function Reset_Brown return Integer;
739
740    function Reset_Blue return Integer;
741
742    function Reset_BlueViolet return Integer;
743
744    function Reset_Cyan return Integer;
745
746    function Reset_Turquoise return Integer;
747
748    function Reset_Magenta return Integer;
749
750    function Reset_Salmon return Integer;
751
752    function Reset_White return Integer;
753
754
755    -- Things for manipulating color map 1 --
756
757    type Color_Themes_For_Map_1_Type is (Gray, Blue_Green_Red, Red_Green_Blue,
758        Red_Cyan_Blue, Blue_Black_Red, Red_Blue_Green, Red_Yellow);
759    type Alt_Hue_Path_Type is (Alt_Hue_Path_None, Alt_Hue_Path_All);
760
761
762    -- Quick application of pre-fabricated color schemes to color map 1.
763    procedure Quick_Set_Color_Map_1(Color_Theme : Color_Themes_For_Map_1_Type);
764
765
766--------------------------------------------------------------------------------
767--        Auxiliary things                                                    --
768--------------------------------------------------------------------------------
769
770    -- This is a mask function for Shade_Regions (aka plshades) et al that always
771    -- returns 1 so that all points are plotted. Can be used as a template
772    -- for other user-written mask functions. This should be the same as
773    -- passing null for the second argument in Shade_Regions.
774    function Mask_Function_No_Mask(x, y : Long_Float) return Integer;
775    pragma Convention(Convention => C, Entity => Mask_Function_No_Mask);
776
777
778    -- Given an array to hold contour levels and function minimum and maximum,
779    -- fill it and return. Useful for contour and shade plots.
780    procedure Calculate_Contour_Levels
781       (Contour_Levels : in out Real_Vector;
782        z_Min, z_Max : Long_Float);
783
784
785--------------------------------------------------------------------------------
786--        Re-define PLplot procedures using Ada style.                        --
787--------------------------------------------------------------------------------
788
789-- These correspond to the section in plot.h called "Function Prototypes".
790
791    -- set the format of the contour labels
792    -- pl_setcontlabelformat
793    procedure Set_Contour_Label_Format
794       (Limit_Exponent     : Integer := 4;
795        Significant_Digits : Integer := 2);
796
797
798    -- set offset and spacing of contour labels
799    -- pl_setcontlabelparam
800    procedure Set_Contour_Label_Parameters
801       (Label_Offset       : Long_Float := 0.006; -- Units are ???
802        Label_Font_Height  : Long_Float := 0.3;   -- Units are ???
803        Label_Spacing      : Long_Float := 0.1;  -- Units are???
804        Labels_Active      : Boolean := False);
805
806
807    Next_Subpage : constant Integer := 0;
808
809    -- Advance to subpage "page", or to the next one if "page" = 0.
810    -- pladv
811    procedure Advance_To_Subpage(Page : Natural);
812
813
814    -- Plot an arc.
815    -- plarc
816    procedure Draw_Arc
817       (x, y, a, b, angle1, angle2, rotate : Long_Float;
818        fill : Boolean);
819
820
821    -- Draw a 2D vector plot.
822    -- plvect
823    procedure Vector_Plot
824       (u, v                             : Real_Matrix;
825        Scale                            : Long_Float;
826        Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type;
827        Transformation_Data_Pointer      : PL_Pointer);
828
829
830       -- Set the style for the arrow used by plvect to plot vectors.
831    -- plsvect
832    procedure Set_Arrow_Style_For_Vector_Plots
833       (X_Vertices, Y_Vertices : Real_Vector;
834        Fill_Arrow             : Boolean);
835
836
837    -- Set the default style for the arrow used by plvect to plot vectors.
838    -- plsvect (for setting default)
839    procedure Set_Arrow_Style_For_Vector_Plots
840       (X_Vertices, Y_Vertices : PL_Pointer;
841        Fill_Arrow : Boolean);
842
843
844    -- Simple method to set the default style for the arrow used by plvect to plot vectors.
845    -- plsvect (alternate for setting default)
846    procedure plsvect;
847
848
849    -- Another simple method to set the default style for the arrow used by plvect to plot vectors.
850    -- plsvect (alternate for setting default)
851    procedure Reset_Vector_Arrow_Style;
852
853
854    -- This functions similarly to plbox() except that the origin of the axes
855    -- is placed at the user-specified point (x0, y0).
856    -- plaxes
857    procedure Box_Around_Viewport_With_Origin
858       (X_Origin, Y_Origin       : Long_Float;
859        X_Option_String          : String;
860        X_Major_Tick_Interval    : Long_Float;
861        X_Number_Of_Subintervals : Natural;
862        Y_Option_String          : String;
863        Y_Major_Tick_Interval    : Long_Float;
864        Y_Number_Of_Subintervals : Natural);
865
866
867    -- Plot a histogram using x to store data values and y to store frequencies
868    -- plbin
869    procedure Histogram_Binned
870       (Bin_Values     : Real_Vector; -- "x"
871        Bin_Counts     : Real_Vector; -- "y"
872        Options        : Integer); -- Options are not defined in plplot.h.
873
874
875    -- Calculate broken-down time from continuous time for current stream.
876    -- plbtime
877    procedure Broken_Down_From_Continuous_Time
878       (year, month, day, hour, min : out Integer;
879        sec                         : out Long_Float;
880        ctime                       : Long_Float);
881
882
883    -- Start new page. Should only be used with pleop().
884    -- plbop
885    procedure Begin_New_Page;
886
887
888    -- This draws a box around the current viewport.
889    -- plbox
890    procedure Box_Around_Viewport
891       (X_Option_String          : String;
892        X_Major_Tick_Interval    : Long_Float;
893        X_Number_Of_Subintervals : Natural := 0;
894        Y_Option_String          : String;
895        Y_Major_Tick_Interval    : Long_Float;
896        Y_Number_Of_Subintervals : Natural := 0);
897
898    Auto_Subintervals : Integer := 0; -- Intervals for minor ticks is automatic.
899
900
901    -- This is the 3-d analogue of plbox().
902    -- plbox3
903    procedure Box_Around_Viewport_3D
904       (X_Option_String          : String;
905        X_Label                  : String := To_String(Default_Label_String);
906        X_Major_Tick_Interval    : Long_Float := 0.0;
907        X_Number_Of_Subintervals : Natural := 0;
908
909        Y_Option_String          : String;
910        Y_Label                  : String := To_String(Default_Label_String);
911        Y_Major_Tick_Interval    : Long_Float := 0.0;
912        Y_Number_Of_Subintervals : Natural := 0;
913
914        Z_Option_String          : String;
915        Z_Label                  : String := To_String(Default_Label_String);
916        Z_Major_Tick_Interval    : Long_Float := 0.0;
917        Z_Number_Of_Subintervals : Natural := 0);
918
919
920    -- Calculate world coordinates and subpage from relative device coordinates.
921    -- plcalc_world
922    procedure World_From_Relative_Coordinates
923       (x_Relative, y_Relative : Long_Float_0_1_Type;
924        x_World,    y_World    : out Long_Float;
925        Last_Window_Index      : out Integer);
926
927
928    -- Clear current subpage.
929    -- plclear
930    procedure Clear_Current_Subpage;
931
932
933    -- Set color, map 0. Argument is integer between 0 and 15.
934    -- plcol0
935    procedure Set_Pen_Color(A_Color : Plot_Color_Type);
936
937
938    -- Set color, map 1. Argument is a float between 0. and 1.
939    -- plcol1
940    procedure Set_Color_Map_1(Color : Long_Float_0_1_Type);
941
942
943    -- Configure transformation between continuous and broken-down time (and
944    -- vice versa) for current stream.
945    -- plconfigtime
946    procedure Configure_Time_Transformation
947       (skale, offset1, offset2      : Long_Float;
948        ccontrol                     : Integer;
949        ifbtime_offset               : Boolean;
950        year, month, day, hour, min : Integer;
951        sec                          : Long_Float);
952
953
954    -- Draws a contour plot from data in f(nx,ny). Is just a front-end to plfcont,
955    -- with a particular choice for f2eval and f2eval_data.
956
957    -- plcont
958    procedure Contour_Plot
959       (z                                : Real_Matrix;
960        x_Min_Index, x_Max_Index         : Integer;
961        y_Min_Index, y_Max_Index         : Integer;
962        Contour_Levels                   : Real_Vector;
963        Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type;
964        Transformation_Data_Pointer      : PL_Pointer);
965
966
967    -- The procedure plfcont is not documented and is not part of the API.
968    -- However, it is a very useful capability to have available.
969    -- I have tried to implement it as I think was intended but this may be incorrect.
970    -- It appears as though the intent is to pass the arbitrarily organized
971    -- data (pointed to by Irregular_Data_Pointer) as a (single) pointer to a
972    -- 2D C-style array. Thus, for examaple, it is not possible to pass the data
973    -- as triples.
974
975    -- Draws a contour plot using the function evaluator f2eval and data stored
976    -- by way of the f2eval_data pointer. This allows arbitrary organizations
977    -- of 2d array data to be used.
978
979    -- plfcont
980    procedure Contour_Plot_Irregular_Data
981       (Function_Evaluator_Pointer       : Function_Evaluator_Pointer_Type;
982        Irregular_Data                   : Real_Matrix;
983        x_Min_Index, x_Max_Index         : Integer;
984        y_Min_Index, y_Max_Index         : Integer;
985        Contour_Levels                   : Real_Vector;
986        Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type;
987        Transformation_Data              : Transformation_Data_Type);
988
989
990    -- Copies state parameters from the reference stream to the current stream.
991    -- plcpstrm
992    procedure Copy_State_Parameters
993       (Stream_ID                      : Integer;
994        Do_Not_Copy_Device_Coordinates : Boolean);
995
996
997    -- Calculate continuous time from broken-down time for current stream.
998    -- plctime
999    procedure Continuous_From_Broken_Down_Time
1000       (year, month, day, hour, min : Integer;
1001        sec                         : Long_Float;
1002        ctime                       : out Long_Float);
1003
1004
1005    -- Converts input values from relative device coordinates to relative plot
1006    -- coordinates.
1007    -- pldid2pc
1008    procedure pldid2pc_Placeholder;
1009
1010
1011    -- Converts input values from relative plot coordinates to relative
1012    -- device coordinates.
1013    -- pldip2dc
1014    procedure pldip2dc_Placeholder;
1015
1016
1017    -- End a plotting session for all open streams.
1018    -- plend
1019    procedure End_PLplot;
1020
1021
1022    -- End a plotting session for the current stream only.
1023    -- plend1
1024    procedure End_PLplot_Current_Stream;
1025
1026
1027    -- Simple interface for defining viewport and window.
1028    -- plenv
1029    procedure Set_Environment
1030       (x_Min, x_Max, y_Min, y_Max : Long_Float;
1031        Justification              : Justification_Type;
1032        Axis_Style                 : Axis_Style_Type);
1033
1034
1035    -- similar to plenv() above, but in multiplot mode does not advance the subpage,
1036    -- instead the current subpage is cleared
1037    -- plenv0
1038    procedure Set_Environment_Clear_Subpage
1039       (x_Min, x_Max, y_Min, y_Max : Long_Float;
1040        Justification              : Justification_Type;
1041        Axis_Style                 : Axis_Style_Type);
1042
1043
1044    -- End current page. Should only be used with plbop().
1045    -- pleop
1046    procedure Eject_Current_Page;
1047
1048
1049    -- Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i))
1050    -- plerrx
1051    procedure Draw_Error_Bars_X(x_Min, x_Max, y : Real_Vector);
1052
1053
1054    -- Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i))
1055    -- plerry
1056    procedure Draw_Error_Bars_Y(x, y_Min, y_Max : Real_Vector);
1057
1058
1059    -- Advance to the next family file on the next new page
1060    -- plfamadv
1061    procedure Next_Family_File_On_New_Page;
1062
1063
1064    -- Other "fill" routines similar to Fill_Polygon could be written in Ada if
1065    -- desired, but if they are intended to be used as callbacks in subprograms
1066    -- such as Shade_Region and Shade_Regions, they should be called with C
1067    -- calling conventions.
1068
1069    -- Pattern fills the polygon bounded by the input points.
1070    -- plfill
1071    procedure Fill_Polygon(x, y : Real_Vector);
1072
1073
1074    -- Pattern fills the 3d polygon bounded by the input points.
1075    -- plfill3
1076    procedure Fill_Polygon_3D (x, y, z : Real_Vector);
1077
1078
1079    -- Flushes the output stream. Use sparingly, if at all.
1080    -- plflush
1081    procedure Flush_Output_Stream;
1082
1083
1084    -- Sets the global font flag to 'ifont'.
1085    -- plfont
1086    procedure Set_Font_Style(Font_Style : Font_Style_Type);
1087
1088
1089    -- Load specified font set.
1090    -- plfontld
1091    procedure Set_Characer_Set(Character_Set : Character_Set_Type);
1092
1093
1094    -- Get character default height and current (scaled) height
1095    -- plgchr
1096    procedure Get_Character_Height(Default_Height, Current_Height : out Long_Float);
1097
1098
1099    -- Returns 8 bit RGB values for given color from color map 0
1100    -- plgcol0
1101    procedure Get_Color_RGB
1102       (Color_Index      : Integer;
1103        Red_Component, Green_Component, Blue_Component : out Integer);
1104
1105
1106    -- Returns 8 bit RGB values for given color from color map 0 and alpha value
1107    -- plgcol0a
1108    procedure Get_Color_RGB_And_Alpha
1109       (Color_Index                                    : Integer;
1110        Red_Component, Green_Component, Blue_Component : out Integer;
1111        Alpha                                          : out Long_Float_0_1_Type);
1112
1113
1114    -- Returns the background color by 8 bit RGB value
1115    -- plgcolbg
1116    procedure Get_Background_Color_RGB
1117       (Red_Component, Green_Component, Blue_Component : out Integer);
1118
1119
1120    -- Returns the background color by 8 bit RGB value and alpha value
1121    -- plgcolbga
1122    procedure Get_Background_Color_RGB_And_Alpha
1123       (Red_Component, Green_Component, Blue_Component : out Integer;
1124        Alpha                                          : out Long_Float_0_1_Type);
1125
1126
1127    -- Returns the current compression setting
1128    -- plgcompression
1129    procedure Get_Compression_Level(Compression_Level : out Integer);
1130
1131
1132    -- Make a function version of Get_Device_Name so that the caller can use it whereever
1133    -- a String type is expected without fooling around with conversions between
1134    -- Ada string types. See Example 14 for useage.
1135    -- This _replaces_ the procedure version.
1136    -- THIS IS NOT IN THE C API.
1137
1138    -- Get the current device (keyword) name
1139    -- plgdev
1140    function Get_Device_Name return String;
1141
1142
1143    -- Retrieve current window into device space
1144    -- plgdidev
1145    procedure Get_Device_Window_Parameters
1146       (Relative_Margin_Width : out Long_Float;
1147        Aspect_Ratio          : out Long_Float;
1148        x_Justification       : out Long_Float;
1149        y_Justification       : out Long_Float);
1150
1151
1152    -- Get plot orientation
1153    -- plgdiori
1154    procedure Get_Plot_Orientation(Rotation : out Long_Float);
1155
1156
1157    -- Retrieve current window into plot space
1158    -- plgdiplt
1159    procedure Get_Device_Window_Extrema
1160       (x_Min : out Long_Float;
1161        y_Min : out Long_Float;
1162        x_Max : out Long_Float;
1163        y_Max : out Long_Float);
1164
1165
1166    -- Get FCI (font characterization integer)
1167    -- plgfci
1168    procedure Get_Font_Characterization_Integer(Font_Characterization_Integer : out Unicode);
1169
1170
1171    -- Get family, style and weight of the current font
1172    -- plgfont
1173    procedure Get_Font(Family, Style, Weight : out Integer);
1174
1175
1176    -- Get family file parameters
1177    -- plgfam
1178    procedure Get_File_Family_Parameters
1179       (Family_Enabled : out Boolean;
1180        Family_File_Number : out Integer;
1181        Maximum_File_Size : out Integer);
1182
1183
1184    -- Make a function version of Get_Output_File_Name so that the caller can use it whereever
1185    -- a String type is expected without fooling around with conversions between
1186    -- Ada string types. See Example 14 for useage.
1187    -- This _replaces_ the procedure version.
1188    -- THIS IS NOT IN THE C API.
1189
1190    -- Get the (current) output file name.
1191    -- plgfnam
1192    function Get_Output_File_Name return String;
1193
1194
1195    -- Get the (current) run level.
1196    -- plglevel
1197    procedure Get_Run_Level(Run_Level : out Integer);
1198
1199
1200    -- Get output device parameters.
1201    -- plgpage
1202    procedure Get_Page_Parameters
1203       (x_Pixels, y_Pixels           : out Long_Float;
1204        x_Page_Length, y_Page_Length : out Integer;
1205        x_Page_Offset, y_Page_Offset : out Integer);
1206
1207
1208    -- Switches to graphics screen.
1209    -- plgra
1210    procedure Use_Graphics_Mode;
1211
1212
1213    -- Draw gradient in polygon.
1214    -- plgradient
1215    procedure Fill_Polygon_Gradient(x, y : Real_Vector; Angle : Long_Float);
1216
1217
1218    -- Grid irregularly sampled data.
1219    -- plgriddata
1220    procedure Grid_Data
1221       (x, y, z                : Real_Vector; -- ungridded x- and y-points; z is height
1222        x_Grid, y_Grid         : Real_Vector;
1223        z_Gridded              : in out Real_Matrix;
1224        Gridding_Algorithm     : Gridding_Algorithm_Type;
1225        Griding_Algorithm_Data : Long_Float);
1226
1227
1228    -- Get subpage boundaries in absolute coordinates
1229    -- Results are millimeters from the lower left corner.
1230    -- plgspa
1231    procedure Get_Subpage_Boundaries
1232       (Left_Edge, Right_Edge, Bottom_Edge, Top_Edge : out Long_Float);
1233
1234
1235    -- Get current stream number.
1236    -- plgstrm
1237    procedure Get_Stream_Number(Stream_Number : out Integer);
1238
1239
1240    -- Make a function version of Get_Version_Number so that the caller can use it whereever
1241    -- a String type is expected without fooling around with conversions between
1242    -- Ada string types. See Example 14 for useage.
1243    -- This _replaces_ the procedure version.
1244    -- THIS IS NOT IN THE C API.
1245
1246    -- Get the current library version number
1247    -- plgver
1248    function Get_Version_Number return String;
1249
1250    -- Get viewport boundaries in normalized device coordinates
1251    -- plgvpd
1252    procedure Get_Viewport_Normalized(x_Min, x_Max, y_Min, y_Max : out Long_Float);
1253
1254
1255    -- Get viewport boundaries in world coordinates
1256    -- plgvpw
1257    procedure Get_Viewport_World(x_Min, x_Max, y_Min, y_Max : out Long_Float);
1258
1259
1260    -- Get x axis labeling parameters
1261    -- plgxax
1262    procedure Get_X_Label_Parameters(Max_Digits, Actual_Digits : out Integer);
1263
1264
1265    -- Get y axis labeling parameters
1266    -- plgyax
1267    procedure Get_Y_Label_Parameters(Max_Digits, Actual_Digits : out Integer);
1268
1269
1270    -- Get z axis labeling parameters
1271    -- plgzax
1272    procedure Get_Z_Label_Parameters(Max_Digits, Actual_Digits : out Integer);
1273
1274
1275    -- Draws a histogram of n values of a variable in array data[0..n-1]
1276    -- plhist
1277    procedure Histogram_Unbinned
1278       (Data           : Real_Vector;
1279        Data_Min       : Long_Float; -- left  edge of left-most bin
1280        Data_Max       : Long_Float; -- right edge of right-most bin
1281        Number_Of_Bins : Positive; -- equal-sized, between Data_Min and Data_Max
1282        Options : Integer); -- Options are not defined in plplot.h.
1283
1284
1285    -- Functions for converting between HLS and RGB color space
1286    -- plhlsrgb
1287    procedure HLS_To_RGB
1288       (Hue_Component        : Long_Float;
1289        Lightness_Component  : Long_Float_0_1_Type;
1290        Saturation_Component : Long_Float_0_1_Type;
1291        Red_Component        : out Long_Float_0_1_Type;
1292        Green_Component      : out Long_Float_0_1_Type;
1293        Blue_Component       : out Long_Float_0_1_Type);
1294
1295
1296    -- Initialization. Must be called before starting plot.
1297    -- Certain other procedures, if used, must be called first.
1298    -- Initializes PLplot, using preset or default options
1299    -- plinit
1300    procedure Initialize_PLplot;
1301
1302
1303    -- Draws a line segment from (x1, y1) to (x2, y2).
1304    -- pljoin
1305    procedure Draw_Line(x1, y1, x2, y2 : Long_Float);
1306
1307
1308    -- Simple routine for labelling graphs.
1309    -- pllab
1310    procedure Write_Labels(X_Label, Y_Label, Title_Label : String := To_String(Default_Label_String));
1311
1312
1313    -- Arrays that could have elements of Plot_Color_Type are merely arrays of
1314    -- integers; we have not defined special arrays (e.g., array(somerange) of
1315    -- Plot_Color_Type) for the arguments Text_Colors, Box_Colors, Line_Colors,
1316    -- or Symbol_Colors. Similarly for Entry_Options which could be an array
1317    -- of Legend_Flag_Type and some other arguments. fixme
1318    -- Routine for drawing discrete line, symbol, or cmap0 legends
1319    -- pllegend
1320    procedure Create_Legend
1321       (Legend_Width, Legend_Height           : out Long_Float;
1322        Options, Position                     : Integer;
1323        X_Offset, Y_Offset                    : Long_Float;
1324        Plot_Area_Width                       : Long_Float;
1325        Background_Color, Bounding_Box_Color  : Plot_Color_Type;
1326        Bounding_Box_Style                    : Line_Style_Type;
1327        Number_Rows, Number_Columns           : Integer;
1328        Entry_Options                         : Integer_Array_1D;
1329        Text_Offset, Text_Scale, Text_Spacing : Long_Float;
1330        Text_Justification                    : Long_Float;
1331        Text_Colors                           : Integer_Array_1D;
1332        Label_Text                            : Legend_String_Array_Type;
1333        Box_Colors, Box_Patterns              : Integer_Array_1D;
1334        Box_Scales                            : Real_Vector;
1335        Box_Line_Widths                       : Real_Vector;
1336        Line_Colors, Line_Styles              : Integer_Array_1D;
1337        Line_Widths                           : Real_Vector;
1338        Symbol_Colors                         : Integer_Array_1D;
1339        Symbol_Scales                         : Real_Vector;
1340        Symbol_Numbers                        : Integer_Array_1D;
1341        Symbols                               : Legend_String_Array_Type);
1342
1343
1344    -- Routine for drawing continuous colour legends
1345    -- plcolorbar
1346    procedure Create_Colorbar
1347        (Colorbar_Width, Colorbar_Height      : out Long_Float;
1348         Options, Position                    : Integer;
1349         X_Offset, Y_Offset                   : Long_Float;
1350         X_Length, Y_Length                   : Long_Float;
1351         Background_Color, Bounding_Box_Color : Plot_Color_Type;
1352         Bounding_Box_Style                   : Line_Style_Type;
1353         Low_Cap_Color, High_Cap_Color        : Long_Float;
1354         Contour_Color_For_Shade              : Plot_Color_Type;
1355         Contour_Width_For_Shade              : Long_Float;
1356         Label_Options                        : Integer_Array_1D;
1357         Label_Text                           : Legend_String_Array_Type;
1358         Axis_Options                         : Legend_String_Array_Type;
1359         Tick_Spacing                         : Real_Vector;
1360         Number_Subticks                      : Integer_Array_1D;
1361         Number_Values                        : Integer_Array_1D;
1362         Values                               : Real_Matrix);
1363
1364
1365    -- Sets position of the light source
1366    -- pllightsource
1367    procedure Set_Light_Source
1368       (x : Long_Float := 1.0;
1369        y: Long_Float := 1.0;
1370        z: Long_Float := 1.0);
1371
1372
1373    -- Draws line segments connecting a series of points.
1374    -- plline
1375    procedure Draw_Curve(x, y : Real_Vector);
1376
1377
1378    -- Draws a line in 3 space.
1379    -- plline3
1380    procedure Draw_Curve_3D(x, y, z : Real_Vector);
1381
1382
1383    -- Set line style.
1384    -- pllsty
1385    procedure Select_Line_Style(Line_Style : Line_Style_Type);
1386
1387
1388    -- fix this See comment in Example 19, x19a.adb or xthick19a.adb for how to
1389    -- possibly eliminate the need to pass array size as the first argument in
1390    -- the function pointed to by Map_Form_Function_Pointer. Ditto for plmeridians.
1391
1392    -- plot continental outline in world coordinates
1393    -- plmap
1394    procedure Draw_Map
1395       (Map_Form_Function_Pointer            : Map_Form_Function_Pointer_Type;
1396        Map_Kind                             : Map_Type;
1397        Minimum_Longitude, Maximum_Longitude : Long_Float;
1398        Minimum_Latitude,  Maximum_Latitude  : Long_Float);
1399
1400
1401    -- Plot map fills.
1402    -- plmapfill
1403    procedure Plot_Shapefile
1404       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1405        Shapefile_File_Name        : String;
1406        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1407        Plot_Entries               : Integer_Array_1D);
1408
1409
1410    -- Plot map fills: overload passes null pointer plotentries to emulate C, match documentaton.
1411    -- plmapfill (alternate)
1412    procedure Plot_Shapefile
1413       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1414        Shapefile_File_Name        : String;
1415        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1416        Plot_Entries               : PL_Pointer);
1417
1418
1419    -- Plot map fills: overload that doesn't use plotentries to emulate C, match documentaton.
1420    -- plmapfill (another alternate)
1421    procedure Plot_Shapefile_All
1422       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1423        Shapefile_File_Name        : String;
1424        Min_X, Max_X, Min_Y, Max_Y : Long_Float);
1425
1426
1427    -- Plot map outlines.
1428    -- plmapline
1429    procedure Plot_Shapefile_World
1430       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1431        Shapefile_File_Name        : String;
1432        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1433        Plot_Entries               : Integer_Array_1D);
1434
1435
1436    -- Plot map outlines: overload passes null pointer plotentries to emulate C, match documentaton.
1437    -- plmapline (alternate)
1438    procedure Plot_Shapefile_World
1439       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1440        Shapefile_File_Name        : String;
1441        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1442        Plot_Entries               : PL_Pointer);
1443
1444
1445    -- Plot map outlines: overload that doesn't use plotentries to emulate C, match documentaton.
1446    -- plmapline (another alternate)
1447    procedure Plot_Shapefile_World_All
1448       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1449        Shapefile_File_Name        : String;
1450        Min_X, Max_X, Min_Y, Max_Y : Long_Float);
1451
1452
1453    -- Plot map points.
1454    -- plmapstring
1455    procedure Draw_Shapefile_String
1456       (Map_Form_Function_Pointer : Map_Form_Function_Pointer_Type;
1457        Shapefile_File_Name : String;
1458        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1459        Plot_Entries : Integer_Array_1D);
1460
1461
1462    -- Plot map text.
1463    -- plmaptex
1464    procedure Draw_Shapefile_Text_World
1465       (Map_Form_Function_Pointer  : Map_Form_Function_Pointer_Type;
1466        Shapefile_File_Name        : String;
1467        dx, dy                     : Long_Float;
1468        Justification              : Long_Float;
1469        Text                       : String;
1470        Min_X, Max_X, Min_Y, Max_Y : Long_Float;
1471        Which_Shapefile_String     : Integer);
1472
1473
1474    -- fix this See comment for plmap.
1475
1476    -- Plot the latitudes and longitudes on the background.
1477    -- plmeridians
1478    procedure Draw_Latitude_Longitude
1479       (Map_Form_Function_Pointer            : Map_Form_Function_Pointer_Type;
1480        Delta_Longitude, Delta_Latitude      : Long_Float;
1481        Minimum_Longitude, Maximum_Longitude : Long_Float;
1482        Minimum_Latitude,  Maximum_Latitude  : Long_Float);
1483
1484
1485    -- Plots a mesh representation of the function z(x, y).
1486    -- plmesh
1487    procedure Mesh_3D
1488       (x, y    : Real_Vector; -- surface definition points
1489        z       : Real_Matrix; -- height of surface at definition points
1490        Options : Integer);
1491
1492    -- Plots a mesh representation of the function z(x, y) with contour
1493    -- plmeshc
1494    procedure Mesh_3D_Base_Contour
1495       (x, y           : Real_Vector; -- surface definition points
1496        z              : in Real_Matrix; -- height of surface at definition points
1497        Options        : Integer;
1498        Contour_Levels : Real_Vector); -- levels at which to draw contours
1499
1500
1501    -- Creates a new stream and makes it the default.
1502    -- plmkstrm
1503    procedure Make_Stream(New_Stream_Number : out Integer);
1504
1505
1506    -- Prints out "The_Text" at specified position relative to viewport
1507    -- plmtex
1508    procedure Write_Text_Viewport
1509       (Side                : String;
1510        Position_From_Edge  : Long_Float;
1511        Position_Along_Edge : Long_Float;
1512        Justification       : Long_Float;
1513        The_Text            : String);
1514
1515
1516    -- Prints out "The_Text" at specified position relative to viewport (3D)
1517    -- plmtex3
1518    procedure Write_Text_Viewport_3D
1519       (Side                : String;
1520        Position_From_Edge  : Long_Float;
1521        Position_Along_Edge : Long_Float;
1522        Justification       : Long_Float;
1523        The_Text            : String);
1524
1525
1526    -- Plots a 3-d representation of the function z(x, y).
1527    -- plot3d
1528    procedure Plot_3D
1529       (x, y    : Real_Vector; -- surface definition points
1530        z       : Real_Matrix; -- height of surface at definition points
1531        Options : Integer;
1532        Sides : Boolean); -- draw sides?
1533
1534
1535    -- Plots a 3-d representation of the function z(x, y) with contour.
1536    -- plot3dc
1537    procedure Plot_3D_Base_Contour
1538       (x, y           : Real_Vector; -- surface definition points
1539        z              : Real_Matrix; -- height of surface at definition points
1540        Options        : Integer;
1541        Contour_Levels : Real_Vector); -- levels at which to draw contours
1542
1543
1544    -- Plots a 3-d representation of the function z(x, y) with contour and
1545    -- y index limits.
1546    -- plot3dcl
1547    procedure Plot_3D_Base_Contour_Limits -- Lacks documentation in Chapter 17 of Ref. Man.
1548       (x, y           : Real_Vector; -- surface definition points
1549        z              : Real_Matrix; -- height of surface at definition points
1550        Options        : Integer;
1551        Contour_Levels : Real_Vector;
1552        ixstart, ixn   : Integer;
1553        indexymin, indexymax : Integer_Array_1D); -- levels at which to draw contours
1554
1555
1556
1557       --  valid options for plot3dc():
1558       --
1559       --  DRAW_SIDES, BASE_CONT, TOP_CONT (not yet),
1560       --  MAG_COLOR, DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY.
1561       --
1562       --  valid options for plsurf3d():
1563       --
1564       --  MAG_COLOR, BASE_CONT, SURF_CONT, FACETED, DRAW_SIDES.
1565
1566
1567    -- Set fill pattern directly.
1568    -- plpat
1569    procedure Set_Fill_Pattern
1570       (Inclinations : Integer_Array_1D;
1571        Spacings     : Integer_Array_1D);
1572
1573
1574    -- Draw a line connecting two points, accounting for coordinate transform
1575    procedure Draw_Line_With_Transform
1576       (Num_Segments   : Integer;
1577        x1, y1, x2, y2 : Long_Float);
1578
1579
1580    -- Plots array y against x for n points using ASCII code "code".
1581    -- plpoin
1582    procedure Draw_Points
1583       (x, y : Real_Vector;
1584        Symbol_As_Number : Integer);
1585
1586
1587    -- Draws a series of points in 3 space.
1588    -- plpoin3
1589    procedure Draw_Points_3D
1590       (x, y, z          : Real_Vector;
1591        Symbol_As_Number : Integer);
1592
1593
1594    -- Draws a polygon in 3 space.
1595    -- plpoly3
1596    procedure Draw_Polygon_3D
1597       (x, y, z : Real_Vector;
1598        Draw_Segments : Boolean_Array_1D;
1599        Draw_Counterclockwise : Boolean);
1600
1601
1602    -- Set the floating point precision (in number of places) in numeric labels.
1603    -- plprec
1604    procedure Set_Numeric_Label_Precision
1605       (Set_Manually : Boolean := True;
1606        Number_Digits_After_Decimal_Point : Integer := 2);
1607
1608
1609    -- Set fill pattern, using one of the predefined patterns.
1610    -- plpsty
1611    procedure Select_Fill_Pattern(Fill_Pattern : Fill_Pattern_Type);
1612
1613
1614    -- Prints out "text" at world cooordinate (x, y).
1615    -- plptex
1616    procedure Write_Text_World
1617       (x, y             : Long_Float;
1618        Delta_X, Delta_Y : Long_Float;
1619        Justification    : Long_Float;
1620        The_Text         : String);
1621
1622
1623    -- Prints out "The_Text" at world cooordinate (x, y, z).
1624    -- plptex3
1625    procedure Write_Text_World_3D
1626       (x, y, z                   : Long_Float;
1627        Delta_X, Delta_Y, Delta_Z : Long_Float;
1628        Shear_X, Shear_Y, Shear_Z : Long_Float;
1629        Justification             : Long_Float;
1630        The_Text                  : String);
1631
1632
1633    -- Random number generator based on Mersenne Twister.
1634    -- Obtain real random number in range [0,1].
1635    -- plrandd
1636    function Random_Number return Long_Float;
1637
1638
1639    -- Replays contents of plot buffer to current device/file.
1640    -- plreplot
1641    procedure Replot;
1642
1643
1644    -- Functions for converting between HLS and RGB color space
1645    -- plrgbhls
1646    procedure RGB_To_HLS
1647       (Red_Component        : Long_Float_0_1_Type;
1648        Green_Component      : Long_Float_0_1_Type;
1649        Blue_Component       : Long_Float_0_1_Type;
1650        Hue_Component        : out Long_Float;
1651        Lightness_Component  : out Long_Float_0_1_Type;
1652        Saturation_Component : out Long_Float_0_1_Type);
1653
1654
1655    -- Set character height.
1656    -- plschr
1657    procedure Set_Character_Height(Default_Height, Scale_Factor : Long_Float);
1658
1659
1660    -- The PLplot docs say that the arguments to this procedure are arrays of 8-bit numbers
1661    -- but plplot.h says that they are arrays of 32-bit integers.
1662    -- Set color map 0 colors by 8 bit RGB values
1663    -- plscmap0
1664    procedure Set_Color_Map_0(Red_Components, Green_Components, Blue_Components : Integer_Array_1D);
1665
1666
1667    -- Set color map 0 colors by 8 bit RGB values and alpha values
1668    -- plscmap0a
1669    procedure Set_Color_Map_0_And_Alpha
1670       (Red_Components, Green_Components, Blue_Components : Integer_Array_1D;
1671        Alpha                                             : Real_Vector);
1672
1673
1674    -- Set number of colors in cmap 0
1675    -- plscmap0n
1676    procedure Set_Number_Of_Colors_Map_0(Number_Of_Colors : Integer);
1677
1678
1679    -- Set color map 1 colors by 8 bit RGB values
1680    -- plscmap1
1681    procedure Set_Color_Map_1_RGB
1682       (Red_Component, Green_Component, Blue_Component : Integer_0_255_Array);
1683
1684
1685    -- Set color map 1 colors by 8 bit RGB and alpha values
1686    -- plscmap1a
1687    procedure Set_Color_Map_1_RGB_And_Alpha
1688       (Red_Component, Green_Component, Blue_Component : Integer_0_255_Array;
1689        Alpha                                          : Real_Vector);
1690
1691
1692    -- Types for colors for color map 1.
1693    type Color_Model_Type is (HLS, RGB); -- Red, Green, Blue or Hue, Lightness, Saturation
1694
1695
1696    -- Set color map 1 colors using a piece-wise linear relationship between
1697    -- intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
1698    -- plscmap1l
1699    procedure Set_Color_Map_1_Piecewise
1700       (Color_Model    : Color_Model_Type; -- HLS or RGB
1701        Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here
1702        H_Or_R         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1703        L_Or_G         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1704        S_Or_B         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1705        Alt_Hue_Path    : Boolean_Array_1D);   -- True means use alternative hue interpolation path which always includes the point hue = 0.  False reverses.
1706
1707    -- Overloaded version of Set_Color_Map_1_Piecewise which allows simplified (alt_hue_path false) interpolation.
1708    -- This is an Ada-like way of doing what is described
1709    -- in the PLplot documentation when a C user passes a null pointer as the
1710    -- final argument instead of an array of booleans to indicate which
1711    -- of the two hue interpolation paths to take.
1712    procedure Set_Color_Map_1_Piecewise
1713       (Color_Model    : Color_Model_Type; -- HLS or RGB
1714        Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here
1715        H_Or_R         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1716                                              -- Note: Hue is 0.0 .. 360.0.
1717        L_Or_G         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1718        S_Or_B         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1719        Alt_Hue_Path    : Alt_Hue_Path_Type);
1720
1721
1722    -- Set color map 1 colors using a piece-wise linear relationship between
1723    -- intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
1724    -- Will also linear interpolate alpha values.
1725    -- plscmap1la
1726    procedure Set_Color_Map_1_Piecewise_And_Alpha
1727       (Color_Model    : Color_Model_Type; -- HLS or RGB
1728        Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here
1729        H_Or_R         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1730        L_Or_G         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1731        S_Or_B         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1732        Alpha          : Real_Vector; -- range 0.0 .. 1.0; not checked here
1733        Alt_Hue_Path    : Boolean_Array_1D);   -- True means use alternative hue interpolation path which always includes the point hue = 0.  False reverses.
1734
1735
1736    -- Overloaded version of Set_Color_Map_1_Piecewise_And_Alpha which allows simplified (alt_hue_path false) interpolation.
1737    -- This is an Ada-like way of doing what is described
1738    -- in the PLplot documentation when a C user passes a null pointer as the
1739    -- final argument instead of an array of booleans to indicate which
1740    -- of the two hue interpolation paths to take.
1741    procedure Set_Color_Map_1_Piecewise_And_Alpha
1742       (Color_Model    : Color_Model_Type; -- HLS or RGB
1743        Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here
1744        H_Or_R         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1745        L_Or_G         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1746        S_Or_B         : Real_Vector; -- range 0.0 .. 1.0; not checked here
1747        Alpha          : Real_Vector; -- range 0.0 .. 1.0; not checked here
1748        Alt_Hue_Path    : Alt_Hue_Path_Type);
1749
1750
1751    -- Set number of colors in cmap 1
1752    -- plscmap1n
1753    procedure Set_Number_Of_Colors_In_Color_Map_1(Number_Of_Colors : Integer);
1754
1755
1756    -- Set the color map 1 range used in continuous plots.
1757    -- plscmap1_range
1758    procedure Set_Color_Map_1_Range(Min_Color, Max_Color : Long_Float);
1759
1760
1761    -- Get the color map 1 range used in continuous plots
1762    -- plgcmap1_range
1763    procedure Get_Color_Map_1_Range(Min_Color, Max_Color : out Long_Float);
1764
1765
1766    -- Set a given color from color map 0 by 8 bit RGB value
1767    -- plscol0
1768    procedure Set_One_Color_Map_0
1769       (Plot_Color : Plot_Color_Type;
1770        Red_Component, Green_Component, Blue_Component : Integer);
1771
1772
1773    -- Set a given color from color map 0 by 8 bit RGB value and alpha value
1774    -- plscol0a
1775    procedure Set_One_Color_Map_0_And_Alpha
1776       (Plot_Color                                     : Plot_Color_Type;
1777        Red_Component, Green_Component, Blue_Component : Integer;
1778        Alpha                                          : Long_Float_0_1_Type);
1779
1780
1781    -- Set the background color by 8 bit RGB value
1782    -- plscolbg
1783    procedure Set_Background_Color_RGB
1784       (Red_Component, Green_Component, Blue_Component : Integer);
1785
1786
1787    -- Set the background color by 8 bit RGB value and alpha value
1788    -- plscolbga
1789    procedure Set_Background_Color_RGB_And_Alpha
1790       (Red_Component, Green_Component, Blue_Component : Integer;
1791        Alpha                                          : Long_Float_0_1_Type);
1792
1793
1794    -- Used to globally turn color output on/off
1795    -- plscolor
1796    procedure Enable_Color_Output(Enable_Color : Boolean);
1797
1798
1799    -- Set the compression level
1800    -- plscompression
1801    procedure Set_Compression_Level(Compression_Level : Integer);
1802
1803
1804    -- Set the device (keyword) name
1805    -- plsdev
1806    procedure Set_Device_Name(Device_Name : String);
1807
1808
1809    -- Set window into device space using margin, aspect ratio, and
1810    -- justification
1811    -- plsdidev
1812    procedure Set_Device_Window_Parameters
1813       (Margin          : Long_Float;
1814        Aspect_Ratio    : Long_Float;
1815        x_Justification : Long_Float;
1816        y_Justification : Long_Float);
1817
1818
1819    -- Set up transformation from metafile coordinates.
1820    -- plsdimap
1821    procedure Set_Metafile_Transformation
1822       (dimxmin : Integer;
1823        dimxmax : Integer;
1824        dimymin : Integer;
1825        dimymax : Integer;
1826        dimxpmm : Long_Float;
1827        dimypmm : Long_Float);
1828
1829
1830    -- Set plot orientation, specifying rotation in units of pi/2.
1831    -- plsdiori
1832    procedure Set_Plot_Orientation(Rotation : Long_Float);
1833
1834
1835    -- Set window into plot space
1836    -- plsdiplt
1837    procedure Set_Device_Window_Extrema
1838       (x_Min : Long_Float := 0.0;
1839        y_Min : Long_Float := 0.0;
1840        x_Max : Long_Float := 1.0;
1841        y_Max : Long_Float := 1.0);
1842
1843
1844    -- Set window into plot space incrementally (zoom)
1845    -- plsdiplz
1846    procedure Set_Zoom
1847       (x_Min_Relative : Long_Float;
1848        y_Min_Relative : Long_Float;
1849        x_Max_Relative : Long_Float;
1850        y_Max_Relative : Long_Float);
1851
1852
1853    -- Set seed for internal random number generator
1854    -- plseed
1855    procedure Random_Number_Seed(Seed : Unsigned_Int);
1856
1857
1858    -- Set the escape character for text strings.
1859    -- plsesc
1860    procedure Set_Escape_Character(Escape_Character : Character);
1861
1862
1863    -- Set family file parameters
1864    -- plsfam
1865    procedure Set_File_Family_Parameters
1866       (Enable_Family : Boolean;
1867        Family_File_Number : Integer := 1;
1868        Maximum_File_Size : Integer := 1_000_000);
1869
1870
1871    -- Set FCI (font characterization integer)
1872    -- plsfci
1873    procedure Set_Font_Characterization_Integer(Font_Characterization_Integer : Unicode);
1874
1875
1876    -- Set the font family, style and weight
1877    -- plsfont
1878    procedure Set_Font(Family, Style, Weight : Integer);
1879
1880
1881    -- Set the output file name.
1882    -- plsfnam
1883    procedure Set_Output_File_Name(Output_File_Name : String);
1884
1885
1886    -- Shade region.
1887    -- plshade
1888    procedure Shade_Region
1889       (z                                        : Real_Matrix;
1890        Mask_Function_Pointer                    : Mask_Function_Pointer_Type;
1891        x_Min, x_Max, y_Min, y_Max               : Long_Float; -- world mins and maxes
1892        Shade_Min, Shade_Max                     : Long_Float;
1893        Select_Color_Map                         : Natural; -- should be 0 or 1
1894        Color                                    : Long_Float;
1895        Fill_Pattern_Pen_Width                   : Long_Float;
1896        Shade_Min_Pen_Color                      : Natural;
1897        Shade_Min_Pen_Width                      : Long_Float;
1898        Shade_Max_Pen_Color                      : Natural;
1899        Shade_Max_Pen_Width                      : Long_Float;
1900        Fill_Procedure_Pointer                   : Fill_Procedure_Pointer_Type;
1901        Preserve_Rectangles                      : Boolean;
1902        Transformation_Procedure_Pointer          : Transformation_Procedure_Pointer_Type;
1903        Transformation_Data_Pointer              : PL_Pointer);
1904
1905
1906    -- plshades
1907    procedure Shade_Regions
1908       (z                                : Real_Matrix;
1909        Mask_Function_Pointer            : Mask_Function_Pointer_Type;
1910        x_Min, x_Max, y_Min, y_Max       : Long_Float; -- world mins and maxes
1911        Contour_Levels                   : Real_Vector;
1912        Fill_Pattern_Pen_Width           : Long_Float; -- 0 is allowed
1913        Contour_Pen_Color                : Natural; -- 0 for no contours
1914        Contour_Pen_Width                : Long_Float; -- 0 for no contours
1915        Fill_Procedure_Pointer           : Fill_Procedure_Pointer_Type;
1916        Preserve_Rectangles              : Boolean;
1917        Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type;
1918        Transformation_Data_Pointer      : PL_Pointer);
1919
1920
1921    -- The procedure plfshade is not part of the API. If it should be necessary
1922    -- to make it available to Ada programs, use the binding to plfcont in this
1923    -- file as a guidline.
1924
1925    -- fix this
1926    --    procedure
1927    --    plfshade(PLFLT (*f2eval) ( : PLINT;  : PLINT; PL_Pointer),
1928    --         PL_Pointer f2eval_data,
1929    --         PLFLT (*c2eval) ( : PLINT;  : PLINT; PL_Pointer),
1930    --         PL_Pointer c2eval_data,
1931    --         nx : PLINT; ny : PLINT;
1932    --         left : PLFLT; right : PLFLT; bottom : PLFLT; top : PLFLT;
1933    --         shade_min : PLFLT; shade_max : PLFLT;
1934    --         sh_cmap : PLINT; sh_color : PLFLT; sh_width : PLINT;
1935    --         min_color : PLINT; min_width : PLINT;
1936    --         max_color : PLINT; max_width : PLINT;
1937    --         void (*fill) ( : PLINT;  : PL_Float_Array;  : PL_Float_Array), rectangular : PLINT;
1938    --         void (*pltr) ( : PLFLT;  : PLFLT;  : PL_Float_Array;  : PL_Float_Array; PL_Pointer),
1939    --         PL_Pointer pltr_data);
1940    --
1941
1942
1943    -- Setup a user-provided custom labeling function.
1944    -- plslabelfunc
1945    procedure Set_Custom_Label
1946       (Custom_Label_Procedure_Pointer : Custom_Label_Procedure_Pointer_Type;
1947        label_data : PL_Pointer);
1948
1949
1950    -- Reset to default labeling. Not part of the C API.
1951    procedure Use_Default_Labels;
1952
1953
1954    -- Set up lengths of major tick marks.
1955    -- plsmaj
1956    procedure Set_Major_Tick_Length(Default_Length, Scale_Factor : Long_Float);
1957
1958
1959    -- Set the memory area to be plotted (with the 'mem' driver)
1960    -- plsmem
1961    procedure Plot_From_Memory
1962       (x_Size, y_Size : Integer;
1963        Plot_This      : System.Address);
1964
1965
1966    -- Set up lengths of minor tick marks.
1967    -- plsmin
1968    procedure Set_Minor_Tick_Length(Default_Length, Scale_Factor : Long_Float);
1969
1970
1971    -- Set orientation. Must be done before calling plinit.
1972    -- plsori
1973    procedure Set_Orientation(Orientation : Orientation_Type);
1974
1975
1976    -- Set output device parameters. Usually ignored by the driver.
1977    -- plspage
1978    procedure Set_Page_Parameters
1979       (x_Pixels, y_Pixels : Long_Float;
1980        x_Length, y_Length : Integer;
1981        x_Offset, y_Offset : Integer);
1982
1983
1984    -- Set the colors for color table 0 from a cmap0 file.
1985    -- plspal0
1986    procedure Set_Color_Map_0_From_File(Color_File_Name : String);
1987
1988
1989    -- Set the colors for color table 1 from a cmap1 file.
1990    -- plspal1
1991    procedure Set_Color_Map_1_From_File(Color_File_Name : String; Interpolate : Boolean);
1992
1993
1994    -- Set the pause (on end-of-page) status
1995    -- plspause
1996    procedure Set_Pause(Pause : Boolean);
1997
1998
1999    -- Set stream number.
2000    -- plsstrm
2001    procedure Set_Stream_Number(Stream_Number : Integer);
2002
2003
2004    -- Set the number of subwindows in x and y
2005    -- plssub
2006    procedure Set_Number_Of_Subpages(x_Number, y_Number : Integer);
2007
2008
2009    -- Set symbol height.
2010    -- plssym
2011    procedure Set_Symbol_Size(Default_Height, Scale_Factor : Long_Float);
2012
2013
2014    -- Initialize PLplot, passing in the windows/page settings.
2015    -- plstar
2016    procedure Initialize_Query_Device
2017       (Number_Horizontal_Subpages, Number_Vertical_Subpages : Integer := 1);
2018
2019
2020    -- Initialize PLplot, passing the device name and windows/page settings.
2021    -- plstart
2022    procedure Initialize_Set_Device
2023       (Device_Name                                          : String;
2024        Number_Horizontal_Subpages, Number_Vertical_Subpages : Integer := 1);
2025
2026
2027    -- Set the coordinate transform.
2028    -- plstransform
2029    procedure Set_Custom_Coordinate_Transform
2030       (Coordinate_Transform_Procedure_Pointer : Coordinate_Transform_Procedure_Pointer_Type;
2031        Coordinate_Transform_Data_Pointer : PL_Pointer);
2032
2033
2034    -- Clear the coordinate transform. Ada only; not part of the C API.
2035    procedure Clear_Custom_Coordinate_Transform;
2036
2037
2038    -- Prints out the same string repeatedly at the n points in world
2039    -- coordinates given by the x and y arrays.  Supersedes plpoin and
2040    -- plsymbol for the case where text refers to a unicode glyph either
2041    -- directly as UTF-8 or indirectly via the standard text escape
2042    -- sequences allowed for PLplot input strings.
2043    -- plstring
2044    procedure Draw_String
2045       (x, y : Real_Vector;
2046        Plot_This_String : String);
2047
2048
2049    -- Prints out the same string repeatedly at the n points in world
2050    -- coordinates given by the x, y, and z arrays.  Supersedes plpoin3
2051    -- for the case where text refers to a unicode glyph either directly
2052    -- as UTF-8 or indirectly via the standard text escape sequences
2053    -- allowed for PLplot input strings.
2054    -- plstring3
2055    procedure Draw_String_3D
2056       (x, y, z : Real_Vector;
2057        Plot_This_String : String);
2058
2059
2060    -- Add a point to a stripchart.
2061    -- plstripa
2062    procedure Update_Stripchart
2063       (ID         : Integer;
2064        Pen_Number : Integer;
2065        x, y       : Long_Float);
2066
2067
2068    -- Create 1d stripchart
2069    -- plstripc
2070    procedure Create_Stripchart
2071       (ID                                   : out Integer;
2072        X_Options, Y_Options                 : String;
2073        x_Min, x_Max                         : Long_Float;
2074        x_Jump                               : Long_Float;
2075        y_Min, y_Max                         : Long_Float;
2076        x_Legend_Position, y_Legend_Position : Long_Float;
2077        Autoscale_Y                          : Boolean;
2078        Accumulate                           : Boolean; --Accumulate or slide
2079        Box_Color, Legend_Color              : Plot_Color_Type;
2080        Pen_Colors                           : Integer_Array_1D;
2081        Line_Styles                          : Integer_Array_1D;
2082        Pen_Labels                           : in out Stripchart_Label_String_Array_Type;
2083        X_Label, Y_Label, Title_Label        : String := To_String(Default_Label_String));
2084
2085
2086    -- Deletes and releases memory used by a stripchart.
2087    -- plstripd
2088    procedure Delete_Stripchart(ID : Integer);
2089
2090
2091    -- plots a 2d image (or a matrix too large for plshade() )
2092    -- plimagefr
2093    procedure Draw_Image_Color_Map_1
2094       (Data                             : Real_Matrix;
2095        x_Min,     x_Max                 : Long_Float;
2096        y_Min,     y_Max                 : Long_Float;
2097        z_Min,     z_Max                 : Long_Float;
2098        Value_Min, Value_Max             : Long_Float;
2099        Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type;
2100        Transformation_Data_Pointer      : PL_Pointer);
2101
2102
2103    -- plots a 2d image (or a matrix too large for plshade() )
2104    -- plimage
2105    procedure Draw_Image_Color_Map_1_Automatic
2106       (Data : Real_Matrix;
2107        x_Min, x_Max : Long_Float;
2108        y_Min, y_Max : Long_Float;
2109        z_Min, z_Max : Long_Float;
2110        Dxmin, Dxmax : Long_Float;
2111        Dymin, Dymax : Long_Float);
2112
2113
2114    -- Set up a new line style
2115    -- plstyl
2116    procedure Set_Line_Style(Marks, Spaces : Integer_Array_1D);
2117
2118
2119    Default_Continuous_Line : constant Integer := 0;
2120
2121    -- This is an overloaded procedure equivalent to calling plstyl with its
2122    -- first argument zero.
2123    -- plstyl
2124    procedure Set_Line_Style(Default_Continuous_Line : Integer);
2125
2126
2127    -- Plots the 3d surface representation of the function z(x, y).
2128    -- plsurf3d
2129    procedure Shaded_Surface_3D
2130       (x, y           : Real_Vector; -- surface definition points
2131        z              : Real_Matrix; -- height of surface at definition points
2132        Options        : Integer;
2133        Contour_Levels : Real_Vector); -- levels at which to draw contours
2134
2135
2136    -- Plots the 3-d surface representation of the function z(x, y) with limits on x and y.
2137    -- plsurf3dl
2138    procedure Shaded_Surface_3D_Non_Rectangular
2139       (x, y                     : Real_Vector; -- surface definition points
2140        z                        : Real_Matrix; -- height of surface at definition points
2141        Options                  : Integer;
2142        Contour_Levels           : Real_Vector; -- levels at which to draw contours
2143        Index_x_Min, Index_x_Max : Integer;           -- limits on x
2144        Index_y_Min, Index_y_Max : Integer_Array_1D); -- limits on y
2145
2146
2147    -- Sets the edges of the viewport to the specified absolute coordinates
2148    -- plsvpa
2149    procedure Set_Viewport_Absolute
2150       (Left_Edge   : Long_Float;  -- millimeters from edge of subpage
2151        Right_Edge  : Long_Float;  -- millimeters from edge of subpage
2152        Bottom_Edge : Long_Float;  -- millimeters from edge of subpage
2153        Top_Edge    : Long_Float); -- millimeters from edge of subpage
2154
2155
2156    -- Set x axis labeling parameters
2157    -- "digits" changed to "field_digits".
2158    -- plsxax
2159    procedure Set_Floating_Point_Display_X(Max_Digits, Field_Digits : Integer);
2160
2161
2162    -- Set inferior X window
2163    -- plsxwin
2164    procedure Set_Inferior_Window(Window_ID : Integer);
2165
2166
2167    -- Set y axis labeling parameters
2168    -- "digits" changed to "field_digits".
2169    -- plsyax
2170    procedure Set_Floating_Point_Display_Y(Max_Digits, Field_Digits : Integer);
2171
2172
2173    -- Plots array y against x for n points using Hershey symbol "code"
2174    -- plsym
2175    procedure Draw_Hershey_Symbol
2176       (x, y : Real_Vector;
2177        Hershey_Code : Integer);
2178
2179
2180    -- Set z axis labeling parameters
2181    -- "digits" changed to "field_digits".
2182    -- plszax
2183    procedure Set_Floating_Point_Display_Z(Max_Digits, Field_Digits : Integer);
2184
2185
2186    -- Switches to text screen.
2187    -- pltext
2188    procedure Use_Text_Mode;
2189
2190
2191    -- Set the format for date / time labels
2192    -- pltimefmt
2193    procedure Set_Date_Time_Label_Format(Format : String);
2194
2195
2196    -- Sets the edges of the viewport with the given aspect ratio, leaving
2197    -- room for labels.
2198    -- plvasp
2199    procedure Set_Viewport_Aspect_Ratio(Aspect_Ratio : Long_Float);
2200
2201
2202    -- Creates the largest viewport of the specified aspect ratio that fits
2203    -- within the specified normalized subpage coordinates.
2204    -- plvpas
2205    procedure Set_Viewport_Maximized_For_Aspect_Ratio
2206       (x_Min, x_Max : Long_Float;
2207        y_Min, y_Max : Long_Float;
2208        Aspect_Ratio : Long_Float);
2209
2210
2211    -- Creates a viewport with the specified normalized subpage coordinates.
2212    -- plvpor
2213    procedure Set_Viewport_Normalized
2214       (Left_Edge   : Long_Float := 0.0;
2215        Right_Edge  : Long_Float := 1.0;
2216        Bottom_Edge : Long_Float := 0.0;
2217        Top_Edge    : Long_Float := 1.0);
2218
2219
2220    -- Defines a "standard" viewport with seven character heights for
2221    -- the left margin and four character heights everywhere else.
2222    -- plvsta
2223    procedure Set_Viewport_Standard;
2224
2225
2226    -- Set up a window for three-dimensional plotting.
2227    -- plw3d
2228    procedure Set_Up_3D
2229       (X_Box, Y_Box, Z_Box                      : Long_Float;  -- Extents of enclosing box; world coordinates
2230        X_Min, X_Max, Y_Min, Y_Max, Z_Min, Z_Max : Long_Float;  -- Data limits; user coordinates
2231        Altitude, Azimuth                        : Long_Float); -- Viewing angles in world coordinates
2232
2233
2234    -- Set pen width.
2235    -- plwidth
2236    procedure Set_Pen_Width(Pen_Width : Long_Float);
2237
2238
2239    -- Set up world coordinates of the viewport boundaries (2d plots).
2240    -- plwind
2241    procedure Set_Viewport_World
2242       (Left_Edge   : Long_Float;
2243        Right_Edge  : Long_Float;
2244        Bottom_Edge : Long_Float;
2245        Top_Edge    : Long_Float);
2246
2247    -- set xor mode; mode = 1-enter, 0-leave, status = 0 if not interactive device
2248    -- plxormod
2249    procedure Set_XOR_Mode
2250       (Use_XOR : Boolean;
2251        Supports_XOR : out Boolean);
2252
2253
2254--------------------------------------------------------------------------------
2255--         Functions for use from C or C++ only                               --
2256--         (Not really ;).                                                    --
2257--------------------------------------------------------------------------------
2258--  THESE FUNCTIONS ^^^ ARE NOT IMPLEMENTED FOR THE ADA BINDING
2259--  EXCEPT FOR THE FOLLOWING.
2260
2261    -- This procedure is currently GNAT-specific, importing Gnat_Argc and Gnat_Argv.
2262    -- Process options list using current options info.
2263    -- plparseopts
2264    procedure Parse_Command_Line_Arguments(Mode : Parse_Mode_Type);
2265
2266
2267    -- Process input strings, treating them as an option and argument pair.
2268    -- plsetopt
2269    procedure Set_Command_Line_Option(Option, Argument : String);
2270
2271
2272	-- Transformation routines
2273
2274    -- fix this These functions are redundant with those in plplot_thin.
2275    -- This might be OK since they are now available at all levels of binding.
2276    -- I wonder if this is approaching "wrapper bloat" since these procedures
2277    -- get called a lot of times during the making of a contour plot.
2278    -- The way to eliminate one level of calling would be to move the bodies
2279    -- of pltr? from plplot_thin.adb into plplot_traditional.adb and
2280    -- plplot.adb, then optionally eliminating the bodies from plplot_thin.adb
2281    -- on the idea that nobody is going to use them anyway. But even if the
2282    -- bodies were left in plplot_thin.adb, having them here would still
2283    -- remove the extra call level. The argument for the current arrangement is
2284    -- easier code maintainence.
2285
2286    -- Identity transformation.
2287    -- pltr0
2288    procedure Plot_Transformation_0
2289       (x_Grid, y_Grid   : Long_Float;
2290        x_World, y_World : out Long_Float;
2291        Data             : PL_Pointer);
2292    pragma Convention(Convention => C, Entity => Plot_Transformation_0);
2293
2294
2295    -- Does linear interpolation from singly dimensioned coord arrays.
2296    -- pltr1
2297    procedure Plot_Transformation_1
2298       (x_Grid, y_Grid   : Long_Float;
2299        x_World, y_World : out Long_Float;
2300        Data_Pointer     : PL_Pointer);
2301    pragma Convention(Convention => C, Entity => Plot_Transformation_1);
2302
2303
2304    -- Does linear interpolation from doubly dimensioned coord arrays
2305    -- (column dominant, as per normal C 2d arrays).
2306    -- pltr2
2307    procedure Plot_Transformation_2
2308       (x_Grid, y_Grid   : Long_Float;
2309        x_World, y_World : out Long_Float;
2310        Data_Pointer     : PL_Pointer);
2311    pragma Convention(Convention => C, Entity => Plot_Transformation_2);
2312
2313
2314    -- Wait for graphics input event and translate to world coordinates.
2315    procedure Get_Cursor(Graphics_Input : out Graphics_Input_Record_Type);
2316
2317end PLplot_Standard;
2318