diff --git a/Box/Box.cpp b/Box/Box.cpp index a4ab97bab75acacdc6be8c44a428ff75bc4a6cd8..7f01e91dedf66be06e797861c4c6c9e067ca9f82 100644 --- a/Box/Box.cpp +++ b/Box/Box.cpp @@ -1,4 +1,4 @@ -/* $Id: Box.cpp,v 1.3 2000-11-23 14:11:26 geuzaine Exp $ */ +/* $Id: Box.cpp,v 1.4 2000-11-23 16:51:27 geuzaine Exp $ */ #include <signal.h> @@ -18,9 +18,16 @@ char *TheFileNameTab[MAX_OPEN_FILES]; char *ThePathForIncludes=NULL, *TheBgmFileName=NULL; int VERBOSE = 0 ; -char progname[] = "This is Gmsh (non-interactive)" ; -char copyright[] = "Copyright (C) 1997-2000 C. Geuzaine, J.-F. Remacle" ; -char clargs[] = +char gmsh_progname[] = "This is Gmsh (non-interactive)" ; +char gmsh_copyright[] = "Copyright (C) 1997-2000 J.-F. Remacle, C. Geuzaine"; +char gmsh_version[] = "Version : " ; +char gmsh_os[] = "Operating System : " GMSH_OS ; +char gmsh_date[] = "Build Date : " GMSH_DATE ; +char gmsh_host[] = "Build Host : " GMSH_HOST ; +char gmsh_packager[] = "Packager : " GMSH_PACKAGER ; +char gmsh_email[] = "E-Mail : " GMSH_EMAIL ; +char gmsh_url[] = "URL : " GMSH_URL ; +char gmsh_help[] = "Usage: %s [options] [files]\n" "Mesh options:\n" " -0 parse input and exit\n" @@ -284,19 +291,21 @@ int main(int argc, char *argv[]){ void Info (int level, char *arg0){ switch(level){ case 0 : - fprintf(stderr, "%s\n", progname); - fprintf(stderr, "%s\n", copyright); - fprintf(stderr, clargs, arg0); + fprintf(stderr, "%s\n", gmsh_progname); + fprintf(stderr, "%s\n", gmsh_copyright); + fprintf(stderr, gmsh_help, arg0); exit(1); case 1: fprintf(stderr, "%g\n", GMSH_VERSION); exit(1) ; case 2: - fprintf(stderr, "Version : %g\n", GMSH_VERSION); - fprintf(stderr, "OS : %s\n", GMSH_OS); - fprintf(stderr, "Build Date : %s\n", GMSH_DATE); - fprintf(stderr, "Build Host : %s\n", GMSH_HOST); - fprintf(stderr, "Packager : %s\n", GMSH_PACKAGER); + fprintf(stderr, "%s%g\n", gmsh_version, GMSH_VERSION); + fprintf(stderr, "%s\n", gmsh_os); + fprintf(stderr, "%s\n", gmsh_date); + fprintf(stderr, "%s\n", gmsh_host); + fprintf(stderr, "%s\n", gmsh_packager); + fprintf(stderr, "%s\n", gmsh_email); + fprintf(stderr, "%s\n", gmsh_url); exit(1) ; default : break; diff --git a/Common/Context.cpp b/Common/Context.cpp index bec3532d237188dfa3db566f18c59790aaae9545..f10f7231bf9059e1a8ccd6171f0688ca74cf5fcb 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,4 +1,4 @@ -/* $Id: Context.cpp,v 1.3 2000-11-23 14:11:27 geuzaine Exp $ */ +/* $Id: Context.cpp,v 1.4 2000-11-23 16:51:28 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -21,21 +21,21 @@ void InitColors(rgbacolors * col, int num){ case 1 : /* alternative drawing colors: white background */ switch(num){ case 0 : - col->bg = PACK_COLOR(0, 0, 0, 255) ; - col->fg = PACK_COLOR(255, 255, 255, 255) ; - col->text = PACK_COLOR(255, 255, 255, 255) ; - col->axes = PACK_COLOR(255, 255, 0, 255) ; - col->little_axes = PACK_COLOR(255, 255, 255, 255) ; - break; - case 1 : - col->bg = PACK_COLOR(255, 255, 255, 255) ; - col->fg = PACK_COLOR(0, 0, 0, 255) ; - col->text = PACK_COLOR(0, 0, 0, 255) ; - col->axes = PACK_COLOR(128, 128, 128, 255) ; - col->little_axes = PACK_COLOR(0, 0, 0, 255) ; + col->bg = PACK_COLOR(0, 0, 0, 255) ; + col->fg = PACK_COLOR(255, 255, 255, 255) ; + col->text = PACK_COLOR(255, 255, 255, 255) ; + col->axes = PACK_COLOR(255, 255, 0, 255) ; + col->little_axes = PACK_COLOR(255, 255, 255, 255) ; + break; + case 1 : + col->bg = PACK_COLOR(255, 255, 255, 255) ; + col->fg = PACK_COLOR(0, 0, 0, 255) ; + col->text = PACK_COLOR(0, 0, 0, 255) ; + col->axes = PACK_COLOR(128, 128, 128, 255) ; + col->little_axes = PACK_COLOR(0, 0, 0, 255) ; break; } - col->geom.point = PACK_COLOR(178, 182, 129, 255) ; + col->geom.point = PACK_COLOR(178, 182, 129, 255) ; col->geom.line = PACK_COLOR(0, 0, 255, 255) ; col->geom.surface = PACK_COLOR(128, 128, 128, 255) ; col->geom.volume = PACK_COLOR(128, 128, 128, 255) ; @@ -128,44 +128,40 @@ void InitColors(rgbacolors * col, int num){ void InitContext(Context_T *ctx){ - ctx->interactive = 0 ; - ctx->expose = 0 ; - - ctx->r[0] = 0.0 ; - ctx->r[1] = 0.0 ; - ctx->r[2] = 0.0 ; - ctx->t[0] = 0.0 ; - ctx->t[1] = 0.0 ; - ctx->t[2] = 0.0 ; - ctx->s[0] = 1.0 ; - ctx->s[1] = 1.0 ; - ctx->s[2] = 1.0 ; - - ctx->min[0] = 0.0 ; - ctx->min[1] = 0.0 ; - ctx->min[2] = 0.0 ; - ctx->max[0] = 0.0 ; - ctx->max[1] = 0.0 ; - ctx->max[2] = 0.0 ; - ctx->range[0] = 0.0 ; - ctx->range[1] = 0.0 ; - ctx->range[2] = 0.0 ; - - ctx->viewport[0] = 0 ; - ctx->viewport[1] = 0 ; - ctx->viewport[2] = 1 ; - ctx->viewport[3] = 1 ; - ctx->render_mode = GMSH_RENDER ; - ctx->pixel_equiv_x = 0. ; - ctx->pixel_equiv_y = 0. ; - -#ifdef _UNIX + ctx->interactive = 0 ; + ctx->verbosity = 2 ; + ctx->expose = 0 ; + + ctx->r[0] = 0.0 ; + ctx->r[1] = 0.0 ; + ctx->r[2] = 0.0 ; + ctx->t[0] = 0.0 ; + ctx->t[1] = 0.0 ; + ctx->t[2] = 0.0 ; + ctx->s[0] = 1.0 ; + ctx->s[1] = 1.0 ; + ctx->s[2] = 1.0 ; + + ctx->min[0] = 0.0 ; + ctx->min[1] = 0.0 ; + ctx->min[2] = 0.0 ; + ctx->max[0] = 0.0 ; + ctx->max[1] = 0.0 ; + ctx->max[2] = 0.0 ; + ctx->range[0] = 0.0 ; + ctx->range[1] = 0.0 ; + ctx->range[2] = 0.0 ; + + ctx->viewport[0] = 0 ; + ctx->viewport[1] = 0 ; + ctx->viewport[2] = 1 ; + ctx->viewport[3] = 1 ; + ctx->render_mode = GMSH_RENDER ; + ctx->pixel_equiv_x = 0. ; + ctx->pixel_equiv_y = 0. ; + ctx->font_string = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*"; ctx->colorbar_font_string = "fixed"; -#else - ctx->font_string = "dummy"; - ctx->colorbar_font_string = "dummy"; -#endif ctx->light0[0] = 0.5 ; ctx->light0[1] = 0.3 ; @@ -204,45 +200,45 @@ void InitContext(Context_T *ctx){ ctx->geom.hidden = 0 ; ctx->geom.shade = 0 ; - ctx->mesh.vis_type = 0 ; - ctx->mesh.draw = 1 ; - ctx->mesh.points = 1 ; - ctx->mesh.lines = 1 ; - ctx->mesh.surfaces = 1 ; - ctx->mesh.volumes = 1 ; - ctx->mesh.points_num = 0 ; - ctx->mesh.lines_num = 0 ; - ctx->mesh.surfaces_num = 0 ; - ctx->mesh.volumes_num = 0 ; - ctx->mesh.normals = 0.0 ; - ctx->mesh.tangents = 0.0 ; - ctx->mesh.explode = 1.0 ; - ctx->mesh.hidden = 0 ; - ctx->mesh.shade = 0 ; - ctx->mesh.format = FORMAT_MSH ; - ctx->mesh.nb_smoothing = 0 ; - ctx->mesh.algo = DELAUNAY_OLDALGO ; - ctx->mesh.point_insertion = CENTER_CIRCCIRC; - ctx->mesh.speed_max = 0 ; - ctx->mesh.degree = 1 ; - ctx->mesh.limit_gamma = 0.0 ; - ctx->mesh.limit_eta = 0.0 ; - ctx->mesh.limit_rho = 0.0 ; - ctx->mesh.dual = 0 ; - ctx->mesh.interactive = 0 ; - - ctx->post.draw = 1 ; - ctx->post.scales = 1 ; - ctx->post.link = 0 ; - ctx->post.font = "Courier" ; - ctx->post.fontsize = 12 ; - ctx->post.initial_visibility = 1 ; - ctx->post.initial_intervals = DRAW_POST_ISO ; - ctx->post.initial_nbiso = 15 ; - ctx->post.anim_delay = 0 ; - - ctx->print.type = GLPRPAINTER ; - ctx->print.format = FORMAT_EPS ; + ctx->mesh.vis_type = 0 ; + ctx->mesh.draw = 1 ; + ctx->mesh.points = 1 ; + ctx->mesh.lines = 1 ; + ctx->mesh.surfaces = 1 ; + ctx->mesh.volumes = 1 ; + ctx->mesh.points_num = 0 ; + ctx->mesh.lines_num = 0 ; + ctx->mesh.surfaces_num = 0 ; + ctx->mesh.volumes_num = 0 ; + ctx->mesh.normals = 0.0 ; + ctx->mesh.tangents = 0.0 ; + ctx->mesh.explode = 1.0 ; + ctx->mesh.hidden = 0 ; + ctx->mesh.shade = 0 ; + ctx->mesh.format = FORMAT_MSH ; + ctx->mesh.nb_smoothing = 0 ; + ctx->mesh.algo = DELAUNAY_OLDALGO ; + ctx->mesh.point_insertion = CENTER_CIRCCIRC; + ctx->mesh.speed_max = 0 ; + ctx->mesh.degree = 1 ; + ctx->mesh.limit_gamma = 0.0 ; + ctx->mesh.limit_eta = 0.0 ; + ctx->mesh.limit_rho = 0.0 ; + ctx->mesh.dual = 0 ; + ctx->mesh.interactive = 0 ; + + ctx->post.draw = 1 ; + ctx->post.scales = 1 ; + ctx->post.link = 0 ; + ctx->post.font = "Courier" ; + ctx->post.fontsize = 12 ; + ctx->post.initial_visibility = 1 ; + ctx->post.initial_intervals = DRAW_POST_ISO ; + ctx->post.initial_nbiso = 15 ; + ctx->post.anim_delay = 0 ; + + ctx->print.type = PRINT_GL2PS_SIMPLE ; + ctx->print.format = FORMAT_EPS ; ctx->color.id = -1; InitColors(&ctx->color, 0) ; diff --git a/Common/Context.h b/Common/Context.h index abc9eb074272cd46a01c19104a7acd0ddef6c52f..ec7647f74106cea1ecfcda9635a2506fa053abb4 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -1,4 +1,4 @@ -/* $Id: Context.h,v 1.3 2000-11-23 14:11:27 geuzaine Exp $ */ +/* $Id: Context.h,v 1.4 2000-11-23 16:51:28 geuzaine Exp $ */ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ @@ -51,6 +51,7 @@ typedef struct{ typedef struct { int interactive; /* 0=full gfx; -1=just parse; 1,2,3=batch mesh */ + int verbosity; /* 0=silent -> 3=debug */ int expose; /* 1 if everything is ready to expose and draw */ double r[3], t[3], s[3]; /* current rotation, translation and scale */ diff --git a/Common/Static.h b/Common/Static.h index b7e8ad0ea17aa5fa8f857233d3b43489eb0118da..bf0bac479db6090ecf079347e323c874620ab297 100644 --- a/Common/Static.h +++ b/Common/Static.h @@ -1,23 +1,9 @@ -/* $Id: Static.h,v 1.3 2000-11-23 14:11:28 geuzaine Exp $ */ +/* $Id: Static.h,v 1.4 2000-11-23 16:51:28 geuzaine Exp $ */ #ifndef _STATIC_H_ #define _STATIC_H_ /* This file defines the static structures for Gmsh. It should be - included only once, in any 'main' file */ - -#include "Version.h" - -char gmsh_progname[] = "This is Gmsh" ; -char gmsh_copyright[] = "Copyright (C) 1997-2000 J.-F. Remacle, C. Geuzaine"; -char gmsh_version[] = "Version : " ; -char gmsh_os[] = "Operating System : " GMSH_OS ; -char gmsh_date[] = "Build Date : " GMSH_DATE ; -char gmsh_host[] = "Build Host : " GMSH_HOST ; -char gmsh_packager[] = "Packager : " GMSH_PACKAGER ; -char gmsh_email[] = "E-Mail : " - "Christophe.Geuzaine@ulg.ac.be, Remacle@scorec.rpi.edu"; -char gmsh_url[] = "URL : http://www.geuz.org/gmsh/"; - + included only once, in your 'main' file */ char TheFileName[NAME_STR_L], TheBaseFileName[NAME_STR_L]; char yyname[NAME_STR_L]; diff --git a/Common/Version.h b/Common/Version.h index 46d4911fca0438160cafc348cce8ffab826cbf52..aa73e8e230fde097b0cacbf2fcc0c8e47de02f12 100644 --- a/Common/Version.h +++ b/Common/Version.h @@ -1,6 +1,7 @@ -/* $Id: Version.h,v 1.3 2000-11-23 14:11:28 geuzaine Exp $ */ #define GMSH_VERSION 0.995 -#define GMSH_DATE "Thu Nov 23 14:48:03 MET 2000" +#define GMSH_DATE "Thu Nov 23 17:33:29 MET 2000" #define GMSH_HOST "elap57.montefiore.ulg.ac.be" #define GMSH_PACKAGER "geuzaine" #define GMSH_OS "OSF1 V4.0" +#define GMSH_URL "http://www.geuz.org/gmsh/" +#define GMSH_EMAIL "Christophe.Geuzaine@ulg.ac.be, Remacle@scorec.rpi.edu" diff --git a/Graphics/Draw.h b/Graphics/Draw.h index 88ad66f50ffd02a6b4071840d9f6b08dfefe68b8..57525a1c90e3dbba0b775c27173f2af5f104510a 100644 --- a/Graphics/Draw.h +++ b/Graphics/Draw.h @@ -1,4 +1,4 @@ -/* $Id: Draw.h,v 1.2 2000-11-23 14:11:32 geuzaine Exp $ */ +/* $Id: Draw.h,v 1.3 2000-11-23 16:51:29 geuzaine Exp $ */ #ifndef _DRAW_H_ #define _DRAW_H_ @@ -11,31 +11,16 @@ #define TO_SCREEN 1 #define TO_FILE 2 -#define XDUMP 1 -#define GLPPAINTER 2 -#define GLPRECURSIVE 3 -#define GLPIMAGE 4 -#define GLPRPAINTER 5 -#define GLPRRECURSIVE 6 -#define GIF 7 +#define PRINT_XDUMP 1 +#define PRINT_GL2PS_SIMPLE 2 +#define PRINT_GL2PS_RECURSIVE 3 +#define PRINT_GL2PS_IMAGE 4 +#define PRINT_GL2GIF 5 #define FORMAT_XPM 1 -#define FORMAT_PS 2 -#define FORMAT_EPS 3 -#define FORMAT_HPGL 4 -#define FORMAT_CGM 5 -#define FORMAT_BMP 6 -#define FORMAT_GIF 7 - -#define FORMAT_MSH 1 -#define FORMAT_UNV 2 -#define FORMAT_GREF 3 - -#define COLOR 1 -#define COLOR_INV 2 -#define GRAYSCALE 3 -#define GRAYSCALE_INV 4 -#define BLACKWHITE 5 +#define FORMAT_EPS 2 +#define FORMAT_BMP 3 +#define FORMAT_GIF 4 void Init(void); void InitOv(void); @@ -50,7 +35,7 @@ void Palette (Post_View * View, int nbi, int i); void Palette2 (Post_View * View, double min, double max, double val); void ColorSwitch(int i); -int SelectEntity(int type, Vertex **v, Curve **c, Surface **s); +int SelectEntity(int type, Vertex **v, Curve **c, Surface **s); void ZeroHighlight(Mesh *m); void begin_highlight(void); void end_highlight(int permanent); @@ -68,41 +53,30 @@ void Draw_Post(void); void Draw_Scales(void); void Draw_Axes (double s); void Draw_SmallAxes(void); - void Draw_Point(double *x, double *y, double *z, double *Offset, double Raise[3][5]); - void Draw_Line (double *x, double *y, double *z, double *Offset, double Raise[3][5]); - void Draw_Triangle (double *x, double *y, double *z, double *Offset, double Raise[3][5], int shade); - void Draw_Quadrangle (double *x, double *y, double *z, double *Offset, double Raise[3][5], int shade); - void Draw_Polygon (int n, double *x, double *y, double *z, double *Offset, double Raise[3][5]); - void Draw_Vector (int Type, int Fill, double x, double y, double z, double d, double dx, double dy, double dz, double *Offset, double Raise[3][5]); - - void Draw_Mesh_Volumes(void *a, void *b); void Draw_Mesh_Surfaces(void *a, void *b); void Draw_Mesh_Curves(void *a, void *b); void Draw_Mesh_Points(void *a, void *b); - void Draw_Simplex_Surfaces (void *a, void *b); void Draw_Simplex_Points(void *a,void *b); void Draw_Extruded_Surfaces(void *a, void *b); - void Draw_Simplex_Volume (void *a, void *b); void Draw_Hexahedron_Volume (void *a, void *b); void Draw_Prism_Volume (void *a, void *b); - void Draw_Post_Simplex (Post_View * View, Post_Simplex * s, double ValMin, double ValMax, double Raise[3][5]); void Draw_Post_Triangle (Post_View * View, Post_Triangle * t, diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index d728692fca20f65be4b72d19a3d1c7523cf35e84..c344fc9ba34d981abd8e9bef49e0953b124e1128 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: Mesh.cpp,v 1.4 2000-11-23 16:07:11 geuzaine Exp $ */ +/* $Id: Mesh.cpp,v 1.5 2000-11-23 16:51:29 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -342,7 +342,7 @@ void Draw_Simplex_Surfaces (void *a, void *b){ Simplex **s; double X[4],Y[4],Z[4],Xc,Yc,Zc,pX[8],pY[8],pZ[8]; double x1x0, y1y0, z1z0, x2x0, y2y0, z2z0, n[3], m[3], mm; - int i,j,K,L,k,special; + int i,j,K,L,k; char Num[256]; s = (Simplex**)a; @@ -438,12 +438,6 @@ void Draw_Simplex_Surfaces (void *a, void *b){ if(CTX.mesh.surfaces){ - special = - CTX.mesh.hidden && - CTX.stream == TO_FILE && - (CTX.print.type == GLPPAINTER || CTX.print.type == GLPRECURSIVE) ; - - if (CTX.mesh.hidden) { glEnable(GL_POLYGON_OFFSET_FILL); glBegin(GL_POLYGON); @@ -452,7 +446,7 @@ void Draw_Simplex_Surfaces (void *a, void *b){ glDisable(GL_POLYGON_OFFSET_FILL); } - if(CTX.mesh.lines && !special){ + if(CTX.mesh.lines){ glColor4ubv((GLubyte*)&CTX.color.mesh.line); glBegin(GL_LINE_LOOP); for(i=0 ; i<K*(1+L) ; i++){ diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp index b3c220aa9e577fe3b83f89e3a64dad99b8261b86..1b1ba227cc6995ad40e583c2bc7aeedbd912f952 100644 --- a/Graphics/Scale.cpp +++ b/Graphics/Scale.cpp @@ -1,4 +1,4 @@ -/* $Id: Scale.cpp,v 1.2 2000-11-23 14:11:32 geuzaine Exp $ */ +/* $Id: Scale.cpp,v 1.3 2000-11-23 16:51:29 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -32,7 +32,8 @@ extern List_T *Post_ViewList; void Draw_String(char *s){ if(CTX.stream == TO_FILE){ - if(CTX.print.type == GLPRPAINTER || CTX.print.type == GLPRRECURSIVE) { + if(CTX.print.type == PRINT_GL2PS_SIMPLE || + CTX.print.type == PRINT_GL2PS_RECURSIVE) { gl2psText(s,CTX.post.font,CTX.post.fontsize); return ; } diff --git a/Makefile b/Makefile index e42e55fe15cc11e657c52a2129e4c1f108430dc3..91c2e9867811847456dd0f3d6ad391eba34d7d66 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,8 @@ tag: echo "#define GMSH_HOST \"`hostname`\"" >> Common/Version.h echo "#define GMSH_PACKAGER \"`logname`\"" >> Common/Version.h echo "#define GMSH_OS \"`uname -sr`\"" >> Common/Version.h + echo "#define GMSH_URL \"http://www.geuz.org/gmsh/\"" >> Common/Version.h + echo "#define GMSH_EMAIL \"Christophe.Geuzaine@ulg.ac.be, Remacle@scorec.rpi.edu\"" >> Common/Version.h initialtag: @if [ ! -r Common/Version.h ]; then \ diff --git a/Unix/CbFile.cpp b/Unix/CbFile.cpp index e49ad7b345a9f32a56269a54d5e204e397e38446..8d13a5b33029e2718bd99a7877bfd9f65df46d3d 100644 --- a/Unix/CbFile.cpp +++ b/Unix/CbFile.cpp @@ -1,4 +1,4 @@ -/* $Id: CbFile.cpp,v 1.3 2000-11-23 14:11:40 geuzaine Exp $ */ +/* $Id: CbFile.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #include <unistd.h> @@ -71,12 +71,11 @@ void CreateImage (FILE *fp) { switch(CTX.print.type){ - case XDUMP : + case PRINT_XDUMP : switch(CTX.print.format){ case FORMAT_XPM : Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), fp); break; - case FORMAT_PS : case FORMAT_EPS : tmp = fopen(tmpFileName,"w"); Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), tmp); @@ -90,21 +89,20 @@ void CreateImage (FILE *fp) { Msg(INFOS, "X image dump complete: '%s'", KeepFileName); break ; - case GIF : + case PRINT_GL2GIF : create_gif(fp, CTX.viewport[2]-CTX.viewport[0], CTX.viewport[3]-CTX.viewport[1]); Msg(INFOS, "GIF dump complete: '%s'", KeepFileName); break; - case GLPRPAINTER : - case GLPRRECURSIVE : + case PRINT_GL2PS_SIMPLE : + case PRINT_GL2PS_RECURSIVE : size3d = 0 ; res = GL2PS_OVERFLOW ; while(res == GL2PS_OVERFLOW){ size3d += 1024*1024 ; gl2psBeginPage(TheBaseFileName, "Gmsh", - (CTX.print.type == GLPRPAINTER ? - GL2PS_SIMPLE_SORT : GL2PS_BSP_SORT), + (CTX.print.type == PRINT_GL2PS_SIMPLE ? GL2PS_SIMPLE_SORT : GL2PS_BSP_SORT), GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND, GL_RGBA, 0, NULL, size3d, fp); CTX.stream = TO_FILE ; diff --git a/Unix/CbOptions.cpp b/Unix/CbOptions.cpp index 3ec1737f29a2126b4a7f114443fbe98c92dee176..352c1724dad5b7a12c0bb91781ffb36e3ba9e99f 100644 --- a/Unix/CbOptions.cpp +++ b/Unix/CbOptions.cpp @@ -1,4 +1,4 @@ -/* $Id: CbOptions.cpp,v 1.3 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: CbOptions.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -112,14 +112,11 @@ void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data){ /* print */ - case OPTIONS_PRINT_XDUMP : CTX.print.type = XDUMP; CTX.print.format = FORMAT_XPM; break; - case OPTIONS_PRINT_GIF : CTX.print.type = GIF; CTX.print.format = FORMAT_GIF; break; - case OPTIONS_PRINT_GLPPAINTER : CTX.print.type = GLPPAINTER; CTX.print.format = FORMAT_EPS; break; - case OPTIONS_PRINT_GLPRECURSIVE : CTX.print.type = GLPRECURSIVE; CTX.print.format = FORMAT_EPS; break; - case OPTIONS_PRINT_GLPIMAGE : CTX.print.type = GLPIMAGE; CTX.print.format = FORMAT_EPS; break; - case OPTIONS_PRINT_GL2PS_SIMPLE : CTX.print.type = GLPRPAINTER; CTX.print.format = FORMAT_EPS;break; - case OPTIONS_PRINT_GL2PS_COMPLEX: CTX.print.type = GLPRRECURSIVE; CTX.print.format = FORMAT_EPS;break; - case OPTIONS_PRINT_GL2PS_IMAGE : CTX.print.type = XDUMP; CTX.print.format = FORMAT_EPS;break; + case OPTIONS_PRINT_XDUMP : CTX.print.type = PRINT_XDUMP; CTX.print.format = FORMAT_XPM; break; + case OPTIONS_PRINT_GL2GIF : CTX.print.type = PRINT_GL2GIF; CTX.print.format = FORMAT_GIF; break; + case OPTIONS_PRINT_GL2PS_SIMPLE : CTX.print.type = PRINT_GL2PS_SIMPLE; CTX.print.format = FORMAT_EPS;break; + case OPTIONS_PRINT_GL2PS_COMPLEX: CTX.print.type = PRINT_GL2PS_RECURSIVE; CTX.print.format = FORMAT_EPS;break; + case OPTIONS_PRINT_GL2PS_IMAGE : CTX.print.type = PRINT_XDUMP; CTX.print.format = FORMAT_EPS;break; /* geometrie */ diff --git a/Unix/CbOptions.h b/Unix/CbOptions.h index 821cd77c6ebf0940938cf407558e87d7f4afd4e8..19074b66df28fc5b51dc28069a5f16d74cd21936 100644 --- a/Unix/CbOptions.h +++ b/Unix/CbOptions.h @@ -1,4 +1,4 @@ -/* $Id: CbOptions.h,v 1.3 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: CbOptions.h,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #ifndef _CB_OPTIONS_H_ #define _CB_OPTIONS_H_ @@ -96,12 +96,9 @@ /* options print */ #define OPTIONS_PRINT_XDUMP 400 -#define OPTIONS_PRINT_GLPPAINTER 401 -#define OPTIONS_PRINT_GLPRECURSIVE 402 -#define OPTIONS_PRINT_GLPIMAGE 403 -#define OPTIONS_PRINT_GL2PS_SIMPLE 404 -#define OPTIONS_PRINT_GL2PS_COMPLEX 405 -#define OPTIONS_PRINT_GL2PS_IMAGE 406 -#define OPTIONS_PRINT_GIF 407 +#define OPTIONS_PRINT_GL2PS_SIMPLE 401 +#define OPTIONS_PRINT_GL2PS_COMPLEX 402 +#define OPTIONS_PRINT_GL2PS_IMAGE 403 +#define OPTIONS_PRINT_GL2GIF 404 #endif diff --git a/Unix/Main.cpp b/Unix/Main.cpp index ac876f58116c87ebcf348983573cfab7491481ca..7c0348219eb3b0ca5feb2b2c1e96ad5a05b01045 100644 --- a/Unix/Main.cpp +++ b/Unix/Main.cpp @@ -1,4 +1,4 @@ -/* $Id: Main.cpp,v 1.4 2000-11-23 15:06:04 geuzaine Exp $ */ +/* $Id: Main.cpp,v 1.5 2000-11-23 16:51:30 geuzaine Exp $ */ #include <signal.h> @@ -28,6 +28,18 @@ #include "Static.h" #include "XStatic.h" +#include "Version.h" + +char gmsh_progname[] = "This is Gmsh" ; +char gmsh_copyright[] = "Copyright (C) 1997-2000 J.-F. Remacle, C. Geuzaine"; +char gmsh_version[] = "Version : " ; +char gmsh_os[] = "Operating System : " GMSH_OS ; +char gmsh_date[] = "Build Date : " GMSH_DATE ; +char gmsh_host[] = "Build Host : " GMSH_HOST ; +char gmsh_packager[] = "Packager : " GMSH_PACKAGER ; +char gmsh_email[] = "E-Mail : " GMSH_EMAIL ; +char gmsh_url[] = "URL : " GMSH_URL ; + char *TheFileNameTab[MAX_OPEN_FILES], *TheBgmFileName=NULL; char ThePathForIncludes[NAME_STR_L]; @@ -334,10 +346,18 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { !strcmp(argv[i]+1, "bg")){ i+=2; } + else if(!strcmp(argv[i]+1, "v")){ + i++; + if(argv[i]!=NULL){ + CTX.verbosity = atoi(argv[i]); i++; + } + else { + fprintf(stderr, "Error: Missing Number\n"); + exit(1); + } + } else if(!strcmp(argv[i]+1, "version") || - !strcmp(argv[i]+1, "v") || - !strcmp(argv[i]+1, "-version") || - !strcmp(argv[i]+1, "-v")){ + !strcmp(argv[i]+1, "-version")){ Info(2,argv[0]); } else if(!strcmp(argv[i]+1, "info") || @@ -345,9 +365,7 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { Info(1,argv[0]); } else if(!strcmp(argv[i]+1, "help") || - !strcmp(argv[i]+1, "h") || - !strcmp(argv[i]+1, "-help") || - !strcmp(argv[i]+1, "-h")){ + !strcmp(argv[i]+1, "-help")){ Info(0,argv[0]); } else{ diff --git a/Unix/Message.cpp b/Unix/Message.cpp index f5e3f4fab2f07d63639008a50f9e906499b2d0c4..ca854b8dc6d66d16a4f815d070d1980c16ab2282 100644 --- a/Unix/Message.cpp +++ b/Unix/Message.cpp @@ -1,4 +1,4 @@ -/* $Id: Message.cpp,v 1.3 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: Message.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #include <signal.h> #include <sys/resource.h> @@ -47,6 +47,7 @@ char clargs[] = " -flash allow colormap flashing\n" " -samevisual force same visual for OpenGL and GUI\n" "Other options:\n" + " -v int set verbosity level (default: 2)\n" " -threads enable threads\n" " -path string path for included files\n" " -version show version number\n" @@ -122,6 +123,9 @@ void Msg(int level, char *fmt, ...){ Arg arg[2]; int nb, nbvis; + if(!CTX.verbosity && CTX.interactive && + level != ERROR && level != PARSER_ERROR) return ; + va_start (args, fmt); switch(level){ diff --git a/Unix/Register.cpp b/Unix/Register.cpp index 7975dfdc03747d61edd1ed7ba00ceb8aa193e3be..ebcf6104e344bb44131f02f08a75e37a669ced93 100644 --- a/Unix/Register.cpp +++ b/Unix/Register.cpp @@ -1,4 +1,4 @@ -/* $Id: Register.cpp,v 1.3 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: Register.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -151,14 +151,7 @@ void RegisterCallbacks_FD(Widgets_T *w){ register_activate_cb (w->FD.printButt[0], OptionsCb, OPTIONS_PRINT_GL2PS_SIMPLE); register_activate_cb (w->FD.printButt[1], OptionsCb, OPTIONS_PRINT_GL2PS_COMPLEX); register_activate_cb (w->FD.printButt[2], OptionsCb, OPTIONS_PRINT_XDUMP); - register_activate_cb (w->FD.printButt[3], OptionsCb, OPTIONS_PRINT_GIF); - register_activate_cb (w->FD.printButt[4], OptionsCb, OPTIONS_PRINT_GLPRECURSIVE); - register_activate_cb (w->FD.printButt[5], OptionsCb, OPTIONS_PRINT_GLPIMAGE); - /* - register_activate_cb (w->FD.printButt[6], OptionsCb, OPTIONS_PRINT_XPM); - register_activate_cb (w->FD.printButt[7], OptionsCb, OPTIONS_PRINT_PS); - register_activate_cb (w->FD.printButt[8], OptionsCb, OPTIONS_PRINT_EPS); - */ + register_activate_cb (w->FD.printButt[3], OptionsCb, OPTIONS_PRINT_GL2GIF); } void RegisterCallbacks_OD(Widgets_T *w){ diff --git a/Unix/Widgets.cpp b/Unix/Widgets.cpp index 238d6870bae027e9fed010bdb04a312f515451f3..1cff1a4ffb43ad1def516d85fa4f9cc872835f8b 100644 --- a/Unix/Widgets.cpp +++ b/Unix/Widgets.cpp @@ -1,4 +1,4 @@ -/* $Id: Widgets.cpp,v 1.3 2000-11-23 14:11:41 geuzaine Exp $ */ +/* $Id: Widgets.cpp,v 1.4 2000-11-23 16:51:30 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -680,14 +680,6 @@ void CreateWidgets_FD(Widgets_T *w){ w->FD.printButt[3] = XmCreatePushButton(w->FD.printPane[0], "MprintButt3", arg, i); XtManageChild(w->FD.printButt[3]); i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("EPS (GLPr)")); i++; - w->FD.printButt[4] = XmCreatePushButton(w->FD.printPane[0], "MprintButt4", arg, i); - XtManageChild(w->FD.printButt[4]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("EPS Bitmap (GLPr)")); i++; - w->FD.printButt[5] = XmCreatePushButton(w->FD.printPane[0], "MprintButt5", arg, i); - XtManageChild(w->FD.printButt[5]); - i=0; XtSetArg(arg[i], XmNsubMenuId, w->FD.printPane[0]); i++; XtSetArg(arg[i], XmNspacing, 0); i++; @@ -718,11 +710,6 @@ void CreateWidgets_FD(Widgets_T *w){ XtManageChild(w->FD.printMenu[1]); */ -#ifndef _GL_PRINT - XtSetSensitive(w->FD.printButt[4], 0); - XtSetSensitive(w->FD.printButt[5], 0); -#endif - tmp = XmFileSelectionBoxGetChild(w->FD.openDialog, XmDIALOG_HELP_BUTTON); XtUnmanageChild(tmp); tmp = XmFileSelectionBoxGetChild(w->FD.mergeDialog, XmDIALOG_HELP_BUTTON);