Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gl2ps.h
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 /*
27  * GL2PS, an OpenGL to PostScript Printing Library
28  * Copyright (C) 1999-2009 C. Geuzaine
29  *
30  * This program is free software; you can redistribute it and/or
31  * modify it under the terms of either:
32  *
33  * a) the GNU Library General Public License as published by the Free
34  * Software Foundation, either version 2 of the License, or (at your
35  * option) any later version; or
36  *
37  * b) the GL2PS License as published by Christophe Geuzaine, either
38  * version 2 of the License, or (at your option) any later version.
39  *
40  * This program is distributed in the hope that it will be useful, but
41  * WITHOUT ANY WARRANTY; without even the implied warranty of
42  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
43  * the GNU Library General Public License or the GL2PS License for
44  * more details.
45  *
46  * You should have received a copy of the GNU Library General Public
47  * License along with this library in the file named "COPYING.LGPL";
48  * if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
49  * Cambridge, MA 02139, USA.
50  *
51  * You should have received a copy of the GL2PS License with this
52  * library in the file named "COPYING.GL2PS"; if not, I will be glad
53  * to provide one.
54  *
55  * For the latest info about gl2ps and a full list of contributors,
56  * see http://www.geuz.org/gl2ps/.
57  *
58  * Please report all bugs and problems to <gl2ps@geuz.org>.
59  */
60 
61 #ifndef __GL2PS_H__
62 #define __GL2PS_H__
63 
64 #include <stdio.h>
65 #include <stdlib.h>
66 
67 /* Define GL2PSDLL at compile time to build a Windows DLL */
68 
69 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
70 # if defined(_MSC_VER)
71 # pragma warning(disable:4115)
72 # pragma warning(disable:4996)
73 # endif
74 # include <windows.h>
75 # if defined(GL2PSDLL)
76 # if defined(GL2PSDLL_EXPORTS)
77 # define GL2PSDLL_API __declspec(dllexport)
78 # else
79 # define GL2PSDLL_API __declspec(dllimport)
80 # endif
81 # else
82 # define GL2PSDLL_API
83 # endif
84 #else
85 # define GL2PSDLL_API
86 #endif
87 
88 #if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H)
89 # include <OpenGL/gl.h>
90 #else
91 # include <GL/gl.h>
92 #endif
93 
94 /* Support for compressed PostScript/PDF/SVG and for embedded PNG
95  images in SVG */
96 
97 #if defined(HAVE_ZLIB) || defined(HAVE_LIBZ)
98 # define GL2PS_HAVE_ZLIB
99 # if defined(HAVE_LIBPNG) || defined(HAVE_PNG)
100 # define GL2PS_HAVE_LIBPNG
101 # endif
102 #endif
103 
104 /* Version number */
105 
106 #define GL2PS_MAJOR_VERSION 1
107 #define GL2PS_MINOR_VERSION 3
108 #define GL2PS_PATCH_VERSION 5
109 #define GL2PS_EXTRA_VERSION ""
110 
111 #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
112  0.01 * GL2PS_MINOR_VERSION + \
113  0.0001 * GL2PS_PATCH_VERSION)
114 
115 #define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine"
116 
117 /* Output file formats (the values and the ordering are important!) */
118 
119 #define GL2PS_PS 0
120 #define GL2PS_EPS 1
121 #define GL2PS_TEX 2
122 #define GL2PS_PDF 3
123 #define GL2PS_SVG 4
124 #define GL2PS_PGF 5
125 
126 /* Sorting algorithms */
127 
128 #define GL2PS_NO_SORT 1
129 #define GL2PS_SIMPLE_SORT 2
130 #define GL2PS_BSP_SORT 3
131 
132 /* Message levels and error codes */
133 
134 #define GL2PS_SUCCESS 0
135 #define GL2PS_INFO 1
136 #define GL2PS_WARNING 2
137 #define GL2PS_ERROR 3
138 #define GL2PS_NO_FEEDBACK 4
139 #define GL2PS_OVERFLOW 5
140 #define GL2PS_UNINITIALIZED 6
141 
142 /* Options for gl2psBeginPage */
143 
144 #define GL2PS_NONE 0
145 #define GL2PS_DRAW_BACKGROUND (1<<0)
146 #define GL2PS_SIMPLE_LINE_OFFSET (1<<1)
147 #define GL2PS_SILENT (1<<2)
148 #define GL2PS_BEST_ROOT (1<<3)
149 #define GL2PS_OCCLUSION_CULL (1<<4)
150 #define GL2PS_NO_TEXT (1<<5)
151 #define GL2PS_LANDSCAPE (1<<6)
152 #define GL2PS_NO_PS3_SHADING (1<<7)
153 #define GL2PS_NO_PIXMAP (1<<8)
154 #define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
155 #define GL2PS_COMPRESS (1<<10)
156 #define GL2PS_NO_BLENDING (1<<11)
157 #define GL2PS_TIGHT_BOUNDING_BOX (1<<12)
158 
159 /* Arguments for gl2psEnable/gl2psDisable */
160 
161 #define GL2PS_POLYGON_OFFSET_FILL 1
162 #define GL2PS_POLYGON_BOUNDARY 2
163 #define GL2PS_LINE_STIPPLE 3
164 #define GL2PS_BLEND 4
165 
166 /* Text alignment (o=raster position; default mode is BL):
167  +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o
168  | o | o | | o | | | | | | | | | | | |
169  +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+
170  C CL CR B BL BR T TL TR */
171 
172 #define GL2PS_TEXT_C 1
173 #define GL2PS_TEXT_CL 2
174 #define GL2PS_TEXT_CR 3
175 #define GL2PS_TEXT_B 4
176 #define GL2PS_TEXT_BL 5
177 #define GL2PS_TEXT_BR 6
178 #define GL2PS_TEXT_T 7
179 #define GL2PS_TEXT_TL 8
180 #define GL2PS_TEXT_TR 9
181 
182 typedef GLfloat GL2PSrgba[4];
183 
184 #if defined(__cplusplus)
185 extern "C" {
186 #endif
187 
188 GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
189  GLint viewport[4], GLint format, GLint sort,
190  GLint options, GLint colormode,
191  GLint colorsize, GL2PSrgba *colormap,
192  GLint nr, GLint ng, GLint nb, GLint buffersize,
193  FILE *stream, const char *filename);
194 GL2PSDLL_API GLint gl2psEndPage(void);
195 GL2PSDLL_API GLint gl2psSetOptions(GLint options);
196 GL2PSDLL_API GLint gl2psGetOptions(GLint *options);
197 GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
198 GL2PSDLL_API GLint gl2psEndViewport(void);
199 GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname,
200  GLshort fontsize);
201 GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname,
202  GLshort fontsize, GLint align, GLfloat angle);
203 GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str);
204 GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
205  GLint xorig, GLint yorig,
206  GLenum format, GLenum type, const void *pixels);
207 GL2PSDLL_API GLint gl2psEnable(GLint mode);
208 GL2PSDLL_API GLint gl2psDisable(GLint mode);
209 GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
210 GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
211 GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor);
212 
213 /* undocumented */
214 GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
215  const GLfloat position[3],
216  const unsigned char *imagemap);
217 GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
218 GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
219 
220 #if defined(__cplusplus)
221 }
222 #endif
223 
224 #endif /* __GL2PS_H__ */
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, GLint xorig, GLint yorig, GLenum format, GLenum type, const void *pixels)
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, GLint viewport[4], GLint format, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint nr, GLint ng, GLint nb, GLint buffersize, FILE *stream, const char *filename)
GLfloat GL2PSrgba[4]
Definition: gl2ps.h:182
GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4])
GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize)
GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor)
static G4double angle[DIM]
GL2PSDLL_API GLint gl2psGetOptions(GLint *options)
GL2PSDLL_API GLint gl2psEndViewport(void)
GL2PSDLL_API const char * gl2psGetFileExtension(GLint format)
GL2PSDLL_API GLint gl2psDisable(GLint mode)
GL2PSDLL_API GLint gl2psSetOptions(GLint options)
const XML_Char int const XML_Char * value
Definition: expat.h:331
GL2PSDLL_API GLint gl2psEndPage(void)
GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, GLshort fontsize, GLint align, GLfloat angle)
GL2PSDLL_API GLint gl2psPointSize(GLfloat value)
GL2PSDLL_API const char * gl2psGetFormatDescription(GLint format)
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value)
#define GL2PSDLL_API
Definition: gl2ps.h:85
GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, const GLfloat position[3], const unsigned char *imagemap)
GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str)
GL2PSDLL_API GLint gl2psEnable(GLint mode)