"Fossies" - the Fresh Open Source Software Archive

Member "gamgi0.17.5x/src/io/gamgi_io_x3d_render.h" (23 Feb 2022, 5968 Bytes) of package /linux/misc/gamgi-all-0.17.5x.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.

    1 /******************************************
    2  *
    3  * $GAMGI/src/io/gamgi_io_x3d_render.h
    4  *
    5  * Copyright (C) 2008 Tiago Farto
    6  *
    7  * Distributed under the terms of the GNU
    8  * General Public License: $GAMGI/LICENSE
    9  *
   10  */
   11 
   12 /*
   13  * OGLFT: A library for drawing text with OpenGL using the FreeType library
   14  * Copyright (C) 2002 lignum Computing, Inc.
   15  * Author: Allen Barnett
   16  *
   17  * This program is free software; you can redistribute it and/or modify
   18  * it under the terms of the GNU General Public License as published by
   19  * the Free Software Foundation; either version 2 of the License, or
   20  * (at your option) any later version.
   21  *
   22  * This program is distributed in the hope that it will be useful,
   23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   25  * GNU General Public License for more details.
   26  *
   27  * You should have received a copy of the GNU General Public License
   28  * along with this program; if not, write to the Free Software
   29  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   30  */
   31 
   32 /*********************************
   33  * Code taken from: OGLFT-0.9    *
   34  *                               *
   35  * Functions with OGLFT code:    *
   36  * x3d_font_extrusion            *
   37  * static_glu_begin              *
   38  * static_glu_vertex             *
   39  * static_glu_combine            *
   40  * static_vertical_move          *
   41  * static_vertical_line          *
   42  * static_vertical_conic         *
   43  * static_vertical_cubic         *
   44  * x3d_font_face                 *
   45  * static_extruded_create        *
   46  * static_extruded_remove        *
   47  * gamgi_io_x3d_render_solid     *
   48  *                               *
   49  * Code taken by: Carlos Pereira *
   50  *********************************/
   51 
   52 /*
   53  * GLE: The Tubing and Extrusion Library
   54  * Copyright (C) 1991,1994,2003 Linas Vepstas
   55  *
   56  * The GLE library is distributed under two licenses:
   57  * GNU General Public License (GPL) and Public Domain
   58  *
   59  *  This program is free software; you can redistribute it and/or modify
   60  * it under the terms of the GNU General Public License as published by
   61  * the Free Software Foundation; either version 2 of the License, or
   62  * (at your option) any later version.
   63  *
   64  * This program is distributed in the hope that it will be useful,
   65  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   66  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   67  * GNU General Public License for more details.
   68  *
   69  * You should have received a copy of the GNU General Public License
   70  * along with this program; if not, write to the Free Software
   71  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   72  */
   73 
   74 /***********************************************
   75  * Code taken from: GLE-3.1.0                  *
   76  *                                             *
   77  * Functions with GLE code: x3d_font_extrusion *
   78  *                                             *
   79  * Code taken by: Carlos Pereira               *
   80  ***********************************************/
   81 
   82 #define GAMGI_IO_X3D_DIRECTION_WIDTH 4.0
   83 
   84 typedef struct
   85 {
   86 gamgi_extruded * extruded;
   87 
   88 GLenum polygon;         /* polygon type */
   89 int vcount;                     /* vertex points count */
   90 int ocount;                     /* order points count */
   91 int vertex;                     /* auxiliary vertex count */
   92 int fancenter;                  /* center of the triangle fan */
   93 
   94 float x, y, z;                  /* offset */
   95 
   96 gamgi_darray * vert;    /* vertex array */
   97 gamgi_iarray * order;   /* vertex order array */
   98 } glu_tessdata;
   99 
  100 /**********************
  101  * internal functions *
  102  **********************
  103 
  104 static void static_point (FILE *fp, int n_points, double *points, 
  105 float *color, int type, int width, int pattern, gamgi_bool *error);
  106 
  107  **********************
  108  * external functions *
  109  **********************/
  110 
  111 void gamgi_io_x3d_render_cross (FILE *fp, int n_points, 
  112 double *points, float *color, gamgi_bool *error);
  113 
  114 void gamgi_io_x3d_render_chess (FILE *fp, int n_points, 
  115 double *points,  float *color, gamgi_bool *error);
  116 
  117 void gamgi_io_x3d_render_points (FILE *fp, int n_points, 
  118 double *points, float *color, gamgi_bool *error);
  119 
  120 void gamgi_io_x3d_render_loops (FILE *fp, int *loops, 
  121 double *points, gamgi_bool *error);
  122 
  123 void gamgi_io_x3d_render_lines (FILE *fp, 
  124 int *lines, double *points, gamgi_bool *error);
  125 
  126 void gamgi_io_x3d_render_triangles (FILE *fp,
  127 int n_triangles, double * points, gamgi_bool *error);
  128 
  129 void gamgi_io_x3d_render_line_strip (FILE *fp, 
  130 int n_points, double * points, gamgi_bool *error);
  131 
  132 void gamgi_io_x3d_render_polygons (FILE *fp, 
  133 int *loops, double *points, gamgi_bool * error);
  134 
  135 void gamgi_io_x3d_render_polygons_color (FILE *fp, int *loops, 
  136 double *points, int *paints, float *colors, gamgi_bool * error);
  137 
  138 void gamgi_io_x3d_render_wired (FILE *fp, gamgi_text *text, gamgi_bool *error);
  139 
  140 void x3d_font_extrusion (glu_tessdata *data);
  141 
  142 /**********************
  143  * internal functions *
  144  **********************
  145 
  146 static void static_glu_begin (GLenum polygon, glu_tessdata *data);
  147 
  148 static void static_glu_vertex (double* vertex, glu_tessdata *data);
  149 
  150 static void static_glu_combine (double coords[3], void *vertices[4], 
  151 float weights[4], void** output, glu_tessdata *data);
  152 
  153 static int static_vertical_move (FT_Vector *to, glu_tessdata *data);
  154 
  155 static int static_vertical_line (FT_Vector *to, glu_tessdata *data);
  156 
  157 static int static_vertical_conic (FT_Vector *control, FT_Vector *to, glu_tessdata *data);
  158 
  159 static int static_vertical_cubic (FT_Vector *control1, 
  160 FT_Vector *control2, FT_Vector* to, glu_tessdata *data);
  161 
  162 static void x3d_font_face (FT_OutlineGlyph glyph, glu_tessdata *data);
  163 
  164  **********************
  165  * external functions *
  166  **********************/
  167 
  168 gamgi_extruded *static_extruded_create (gamgi_enum font, 
  169 FT_Library *freetype, FT_Face *face);
  170 
  171 gamgi_bool static_extruded_remove (FT_Library freetype, 
  172 FT_Face face, gamgi_extruded *extruded);
  173 
  174 void gamgi_io_x3d_render_solid (FILE *fp, gamgi_text *text, gamgi_bool *error);