Skip to content
Snippets Groups Projects
Commit 7a368d65 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent dcd88904
No related branches found
No related tags found
No related merge requests found
// $Id: CreateFile.cpp,v 1.23 2001-11-19 09:29:18 geuzaine Exp $ // $Id: CreateFile.cpp,v 1.24 2001-11-19 10:43:16 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -160,7 +160,7 @@ void CreateOutputFile (char *name, int format) { ...@@ -160,7 +160,7 @@ void CreateOutputFile (char *name, int format) {
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SIMPLE_LINE_OFFSET |
(CTX.print.eps_background ? GL2PS_DRAW_BACKGROUND : 0) | (CTX.print.eps_background ? GL2PS_DRAW_BACKGROUND : 0) |
(format==FORMAT_PSTEX ? GL2PS_NO_TEXT : 0), (format==FORMAT_PSTEX ? GL2PS_NO_TEXT : 0),
GL_RGBA, 0, NULL, size3d, fp); GL_RGBA, 0, NULL, size3d, fp, name);
CTX.stream = TO_FILE ; CTX.stream = TO_FILE ;
FillBuffer(); FillBuffer();
CTX.stream = TO_SCREEN ; CTX.stream = TO_SCREEN ;
...@@ -179,7 +179,7 @@ void CreateOutputFile (char *name, int format) { ...@@ -179,7 +179,7 @@ void CreateOutputFile (char *name, int format) {
} }
gl2psBeginPage(CTX.base_filename, "Gmsh", gl2psBeginPage(CTX.base_filename, "Gmsh",
GL2PS_TEX, GL2PS_NO_SORT, 0, GL2PS_TEX, GL2PS_NO_SORT, 0,
GL_RGBA, 0, NULL, 1, fp); GL_RGBA, 0, NULL, 1, fp, name);
CTX.stream = TO_FILE ; CTX.stream = TO_FILE ;
CTX.print.gl_fonts = 0; CTX.print.gl_fonts = 0;
FillBuffer(); FillBuffer();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* GL2PS, an OpenGL to PostScript Printing Library * GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2001 Christophe Geuzaine * Copyright (C) 1999-2001 Christophe Geuzaine
* *
* $Id: gl2ps.cpp,v 1.30 2001-11-19 09:29:18 geuzaine Exp $ * $Id: gl2ps.cpp,v 1.31 2001-11-19 10:43:16 geuzaine Exp $
* *
* E-mail: Christophe.Geuzaine@AdValvas.be * E-mail: Christophe.Geuzaine@AdValvas.be
* URL: http://www.geuz.org/gl2ps/ * URL: http://www.geuz.org/gl2ps/
...@@ -1282,16 +1282,31 @@ void gl2psPrintPostScriptFooter(GLvoid){ ...@@ -1282,16 +1282,31 @@ void gl2psPrintPostScriptFooter(GLvoid){
GLvoid gl2psPrintTeXHeader(GLvoid){ GLvoid gl2psPrintTeXHeader(GLvoid){
GLint viewport[4]; GLint viewport[4];
char name[256];
int i;
glGetIntegerv(GL_VIEWPORT, viewport); glGetIntegerv(GL_VIEWPORT, viewport);
if(gl2ps.filename && strlen(gl2ps.filename)<256){
for(i=strlen(gl2ps.filename)-1 ; i>=0 ; i--){
if(gl2ps.filename[i] == '.'){
strncpy(name, gl2ps.filename, i);
name[i]='\0';
break;
}
}
if(i<=0) strcpy(name, gl2ps.filename);
}
else
strcpy(name, "unnamed");
fprintf(gl2ps.stream, fprintf(gl2ps.stream,
"\\begin{picture}(0,0)\n"
"\\includegraphics{}\n"
"\\end{picture}\n"
"\\setlength{\\unitlength}{1pt}\n" "\\setlength{\\unitlength}{1pt}\n"
"\\begin{picture}(%d,%d)(%d,%d)\n", "\\begin{picture}(0,0)\n"
10,10,10,10); "\\includegraphics{%s}\n"
"\\end{picture}%%\n"
"\\begin{picture}(%d,%d)(0,0)\n",
name, viewport[2],viewport[3]);
} }
GLvoid gl2psPrintTeXPrimitive(GLvoid *a, GLvoid *b){ GLvoid gl2psPrintTeXPrimitive(GLvoid *a, GLvoid *b){
...@@ -1319,11 +1334,12 @@ void gl2psPrintTeXFooter(GLvoid){ ...@@ -1319,11 +1334,12 @@ void gl2psPrintTeXFooter(GLvoid){
GLvoid gl2psBeginPage(char *title, char *producer, GLvoid gl2psBeginPage(char *title, char *producer,
GLint format, GLint sort, GLint options, GLint format, GLint sort, GLint options,
GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint colormode, GLint colorsize, GL2PSrgba *colormap,
GLint buffersize, FILE *stream){ GLint buffersize, FILE *stream, char *filename){
gl2ps.format = format; gl2ps.format = format;
gl2ps.title = title; gl2ps.title = title;
gl2ps.producer = producer; gl2ps.producer = producer;
gl2ps.filename = filename;
gl2ps.sort = sort; gl2ps.sort = sort;
gl2ps.options = options; gl2ps.options = options;
gl2ps.colormode = colormode; gl2ps.colormode = colormode;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* GL2PS, an OpenGL to PostScript Printing Library * GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2001 Christophe Geuzaine * Copyright (C) 1999-2001 Christophe Geuzaine
* *
* $Id: gl2ps.h,v 1.14 2001-11-19 09:29:18 geuzaine Exp $ * $Id: gl2ps.h,v 1.15 2001-11-19 10:43:16 geuzaine Exp $
* *
* E-mail: Christophe.Geuzaine@AdValvas.be * E-mail: Christophe.Geuzaine@AdValvas.be
* URL: http://www.geuz.org/gl2ps/ * URL: http://www.geuz.org/gl2ps/
...@@ -150,7 +150,7 @@ typedef struct { ...@@ -150,7 +150,7 @@ typedef struct {
typedef struct { typedef struct {
GLint format, sort, options, colorsize, colormode, buffersize; GLint format, sort, options, colorsize, colormode, buffersize;
char *title, *producer; char *title, *producer, *filename;
GLboolean shade, boundary; GLboolean shade, boundary;
GLfloat *feedback, offset[2]; GLfloat *feedback, offset[2];
GL2PSrgba *colormap; GL2PSrgba *colormap;
...@@ -164,7 +164,7 @@ typedef struct { ...@@ -164,7 +164,7 @@ typedef struct {
GLvoid gl2psBeginPage(char *title, char *producer, GLvoid gl2psBeginPage(char *title, char *producer,
GLint format, GLint sort, GLint options, GLint format, GLint sort, GLint options,
GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint colormode, GLint colorsize, GL2PSrgba *colormap,
GLint buffersize, FILE * stream); GLint buffersize, FILE *stream, char *filename);
GLint gl2psEndPage(GLvoid); GLint gl2psEndPage(GLvoid);
GLvoid gl2psText(char *str, char *fontname, GLint size); GLvoid gl2psText(char *str, char *fontname, GLint size);
GLvoid gl2psEnable(GLint mode); GLvoid gl2psEnable(GLint mode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment