"Fossies" - the Fresh Open Source Software Archive

Member "gfsview-snapshot-121130/gl/gfsgl.h" (30 Nov 2012, 21439 Bytes) of package /linux/privat/gfsview-snapshot-121130.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gfsgl.h" see the Fossies "Dox" file reference documentation.

    1 /* Gerris - The GNU Flow Solver
    2  * Copyright (C) 2001-2004 National * Institute of Water and
    3  * Atmospheric Research
    4  *
    5  * This program is free software; you can redistribute it and/or
    6  * modify it under the terms of the GNU General Public License as
    7  * published by the Free Software Foundation; either version 2 of the
    8  * License, or (at your option) any later version.
    9  *
   10  * This program is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   13  * General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU General Public License
   16  * along with this program; if not, write to the Free Software
   17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   18  * 02111-1307, USA.  
   19  */
   20 
   21 #ifndef __GFSGL_H__
   22 #define __GFSGL_H__
   23 
   24 #include <gfs.h>
   25 
   26 #include "gl2ps/gl2ps.h"
   27 
   28 #ifdef __cplusplus
   29 extern "C" {
   30 #endif /* __cplusplus */
   31 
   32 FILE * gfs_gl_popen (const gchar * fname);
   33 
   34 #define GFS_COLORMAP_TEXTURE_SAMPLES 256
   35 
   36 typedef struct _GfsColormap GfsColormap;
   37 
   38 struct _GfsColormap {
   39   GPtrArray * colors;
   40   gboolean reversed;
   41   GLfloat texture[3*GFS_COLORMAP_TEXTURE_SAMPLES];
   42   gchar * name;
   43 };
   44 
   45 GfsColormap *     gfs_colormap_jet                 (void);
   46 GfsColormap *     gfs_colormap_cool_warm           (void);
   47 GfsColormap *     gfs_colormap_gray                (void);
   48 GtsColor          gfs_colormap_color               (GfsColormap * cmap, 
   49                             gdouble val);
   50 void              gfs_colormap_texture             (GfsColormap * cmap);
   51 void              gfs_colormap_destroy             (GfsColormap * colormap);
   52 
   53 typedef struct _GfsGlViewParams GfsGlViewParams;
   54 
   55 typedef struct {
   56   float m[16], p[16], res;
   57   GtsVector n[6];
   58   gdouble d[6];
   59   guint width;
   60 
   61   GList * symmetries;
   62   FttVector * s;
   63 } GfsFrustum;
   64 
   65 void          gfs_gl_get_frustum           (GfsGlViewParams * vp,
   66                         GList * symmetries,
   67                         GfsFrustum * f);
   68 void          gfs_gl_frustum_free          (GfsFrustum * f);
   69 GtsIntersect  gfs_sphere_in_frustum        (FttVector * p, 
   70                         gdouble r, 
   71                         GfsFrustum * f);
   72 gboolean      gfs_sphere_is_small          (FttVector * c, 
   73                         gdouble r, 
   74                         GfsFrustum * f);
   75 
   76 void          gfs_gl_init                  (void);
   77 void          gfs_gl_init_gl               (void);
   78 
   79 /* GfsGl: Header */
   80 
   81 typedef struct _GfsGl           GfsGl;
   82 typedef struct _GfsGl2D         GfsGl2D;
   83 
   84 typedef enum {
   85   GFS_GL_CONSTANT,
   86   GFS_GL_FLAT,
   87   GFS_GL_SMOOTH,
   88   GFS_GL_CSMOOTH
   89 } GfsGlShading;
   90 
   91 struct _GfsGl {
   92   /*< private >*/
   93   GtsObject parent;
   94 
   95   /*< public >*/
   96   GfsSimulation * sim;
   97   GfsGlViewParams * p;
   98   guint size, format;
   99   
  100   GtsColor lc;
  101   GfsGlShading shading;
  102   gint maxlevel;
  103 
  104   gfloat font_size;
  105   gboolean use_raster_font;
  106   gfloat line_width;
  107 };
  108 
  109 typedef struct _GfsGlClass    GfsGlClass;
  110 typedef struct {
  111   FttVector a, b;
  112 } GfsGlRay;
  113 
  114 struct _GfsGlClass {
  115   /*< private >*/
  116   GtsObjectClass parent_class;
  117 
  118   /*< public >*/
  119   void          (* set_simulation)  (GfsGl *, GfsSimulation *);
  120   void          (* draw)            (GfsGl *, GfsFrustum *);
  121   void          (* cut)             (GfsGl *, FttCell *, GfsGl2D *);
  122   gdouble       (* pick)            (GfsGl *, GfsGlRay *);
  123   gboolean      (* relevant)        (GfsSimulation *);
  124 };
  125 
  126 #define GFS_GL(obj)            GTS_OBJECT_CAST (obj,\
  127                              GfsGl,\
  128                              gfs_gl_class ())
  129 #define GFS_GL_CLASS(klass)    GTS_OBJECT_CLASS_CAST (klass,\
  130                          GfsGlClass,\
  131                          gfs_gl_class())
  132 #define GFS_IS_GL(obj)         (gts_object_is_from_class (obj,\
  133                          gfs_gl_class ()))
  134 
  135 GfsGlClass *  gfs_gl_class                 (void);
  136 GfsGl *       gfs_gl_new                   (GfsGlClass * klass);
  137 GfsGl *       gfs_gl_new_from_file         (GtsFile * fp);
  138 void          gfs_gl_cell_traverse_visible (GfsGl * gl,
  139                         GfsFrustum * f,
  140                         FttCellTraverseFunc func,
  141                         gpointer data);
  142 void          gfs_gl_cell_traverse_visible_condition (GfsGl * gl,
  143                               GfsFrustum * f,
  144                               gboolean (* condition) (FttCell *, gpointer),
  145                               gpointer datacon,
  146                               FttCellTraverseFunc func,
  147                               gpointer data);
  148 void          gfs_gl_cell_traverse_visible_mixed (GfsGl * gl,
  149                           GfsFrustum * f,
  150                           FttCellTraverseFunc func,
  151                           gpointer data);
  152 void          gfs_gl_cell_traverse_visible_boundary (GfsGl * gl,
  153                              GfsFrustum * f,
  154                              FttCellTraverseFunc func,
  155                              gpointer data);
  156 void          gfs_gl_set_simulation        (GfsGl * gl, 
  157                         GfsSimulation * sim);
  158 void          gfs_gl_draw                  (GfsGl * gl, 
  159                         GfsFrustum * f);
  160 void          gfs_gl_set_raster_font       (GfsGl * gl, 
  161                         gboolean raster);
  162 void          gfs_gl_set_font_size         (GfsGl * gl, 
  163                         gfloat size);
  164 
  165 #if FTT_2D
  166 # define      gfs_gl_cell_traverse_visible_plane gfs_gl_cell_traverse_visible
  167 #endif /* 2D */
  168 
  169 #define       gfs_gl_normal(gl)            (glNormal3d (GFS_GL2D (gl)->n.x,\
  170                                             GFS_GL2D (gl)->n.y,\
  171                                             GFS_GL2D (gl)->n.z))
  172 #define       gfs_gl_vector_format(gl)     (gl->format != GFSGL_SCREEN && \
  173                                             gl->format != GFSGL_PPM_OFFSCREEN)
  174 
  175 /* GfsGlLabel: Header */
  176 
  177 typedef struct _GfsGlLabel GfsGlLabel;
  178 
  179 struct _GfsGlLabel {
  180   /*< private >*/
  181   GfsGl parent;
  182   gchar * formatted_label;
  183 
  184   /*< public >*/
  185   FttVector p;
  186   gboolean symbol;
  187   gchar * label;
  188 };
  189 
  190 #define GFS_GL_LABEL(obj)            GTS_OBJECT_CAST (obj,\
  191                              GfsGlLabel,    \
  192                              gfs_gl_label_class ())
  193 #define GFS_IS_GL_LABEL(obj)         (gts_object_is_from_class (obj,\
  194                          gfs_gl_label_class ()))
  195 
  196 GfsGlClass *   gfs_gl_label_class     (void);
  197 void           gfs_gl_label_set_label (GfsGlLabel * gl, 
  198                        const gchar * label, 
  199                        GfsSimulation * sim);
  200 
  201 /* GfsGl2D: Header */
  202 
  203 struct _GfsGl2D {
  204   /*< private >*/
  205   GfsGl parent;
  206   FttVector n;
  207   gdouble pos;
  208   FttCell * picked;
  209   FttVector pickedpos;
  210 
  211   /*< public >*/
  212   FttVector p[3];
  213 };
  214 
  215 typedef struct _GfsGl2DClass    GfsGl2DClass;
  216 
  217 struct _GfsGl2DClass {
  218   /*< private >*/
  219   GfsGlClass parent_class;
  220 
  221   /*< public >*/
  222   void (* update_plane)  (GfsGl2D *);
  223 };
  224 
  225 #define GFS_GL2D(obj)            GTS_OBJECT_CAST (obj,\
  226                              GfsGl2D,\
  227                              gfs_gl2D_class ())
  228 #define GFS_GL2D_CLASS(klass)    GTS_OBJECT_CLASS_CAST (klass,\
  229                          GfsGl2DClass,\
  230                          gfs_gl2D_class())
  231 #define GFS_IS_GL2D(obj)         (gts_object_is_from_class (obj,\
  232                          gfs_gl2D_class ()))
  233 
  234 GfsGl2DClass * gfs_gl2D_class             (void);
  235 void           gfs_gl2D_update_plane      (GfsGl2D * gl);
  236 void           gfs_gl2D_update_pos_bounds (GfsGl2D * gl);
  237 
  238 /* GfsGlSymmetry: Header */
  239 
  240 typedef struct _GfsGlSymmetry GfsGlSymmetry;
  241 
  242 struct _GfsGlSymmetry {
  243   /*< private >*/
  244   GfsGl2D parent;
  245 
  246   /*< public >*/
  247   GLfloat m[16];
  248   gboolean periodic;
  249 };
  250 
  251 #define GFS_GL_SYMMETRY(obj)            GTS_OBJECT_CAST (obj,\
  252                              GfsGlSymmetry, \
  253                              gfs_gl_symmetry_class ())
  254 #define GFS_IS_GL_SYMMETRY(obj)         (gts_object_is_from_class (obj,\
  255                          gfs_gl_symmetry_class ()))
  256 
  257 GfsGlClass *   gfs_gl_symmetry_class  (void);
  258 void           gfs_gl_symmetry_apply  (GList * symmetry,
  259                        GLuint display_list);
  260 void           gfs_gl_symmetry_transform (GfsGl * gl,
  261                       FttVector * p,
  262                       FttVector * t);
  263 
  264 /* GfsGlPeriodic: Header */
  265 
  266 GfsGlClass *   gfs_gl_periodic_class  (void);
  267 
  268 /* GfsGlCells: Header */
  269 
  270 #define GFS_IS_GL_CELLS(obj)         (gts_object_is_from_class (obj,\
  271                          gfs_gl_cells_class ()))
  272 
  273 GfsGlClass * gfs_gl_cells_class  (void);
  274 
  275 /* GfsGlFractions: Header */
  276 
  277 #define GFS_IS_GL_FRACTIONS(obj)         (gts_object_is_from_class (obj,\
  278                          gfs_gl_fractions_class ()))
  279 
  280 GfsGlClass * gfs_gl_fractions_class  (void);
  281 
  282 /* GfsGlBoundaries: Header */
  283 
  284 #define GFS_IS_GL_BOUNDARIES(obj)         (gts_object_is_from_class (obj,\
  285                          gfs_gl_boundaries_class ()))
  286 
  287 GfsGlClass * gfs_gl_boundaries_class  (void);
  288 
  289 /* GfsGlVarFunc: Header */
  290 
  291 typedef struct {
  292   GfsVariable * v;
  293   GfsFunction * f;
  294 } GfsGlVarFunc;
  295 
  296 GfsGlVarFunc *   gfs_gl_var_func_new     (void);
  297 void             gfs_gl_var_func_destroy (GfsGlVarFunc * vf);
  298 GtsFile *        gfs_gl_var_func_set     (GfsGlVarFunc * vf, 
  299                       GfsSimulation * sim, 
  300                       const gchar * func,
  301                       GString * expr,
  302                       GfsVariableClass * klass);
  303 
  304 /* GfsGlScalar: Header */
  305 
  306 typedef struct _GfsGlScalar         GfsGlScalar;
  307 
  308 struct _GfsGlScalar {
  309   /*< private >*/
  310   GfsGl2D parent;
  311   GfsGlVarFunc * vf;
  312   gboolean amin, amax;
  313   gdouble aminv, amaxv;
  314 
  315   /*< public >*/
  316   GString * expr;
  317   GfsVariable * v;
  318   gdouble min, max;
  319   GfsColormap * cmap;
  320   gboolean show;
  321 };
  322 
  323 typedef struct _GfsGlScalarClass    GfsGlScalarClass;
  324 
  325 struct _GfsGlScalarClass {
  326   /*< private >*/
  327   GfsGl2DClass parent_class;
  328 
  329   /*< public >*/
  330   GtsFile * (* set_scalar)  (GfsGlScalar *, const gchar * func);
  331 };
  332 
  333 #define GFS_GL_SCALAR(obj)            GTS_OBJECT_CAST (obj,\
  334                              GfsGlScalar,\
  335                              gfs_gl_scalar_class ())
  336 #define GFS_GL_SCALAR_CLASS(klass)    GTS_OBJECT_CLASS_CAST (klass,\
  337                          GfsGlScalarClass,\
  338                          gfs_gl_scalar_class())
  339 #define GFS_IS_GL_SCALAR(obj)         (gts_object_is_from_class (obj,\
  340                          gfs_gl_scalar_class ()))
  341 
  342 GfsGlScalarClass *  gfs_gl_scalar_class        (void);
  343 GtsFile *           gfs_gl_scalar_set          (GfsGlScalar * gl,
  344                         const gchar * func);
  345 
  346 /* GfsGlSquares: Header */
  347 
  348 typedef struct _GfsGlSquares         GfsGlSquares;
  349 
  350 struct _GfsGlSquares {
  351   /*< private >*/
  352   GfsGlScalar parent;
  353 
  354   /*< public >*/
  355 };
  356 
  357 #define GFS_GL_SQUARES(obj)            GTS_OBJECT_CAST (obj,\
  358                              GfsGlSquares,\
  359                              gfs_gl_squares_class ())
  360 #define GFS_IS_GL_SQUARES(obj)         (gts_object_is_from_class (obj,\
  361                          gfs_gl_squares_class ()))
  362 
  363 GfsGlClass * gfs_gl_squares_class  (void);
  364 
  365 /* GfsGlLinear: Header */
  366 
  367 typedef struct _GfsGlLinear         GfsGlLinear;
  368 
  369 struct _GfsGlLinear {
  370   /*< private >*/
  371   GfsGlScalar parent;
  372   GfsGlVarFunc * vf;
  373   GfsVariable * nx, * ny;
  374   
  375   /*< public >*/
  376   GString * expr;
  377   GfsVariable * use_scalar;
  378   gboolean reversed;
  379 };
  380 
  381 #define GFS_GL_LINEAR(obj)            GTS_OBJECT_CAST (obj,\
  382                              GfsGlLinear,\
  383                              gfs_gl_linear_class ())
  384 #define GFS_IS_GL_LINEAR(obj)         (gts_object_is_from_class (obj,\
  385                          gfs_gl_linear_class ()))
  386 
  387 GfsGlClass * gfs_gl_linear_class  (void);
  388 GtsFile *    gfs_gl_linear_set    (GfsGlLinear * gl, 
  389                    const gchar * func);
  390 
  391 /* GfsGlIsoline: Header */
  392 
  393 typedef struct _GfsGlIsoline         GfsGlIsoline;
  394 
  395 struct _GfsGlIsoline {
  396   /*< private >*/
  397   GfsGlLinear parent;
  398   GArray * levels;
  399   GfsVariable * used;
  400   GfsFrustum * f;
  401   gdouble val;
  402 
  403   /*< public >*/
  404   GfsVariable * min, * max;
  405   gchar * ls;
  406   gdouble n;
  407 };
  408 
  409 #define GFS_GL_ISOLINE(obj)            GTS_OBJECT_CAST (obj,\
  410                              GfsGlIsoline,\
  411                              gfs_gl_isoline_class ())
  412 #define GFS_IS_GL_ISOLINE(obj)         (gts_object_is_from_class (obj,\
  413                          gfs_gl_isoline_class ()))
  414 
  415 GfsGlClass * gfs_gl_isoline_class             (void);
  416 void         gfs_gl_isoline_set_levels        (GfsGlIsoline * gl, 
  417                            const gchar * levels);
  418 void         gfs_gl_cell_traverse_visible_iso (GfsGl * gl,
  419                            GfsFrustum * f,
  420                            GfsVariable * min,
  421                            GfsVariable * max,
  422                            gdouble level,
  423                            FttCellTraverseFunc func,
  424                            gpointer data);
  425 
  426 /* GfsGlVOF: Header */
  427 
  428 typedef struct _GfsGlVOF         GfsGlVOF;
  429 
  430 struct _GfsGlVOF {
  431   /*< private >*/
  432   GfsGlScalar parent;
  433   GfsGlVarFunc * vf;
  434 
  435   /*< public >*/
  436   GString * expr;
  437   GfsVariable * use_scalar;
  438   gboolean reversed, draw_edges, interpolate;
  439 };
  440 
  441 #define GFS_GL_VOF(obj)            GTS_OBJECT_CAST (obj,\
  442                              GfsGlVOF,\
  443                              gfs_gl_vof_class ())
  444 #define GFS_IS_GL_VOF(obj)         (gts_object_is_from_class (obj,\
  445                          gfs_gl_vof_class ()))
  446 
  447 GfsGlClass * gfs_gl_vof_class      (void);
  448 GtsFile *    gfs_gl_vof_set        (GfsGlVOF * gl, 
  449                     const gchar * func);
  450 
  451 /* GfsGlSolid: Header */
  452 
  453 #if (!FTT_2D)
  454 typedef struct _GfsGlSolid         GfsGlSolid;
  455 
  456 struct _GfsGlSolid {
  457   /*< private >*/
  458   GfsGlScalar parent;
  459   gboolean needs_updating;
  460 
  461   /*< public >*/
  462   gboolean reversed;
  463   GfsVariable * p, * s, * use_scalar;
  464   GSList * solids;
  465 };
  466 
  467 #define GFS_GL_SOLID(obj)            GTS_OBJECT_CAST (obj,\
  468                              GfsGlSolid,\
  469                              gfs_gl_solid_class ())
  470 #endif /* 3D */
  471 
  472 #define GFS_IS_GL_SOLID(obj)         (gts_object_is_from_class (obj,\
  473                          gfs_gl_solid_class ()))
  474 
  475 GfsGlClass * gfs_gl_solid_class  (void);
  476 #if (!FTT_2D)
  477 void         gfs_gl_solid_reset  (GfsGlSolid * gl);
  478 #endif /* 3D */
  479 
  480 /* GfsGlLevels: Header */
  481 
  482 typedef struct _GfsGlLevels         GfsGlLevels;
  483 
  484 struct _GfsGlLevels {
  485   /*< private >*/
  486   GfsGl2D parent;
  487 
  488   /*< public >*/
  489   GfsVariable * v;
  490 };
  491 
  492 #define GFS_GL_LEVELS(obj)            GTS_OBJECT_CAST (obj,\
  493                              GfsGlLevels,\
  494                              gfs_gl_levels_class ())
  495 #define GFS_IS_GL_LEVELS(obj)         (gts_object_is_from_class (obj,\
  496                          gfs_gl_levels_class ()))
  497 
  498 GfsGlClass * gfs_gl_levels_class  (void);
  499 
  500 /* GfsGlVectors: Header */
  501 
  502 typedef struct _GfsGlVectors         GfsGlVectors;
  503 
  504 struct _GfsGlVectors {
  505   /*< private >*/
  506   GfsGlScalar parent;
  507   gdouble h, max;
  508   gboolean already_set;
  509   GfsGlVarFunc * vf[FTT_DIMENSION];
  510 
  511   /*< public >*/
  512   GString * expr[FTT_DIMENSION];
  513   GfsVariable * v[FTT_DIMENSION];
  514   gdouble scale;
  515   GtsColor c;
  516   gboolean use_scalar;
  517 };
  518 
  519 #define GFS_GL_VECTORS(obj)            GTS_OBJECT_CAST (obj,\
  520                              GfsGlVectors,\
  521                              gfs_gl_vectors_class ())
  522 #define GFS_IS_GL_VECTORS(obj)         (gts_object_is_from_class (obj,\
  523                          gfs_gl_vectors_class ()))
  524 
  525 GfsGlClass * gfs_gl_vectors_class        (void);
  526 GtsFile *    gfs_gl_vectors_set          (GfsGlVectors * gl,
  527                       FttComponent c,
  528                       const gchar * func);
  529 
  530 /* GfsGlStreamline: Header */
  531 
  532 typedef struct _GfsGlStreamline         GfsGlStreamline;
  533 
  534 struct _GfsGlStreamline {
  535   /*< private >*/
  536   GtsObject parent;
  537   GLuint list;
  538 
  539   /*< public >*/
  540   FttVector c;
  541   GList * l;
  542 };
  543 
  544 #define GFS_GL_STREAMLINE(obj)            GTS_OBJECT_CAST (obj,\
  545                              GfsGlStreamline,\
  546                              gfs_gl_streamline_class ())
  547 #define GFS_IS_GL_STREAMLINE(obj)         (gts_object_is_from_class (obj,\
  548                          gfs_gl_streamline_class ()))
  549 
  550 GtsObjectClass * gfs_gl_streamline_class        (void);
  551 
  552 /* GfsGlStreamlines: Header */
  553 
  554 typedef struct _GfsGlStreamlines         GfsGlStreamlines;
  555 
  556 struct _GfsGlStreamlines {
  557   /*< private >*/
  558   GfsGlVectors parent;
  559   GfsVariable * s;
  560   GList * stream, * selected, * candidate;
  561 
  562   /*< public >*/
  563   gboolean show_cells;
  564   gdouble dmin, radius;
  565 };
  566 
  567 #define GFS_GL_STREAMLINES(obj)            GTS_OBJECT_CAST (obj,\
  568                              GfsGlStreamlines,\
  569                              gfs_gl_streamlines_class ())
  570 #define GFS_IS_GL_STREAMLINES(obj)         (gts_object_is_from_class (obj,\
  571                          gfs_gl_streamlines_class ()))
  572 
  573 GfsGlClass * gfs_gl_streamlines_class           (void);
  574 void         gfs_gl_streamlines_reset           (GfsGlStreamlines * gl);
  575 void         gfs_gl_streamlines_reset_selected  (GfsGlStreamlines * gl);
  576 GfsGlStreamline * gfs_gl_streamlines_add        (GfsGlStreamlines * gl, 
  577                          FttVector p);
  578 gboolean     gfs_gl_streamlines_remove_selected (GfsGlStreamlines * gl);
  579 void         gfs_gl_streamlines_update_display_lists (GfsGlStreamlines * gl);
  580 gdouble      gfs_gl_streamlines_closest         (GfsGlStreamlines * gl, 
  581                          FttVector * p,
  582                          GtsPoint * closest);
  583 void         gfs_gl_streamlines_evenly_spaced   (GfsGlStreamlines * gl,
  584                          gboolean (* callback) (GfsGlStreamlines *, 
  585                                     gpointer),
  586                          gpointer data);
  587 
  588 /* GfsGlEllipses: Header */
  589 
  590 typedef struct _GfsGlEllipses         GfsGlEllipses;
  591 
  592 struct _GfsGlEllipses {
  593   /*< private >*/
  594   GfsGlScalar parent;
  595   gdouble h, max;
  596   gboolean already_set;
  597   GfsGlVarFunc * vf[4];
  598 
  599   /*< public >*/
  600   GString * expr[4];
  601   GfsVariable * v[4];
  602   gdouble scale;
  603   GtsColor c;
  604   gboolean use_scalar;
  605 };
  606 
  607 #define GFS_GL_ELLIPSES(obj)            GTS_OBJECT_CAST (obj,\
  608                              GfsGlEllipses,\
  609                              gfs_gl_ellipses_class ())
  610 #define GFS_IS_GL_ELLIPSES(obj)         (gts_object_is_from_class (obj,\
  611                          gfs_gl_ellipses_class ()))
  612 
  613 GfsGlClass * gfs_gl_ellipses_class        (void);
  614 GtsFile *    gfs_gl_ellipses_set          (GfsGlEllipses * gl, 
  615                        guint i, 
  616                        const gchar * func);
  617 
  618 /* GfsGlLocation: Header */
  619 
  620 typedef struct _GfsGlLocation         GfsGlLocation;
  621 
  622 struct _GfsGlLocation {
  623   /*< private >*/
  624   GfsGl parent;
  625 
  626   /*< public >*/
  627   gdouble size;
  628   gboolean label;
  629 };
  630 
  631 #define GFS_GL_LOCATION(obj)            GTS_OBJECT_CAST (obj,\
  632                              GfsGlLocation,\
  633                              gfs_gl_location_class ())
  634 
  635 #define GFS_IS_GL_LOCATION(obj)         (gts_object_is_from_class (obj,\
  636                          gfs_gl_location_class ()))
  637 
  638 GfsGlClass * gfs_gl_location_class  (void);
  639 
  640 /* GfsGlHeight: Header */
  641 
  642 #define GFS_IS_GL_HEIGHT(obj)         (gts_object_is_from_class (obj,\
  643                          gfs_gl_height_class ()))
  644 
  645 GfsGlClass * gfs_gl_height_class  (void);
  646 
  647 /* GfsGlLocate: Header */
  648 
  649 typedef struct _GfsGlLocate         GfsGlLocate;
  650 
  651 struct _GfsGlLocate {
  652   /*< private >*/
  653   GfsGl parent;
  654 
  655   /*< public >*/
  656   FttVector p;
  657 };
  658 
  659 #define GFS_GL_LOCATE(obj)            GTS_OBJECT_CAST (obj,\
  660                              GfsGlLocate,\
  661                              gfs_gl_locate_class ())
  662 #define GFS_IS_GL_LOCATE(obj)         (gts_object_is_from_class (obj,\
  663                          gfs_gl_locate_class ()))
  664 
  665 GfsGlClass *  gfs_gl_locate_class             (void);
  666 
  667 /* GfsGlPipes: Header */
  668 
  669 #define GFS_IS_GL_PIPES(obj)         (gts_object_is_from_class (obj,\
  670                          gfs_gl_pipes_class ()))
  671 
  672 GfsGlClass * gfs_gl_pipes_class  (void);
  673 
  674 struct _GfsGlViewParams {
  675   gboolean do_init;
  676   gfloat beginx, beginy;
  677   gfloat dx, dy, tx, ty, sx, sy, sz;
  678   gfloat quat[4];
  679   gfloat dquat[4];
  680   gfloat fov;
  681 
  682   GtsColor bg;
  683   gfloat lc;
  684   gfloat timing, base_res, res, reactivity;
  685   gboolean motion, cp[6];
  686   gfloat lw; /* base line width for vector drawings */
  687 };
  688 
  689 void              gfs_gl_view_params_init    (GfsGlViewParams * p);
  690 GfsGlViewParams * gfs_gl_view_params_new     (void);
  691 void              gfs_gl_view_params_write   (GfsGlViewParams * p, 
  692                           FILE * fp);
  693 void              gfs_gl_view_params_read    (GfsGlViewParams * p, 
  694                           GtsFile * fp);
  695 
  696 typedef struct {
  697   GLint format, sort, options;
  698   guint width, height;
  699   FILE * fp;
  700   gfloat lw; /* base line width */
  701 } GfsGl2PSParams;
  702 
  703 typedef enum {
  704   GFSGL_PPM_OFFSCREEN = GL2PS_PGF + 1,
  705   GFSGL_PPM_SCREEN,
  706   GFSGL_SCREEN,
  707   GFSGL_GFSVIEW,
  708   GFSGL_GERRIS,
  709   GFSGL_GNUPLOT,
  710   GFSGL_OBJ,
  711   GFSGL_KML,
  712   GFSGL_PPM = GFSGL_PPM_OFFSCREEN
  713 } GfsGlFormat;
  714 
  715 void              gfs_gl2ps_params_init      (GfsGl2PSParams * p);
  716 void              gfs_gl2ps_params_read      (GfsGl2PSParams * p,
  717                           GtsFile * fp);
  718 void              gfs_gl2ps_params_write     (GfsGl2PSParams * p,
  719                           FILE * fp);
  720 void              gfs_gl_write_image         (FILE * fp, 
  721                           const GLubyte * buffer, 
  722                           guint width, 
  723                           guint height);
  724 
  725 /* GfsGlClipPlane: Header */
  726 
  727 typedef struct _GfsGlClipPlane         GfsGlClipPlane;
  728 
  729 struct _GfsGlClipPlane {
  730   /*< private >*/
  731   GfsGl2D parent;
  732   gint i;
  733 
  734   /*< public >*/
  735   gboolean disabled;
  736 };
  737 
  738 #define GFS_GL_CLIP_PLANE(obj)            GTS_OBJECT_CAST (obj,\
  739                              GfsGlClipPlane,\
  740                              gfs_gl_clip_plane_class ())
  741 #define GFS_IS_GL_CLIP_PLANE(obj)         (gts_object_is_from_class (obj,\
  742                          gfs_gl_clip_plane_class ()))
  743 
  744 GfsGlClass * gfs_gl_clip_plane_class        (void);
  745 void         gfs_gl_clip_plane_disable      (GfsGlClipPlane * gl);
  746 
  747 /* GfsGlCutPlane: Header */
  748 
  749 typedef struct _GfsGlCutPlane         GfsGlCutPlane;
  750 
  751 struct _GfsGlCutPlane {
  752   /*< private >*/
  753   GfsGl2D parent;
  754   GList * list;
  755 
  756   /*< public >*/
  757 };
  758 
  759 #define GFS_GL_CUT_PLANE(obj)            GTS_OBJECT_CAST (obj,\
  760                              GfsGlCutPlane,\
  761                              gfs_gl_cut_plane_class ())
  762 #define GFS_IS_GL_CUT_PLANE(obj)         (gts_object_is_from_class (obj,\
  763                          gfs_gl_cut_plane_class ()))
  764 
  765 GfsGlClass * gfs_gl_cut_plane_class        (void);
  766 
  767 #if (!FTT_2D)
  768 
  769 /* GfsGlIsosurface: Header */
  770 
  771 typedef struct _GfsGlIsosurface         GfsGlIsosurface;
  772 
  773 struct _GfsGlIsosurface {
  774   /*< private >*/
  775   GfsGlScalar parent;
  776   GfsGlVarFunc * vf;
  777 
  778   /*< public >*/
  779   GString * expr;
  780   GfsVariable * v, * min, * max, * p, * use_scalar;
  781   gdouble level, minv, maxv;
  782   gboolean reversed;
  783 };
  784 
  785 #define GFS_GL_ISOSURFACE(obj)            GTS_OBJECT_CAST (obj,\
  786                              GfsGlIsosurface,\
  787                              gfs_gl_isosurface_class ())
  788 #define GFS_IS_GL_ISOSURFACE(obj)         (gts_object_is_from_class (obj,\
  789                          gfs_gl_isosurface_class ()))
  790 
  791 GfsGlClass * gfs_gl_isosurface_class        (void);
  792 void         gfs_gl_isosurface_reset        (GfsGlIsosurface * gl);
  793 GtsFile *    gfs_gl_isosurface_set          (GfsGlIsosurface * gl, 
  794                          const gchar * func);
  795 
  796 #endif /* 3D */
  797 
  798 gdouble      gfs_gl_domain_extent           (GfsDomain * domain,
  799                          GList * symmetries);
  800 
  801 typedef struct {
  802   GLfloat * feedback;
  803 } GfsGlFeedback;
  804 
  805 GfsGlFeedback * gfs_gl_feedback_begin (guint buffersize);
  806 gboolean        gfs_gl_feedback_end   (GfsGlFeedback * f,
  807                        GfsSimulation * sim,
  808                        FILE * fp,
  809                        GfsGlFormat format);
  810 
  811 #ifdef __cplusplus
  812 }
  813 #endif /* __cplusplus */
  814 
  815 #endif /* __GFSGL_H__ */