diff --git a/Common/Context.cpp b/Common/Context.cpp index b0a5dc0c474aaef65f31867b3e7115e9704f8913..b86349c0da62acd113e717ca8f6b9d90b7cc2787 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,4 +1,4 @@ -/* $Id: Context.cpp,v 1.22 2000-12-11 22:09:42 geuzaine Exp $ */ +/* $Id: Context.cpp,v 1.23 2000-12-20 15:28:42 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -206,9 +206,6 @@ void Init_Context(void){ CTX.max[0] = CTX.max[1] = CTX.max[2] = 1.0 ; CTX.range[0] = CTX.range[1] = CTX.range[2] = 1.0 ; - CTX.viewport[0] = CTX.viewport[1] = 0 ; - CTX.viewport[2] = CTX.viewport[3] = 1 ; - CTX.vxmin = CTX.vymin = CTX.vxmax = CTX.vymax = 0. ; CTX.render_mode = GMSH_RENDER ; diff --git a/Common/Options.h b/Common/Options.h index 82a066af97b0e95073af78c6184e74549671a378..12be4804b37843f878f7a617170a4da49eaddf06 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -1,4 +1,4 @@ -/* $Id: Options.h,v 1.7 2000-12-20 10:40:49 geuzaine Exp $ */ +/* $Id: Options.h,v 1.8 2000-12-20 15:28:42 geuzaine Exp $ */ #ifndef _OPTIONS_H_ #define _OPTIONS_H_ @@ -37,6 +37,10 @@ StringXString PrintOptions_String[] = { // NUMBERS StringXNumber GeneralOptions_Number[] = { + { "Viewport0" , GMSH_INT, (void*)&CTX.viewport[0] , 0. }, + { "Viewport1" , GMSH_INT, (void*)&CTX.viewport[1] , 0. }, + { "Viewport2" , GMSH_INT, (void*)&CTX.viewport[2] , 1. }, + { "Viewport3" , GMSH_INT, (void*)&CTX.viewport[3] , 1. }, { "Rotation0" , GMSH_DOUBLE, (void*)&CTX.r[0] , 0.0 }, { "Rotation1" , GMSH_DOUBLE, (void*)&CTX.r[1] , 0.0 }, { "Rotation2" , GMSH_DOUBLE, (void*)&CTX.r[2] , 0.0 }, diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp index 8432108b810e1718024da491d9d628fcbb520fb2..fdc633f552470cb9233099119595a0b7f5c40f63 100644 --- a/Graphics/Draw.cpp +++ b/Graphics/Draw.cpp @@ -1,4 +1,4 @@ -/* $Id: Draw.cpp,v 1.11 2000-12-10 23:31:45 geuzaine Exp $ */ +/* $Id: Draw.cpp,v 1.12 2000-12-20 15:28:44 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -171,13 +171,21 @@ void Orthogonalize(int x, int y){ /* i n i t */ /* ------------------------------------------------------------------------ */ +#ifdef _UNIX +#include <X11/IntrinsicP.h> +#endif + void Init(void){ - /* - Attention: - X11 interdit de changer le contexte (GLX) en mode GL_FEEDBACK ou GL_SELECT, - ce qui serait le cas pour les sorties postscript... - */ #ifdef _UNIX + /* Resize Graphical Window if told to do it */ + XWindowAttributes xattrib; + XGetWindowAttributes(XtDisplay(WID.G.bottomForm),XtWindow(WID.G.bottomForm),&xattrib); + XtResizeWidget(WID.G.shell, + CTX.viewport[2]-CTX.viewport[0], + xattrib.height+CTX.viewport[3]-CTX.viewport[1], + 0); + /* X11 forbids to change the context (GLX) in GL_FEEDBACK or GL_SELECT mode, + which would happen for postcript output */ if(CTX.stream == TO_SCREEN) glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); #endif diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index be3b0b1085c16e9dd598c02e894d2b063e488ec8..dc8f995024b081e7bbdb3bc991da16d089967679 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -168,7 +168,7 @@ #define UNARYPREC 418 #line 1 "Gmsh.y" - /* $Id: Gmsh.tab.cpp,v 1.53 2000-12-20 12:17:10 geuzaine Exp $ */ + /* $Id: Gmsh.tab.cpp,v 1.54 2000-12-20 15:28:45 geuzaine Exp $ */ #include <stdarg.h> diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index cdf278bd39e9840585536a7421c9b28a7ae98525..f227a095f98535a1dbf5b3a95deeffa28abdab4b 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -2,7 +2,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.53 2000-12-20 12:17:10 geuzaine Exp $ + * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.54 2000-12-20 15:28:46 geuzaine Exp $ */ #define FLEX_SCANNER diff --git a/Unix/Geometry.cpp b/Unix/Geometry.cpp index a044380d2be05f9c8513c08561e81d0d65adca52..7427cea6a7c33c45d35186468422706f4a7c15ed 100644 --- a/Unix/Geometry.cpp +++ b/Unix/Geometry.cpp @@ -1,4 +1,4 @@ -/* $Id: Geometry.cpp,v 1.7 2000-12-20 12:17:13 geuzaine Exp $ */ +/* $Id: Geometry.cpp,v 1.8 2000-12-20 15:28:48 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -215,7 +215,6 @@ void ForceGeometry_G (Widgets_T *w){ XmNmarginHeight, 0, NULL); - } /* ------------------------------------------------------------------------ diff --git a/Unix/Main.cpp b/Unix/Main.cpp index 81556c7aab3722adeb1ecb749edef79bdf5b132f..c4eeeb1f86fea549cbc97d2b89c4aad9c930061d 100644 --- a/Unix/Main.cpp +++ b/Unix/Main.cpp @@ -1,4 +1,4 @@ -/* $Id: Main.cpp,v 1.30 2000-12-19 08:56:56 geuzaine Exp $ */ +/* $Id: Main.cpp,v 1.31 2000-12-20 15:28:48 geuzaine Exp $ */ #include <signal.h> @@ -157,11 +157,12 @@ void OpenProblem(char *name){ strncpy(THEM->name, TheBaseFileName,NAME_STR_L); - if(!CTX.interactive) + if(!CTX.interactive){ XtVaSetValues(WID.G.shell, XmNtitle, TheFileName, XmNiconName, TheBaseFileName, NULL); + } Msg(INFOS, "Opening '%s'", TheFileName); diff --git a/Unix/Widgets.cpp b/Unix/Widgets.cpp index bef0ce1fc32fb8e9b82380f10dc4e641ff51f12f..be853e15766463342541304dac96b7d308efda1b 100644 --- a/Unix/Widgets.cpp +++ b/Unix/Widgets.cpp @@ -1,4 +1,4 @@ -/* $Id: Widgets.cpp,v 1.20 2000-12-20 12:17:13 geuzaine Exp $ */ +/* $Id: Widgets.cpp,v 1.21 2000-12-20 15:28:48 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -417,8 +417,11 @@ void CreateWidgets_G(Widgets_T *w){ /* container form */ i=0; - XtSetArg(arg[i], XmNresizable, False); i++; - XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; + // We want glw to be able to force the size of the container win + //XtSetArg(arg[i], XmNresizable, False); i++; + //XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; + XtSetArg(arg[i], XmNwidth, 700); i++; + XtSetArg(arg[i], XmNheight, 525); i++; w->G.containerForm = XmCreateForm(w->G.shell, "GcontainerForm", arg, i); XtManageChild(w->G.containerForm); @@ -427,6 +430,7 @@ void CreateWidgets_G(Widgets_T *w){ XtSetArg(arg[i], XmNcolormap, XCTX.glw.colormap); i++; XtSetArg(arg[i], GLwNvisualInfo, XCTX.glw.visinfo); i++; XtSetArg(arg[i], GLwNinstallColormap, True); i++; + w->G.glw = GLwCreateMDrawingArea(w->G.containerForm, "glw", arg, i); XtManageChild(w->G.glw); @@ -496,8 +500,8 @@ void CreateWidgets_G(Widgets_T *w){ /* 3 textes au milieu */ i=0; - XtSetArg(arg[i], XmNresizable, False); i++; - XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; + //XtSetArg(arg[i], XmNresizable, False); i++; + //XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; w->G.textForm = XmCreateForm(w->G.bottomForm, "GtextForm", arg, i); XtManageChild(w->G.textForm); diff --git a/Unix/Widgets.h b/Unix/Widgets.h index e70dbac4d11adaffbfcc38c5774815846957558d..d51fded87a8da886589e33f8a0ba0d2a92ade512 100644 --- a/Unix/Widgets.h +++ b/Unix/Widgets.h @@ -1,4 +1,4 @@ -/* $Id: Widgets.h,v 1.10 2000-12-20 12:17:13 geuzaine Exp $ */ +/* $Id: Widgets.h,v 1.11 2000-12-20 15:28:48 geuzaine Exp $ */ #ifndef _WIDGETS_H_ #define _WIDGETS_H_ @@ -49,8 +49,7 @@ typedef struct { struct { Widget shell, containerForm ; - Widget drawForm ; - Widget glw, glo ; + Widget glw, glo ; Widget bottomForm ; Widget Butt[7] ; Widget textForm, infoLabel, selectLabel, statusLabel ; diff --git a/Unix/XRessources.h b/Unix/XRessources.h index a1c957237e0ec28b884333b0d2418e3483bcc317..5e0e0de60685c9eb823f0cb103024d5a8bcf8f4d 100644 --- a/Unix/XRessources.h +++ b/Unix/XRessources.h @@ -1,4 +1,4 @@ -/* $Id: XRessources.h,v 1.3 2000-11-25 15:26:12 geuzaine Exp $ */ +/* $Id: XRessources.h,v 1.4 2000-12-20 15:28:48 geuzaine Exp $ */ /* Les resources ci-dessous sont prises en compte par defaut. Toutre @@ -55,7 +55,8 @@ String FallbackResources[] = { "gmshMW*HDaboutDialog*fontList: fixed", /* geometrie */ - "gmshGW*geometry: 700x525+20+30", + //"gmshGW*geometry: 700x525+20+30", Dont't force the dimension this way !!! + "gmshGW*geometry: +20+30", "gmshMW*geometry: x420+800+80", "gmshCW*geometry: 440x130+30+570", diff --git a/tutorial/t8.geo b/tutorial/t8.geo index 4aed4c765201de60650fba8edb07a4676a69a762..c6696bce96f06d1784742eac59b94456399ae74d 100644 --- a/tutorial/t8.geo +++ b/tutorial/t8.geo @@ -56,9 +56,16 @@ For num In {1:255} PostProcessing.View[0].Raise2 += 0.001*t ; + If (num == 3) +// We want to use mpeg_encode when num==3, so we set the width and +// height of the graphic window have to be multiple of 16! + General.Viewport2 = 320 ; + General.Viewport3 = 240 ; + EndIf + // It is possible to nest loops: - For num2 In {1:10} + For num2 In {1:50} General.Rotation0 += 10 ; General.Rotation1 = General.Rotation0 / 3 ; @@ -67,19 +74,20 @@ For num In {1:255} Sleep 0.01; // sleep for 0.01 second Draw; // draw the scene - EndFor + If ((num == 3) && (num2 < 10)) + Print Sprintf("t8-0%g.jpg", num2); // print the scene in a jpeg file + EndIf -// It is also possible make tests + If ((num == 3) && (num2 >= 10)) + Print Sprintf("t8-%g.jpg", num2); // print the scene in a jpeg file + EndIf - If (num < 10) + EndFor -// The Sprintf function permits to create complex strings using -// variables (since all Gmsh variables are treated internally as -// double precision numbers, the format should only contain valid -// double precision number format specifiers): - - Print Sprintf("t8-0%g.jpg", num); // print the scene in a jpeg file + If(num == 3) + // We make a system call to generate the mpeg + System "mpeg_encode t8.par" ; EndIf EndFor