Merge experimental.
Anton Gladky
7 years ago
0 | 0 | # GL2PS, an OpenGL to PostScript Printing Library |
1 | # Copyright (C) 1999-2012 C. Geuzaine | |
1 | # Copyright (C) 1999-2015 C. Geuzaine | |
2 | 2 | # |
3 | 3 | # This program is free software; you can redistribute it and/or |
4 | 4 | # modify it under the terms of either: |
48 | 48 | |
49 | 49 | set(GL2PS_MAJOR_VERSION 1) |
50 | 50 | set(GL2PS_MINOR_VERSION 3) |
51 | set(GL2PS_PATCH_VERSION 8) | |
51 | set(GL2PS_PATCH_VERSION 9) | |
52 | 52 | set(GL2PS_EXTRA_VERSION "" CACHE STRING "GL2PS extra version string") |
53 | 53 | |
54 | 54 | set(GL2PS_VERSION "${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}") |
105 | 105 | endif(PNG_FOUND) |
106 | 106 | endif(ENABLE_PNG) |
107 | 107 | |
108 | find_library(MATH_LIBRARY m) | |
109 | if(MATH_LIBRARY) | |
110 | list(APPEND EXTERNAL_LIBRARIES ${MATH_LIBRARY}) | |
111 | endif(MATH_LIBRARY) | |
112 | ||
108 | 113 | include_directories(${EXTERNAL_INCLUDES}) |
109 | 114 | |
110 | 115 | if(OPENGL_FOUND) |
115 | 120 | target_link_libraries(shared ${EXTERNAL_LIBRARIES}) |
116 | 121 | set_target_properties(shared PROPERTIES OUTPUT_NAME gl2ps) |
117 | 122 | 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}) | |
120 | 125 | if(MSVC) |
121 | 126 | set_target_properties(shared PROPERTIES COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS") |
122 | 127 | endif(MSVC) |
179 | 184 | set(CPACK_STRIP_FILES TRUE) |
180 | 185 | set(CPACK_SOURCE_PACKAGE_FILE_NAME gl2ps-${GL2PS_VERSION}-source) |
181 | 186 | 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/") | |
184 | 189 | if(WIN32) |
185 | 190 | set(CPACK_GENERATOR ZIP) |
186 | 191 | else(WIN32) |
0 | 0 | |
1 | 1 | GL2PS LICENSE |
2 | 2 | Version 2, November 2003 |
3 | ||
4 | Copyright (C) 2003, Christophe Geuzaine | |
5 | 3 | |
6 | 4 | Permission to use, copy, and distribute this software and its |
7 | 5 | documentation for any purpose with or without fee is hereby granted, |
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. |
2 | 2 | * [13bd395] Set version to 0.0.0. (Closes: #824882) |
3 | 3 | |
4 | 4 | -- 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 | |
5 | 19 | |
6 | 20 | gl2ps (1.3.8-2) unstable; urgency=medium |
7 | 21 |
14 | 14 | Package: libgl2ps-dev |
15 | 15 | Architecture: any |
16 | 16 | Section: libdevel |
17 | Depends: libgl2ps0 (= ${binary:Version}), | |
17 | Depends: libgl2ps1 (= ${binary:Version}), | |
18 | 18 | ${misc:Depends} |
19 | 19 | Description: Lib providing high quality vector output for OpenGL application |
20 | 20 | GL2PS is a C library providing high quality vector output for any OpenGL |
35 | 35 | This package contains the development files needed to compile software to |
36 | 36 | use the libgl2ps API. |
37 | 37 | |
38 | Package: libgl2ps0 | |
38 | Package: libgl2ps1 | |
39 | 39 | Architecture: any |
40 | 40 | Depends: ${shlibs:Depends}, |
41 | 41 | ${misc:Depends} |
42 | Breaks: libgl2ps0 (<<1.3.9-1~exp1) | |
43 | Replaces: libgl2ps0 (<<1.3.9-1~exp1) | |
42 | 44 | Description: Lib providing high quality vector output for OpenGL application |
43 | 45 | GL2PS is a C library providing high quality vector output for any OpenGL |
44 | 46 | application. The main difference between GL2PS and other similar libraries |
0 | usr/lib/*/lib*.so.* |
9 | 9 | Upstream-Commit: https://geuz.org/trac/gl2ps/changeset/601 |
10 | 10 | Bug-Debian: https://bugs.debian.org/820930 |
11 | 11 | |
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 | |
16 | 17 | prim->verts[0].rgba[2], prim->data.text->str); |
17 | 18 | |
18 | - fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n"); | |
19 | + fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}"); | |
20 | + | |
19 | fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}"); | |
21 | 20 | + if(prim->data.text->angle) |
22 | 21 | + fprintf(gl2ps->stream, "}"); |
23 | 22 | + |
24 | 23 | + fprintf(gl2ps->stream, "\n"); |
24 | ||
25 | if(prim->data.text->angle) | |
26 | fprintf(gl2ps->stream, "}"); | |
27 | ||
28 | fprintf(gl2ps->stream, "\n"); | |
29 | + | |
25 | 30 | break; |
26 | 31 | case GL2PS_SPECIAL : |
27 | 32 | /* alignment contains the format for which the special output text |
1 | 1 | Author: Anton Gladky <gladk@debian.org> |
2 | 2 | Last-Update: 2016-05-19 |
3 | 3 | |
4 | Index: gl2ps/CMakeLists.txt | |
4 | Index: gl2ps-1.3.9-source/CMakeLists.txt | |
5 | 5 | =================================================================== |
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 | |
8 | 8 | @@ -55,6 +55,8 @@ set(GL2PS_EXTRA_VERSION "" CACHE STRING |
9 | 9 | set(GL2PS_VERSION "${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}") |
10 | 10 | set(GL2PS_VERSION "${GL2PS_VERSION}.${GL2PS_PATCH_VERSION}${GL2PS_EXTRA_VERSION}") |
14 | 14 | execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE |
15 | 15 | OUTPUT_STRIP_TRAILING_WHITESPACE) |
16 | 16 | if(NOT DATE) |
17 | @@ -113,7 +115,7 @@ if(OPENGL_FOUND) | |
17 | @@ -118,7 +120,7 @@ if(OPENGL_FOUND) | |
18 | 18 | set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps) |
19 | 19 | |
20 | 20 | add_library(shared SHARED gl2ps.c gl2ps.h) |
22 | 22 | + target_link_libraries(shared ${EXTERNAL_LLICIBRARIES}) |
23 | 23 | set_target_properties(shared PROPERTIES OUTPUT_NAME gl2ps) |
24 | 24 | 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) | |
27 | 27 | set_target_properties(shared PROPERTIES COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS") |
28 | 28 | endif(MSVC) |
29 | 29 | |
32 | 32 | endif(OPENGL_FOUND) |
33 | 33 | |
34 | 34 | if(WIN32) |
35 | @@ -133,16 +135,14 @@ endif(WIN32) | |
35 | @@ -138,16 +140,14 @@ endif(WIN32) | |
36 | 36 | |
37 | 37 | install(FILES gl2ps.h DESTINATION include) |
38 | 38 | install(FILES ${CMAKE_SOURCE_DIR}/README.txt DESTINATION ${GL2PS_DOC}) |
0 | 0 | /* |
1 | 1 | * GL2PS, an OpenGL to PostScript Printing Library |
2 | * Copyright (C) 1999-2012 C. Geuzaine | |
2 | * Copyright (C) 1999-2015 C. Geuzaine | |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or |
5 | 5 | * modify it under the terms of either: |
182 | 182 | GLushort pattern; |
183 | 183 | char boundary, offset, culled; |
184 | 184 | GLint factor; |
185 | GLfloat width; | |
185 | GLfloat width, ofactor, ounits; | |
186 | 186 | GL2PSvertex *verts; |
187 | 187 | union { |
188 | 188 | GL2PSstring *text; |
210 | 210 | GLint format, sort, options, colorsize, colormode, buffersize; |
211 | 211 | char *title, *producer, *filename; |
212 | 212 | GLboolean boundary, blending; |
213 | GLfloat *feedback, offset[2], lastlinewidth; | |
213 | GLfloat *feedback, lastlinewidth; | |
214 | 214 | GLint viewport[4], blendfunc[2], lastfactor; |
215 | 215 | GL2PSrgba *colormap, lastrgba, threshold, bgcolor; |
216 | 216 | GLushort lastpattern; |
427 | 427 | #if !defined(GL2PS_HAVE_NO_VSNPRINTF) |
428 | 428 | /* Try writing the string to a 1024 byte buffer. If it is too small to fit, |
429 | 429 | keep trying larger sizes until it does. */ |
430 | size_t bufsize = sizeof(buf); | |
430 | int bufsize = sizeof(buf); | |
431 | 431 | #endif |
432 | 432 | if(gl2ps->options & GL2PS_COMPRESS){ |
433 | 433 | va_start(args, fmt); |
892 | 892 | prim->verts[0].xyz[2] = pos[2]; |
893 | 893 | prim->culled = 0; |
894 | 894 | prim->offset = 0; |
895 | prim->ofactor = 0.0; | |
896 | prim->ounits = 0.0; | |
895 | 897 | prim->pattern = 0; |
896 | 898 | prim->factor = 0; |
897 | 899 | prim->width = 1; |
1043 | 1045 | prim->numverts = p->numverts; |
1044 | 1046 | prim->boundary = p->boundary; |
1045 | 1047 | prim->offset = p->offset; |
1048 | prim->ofactor = p->ofactor; | |
1049 | prim->ounits = p->ounits; | |
1046 | 1050 | prim->pattern = p->pattern; |
1047 | 1051 | prim->factor = p->factor; |
1048 | 1052 | prim->culled = p->culled; |
1240 | 1244 | child->boundary = 0; /* FIXME: not done! */ |
1241 | 1245 | child->culled = parent->culled; |
1242 | 1246 | child->offset = parent->offset; |
1247 | child->ofactor = parent->ofactor; | |
1248 | child->ounits = parent->ounits; | |
1243 | 1249 | child->pattern = parent->pattern; |
1244 | 1250 | child->factor = parent->factor; |
1245 | 1251 | child->width = parent->width; |
1376 | 1382 | (*t1)->numverts = (*t2)->numverts = 3; |
1377 | 1383 | (*t1)->culled = (*t2)->culled = quad->culled; |
1378 | 1384 | (*t1)->offset = (*t2)->offset = quad->offset; |
1385 | (*t1)->ofactor = (*t2)->ofactor = quad->ofactor; | |
1386 | (*t1)->ounits = (*t2)->ounits = quad->ounits; | |
1379 | 1387 | (*t1)->pattern = (*t2)->pattern = quad->pattern; |
1380 | 1388 | (*t1)->factor = (*t2)->factor = quad->factor; |
1381 | 1389 | (*t1)->width = (*t2)->width = quad->width; |
1694 | 1702 | } |
1695 | 1703 | } |
1696 | 1704 | 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; | |
1699 | 1707 | area = |
1700 | 1708 | (prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * |
1701 | 1709 | (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) - |
1915 | 1923 | child->boundary = 0; /* FIXME: not done! */ |
1916 | 1924 | child->culled = parent->culled; |
1917 | 1925 | child->offset = parent->offset; |
1926 | child->ofactor = parent->ofactor; | |
1927 | child->ounits = parent->ounits; | |
1918 | 1928 | child->pattern = parent->pattern; |
1919 | 1929 | child->factor = parent->factor; |
1920 | 1930 | child->width = parent->width; |
2103 | 2113 | b = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); |
2104 | 2114 | b->type = GL2PS_LINE; |
2105 | 2115 | b->offset = prim->offset; |
2116 | b->ofactor = prim->ofactor; | |
2117 | b->ounits = prim->ounits; | |
2106 | 2118 | b->pattern = prim->pattern; |
2107 | 2119 | b->factor = prim->factor; |
2108 | 2120 | b->culled = prim->culled; |
2174 | 2186 | |
2175 | 2187 | static void gl2psAddPolyPrimitive(GLshort type, GLshort numverts, |
2176 | 2188 | GL2PSvertex *verts, GLint offset, |
2189 | GLfloat ofactor, GLfloat ounits, | |
2177 | 2190 | GLushort pattern, GLint factor, |
2178 | 2191 | GLfloat width, char boundary) |
2179 | 2192 | { |
2186 | 2199 | memcpy(prim->verts, verts, numverts * sizeof(GL2PSvertex)); |
2187 | 2200 | prim->boundary = boundary; |
2188 | 2201 | prim->offset = offset; |
2202 | prim->ofactor = ofactor; | |
2203 | prim->ounits = ounits; | |
2189 | 2204 | prim->pattern = pattern; |
2190 | 2205 | prim->factor = factor; |
2191 | 2206 | prim->width = width; |
2228 | 2243 | GLushort pattern = 0; |
2229 | 2244 | GLboolean boundary; |
2230 | 2245 | 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; | |
2232 | 2247 | GLfloat *current; |
2233 | 2248 | GL2PSvertex vertices[3]; |
2234 | 2249 | GL2PSprimitive *prim; |
2248 | 2263 | i = gl2psGetVertex(&vertices[0], current); |
2249 | 2264 | current += i; |
2250 | 2265 | used -= i; |
2251 | gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, | |
2266 | gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, 0.0, 0.0, | |
2252 | 2267 | pattern, factor, psize, 0); |
2253 | 2268 | break; |
2254 | 2269 | case GL_LINE_TOKEN : |
2261 | 2276 | i = gl2psGetVertex(&vertices[1], current); |
2262 | 2277 | current += i; |
2263 | 2278 | used -= i; |
2264 | gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, | |
2279 | gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, 0.0, 0.0, | |
2265 | 2280 | pattern, factor, lwidth, 0); |
2266 | 2281 | break; |
2267 | 2282 | case GL_POLYGON_TOKEN : |
2285 | 2300 | } |
2286 | 2301 | else |
2287 | 2302 | 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); | |
2290 | 2305 | vertices[1] = vertices[2]; |
2291 | 2306 | } |
2292 | 2307 | else |
2304 | 2319 | break; |
2305 | 2320 | case GL_PASS_THROUGH_TOKEN : |
2306 | 2321 | 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; | |
2309 | 2336 | case GL2PS_BEGIN_BOUNDARY_TOKEN : boundary = GL_TRUE; break; |
2310 | 2337 | case GL2PS_END_BOUNDARY_TOKEN : boundary = GL_FALSE; break; |
2311 | 2338 | case GL2PS_END_STIPPLE_TOKEN : pattern = factor = 0; break; |
2347 | 2374 | prim->verts = (GL2PSvertex *)gl2psMalloc(4 * sizeof(GL2PSvertex)); |
2348 | 2375 | prim->culled = 0; |
2349 | 2376 | prim->offset = 0; |
2377 | prim->ofactor = 0.0; | |
2378 | prim->ounits = 0.0; | |
2350 | 2379 | prim->pattern = 0; |
2351 | 2380 | prim->factor = 0; |
2352 | 2381 | prim->width = 1; |
5063 | 5092 | sizeof(unsigned char)); |
5064 | 5093 | gl2psConvertPixmapToPNG(pixmap, png); |
5065 | 5094 | 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; | |
5066 | 5099 | 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); | |
5068 | 5103 | gl2psPrintf("xlink:href=\"data:image/png;base64,"); |
5069 | 5104 | for(i = 0; i < gl2psListNbr(png); i++){ |
5070 | 5105 | gl2psListRead(png, i, &c); |
5446 | 5481 | prim->verts[0].rgba[0], prim->verts[0].rgba[1], |
5447 | 5482 | prim->verts[0].rgba[2], prim->data.text->str); |
5448 | 5483 | |
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"); | |
5450 | 5490 | break; |
5451 | 5491 | case GL2PS_SPECIAL : |
5452 | 5492 | /* alignment contains the format for which the special output text |
5928 | 5968 | prim->verts[0].xyz[2] = pos[2]; |
5929 | 5969 | prim->culled = 0; |
5930 | 5970 | prim->offset = 0; |
5971 | prim->ofactor = 0.0; | |
5972 | prim->ounits = 0.0; | |
5931 | 5973 | prim->pattern = 0; |
5932 | 5974 | prim->factor = 0; |
5933 | 5975 | prim->width = 1; |
6002 | 6044 | GL2PSDLL_API GLint gl2psEnable(GLint mode) |
6003 | 6045 | { |
6004 | 6046 | GLint tmp; |
6047 | GLfloat tmp2; | |
6005 | 6048 | |
6006 | 6049 | if(!gl2ps) return GL2PS_UNINITIALIZED; |
6007 | 6050 | |
6008 | 6051 | switch(mode){ |
6009 | 6052 | case GL2PS_POLYGON_OFFSET_FILL : |
6010 | 6053 | 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); | |
6013 | 6058 | break; |
6014 | 6059 | case GL2PS_POLYGON_BOUNDARY : |
6015 | 6060 | glPassThrough(GL2PS_BEGIN_BOUNDARY_TOKEN); |
0 | 0 | /* |
1 | 1 | * GL2PS, an OpenGL to PostScript Printing Library |
2 | * Copyright (C) 1999-2012 C. Geuzaine | |
2 | * Copyright (C) 1999-2015 C. Geuzaine | |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or |
5 | 5 | * modify it under the terms of either: |
83 | 83 | |
84 | 84 | #define GL2PS_MAJOR_VERSION 1 |
85 | 85 | #define GL2PS_MINOR_VERSION 3 |
86 | #define GL2PS_PATCH_VERSION 8 | |
86 | #define GL2PS_PATCH_VERSION 9 | |
87 | 87 | #define GL2PS_EXTRA_VERSION "" |
88 | 88 | |
89 | 89 | #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \ |
90 | 90 | 0.01 * GL2PS_MINOR_VERSION + \ |
91 | 91 | 0.0001 * GL2PS_PATCH_VERSION) |
92 | 92 | |
93 | #define GL2PS_COPYRIGHT "(C) 1999-2012 C. Geuzaine" | |
93 | #define GL2PS_COPYRIGHT "(C) 1999-2015 C. Geuzaine" | |
94 | 94 | |
95 | 95 | /* Output file formats (the values and the ordering are important!) */ |
96 | 96 |
0 | 0 | % |
1 | 1 | % GL2PS, an OpenGL to PostScript Printing Library |
2 | % Copyright (C) 1999-2012 C. Geuzaine | |
2 | % Copyright (C) 1999-2015 C. Geuzaine | |
3 | 3 | % |
4 | 4 | % This program is free software; you can redistribute it and/or |
5 | 5 | % modify it under the terms of either: |
31 | 31 | % |
32 | 32 | % Please report all bugs and problems to <gl2ps@geuz.org>. |
33 | 33 | |
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} | |
35 | 35 | |
36 | 36 | \documentclass[10pt]{article} |
37 | 37 | |
61 | 61 | |
62 | 62 | \title{GL2PS: an OpenGL to PostScript printing library} |
63 | 63 | \author{Christophe Geuzaine} |
64 | \date{Version 1.3.8, November 27 2012} | |
65 | 64 | |
66 | 65 | \maketitle |
67 | 66 | |
68 | 67 | \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> | |
71 | <a href="http://geuz.org/gl2ps/outBspCulled.eps"><img width="12%" | |
72 | src="http://geuz.org/gl2ps/outThumbnail.png" alt="EPS"></a> | |
73 | <a href="http://geuz.org/gl2ps/outBspCulledCompressed.pdf"><img width="12%" | |
74 | src="http://geuz.org/gl2ps/outThumbnail.png" alt="PDF"></a> | |
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> | |
98 | 90 | </center> |
99 | 91 | <h2>Download</h2> |
100 | 92 | 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 | |
102 | 94 | versions and nightly source snapshots are available <a |
103 | 95 | href="http://geuz.org/gl2ps/src/">here</a>. For read-only svn access use: |
104 | 96 | '<code>svn co https://geuz.org/svn/gl2ps/trunk gl2ps</code>' (username: |
112 | 104 | href="http://geuz.org/mailman/listinfo/gl2ps-announce/">gl2ps-announce</a> |
113 | 105 | mailing list to be notified automatically when a new version of GL2PS is |
114 | 106 | 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> | |
126 | 120 | <h2>Documentation</h2>} |
127 | 121 | |
128 | 122 | \tableofcontents |
901 | 895 | % |
902 | 896 | \noemail{Ben Abbott}{bpabbott@mac.com} for text alignment in SVG; |
903 | 897 | % |
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. | |
905 | 902 | |
906 | 903 | \section{Links} |
907 | 904 | \label{sec:links} |
1049 | 1046 | \item[1.3.7] (Sep 2, 2012) Minor documentation and build system fixes. |
1050 | 1047 | \item[1.3.8] (Nov 27, 2012) Handling of arbitrary length messages in |
1051 | 1048 | 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} | |
1055 | 1052 | |
1056 | 1053 | \end{document} |
0 | 0 | /* |
1 | 1 | * 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> | |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or |
5 | 5 | * modify it under the terms of either: |
281 | 281 | printstring(" b: to change the blending mode (transparency)", 0.); |
282 | 282 | y -= dy; |
283 | 283 | glRasterPos2d(x, y); |
284 | printstring(" q: to quit", 0.), 0.; | |
284 | printstring(" q: to quit", 0.); | |
285 | 285 | y -= dy; |
286 | 286 | glRasterPos2d(x, y); |
287 | 287 | printstring("Click and move the mouse to rotate the objects", 0.); |
0 | 0 | /* |
1 | 1 | * 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> | |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or |
5 | 5 | * modify it under the terms of either: |
66 | 66 | glDisable(GL_LIGHTING); |
67 | 67 | glPopMatrix(); |
68 | 68 | |
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); | |
69 | 85 | 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); | |
70 | 105 | |
71 | 106 | /* draw a stippled line with many small segments (this tests the |
72 | 107 | ability of gl2ps to render lines using as few strokes as |