Codebase list gl2ps / dc7c247
Merge experimental. Anton Gladky 7 years ago
14 changed file(s) with 197 addition(s) and 112 deletion(s). Raw diff Collapse all Expand all
00 # GL2PS, an OpenGL to PostScript Printing Library
1 # Copyright (C) 1999-2012 C. Geuzaine
1 # Copyright (C) 1999-2015 C. Geuzaine
22 #
33 # This program is free software; you can redistribute it and/or
44 # modify it under the terms of either:
4848
4949 set(GL2PS_MAJOR_VERSION 1)
5050 set(GL2PS_MINOR_VERSION 3)
51 set(GL2PS_PATCH_VERSION 8)
51 set(GL2PS_PATCH_VERSION 9)
5252 set(GL2PS_EXTRA_VERSION "" CACHE STRING "GL2PS extra version string")
5353
5454 set(GL2PS_VERSION "${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}")
105105 endif(PNG_FOUND)
106106 endif(ENABLE_PNG)
107107
108 find_library(MATH_LIBRARY m)
109 if(MATH_LIBRARY)
110 list(APPEND EXTERNAL_LIBRARIES ${MATH_LIBRARY})
111 endif(MATH_LIBRARY)
112
108113 include_directories(${EXTERNAL_INCLUDES})
109114
110115 if(OPENGL_FOUND)
115120 target_link_libraries(shared ${EXTERNAL_LIBRARIES})
116121 set_target_properties(shared PROPERTIES OUTPUT_NAME gl2ps)
117122 set_target_properties(shared PROPERTIES
118 VERSION ${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}.${GL2PS_PATCH_VERSION}
119 SOVERSION ${GL2PS_MAJOR_VERSION})
123 VERSION ${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}.${GL2PS_PATCH_VERSION}
124 SOVERSION ${GL2PS_MAJOR_VERSION})
120125 if(MSVC)
121126 set_target_properties(shared PROPERTIES COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS")
122127 endif(MSVC)
179184 set(CPACK_STRIP_FILES TRUE)
180185 set(CPACK_SOURCE_PACKAGE_FILE_NAME gl2ps-${GL2PS_VERSION}-source)
181186 set(CPACK_SOURCE_GENERATOR TGZ)
182 set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}" "/CVS/" "/.svn" "~$"
183 "DS_Store$" "/tmp/" "/bin/" "/lib/")
187 set(CPACK_SOURCE_IGNORE_FILES "TODO.txt" "${CMAKE_BINARY_DIR}" "/CVS/"
188 "/.svn" "~$" "DS_Store$" "/tmp/" "/bin/" "/lib/")
184189 if(WIN32)
185190 set(CPACK_GENERATOR ZIP)
186191 else(WIN32)
00
11 GL2PS LICENSE
22 Version 2, November 2003
3
4 Copyright (C) 2003, Christophe Geuzaine
53
64 Permission to use, copy, and distribute this software and its
75 documentation for any purpose with or without fee is hereby granted,
+0
-16
TODO.txt less more
0 * Add an option to limit the recursion level depth in BSP tree
1
2 * Add an simple option to subdivide long, stretched triangles so that
3 SIMPLE_SORT can still be used for simple, non-intersecting geometries
4 (cf. Olivier Couet's long cylinders at Cern) where BSP_SORT is very
5 slow due to the presence of many, many curved surfaces
6
7 * do we really need gl2psEnable(GL2PS_BLEND)? Couldn't we just check
8 what's in rgba[3] and try to do the "right thing" right away?
9 Update Thu Jul 20 14:51:33 2006: that's what I do now for SVG and it
10 works pretty well. We could probably significantly simplify the PDF
11 code that way.
12
13 * Think about a way to provide a progress indicator through a
14 callback. Not easy for BSP trees due to the recursive
15 implementation.
22 * [13bd395] Set version to 0.0.0. (Closes: #824882)
33
44 -- Anton Gladky <gladk@debian.org> Sat, 21 May 2016 07:57:24 +0200
5
6 gl2ps (1.3.9-1~exp2) experimental; urgency=medium
7
8 * [e6f31b9] Add Breaks/Replaces for libglps0.
9
10 -- Anton Gladky <gladk@debian.org> Fri, 20 May 2016 20:21:20 +0200
11
12 gl2ps (1.3.9-1~exp1) experimental; urgency=medium
13
14 * [53b511d] Imported Upstream version 1.3.9. (Closes: #822057)
15 * [ad4890f] Refresh patches.
16 * [1db23dd] Update package name. (Closes: #824357)
17
18 -- Anton Gladky <gladk@debian.org> Thu, 19 May 2016 23:11:26 +0200
519
620 gl2ps (1.3.8-2) unstable; urgency=medium
721
1414 Package: libgl2ps-dev
1515 Architecture: any
1616 Section: libdevel
17 Depends: libgl2ps0 (= ${binary:Version}),
17 Depends: libgl2ps1 (= ${binary:Version}),
1818 ${misc:Depends}
1919 Description: Lib providing high quality vector output for OpenGL application
2020 GL2PS is a C library providing high quality vector output for any OpenGL
3535 This package contains the development files needed to compile software to
3636 use the libgl2ps API.
3737
38 Package: libgl2ps0
38 Package: libgl2ps1
3939 Architecture: any
4040 Depends: ${shlibs:Depends},
4141 ${misc:Depends}
42 Breaks: libgl2ps0 (<<1.3.9-1~exp1)
43 Replaces: libgl2ps0 (<<1.3.9-1~exp1)
4244 Description: Lib providing high quality vector output for OpenGL application
4345 GL2PS is a C library providing high quality vector output for any OpenGL
4446 application. The main difference between GL2PS and other similar libraries
+0
-1
debian/libgl2ps0.install less more
0 usr/lib/*/lib*.so.*
0 usr/lib/*/lib*.so.*
99 Upstream-Commit: https://geuz.org/trac/gl2ps/changeset/601
1010 Bug-Debian: https://bugs.debian.org/820930
1111
12 --- a/gl2ps.c
13 +++ b/gl2ps.c
14 @@ -5447,7 +5447,12 @@
15 prim->verts[0].rgba[0], prim->verts[0].rgba[1],
12 Index: gl2ps-1.3.9-source/gl2ps.c
13 ===================================================================
14 --- gl2ps-1.3.9-source.orig/gl2ps.c
15 +++ gl2ps-1.3.9-source/gl2ps.c
16 @@ -5483,11 +5483,16 @@ static void gl2psPrintPGFPrimitive(void
1617 prim->verts[0].rgba[2], prim->data.text->str);
1718
18 - fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n");
19 + fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}");
20 +
19 fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}");
2120 + if(prim->data.text->angle)
2221 + fprintf(gl2ps->stream, "}");
2322 +
2423 + fprintf(gl2ps->stream, "\n");
24
25 if(prim->data.text->angle)
26 fprintf(gl2ps->stream, "}");
27
28 fprintf(gl2ps->stream, "\n");
29 +
2530 break;
2631 case GL2PS_SPECIAL :
2732 /* alignment contains the format for which the special output text
11 Author: Anton Gladky <gladk@debian.org>
22 Last-Update: 2016-05-19
33
4 Index: gl2ps/CMakeLists.txt
4 Index: gl2ps-1.3.9-source/CMakeLists.txt
55 ===================================================================
6 --- gl2ps.orig/CMakeLists.txt
7 +++ gl2ps/CMakeLists.txt
6 --- gl2ps-1.3.9-source.orig/CMakeLists.txt
7 +++ gl2ps-1.3.9-source/CMakeLists.txt
88 @@ -55,6 +55,8 @@ set(GL2PS_EXTRA_VERSION "" CACHE STRING
99 set(GL2PS_VERSION "${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}")
1010 set(GL2PS_VERSION "${GL2PS_VERSION}.${GL2PS_PATCH_VERSION}${GL2PS_EXTRA_VERSION}")
1414 execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
1515 OUTPUT_STRIP_TRAILING_WHITESPACE)
1616 if(NOT DATE)
17 @@ -113,7 +115,7 @@ if(OPENGL_FOUND)
17 @@ -118,7 +120,7 @@ if(OPENGL_FOUND)
1818 set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)
1919
2020 add_library(shared SHARED gl2ps.c gl2ps.h)
2222 + target_link_libraries(shared ${EXTERNAL_LLICIBRARIES})
2323 set_target_properties(shared PROPERTIES OUTPUT_NAME gl2ps)
2424 set_target_properties(shared PROPERTIES
25 VERSION ${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}.${GL2PS_PATCH_VERSION}
26 @@ -122,7 +124,7 @@ if(OPENGL_FOUND)
25 VERSION ${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}.${GL2PS_PATCH_VERSION}
26 @@ -127,7 +129,7 @@ if(OPENGL_FOUND)
2727 set_target_properties(shared PROPERTIES COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS")
2828 endif(MSVC)
2929
3232 endif(OPENGL_FOUND)
3333
3434 if(WIN32)
35 @@ -133,16 +135,14 @@ endif(WIN32)
35 @@ -138,16 +140,14 @@ endif(WIN32)
3636
3737 install(FILES gl2ps.h DESTINATION include)
3838 install(FILES ${CMAKE_SOURCE_DIR}/README.txt DESTINATION ${GL2PS_DOC})
00 /*
11 * GL2PS, an OpenGL to PostScript Printing Library
2 * Copyright (C) 1999-2012 C. Geuzaine
2 * Copyright (C) 1999-2015 C. Geuzaine
33 *
44 * This program is free software; you can redistribute it and/or
55 * modify it under the terms of either:
182182 GLushort pattern;
183183 char boundary, offset, culled;
184184 GLint factor;
185 GLfloat width;
185 GLfloat width, ofactor, ounits;
186186 GL2PSvertex *verts;
187187 union {
188188 GL2PSstring *text;
210210 GLint format, sort, options, colorsize, colormode, buffersize;
211211 char *title, *producer, *filename;
212212 GLboolean boundary, blending;
213 GLfloat *feedback, offset[2], lastlinewidth;
213 GLfloat *feedback, lastlinewidth;
214214 GLint viewport[4], blendfunc[2], lastfactor;
215215 GL2PSrgba *colormap, lastrgba, threshold, bgcolor;
216216 GLushort lastpattern;
427427 #if !defined(GL2PS_HAVE_NO_VSNPRINTF)
428428 /* Try writing the string to a 1024 byte buffer. If it is too small to fit,
429429 keep trying larger sizes until it does. */
430 size_t bufsize = sizeof(buf);
430 int bufsize = sizeof(buf);
431431 #endif
432432 if(gl2ps->options & GL2PS_COMPRESS){
433433 va_start(args, fmt);
892892 prim->verts[0].xyz[2] = pos[2];
893893 prim->culled = 0;
894894 prim->offset = 0;
895 prim->ofactor = 0.0;
896 prim->ounits = 0.0;
895897 prim->pattern = 0;
896898 prim->factor = 0;
897899 prim->width = 1;
10431045 prim->numverts = p->numverts;
10441046 prim->boundary = p->boundary;
10451047 prim->offset = p->offset;
1048 prim->ofactor = p->ofactor;
1049 prim->ounits = p->ounits;
10461050 prim->pattern = p->pattern;
10471051 prim->factor = p->factor;
10481052 prim->culled = p->culled;
12401244 child->boundary = 0; /* FIXME: not done! */
12411245 child->culled = parent->culled;
12421246 child->offset = parent->offset;
1247 child->ofactor = parent->ofactor;
1248 child->ounits = parent->ounits;
12431249 child->pattern = parent->pattern;
12441250 child->factor = parent->factor;
12451251 child->width = parent->width;
13761382 (*t1)->numverts = (*t2)->numverts = 3;
13771383 (*t1)->culled = (*t2)->culled = quad->culled;
13781384 (*t1)->offset = (*t2)->offset = quad->offset;
1385 (*t1)->ofactor = (*t2)->ofactor = quad->ofactor;
1386 (*t1)->ounits = (*t2)->ounits = quad->ounits;
13791387 (*t1)->pattern = (*t2)->pattern = quad->pattern;
13801388 (*t1)->factor = (*t2)->factor = quad->factor;
13811389 (*t1)->width = (*t2)->width = quad->width;
16941702 }
16951703 }
16961704 else if(prim->offset && (prim->type == GL2PS_TRIANGLE)){
1697 factor = gl2ps->offset[0];
1698 units = gl2ps->offset[1];
1705 factor = prim->ofactor;
1706 units = prim->ounits;
16991707 area =
17001708 (prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) *
17011709 (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) -
19151923 child->boundary = 0; /* FIXME: not done! */
19161924 child->culled = parent->culled;
19171925 child->offset = parent->offset;
1926 child->ofactor = parent->ofactor;
1927 child->ounits = parent->ounits;
19181928 child->pattern = parent->pattern;
19191929 child->factor = parent->factor;
19201930 child->width = parent->width;
21032113 b = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive));
21042114 b->type = GL2PS_LINE;
21052115 b->offset = prim->offset;
2116 b->ofactor = prim->ofactor;
2117 b->ounits = prim->ounits;
21062118 b->pattern = prim->pattern;
21072119 b->factor = prim->factor;
21082120 b->culled = prim->culled;
21742186
21752187 static void gl2psAddPolyPrimitive(GLshort type, GLshort numverts,
21762188 GL2PSvertex *verts, GLint offset,
2189 GLfloat ofactor, GLfloat ounits,
21772190 GLushort pattern, GLint factor,
21782191 GLfloat width, char boundary)
21792192 {
21862199 memcpy(prim->verts, verts, numverts * sizeof(GL2PSvertex));
21872200 prim->boundary = boundary;
21882201 prim->offset = offset;
2202 prim->ofactor = ofactor;
2203 prim->ounits = ounits;
21892204 prim->pattern = pattern;
21902205 prim->factor = factor;
21912206 prim->width = width;
22282243 GLushort pattern = 0;
22292244 GLboolean boundary;
22302245 GLint i, sizeoffloat, count, v, vtot, offset = 0, factor = 0, auxindex = 0;
2231 GLfloat lwidth = 1.0F, psize = 1.0F;
2246 GLfloat lwidth = 1.0F, psize = 1.0F, ofactor, ounits;
22322247 GLfloat *current;
22332248 GL2PSvertex vertices[3];
22342249 GL2PSprimitive *prim;
22482263 i = gl2psGetVertex(&vertices[0], current);
22492264 current += i;
22502265 used -= i;
2251 gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0,
2266 gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, 0.0, 0.0,
22522267 pattern, factor, psize, 0);
22532268 break;
22542269 case GL_LINE_TOKEN :
22612276 i = gl2psGetVertex(&vertices[1], current);
22622277 current += i;
22632278 used -= i;
2264 gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0,
2279 gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, 0.0, 0.0,
22652280 pattern, factor, lwidth, 0);
22662281 break;
22672282 case GL_POLYGON_TOKEN :
22852300 }
22862301 else
22872302 flag = 0;
2288 gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset,
2289 pattern, factor, 1, flag);
2303 gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset, ofactor,
2304 ounits, pattern, factor, 1, flag);
22902305 vertices[1] = vertices[2];
22912306 }
22922307 else
23042319 break;
23052320 case GL_PASS_THROUGH_TOKEN :
23062321 switch((GLint)current[1]){
2307 case GL2PS_BEGIN_OFFSET_TOKEN : offset = 1; break;
2308 case GL2PS_END_OFFSET_TOKEN : offset = 0; break;
2322 case GL2PS_BEGIN_OFFSET_TOKEN :
2323 offset = 1;
2324 current += 2;
2325 used -= 2;
2326 ofactor = current[1];
2327 current += 2;
2328 used -= 2;
2329 ounits = current[1];
2330 break;
2331 case GL2PS_END_OFFSET_TOKEN :
2332 offset = 0;
2333 ofactor = 0.0;
2334 ounits = 0.0;
2335 break;
23092336 case GL2PS_BEGIN_BOUNDARY_TOKEN : boundary = GL_TRUE; break;
23102337 case GL2PS_END_BOUNDARY_TOKEN : boundary = GL_FALSE; break;
23112338 case GL2PS_END_STIPPLE_TOKEN : pattern = factor = 0; break;
23472374 prim->verts = (GL2PSvertex *)gl2psMalloc(4 * sizeof(GL2PSvertex));
23482375 prim->culled = 0;
23492376 prim->offset = 0;
2377 prim->ofactor = 0.0;
2378 prim->ounits = 0.0;
23502379 prim->pattern = 0;
23512380 prim->factor = 0;
23522381 prim->width = 1;
50635092 sizeof(unsigned char));
50645093 gl2psConvertPixmapToPNG(pixmap, png);
50655094 gl2psListEncodeBase64(png);
5095
5096 /* Use "transform" attribute to scale and translate the image from
5097 the coordinates origin (0,0) */
5098 y -= pixmap->zoom_y * (GLfloat)pixmap->height;
50665099 gl2psPrintf("<image x=\"%g\" y=\"%g\" width=\"%d\" height=\"%d\"\n",
5067 x, y - pixmap->height, pixmap->width, pixmap->height);
5100 0., 0., pixmap->width, pixmap->height);
5101 gl2psPrintf("transform=\"matrix(%g,0,0,%g,%g,%g)\"\n",
5102 pixmap->zoom_x, pixmap->zoom_y, x, y);
50685103 gl2psPrintf("xlink:href=\"data:image/png;base64,");
50695104 for(i = 0; i < gl2psListNbr(png); i++){
50705105 gl2psListRead(png, i, &c);
54465481 prim->verts[0].rgba[0], prim->verts[0].rgba[1],
54475482 prim->verts[0].rgba[2], prim->data.text->str);
54485483
5449 fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n");
5484 fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}");
5485
5486 if(prim->data.text->angle)
5487 fprintf(gl2ps->stream, "}");
5488
5489 fprintf(gl2ps->stream, "\n");
54505490 break;
54515491 case GL2PS_SPECIAL :
54525492 /* alignment contains the format for which the special output text
59285968 prim->verts[0].xyz[2] = pos[2];
59295969 prim->culled = 0;
59305970 prim->offset = 0;
5971 prim->ofactor = 0.0;
5972 prim->ounits = 0.0;
59315973 prim->pattern = 0;
59325974 prim->factor = 0;
59335975 prim->width = 1;
60026044 GL2PSDLL_API GLint gl2psEnable(GLint mode)
60036045 {
60046046 GLint tmp;
6047 GLfloat tmp2;
60056048
60066049 if(!gl2ps) return GL2PS_UNINITIALIZED;
60076050
60086051 switch(mode){
60096052 case GL2PS_POLYGON_OFFSET_FILL :
60106053 glPassThrough(GL2PS_BEGIN_OFFSET_TOKEN);
6011 glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &gl2ps->offset[0]);
6012 glGetFloatv(GL_POLYGON_OFFSET_UNITS, &gl2ps->offset[1]);
6054 glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &tmp2);
6055 glPassThrough(tmp2);
6056 glGetFloatv(GL_POLYGON_OFFSET_UNITS, &tmp2);
6057 glPassThrough(tmp2);
60136058 break;
60146059 case GL2PS_POLYGON_BOUNDARY :
60156060 glPassThrough(GL2PS_BEGIN_BOUNDARY_TOKEN);
00 /*
11 * GL2PS, an OpenGL to PostScript Printing Library
2 * Copyright (C) 1999-2012 C. Geuzaine
2 * Copyright (C) 1999-2015 C. Geuzaine
33 *
44 * This program is free software; you can redistribute it and/or
55 * modify it under the terms of either:
8383
8484 #define GL2PS_MAJOR_VERSION 1
8585 #define GL2PS_MINOR_VERSION 3
86 #define GL2PS_PATCH_VERSION 8
86 #define GL2PS_PATCH_VERSION 9
8787 #define GL2PS_EXTRA_VERSION ""
8888
8989 #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
9090 0.01 * GL2PS_MINOR_VERSION + \
9191 0.0001 * GL2PS_PATCH_VERSION)
9292
93 #define GL2PS_COPYRIGHT "(C) 1999-2012 C. Geuzaine"
93 #define GL2PS_COPYRIGHT "(C) 1999-2015 C. Geuzaine"
9494
9595 /* Output file formats (the values and the ordering are important!) */
9696
00 %
11 % GL2PS, an OpenGL to PostScript Printing Library
2 % Copyright (C) 1999-2012 C. Geuzaine
2 % Copyright (C) 1999-2015 C. Geuzaine
33 %
44 % This program is free software; you can redistribute it and/or
55 % modify it under the terms of either:
3131 %
3232 % Please report all bugs and problems to <gl2ps@geuz.org>.
3333
34 %%tth: \begin{html}<link href="http://geuz.org/geuz.css" rel="stylesheet" type="text/css"> <style type="text/css"> h3 { border-bottom: 0; }</style><title>GL2PS: an OpenGL to PostScript printing library</title>\end{html}
34 %%tth: \begin{html}<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="http://geuz.org/geuz.css" rel="stylesheet" type="text/css"> <style type="text/css"> h3 { border-bottom: 0; }</style><title>GL2PS: an OpenGL to PostScript printing library</title>\end{html}
3535
3636 \documentclass[10pt]{article}
3737
6161
6262 \title{GL2PS: an OpenGL to PostScript printing library}
6363 \author{Christophe Geuzaine}
64 \date{Version 1.3.8, November 27 2012}
6564
6665 \maketitle
6766
6867 \special{html:<center>
69 <table width="50%" style="border:0;padding:4px;">
70 <tr style="border:0;padding:4px;">
71 <td style="border:0;padding:4px;"><a
72 href="http://geuz.org/gl2ps/outBspCulled.ps"><img
73 src="http://geuz.org/gl2ps/outThumbnail.png" alt="PS"></a></td>
74 <td style="border:0;padding:4px;"><a
75 href="http://geuz.org/gl2ps/outBspCulled.eps"><img
76 src="http://geuz.org/gl2ps/outThumbnail.png" alt="EPS"></a></td>
77 <td style="border:0;padding:4px;"><a
78 href="http://geuz.org/gl2ps/outBspCulledCompressed.pdf"><img
79 src="http://geuz.org/gl2ps/outThumbnail.png" alt="PDF"></a></td>
80 <td style="border:0;padding:4px;"><a
81 href="http://geuz.org/gl2ps/outBspCulled.svg"><img
82 src="http://geuz.org/gl2ps/outThumbnail.png" alt="SVG"></a></td>
83 </tr>
84 <tr style="border:0;padding:4px;">
85 <td colspan="4" style="border:0;padding:4px;"><small><em>Example: compressed
86 <a href="http://geuz.org/gl2ps/outBspCulled.ps">PS</a>,
87 <a href="http://geuz.org/gl2ps/outBspCulled.eps">EPS</a>,
88 <a href="http://geuz.org/gl2ps/outBspCulledCompressed.pdf">PDF</a> and
89 <a href="http://geuz.org/gl2ps/outBspCulled.svg">SVG</a>
90 files created with the <tt>gl2psTest.c</tt> demo provided in the
91 distribution. This illustrates the handling of smooth shading,
92 intersecting primitives, line stippling, vector text rendering,
93 multiple viewports and mixed vector/bitmap output. Compare with a
94 <a href="http://geuz.org/gl2ps/outBitmap.png">PNG</a> screenshot of
95 the OpenGL window.</em></small></td>
96 </tr>
97 </table>
68 <p>
69 <a href="http://geuz.org/gl2ps/outBspCulled.ps"><img width="12%"
70 src="http://geuz.org/gl2ps/outThumbnail.png" alt="PS"></a>&nbsp;
71 <a href="http://geuz.org/gl2ps/outBspCulled.eps"><img width="12%"
72 src="http://geuz.org/gl2ps/outThumbnail.png" alt="EPS"></a>&nbsp;
73 <a href="http://geuz.org/gl2ps/outBspCulledCompressed.pdf"><img width="12%"
74 src="http://geuz.org/gl2ps/outThumbnail.png" alt="PDF"></a>&nbsp;
75 <a href="http://geuz.org/gl2ps/outBspCulled.svg"><img width="12%"
76 src="http://geuz.org/gl2ps/outThumbnail.png" alt="SVG"></a>
77 </p>
78 <p><small><em>Example:
79 <a href="http://geuz.org/gl2ps/outBspCulled.ps">PS</a>,
80 <a href="http://geuz.org/gl2ps/outBspCulled.eps">EPS</a>,
81 <a href="http://geuz.org/gl2ps/outBspCulledCompressed.pdf">PDF</a> and
82 <a href="http://geuz.org/gl2ps/outBspCulled.svg">SVG</a>
83 files created with the <tt>gl2psTest.c</tt> demo provided in the
84 distribution. This illustrates the handling of smooth shading,
85 intersecting primitives, line stippling, vector text rendering,
86 multiple viewports and mixed vector/bitmap output. Compare with a
87 <a href="http://geuz.org/gl2ps/outBitmap.png">PNG</a> screenshot of
88 the OpenGL window.</em></small>
89 </p>
9890 </center>
9991 <h2>Download</h2>
10092 The latest stable version of GL2PS is <a
101 href="http://geuz.org/gl2ps/src/gl2ps-1.3.8.tgz">gl2ps-1.3.8.tgz</a>. Older
93 href="http://geuz.org/gl2ps/src/gl2ps-1.3.9.tgz">gl2ps-1.3.9.tgz</a>. Older
10294 versions and nightly source snapshots are available <a
10395 href="http://geuz.org/gl2ps/src/">here</a>. For read-only svn access use:
10496 '<code>svn co https://geuz.org/svn/gl2ps/trunk gl2ps</code>' (username:
112104 href="http://geuz.org/mailman/listinfo/gl2ps-announce/">gl2ps-announce</a>
113105 mailing list to be notified automatically when a new version of GL2PS is
114106 released.
115 <p>
116 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
117 <input type="hidden" name="cmd" value="_xclick">
118 <input type="hidden" name="business" value="paypal@geuz.org">
119 <input type="hidden" name="item_name" value="GL2PS donation">
120 <input type="hidden" name="no_note" value="1">
121 <input type="hidden" name="currency_code" value="USD">
122 <input type="hidden" name="tax" value="0">
123 <input type="image" src="/images/donation.gif" name="submit"
124 alt="Make a donation with PayPal">
125 </form>
107 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
108 <p>
109 <input type="hidden" name="cmd" value="_xclick">
110 <input type="hidden" name="business" value="paypal@geuz.org">
111 <input type="hidden" name="item_name" value="GL2PS donation">
112 <input type="hidden" name="no_note" value="1">
113 <input type="hidden" name="currency_code" value="EUR">
114 <input type="hidden" name="tax" value="0">
115 To help fund GL2PS development, you can make a
116 <input type="submit" value="PayPal" style="display:inline;">
117 donation.
118 </p>
119 </form>
126120 <h2>Documentation</h2>}
127121
128122 \tableofcontents
901895 %
902896 \noemail{Ben Abbott}{bpabbott@mac.com} for text alignment in SVG;
903897 %
904 \noemail{David Lonie}{david.lonie@kitware.com} for VTK patches.
898 \noemail{David Lonie}{david.lonie@kitware.com} for VTK patches;
899 %
900 \noemail{Pantxo Diribarne}{pantxo.diribarne@gmail.com} for polygon offset
901 improvement and image scaling fix for SVG output.
905902
906903 \section{Links}
907904 \label{sec:links}
10491046 \item[1.3.7] (Sep 2, 2012) Minor documentation and build system fixes.
10501047 \item[1.3.8] (Nov 27, 2012) Handling of arbitrary length messages in
10511048 gl2psPrintf; added \dd{gl2psTextOptColor}; minor fixes.
1052 \end{description}
1053
1054 \special{html:<p>Back to <a href="/">geuz.org</a>}
1049 \item[1.3.9] (Oct 17, 2015) Improved \dd{GL_POLYGON_OFFSET_FILL}; fixed scaling
1050 of images in SVG output.
1051 \end{description}
10551052
10561053 \end{document}
00 /*
11 * GL2PS, an OpenGL to PostScript Printing Library
2 * Copyright (C) 1999-2012 Christophe Geuzaine <geuz@geuz.org>
2 * Copyright (C) 1999-2015 Christophe Geuzaine <geuz@geuz.org>
33 *
44 * This program is free software; you can redistribute it and/or
55 * modify it under the terms of either:
281281 printstring(" b: to change the blending mode (transparency)", 0.);
282282 y -= dy;
283283 glRasterPos2d(x, y);
284 printstring(" q: to quit", 0.), 0.;
284 printstring(" q: to quit", 0.);
285285 y -= dy;
286286 glRasterPos2d(x, y);
287287 printstring("Click and move the mouse to rotate the objects", 0.);
00 /*
11 * GL2PS, an OpenGL to PostScript Printing Library
2 * Copyright (C) 1999-2012 Christophe Geuzaine <geuz@geuz.org>
2 * Copyright (C) 1999-2015 Christophe Geuzaine <geuz@geuz.org>
33 *
44 * This program is free software; you can redistribute it and/or
55 * modify it under the terms of either:
6666 glDisable(GL_LIGHTING);
6767 glPopMatrix();
6868
69
70 /* draw three triangles on the same zplane and use polygon offset
71 to order the layers: the grey triangle should be drawn on the
72 middle layer */
73 glEnable(GL_POLYGON_OFFSET_FILL);
74 glPolygonOffset(1.0, 1.0);
75 gl2psEnable(GL2PS_POLYGON_OFFSET_FILL);
76 glColor3f(0.,0.,0.);
77 glBegin(GL_TRIANGLES);
78 glVertex3f(0.6, 0.8, 0);
79 glVertex3f(0.8, 0.8, 0);
80 glVertex3f(0.7, 0.92, 0);
81 glEnd();
82
83 glPolygonOffset(2.0, 2.0);
84 gl2psEnable(GL2PS_POLYGON_OFFSET_FILL);
6985 glColor3f(1.,1.,1.);
86 glBegin(GL_TRIANGLES);
87 glVertex3f(0.7, 0.8, 0);
88 glVertex3f(0.9, 0.8, 0);
89 glVertex3f(0.8, 0.92, 0);
90 glEnd();
91
92 glPolygonOffset(1.5, 1.5);
93 gl2psEnable(GL2PS_POLYGON_OFFSET_FILL);
94 glColor3f(0.5,0.5,0.5);
95 glBegin(GL_TRIANGLES);
96 glVertex3f(0.65, 0.86, 0);
97 glVertex3f(0.85, 0.86, 0);
98 glVertex3f(0.75, 0.98, 0);
99 glEnd();
100
101 glDisable(GL_POLYGON_OFFSET_FILL);
102 gl2psDisable(GL2PS_POLYGON_OFFSET_FILL);
103
104 glColor3f(0.1,0.1,0.1);
70105
71106 /* draw a stippled line with many small segments (this tests the
72107 ability of gl2ps to render lines using as few strokes as