1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                     Copyright (C) 2001-2006                       -- 
  5. --                         AdaCore                                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library 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 GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  A special kind of data set that stores three-dimensional data. 
  32. --  </description> 
  33. --  <c_version>gtkextra 2.1.1</c_version> 
  34. --  <group>Plotting Data</group> 
  35.  
  36. with Gdk.Color; 
  37. with Gtk; 
  38. with Gtk.Extra.Plot_Data;    use Gtk.Extra.Plot_Data; 
  39. with Gtk.Extra.Plot; 
  40.  
  41. package Gtk.Extra.Plot_Surface is 
  42.  
  43.    type Gtk_Plot_Surface_Record is new Gtk.Extra.Plot_Data.Gtk_Plot_Data_Record 
  44.      with private; 
  45.    type Gtk_Plot_Surface is access all Gtk_Plot_Surface_Record'Class; 
  46.  
  47.    type Gtk_Plot_Polygon is new Gdk.C_Proxy; 
  48.  
  49.    procedure Gtk_New 
  50.      (Widget : out Gtk_Plot_Surface; 
  51.       Func   : Gtk.Extra.Plot.Plot3D_Function := null); 
  52.    --  Create a new surface. 
  53.    --  If Func is null, you have to explicitely specify the set of points 
  54.    --  found in the data set. Otherwise, the points will be generated 
  55.    --  automatically from Func. 
  56.  
  57.    procedure Initialize 
  58.      (Widget : access Gtk_Plot_Surface_Record'Class; 
  59.       Func   : Gtk.Extra.Plot.Plot3D_Function := null); 
  60.    --  Internal initialization function. 
  61.    --  See the section "Creating your own widgets" in the documentation. 
  62.  
  63.    function Get_Type return Gtk.Gtk_Type; 
  64.    --  Return the internal value associated with this widget. 
  65.  
  66.    function Get_Grid_Visible 
  67.      (Data : access Gtk_Plot_Surface_Record) return Boolean; 
  68.    --  Return True if the grid is currently visible for this data set. 
  69.  
  70.    procedure Set_Grid_Visible 
  71.      (Data : access Gtk_Plot_Surface_Record; Visible : Boolean); 
  72.    --  Choose whether the grid should be visible 
  73.  
  74.    function Get_Mesh_Visible 
  75.      (Data : access Gtk_Plot_Surface_Record) return Boolean; 
  76.    --  Return True if the wireframe mesh should be drawn. 
  77.  
  78.    procedure Set_Mesh_Visible 
  79.      (Data    : access Gtk_Plot_Surface_Record; Visible : Boolean); 
  80.    --  Indicate whether the wireframe mesh should be visible. 
  81.  
  82.    function Get_Nx (Data : access Gtk_Plot_Surface_Record) return Gint; 
  83.    function Get_Ny (Data : access Gtk_Plot_Surface_Record) return Gint; 
  84.    --  Return the number of points along each coordinate, when drawing a 
  85.    --  data set based on a function. 
  86.  
  87.    procedure Set_Nx (Data : access Gtk_Plot_Surface_Record; Nx : Gint); 
  88.    procedure Set_Ny (Data : access Gtk_Plot_Surface_Record; Ny : Gint); 
  89.    --  Set the number of points along each coordinate 
  90.  
  91.    procedure Set_Points 
  92.      (Data : access Gtk_Plot_Surface_Record; 
  93.       X    : Gdouble_Array_Access; 
  94.       Y    : Gdouble_Array_Access; 
  95.       Z    : Gdouble_Array_Access; 
  96.       Dx   : Gdouble_Array_Access; 
  97.       Dy   : Gdouble_Array_Access; 
  98.       Dz   : Gdouble_Array_Access); 
  99.    --  Set all the values of the data set at once. 
  100.  
  101.    procedure Get_Points 
  102.      (Data : access Gtk_Plot_Surface_Record; 
  103.       X    : out Points_Array; 
  104.       Y    : out Points_Array; 
  105.       Z    : out Points_Array; 
  106.       Dx   : out Points_Array; 
  107.       Dy   : out Points_Array; 
  108.       Dz   : out Points_Array); 
  109.    --  Return the values contained in the data set. 
  110.  
  111.    function Get_X (Data : access Gtk_Plot_Surface_Record) return Points_Array; 
  112.    function Get_Y (Data : access Gtk_Plot_Surface_Record) return Points_Array; 
  113.    function Get_Z (Data : access Gtk_Plot_Surface_Record) return Points_Array; 
  114.    --  Return the values contained in the data set. 
  115.  
  116.    function Get_Xstep (Data : access Gtk_Plot_Surface_Record) return Gdouble; 
  117.    function Get_Ystep (Data : access Gtk_Plot_Surface_Record) return Gdouble; 
  118.    --  Return the step between two points along one of the axis 
  119.  
  120.    procedure Set_Xstep (Data : access Gtk_Plot_Surface_Record; Step : Gdouble); 
  121.    procedure Set_Ystep (Data : access Gtk_Plot_Surface_Record; Step : Gdouble); 
  122.    --  Set the step between two points along one of the axis 
  123.  
  124.    procedure Set_Color 
  125.      (Data  : access Gtk_Plot_Surface_Record; Color : Gdk.Color.Gdk_Color); 
  126.    --  Set the color to use for the surface 
  127.  
  128.    procedure Set_Shadow 
  129.      (Data  : access Gtk_Plot_Surface_Record; Color : Gdk.Color.Gdk_Color); 
  130.    --  Set the color to use for the shadows. 
  131.  
  132.    procedure Set_Grid_Foreground 
  133.      (Data       : access Gtk_Plot_Surface_Record; 
  134.       Foreground : Gdk.Color.Gdk_Color); 
  135.    --  Set the foreground color to use for the grid 
  136.  
  137.    procedure Set_Grid_Background 
  138.      (Data       : access Gtk_Plot_Surface_Record; 
  139.       Background : Gdk.Color.Gdk_Color); 
  140.    --  Set the background color to use for the grid 
  141.  
  142.    procedure Set_Transparent 
  143.      (Data : access Gtk_Plot_Surface_Record; Transparent : Boolean); 
  144.    --  Whether the plot is transparent. If Transparent is true, all background 
  145.    --  attributes are ignored 
  146.  
  147.    procedure Build_Mesh (Data : access Gtk_Plot_Surface_Record); 
  148.    --  ??? 
  149.  
  150.    procedure Recalc_Nodes (Data : access Gtk_Plot_Surface_Record); 
  151.    --  ??? 
  152.  
  153.    --------------------- 
  154.    -- Lightning model -- 
  155.    --------------------- 
  156.  
  157.    procedure Set_Ambient 
  158.      (Data : access Gtk_Plot_Surface_Record; Ambient : Gdouble); 
  159.    --  Set the ambient 
  160.  
  161.    procedure Set_Light 
  162.      (Data : access Gtk_Plot_Surface_Record; X, Y, Z : Gdouble); 
  163.    --  Set the orientation of the light vector 
  164.  
  165.    procedure Use_Height_Gradient 
  166.      (Data : access Gtk_Plot_Surface_Record; Use_Gradient : Boolean); 
  167.    --  ??? 
  168.  
  169.    procedure Use_Amplitud 
  170.      (Data : access Gtk_Plot_Surface_Record; Amplitud : Boolean); 
  171.  
  172.    ------------- 
  173.    -- Signals -- 
  174.    ------------- 
  175.  
  176.    --  <signals> 
  177.    --  The following new signals are defined for this widget: 
  178.    --  </signals> 
  179.  
  180. private 
  181.    type Gtk_Plot_Surface_Record is new Gtk.Extra.Plot_Data.Gtk_Plot_Data_Record 
  182.      with null record; 
  183.    pragma Import (C, Get_Type, "gtk_plot_surface_get_type"); 
  184.  
  185.    --  Not bound, since these duplicates exactly functions from 
  186.    --  Gtk.Extra.Plot_Data: 
  187.    --     gtk_plot_surface_set_x 
  188.    --     gtk_plot_surface_set_y 
  189.    --     gtk_plot_surface_set_z 
  190.    --     gtk_plot_surface_set_dx 
  191.    --     gtk_plot_surface_set_dy 
  192.    --     gtk_plot_surface_set_dz 
  193.    --     gtk_plot_surface_get_dx 
  194.    --     gtk_plot_surface_get_dy 
  195.    --     gtk_plot_surface_get_dz 
  196.    --  </doc_ignore> 
  197.  
  198. end Gtk.Extra.Plot_Surface;