graph/gl2ps.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __GL2PS_H__
00035 #define __GL2PS_H__
00036
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 #include <math.h>
00040
00041
00042
00043 #ifdef WIN32
00044 # include <windows.h>
00045 # ifdef GL2PSDLL
00046 # ifdef GL2PSDLL_EXPORTS
00047 # define GL2PSDLL_API __declspec(dllexport)
00048 # else
00049 # define GL2PSDLL_API __declspec(dllimport)
00050 # endif
00051 # else
00052 # define GL2PSDLL_API
00053 # endif
00054 #else
00055 # define GL2PSDLL_API
00056 #endif
00057
00058 #ifdef __APPLE__
00059 # include <OpenGL/gl.h>
00060 #else
00061 # include <GL/gl.h>
00062 #endif
00063
00064
00065
00066 #if defined(HAVE_ZLIB) || defined(HAVE_LIBZ) || defined(GL2PS_HAVE_ZLIB)
00067 # include <zlib.h>
00068 # ifndef GL2PS_HAVE_ZLIB
00069 # define GL2PS_HAVE_ZLIB
00070 # endif
00071 #endif
00072
00073
00074
00075 #define GL2PS_MAJOR_VERSION 1
00076 #define GL2PS_MINOR_VERSION 1
00077 #define GL2PS_PATCH_VERSION 0
00078
00079 #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
00080 0.01 * GL2PS_MINOR_VERSION + \
00081 0.0001 * GL2PS_PATCH_VERSION)
00082
00083
00084
00085 #define GL2PS_PS 1
00086 #define GL2PS_EPS 2
00087 #define GL2PS_TEX 3
00088 #define GL2PS_PDF 4
00089
00090
00091
00092 #define GL2PS_NO_SORT 1
00093 #define GL2PS_SIMPLE_SORT 2
00094 #define GL2PS_BSP_SORT 3
00095
00096
00097
00098 #define GL2PS_NONE 0
00099 #define GL2PS_DRAW_BACKGROUND (1<<0)
00100 #define GL2PS_SIMPLE_LINE_OFFSET (1<<1)
00101 #define GL2PS_SILENT (1<<2)
00102 #define GL2PS_BEST_ROOT (1<<3)
00103 #define GL2PS_OCCLUSION_CULL (1<<4)
00104 #define GL2PS_NO_TEXT (1<<5)
00105 #define GL2PS_LANDSCAPE (1<<6)
00106 #define GL2PS_NO_PS3_SHADING (1<<7)
00107 #define GL2PS_NO_PIXMAP (1<<8)
00108 #define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
00109 #define GL2PS_COMPRESS (1<<10)
00110
00111
00112
00113 #define GL2PS_POLYGON_OFFSET_FILL 1
00114 #define GL2PS_POLYGON_BOUNDARY 2
00115 #define GL2PS_LINE_STIPPLE 3
00116
00117
00118
00119 #define GL2PS_EPSILON 5.0e-3F
00120 #define GL2PS_DEPTH_FACT 1000.0F
00121 #define GL2PS_SIMPLE_OFFSET 0.05F
00122 #define GL2PS_SIMPLE_OFFSET_LARGE 1.0F
00123 #define GL2PS_ZERO(arg) (fabs(arg)<1.e-20)
00124 #define GL2PS_FIXED_XREF_ENTRIES 7
00125
00126
00127
00128 #define GL2PS_SUCCESS 0
00129 #define GL2PS_INFO 1
00130 #define GL2PS_WARNING 2
00131 #define GL2PS_ERROR 3
00132 #define GL2PS_NO_FEEDBACK 4
00133 #define GL2PS_OVERFLOW 5
00134 #define GL2PS_UNINITIALIZED 6
00135
00136
00137
00138 #define GL2PS_NOTYPE -1
00139 #define GL2PS_TEXT 1
00140 #define GL2PS_POINT 2
00141 #define GL2PS_LINE 3
00142 #define GL2PS_QUADRANGLE 4
00143 #define GL2PS_TRIANGLE 5
00144 #define GL2PS_PIXMAP 6
00145
00146
00147
00148 #define GL2PS_TEXT_C 1
00149 #define GL2PS_TEXT_CL 2
00150 #define GL2PS_TEXT_CR 3
00151 #define GL2PS_TEXT_B 4
00152 #define GL2PS_TEXT_BL 5
00153 #define GL2PS_TEXT_BR 6
00154 #define GL2PS_TEXT_T 7
00155 #define GL2PS_TEXT_TL 8
00156 #define GL2PS_TEXT_TR 9
00157
00158
00159
00160 #define GL2PS_COINCIDENT 1
00161 #define GL2PS_IN_FRONT_OF 2
00162 #define GL2PS_IN_BACK_OF 3
00163 #define GL2PS_SPANNING 4
00164
00165
00166
00167 #define GL2PS_POINT_COINCIDENT 0
00168 #define GL2PS_POINT_INFRONT 1
00169 #define GL2PS_POINT_BACK 2
00170
00171
00172
00173 #define GL2PS_BEGIN_POLYGON_OFFSET_FILL 1
00174 #define GL2PS_END_POLYGON_OFFSET_FILL 2
00175 #define GL2PS_BEGIN_POLYGON_BOUNDARY 3
00176 #define GL2PS_END_POLYGON_BOUNDARY 4
00177 #define GL2PS_BEGIN_LINE_STIPPLE 5
00178 #define GL2PS_END_LINE_STIPPLE 6
00179 #define GL2PS_SET_POINT_SIZE 7
00180 #define GL2PS_SET_LINE_WIDTH 8
00181
00182 typedef GLfloat GL2PSrgba[4];
00183 typedef GLfloat GL2PSxyz[3];
00184 typedef GLfloat GL2PSplane[4];
00185
00186 typedef struct _GL2PSbsptree2d GL2PSbsptree2d;
00187
00188 struct _GL2PSbsptree2d {
00189 GL2PSplane plane;
00190 GL2PSbsptree2d *front, *back;
00191 };
00192
00193 typedef struct {
00194 GLint nmax, size, incr, n;
00195 char *array;
00196 } GL2PSlist;
00197
00198 typedef struct _GL2PSbsptree GL2PSbsptree;
00199
00200 struct _GL2PSbsptree {
00201 GL2PSplane plane;
00202 GL2PSlist *primitives;
00203 GL2PSbsptree *front, *back;
00204 };
00205
00206 typedef struct {
00207 GL2PSxyz xyz;
00208 GL2PSrgba rgba;
00209 } GL2PSvertex;
00210
00211 typedef GL2PSvertex GL2PStriangle[3];
00212
00213 typedef struct {
00214 GLshort fontsize;
00215 char *str, *fontname;
00216 GLint alignment;
00217 } GL2PSstring;
00218
00219 typedef struct {
00220 GLsizei width, height;
00221 GLenum format, type;
00222 void* pixels;
00223 } GL2PSimage;
00224
00225 typedef struct {
00226 GLshort type, numverts;
00227 char boundary, dash, culled;
00228 GLfloat width, depth;
00229 GL2PSvertex *verts;
00230 GL2PSstring *text;
00231 GL2PSimage *image;
00232 } GL2PSprimitive;
00233
00234 typedef struct {
00235 #ifdef GL2PS_HAVE_ZLIB
00236 Bytef *dest, *src, *start;
00237 uLongf destLen, srcLen;
00238 #else
00239 int dummy;
00240 #endif
00241 } GL2PScompress;
00242
00243 typedef struct {
00244
00245 GLint format, sort, options, colorsize, colormode, buffersize;
00246 const char *title, *producer, *filename;
00247 GLboolean boundary;
00248 GLfloat *feedback, offset[2], lastlinewidth;
00249 GLint viewport[4];
00250 GL2PSrgba *colormap, lastrgba, threshold;
00251 GL2PSlist *primitives;
00252 FILE *stream;
00253 GL2PScompress *compress;
00254
00255
00256 GLint maxbestroot;
00257
00258
00259 GLboolean zerosurfacearea;
00260 GL2PSbsptree2d *imagetree;
00261 GL2PSprimitive *primitivetoadd;
00262
00263
00264 int cref[GL2PS_FIXED_XREF_ENTRIES];
00265 int streamlength;
00266 GL2PSlist *tlist, *tidxlist, *ilist, *slist;
00267 int lasttype, consec_cnt, consec_inner_cnt;
00268 int line_width_diff, line_rgb_diff, last_line_finished, last_triangle_finished;
00269 } GL2PScontext;
00270
00271
00272
00273 #ifdef __cplusplus
00274 extern "C" {
00275 #endif
00276
00277 GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
00278 GLint viewport[4], GLint format, GLint sort,
00279 GLint options, GLint colormode,
00280 GLint colorsize, GL2PSrgba *colormap,
00281 GLint nr, GLint ng, GLint nb, GLint buffersize,
00282 FILE *stream, const char *filename);
00283 GL2PSDLL_API GLint gl2psEndPage(void);
00284 GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
00285 GL2PSDLL_API GLint gl2psEndViewport(void);
00286 GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize);
00287 GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
00288 GLint xorig, GLint yorig, GLfloat xscale, GLfloat yscale,
00289 GLenum format, GLenum type, const void *pixels);
00290 GL2PSDLL_API GLint gl2psEnable(GLint mode);
00291 GL2PSDLL_API GLint gl2psDisable(GLint mode);
00292 GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
00293 GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
00294
00295
00296 GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, GLshort fontsize,
00297 GLint align, GL2PSrgba color);
00298
00299 #ifdef __cplusplus
00300 };
00301 #endif
00302
00303 #endif
00304
Generated on Sun Feb 13 01:05:56 2005 for MapQuant by
1.3.7