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

*** empty log message ***

parent ba43440b
No related branches found
No related tags found
No related merge requests found
/* $Id: Context.cpp,v 1.18 2000-12-08 11:16:34 geuzaine Exp $ */ /* $Id: Context.cpp,v 1.19 2000-12-09 17:33:39 geuzaine Exp $ */
#include "Gmsh.h" #include "Gmsh.h"
#include "Const.h" #include "Const.h"
...@@ -285,7 +285,6 @@ void Init_Colors(int num){ ...@@ -285,7 +285,6 @@ void Init_Colors(int num){
void Init_Context(void){ void Init_Context(void){
// Cannot be set by the user // Cannot be set by the user
CTX.script = 0 ;
CTX.expose = 0 ; CTX.expose = 0 ;
CTX.db = 1 ; CTX.db = 1 ;
CTX.overlay = 1 ; CTX.overlay = 1 ;
......
/* $Id: Context.h,v 1.17 2000-12-08 11:16:34 geuzaine Exp $ */ /* $Id: Context.h,v 1.18 2000-12-09 17:33:39 geuzaine Exp $ */
#ifndef _CONTEXT_H_ #ifndef _CONTEXT_H_
#define _CONTEXT_H_ #define _CONTEXT_H_
...@@ -55,7 +55,6 @@ typedef struct{ ...@@ -55,7 +55,6 @@ typedef struct{
class Context_T { class Context_T {
public : public :
int script; /* gmsh in script mode */
int interactive; /* 0=full gfx; -1=just parse; 1,2,3=batch mesh */ int interactive; /* 0=full gfx; -1=just parse; 1,2,3=batch mesh */
int verbosity; /* 0=silent -> 3=debug */ int verbosity; /* 0=silent -> 3=debug */
int expose; /* 1 if everything is ready to expose and draw */ int expose; /* 1 if everything is ready to expose and draw */
......
/* $Id: Options.h,v 1.3 2000-12-05 20:02:12 geuzaine Exp $ */ /* $Id: Options.h,v 1.4 2000-12-09 17:33:39 geuzaine Exp $ */
#ifndef _OPTIONS_H_ #ifndef _OPTIONS_H_
#define _OPTIONS_H_ #define _OPTIONS_H_
...@@ -30,8 +30,8 @@ StringXString PostProcessingOptions_String[] = { ...@@ -30,8 +30,8 @@ StringXString PostProcessingOptions_String[] = {
} ; } ;
StringXString PrintOptions_String[] = { StringXString PrintOptions_String[] = {
{ "Font" , &CTX.print.font , "Courier" }, { "PrintFont" , &CTX.print.font , "Courier" },
{ NULL , NULL , NULL } { NULL , NULL , NULL }
} ; } ;
// NUMBERS // NUMBERS
...@@ -134,10 +134,10 @@ StringXNumber PostProcessingOptions_Number[] = { ...@@ -134,10 +134,10 @@ StringXNumber PostProcessingOptions_Number[] = {
} ; } ;
StringXNumber PrintOptions_Number[] = { StringXNumber PrintOptions_Number[] = {
{ "Type" , GMSH_INT, (void*)&CTX.print.type , PRINT_GL2PS_SIMPLE }, { "Type" , GMSH_INT, (void*)&CTX.print.type , PRINT_GL2PS_SIMPLE },
{ "Format" , GMSH_INT, (void*)&CTX.print.format , FORMAT_EPS }, { "Format" , GMSH_INT, (void*)&CTX.print.format , FORMAT_EPS },
{ "FontSize" , GMSH_INT, (void*)&CTX.print.font_size , 12. }, { "FontSize" , GMSH_INT, (void*)&CTX.print.font_size , 12. },
{ NULL , GMSH_DOUBLE, NULL , 0. } { NULL , GMSH_DOUBLE, NULL , 0. }
} ; } ;
// ARRAYS // ARRAYS
......
%{ /* $Id: Gmsh.l,v 1.18 2000-12-09 15:21:17 geuzaine Exp $ */ %{ /* $Id: Gmsh.l,v 1.19 2000-12-09 17:33:39 geuzaine Exp $ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -114,7 +114,6 @@ Delete return tDelete; ...@@ -114,7 +114,6 @@ Delete return tDelete;
Dilate return tDilate; Dilate return tDilate;
Duplicata return tDuplicata; Duplicata return tDuplicata;
Draw return tDraw; Draw return tDraw;
Sleep return tSleep;
Exp return tExp ; Exp return tExp ;
Ellipsis return tEllipsis; Ellipsis return tEllipsis;
...@@ -128,7 +127,6 @@ Fmod return tFmod ; ...@@ -128,7 +127,6 @@ Fmod return tFmod ;
Hypot return tHypot ; Hypot return tHypot ;
Include return tInclude;
In return tIn; In return tIn;
Knots return tKnots; Knots return tKnots;
...@@ -163,11 +161,10 @@ Rand return tRand; ...@@ -163,11 +161,10 @@ Rand return tRand;
Sqrt return tSqrt ; Sqrt return tSqrt ;
Sin return tSin ; Sin return tSin ;
Sinh return tSinh ; Sinh return tSinh ;
Save return tPhysical;
Spline return tSpline; Spline return tSpline;
Surface return tSurface; Surface return tSurface;
Symmetry return tSymmetry; Symmetry return tSymmetry;
Script return tScript; Sprintf return tSprintf ;
Transfinite return tTransfinite; Transfinite return tTransfinite;
Translate return tTranslate; Translate return tTranslate;
......
This diff is collapsed.
...@@ -36,8 +36,8 @@ typedef union { ...@@ -36,8 +36,8 @@ typedef union {
#define tModulo 283 #define tModulo 283
#define tHypot 284 #define tHypot 284
#define tPrintf 285 #define tPrintf 285
#define tDraw 286 #define tSprintf 286
#define tSleep 287 #define tDraw 287
#define tPoint 288 #define tPoint 288
#define tCircle 289 #define tCircle 289
#define tEllipsis 290 #define tEllipsis 290
...@@ -64,109 +64,107 @@ typedef union { ...@@ -64,109 +64,107 @@ typedef union {
#define tExtrude 311 #define tExtrude 311
#define tDuplicata 312 #define tDuplicata 312
#define tLoop 313 #define tLoop 313
#define tInclude 314 #define tRecombine 314
#define tRecombine 315 #define tDelete 315
#define tDelete 316 #define tCoherence 316
#define tCoherence 317 #define tView 317
#define tView 318 #define tAttractor 318
#define tAttractor 319 #define tLayers 319
#define tLayers 320 #define tScalarTetrahedron 320
#define tScalarTetrahedron 321 #define tVectorTetrahedron 321
#define tVectorTetrahedron 322 #define tTensorTetrahedron 322
#define tTensorTetrahedron 323 #define tScalarTriangle 323
#define tScalarTriangle 324 #define tVectorTriangle 324
#define tVectorTriangle 325 #define tTensorTriangle 325
#define tTensorTriangle 326 #define tScalarLine 326
#define tScalarLine 327 #define tVectorLine 327
#define tVectorLine 328 #define tTensorLine 328
#define tTensorLine 329 #define tScalarPoint 329
#define tScalarPoint 330 #define tVectorPoint 330
#define tVectorPoint 331 #define tTensorPoint 331
#define tTensorPoint 332 #define tBSpline 332
#define tBSpline 333 #define tNurbs 333
#define tNurbs 334 #define tOrder 334
#define tOrder 335 #define tWith 335
#define tWith 336 #define tBounds 336
#define tBounds 337 #define tKnots 337
#define tKnots 338 #define tColor 338
#define tColor 339 #define tFor 339
#define tFor 340 #define tIn 340
#define tIn 341 #define tEndFor 341
#define tEndFor 342 #define tExit 342
#define tScript 343 #define tMerge 343
#define tExit 344 #define tReturn 344
#define tMerge 345 #define tCall 345
#define tReturn 346 #define tFunction 346
#define tCall 347 #define tB_SPLINE_SURFACE_WITH_KNOTS 347
#define tFunction 348 #define tB_SPLINE_CURVE_WITH_KNOTS 348
#define tB_SPLINE_SURFACE_WITH_KNOTS 349 #define tCARTESIAN_POINT 349
#define tB_SPLINE_CURVE_WITH_KNOTS 350 #define tTRUE 350
#define tCARTESIAN_POINT 351 #define tFALSE 351
#define tTRUE 352 #define tUNSPECIFIED 352
#define tFALSE 353 #define tU 353
#define tUNSPECIFIED 354 #define tV 354
#define tU 355 #define tEDGE_CURVE 355
#define tV 356 #define tVERTEX_POINT 356
#define tEDGE_CURVE 357 #define tORIENTED_EDGE 357
#define tVERTEX_POINT 358 #define tPLANE 358
#define tORIENTED_EDGE 359 #define tFACE_OUTER_BOUND 359
#define tPLANE 360 #define tEDGE_LOOP 360
#define tFACE_OUTER_BOUND 361 #define tADVANCED_FACE 361
#define tEDGE_LOOP 362 #define tVECTOR 362
#define tADVANCED_FACE 363 #define tDIRECTION 363
#define tVECTOR 364 #define tAXIS2_PLACEMENT_3D 364
#define tDIRECTION 365 #define tISO 365
#define tAXIS2_PLACEMENT_3D 366 #define tENDISO 366
#define tISO 367 #define tENDSEC 367
#define tENDISO 368 #define tDATA 368
#define tENDSEC 369 #define tHEADER 369
#define tDATA 370 #define tFILE_DESCRIPTION 370
#define tHEADER 371 #define tFILE_SCHEMA 371
#define tFILE_DESCRIPTION 372 #define tFILE_NAME 372
#define tFILE_SCHEMA 373 #define tMANIFOLD_SOLID_BREP 373
#define tFILE_NAME 374 #define tCLOSED_SHELL 374
#define tMANIFOLD_SOLID_BREP 375 #define tADVANCED_BREP_SHAPE_REPRESENTATION 375
#define tCLOSED_SHELL 376 #define tFACE_BOUND 376
#define tADVANCED_BREP_SHAPE_REPRESENTATION 377 #define tCYLINDRICAL_SURFACE 377
#define tFACE_BOUND 378 #define tCONICAL_SURFACE 378
#define tCYLINDRICAL_SURFACE 379 #define tCIRCLE 379
#define tCONICAL_SURFACE 380 #define tTRIMMED_CURVE 380
#define tCIRCLE 381 #define tGEOMETRIC_SET 381
#define tTRIMMED_CURVE 382 #define tCOMPOSITE_CURVE_SEGMENT 382
#define tGEOMETRIC_SET 383 #define tCONTINUOUS 383
#define tCOMPOSITE_CURVE_SEGMENT 384 #define tCOMPOSITE_CURVE 384
#define tCONTINUOUS 385 #define tTOROIDAL_SURFACE 385
#define tCOMPOSITE_CURVE 386 #define tPRODUCT_DEFINITION 386
#define tTOROIDAL_SURFACE 387 #define tPRODUCT_DEFINITION_SHAPE 387
#define tPRODUCT_DEFINITION 388 #define tSHAPE_DEFINITION_REPRESENTATION 388
#define tPRODUCT_DEFINITION_SHAPE 389 #define tELLIPSE 389
#define tSHAPE_DEFINITION_REPRESENTATION 390 #define tTrimmed 390
#define tELLIPSE 391 #define tSolid 391
#define tTrimmed 392 #define tEndSolid 392
#define tSolid 393 #define tVertex 393
#define tEndSolid 394 #define tFacet 394
#define tVertex 395 #define tNormal 395
#define tFacet 396 #define tOuter 396
#define tNormal 397 #define tLoopSTL 397
#define tOuter 398 #define tEndLoop 398
#define tLoopSTL 399 #define tEndFacet 399
#define tEndLoop 400 #define tAND 400
#define tEndFacet 401 #define tOR 401
#define tAND 402 #define tNOTEQUAL 402
#define tOR 403 #define tEQUAL 403
#define tNOTEQUAL 404 #define tAPPROXEQUAL 404
#define tEQUAL 405 #define tAFFECTPLUS 405
#define tAPPROXEQUAL 406 #define tAFFECTMINUS 406
#define tAFFECTPLUS 407 #define tAFFECTTIMES 407
#define tAFFECTMINUS 408 #define tAFFECTDIVIDE 408
#define tAFFECTTIMES 409 #define tLESSOREQUAL 409
#define tAFFECTDIVIDE 410 #define tGREATEROREQUAL 410
#define tLESSOREQUAL 411 #define tCROSSPRODUCT 411
#define tGREATEROREQUAL 412 #define UNARYPREC 412
#define tCROSSPRODUCT 413 #define tPLUSPLUS 413
#define UNARYPREC 414 #define tMINUSMINUS 414
#define tPLUSPLUS 415
#define tMINUSMINUS 416
extern YYSTYPE yylval; extern YYSTYPE yylval;
%{ /* $Id: Gmsh.y,v 1.33 2000-12-09 15:21:17 geuzaine Exp $ */ %{ /* $Id: Gmsh.y,v 1.34 2000-12-09 17:33:39 geuzaine Exp $ */
#include <stdarg.h> #include <stdarg.h>
...@@ -76,20 +76,20 @@ void vyyerror (char *fmt, ...); ...@@ -76,20 +76,20 @@ void vyyerror (char *fmt, ...);
%token tEND tAFFECT tDOTS tPi %token tEND tAFFECT tDOTS tPi
%token tExp tLog tLog10 tSqrt tSin tAsin tCos tAcos tTan tRand %token tExp tLog tLog10 tSqrt tSin tAsin tCos tAcos tTan tRand
%token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil %token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil
%token tFmod tModulo tHypot tPrintf tDraw tSleep %token tFmod tModulo tHypot tPrintf tSprintf tDraw
%token tPoint tCircle tEllipsis tLine tSurface tSpline tVolume %token tPoint tCircle tEllipsis tLine tSurface tSpline tVolume
%token tCharacteristic tLength tParametric tElliptic %token tCharacteristic tLength tParametric tElliptic
%token tPlane tRuled tTransfinite tComplex tPhysical %token tPlane tRuled tTransfinite tComplex tPhysical
%token tUsing tBump tProgression %token tUsing tBump tProgression
%token tRotate tTranslate tSymmetry tDilate tExtrude tDuplicata %token tRotate tTranslate tSymmetry tDilate tExtrude tDuplicata
%token tLoop tInclude tRecombine tDelete tCoherence %token tLoop tRecombine tDelete tCoherence
%token tView tAttractor tLayers %token tView tAttractor tLayers
%token tScalarTetrahedron tVectorTetrahedron tTensorTetrahedron %token tScalarTetrahedron tVectorTetrahedron tTensorTetrahedron
%token tScalarTriangle tVectorTriangle tTensorTriangle %token tScalarTriangle tVectorTriangle tTensorTriangle
%token tScalarLine tVectorLine tTensorLine %token tScalarLine tVectorLine tTensorLine
%token tScalarPoint tVectorPoint tTensorPoint %token tScalarPoint tVectorPoint tTensorPoint
%token tBSpline tNurbs tOrder tWith tBounds tKnots %token tBSpline tNurbs tOrder tWith tBounds tKnots
%token tColor tFor tIn tEndFor tScript tExit tMerge %token tColor tFor tIn tEndFor tExit tMerge
%token tReturn tCall tFunction %token tReturn tCall tFunction
%token tB_SPLINE_SURFACE_WITH_KNOTS %token tB_SPLINE_SURFACE_WITH_KNOTS
...@@ -108,11 +108,12 @@ void vyyerror (char *fmt, ...); ...@@ -108,11 +108,12 @@ void vyyerror (char *fmt, ...);
%type <d> FExpr FExpr_Single %type <d> FExpr FExpr_Single
%type <v> VExpr VExpr_Single %type <v> VExpr VExpr_Single
%type <i> BoolExpr
%type <u> ColorExpr
%type <c> StringExpr
%type <l> ListOfShapes Duplicata Transform MultipleShape %type <l> ListOfShapes Duplicata Transform MultipleShape
%type <l> ListOfStrings ListOfDouble ListOfListOfDouble ListOfColor %type <l> ListOfStrings ListOfDouble ListOfListOfDouble ListOfColor
%type <s> Shape %type <s> Shape
%type <i> BoolExpr
%type <u> Color
/* A VERFIFIER ! Je n'ai pas le bouquin sous les yeux */ /* A VERFIFIER ! Je n'ai pas le bouquin sous les yeux */
...@@ -380,7 +381,6 @@ GeomFormat : ...@@ -380,7 +381,6 @@ GeomFormat :
| Extrude { return 1; } | Extrude { return 1; }
| Transfini { return 1; } | Transfini { return 1; }
| Coherence { return 1; } | Coherence { return 1; }
| Macro { return 1; }
| Loop {return 1;} | Loop {return 1;}
/* | Script { return 1; }*/ /* | Script { return 1; }*/
| Command { return 1; } | Command { return 1; }
...@@ -1231,7 +1231,7 @@ Affectation : ...@@ -1231,7 +1231,7 @@ Affectation :
/* -------- Option Colors -------- */ /* -------- Option Colors -------- */
| tSTRING '.' tColor '.' tSTRING tAFFECT Color tEND | tSTRING '.' tColor '.' tSTRING tAFFECT ColorExpr tEND
{ {
if(!(pColCat = Get_ColorOptionCategory($1))) if(!(pColCat = Get_ColorOptionCategory($1)))
vyyerror("Unknown Color Option Class '%s'", $1); vyyerror("Unknown Color Option Class '%s'", $1);
...@@ -1621,98 +1621,116 @@ Delete : ...@@ -1621,98 +1621,116 @@ Delete :
; ;
/* ----------- /* -----------------
M A C R O C O M M A N D
----------- */ ----------------- */
Command :
tSTRING StringExpr tEND
{
if(!strcmp($1, "Include")){
yyinTab[RecursionLevel++] = yyin;
strcpy(tmpstring, ThePathForIncludes);
if((yyin = fopen(strcat(tmpstring,$2),"r"))){
strcpy(yynameTab[RecursionLevel-1],yyname);
yylinenoTab[RecursionLevel-1]=yylineno;
yylineno=1;
strcpy(yyname,$2);
while(!feof(yyin)){
yyparse();
}
fclose(yyin);
yyin = yyinTab[--RecursionLevel];
strcpy(yyname,yynameTab[RecursionLevel]);
yylineno = yylinenoTab[RecursionLevel];
}
else{
vyyerror("Unknown File '%s'", $2) ;
yyin = yyinTab[--RecursionLevel];
}
}
else if(!strcmp($1, "Print")){
if(!CTX.interactive){ // we're in interactive mode
char ext[6];
strcpy(ext,$2+(strlen($2)-4));
Replot();
extern void CreateImage (char *name, FILE *fp);
FILE *fp = 0;
if(!strcmp(ext,".gif")){
fp = fopen($2,"wb");
CTX.print.type = PRINT_GL2GIF;
}
else if(!strcmp(ext,".eps")){
fp = fopen($2,"w");
CTX.print.type = PRINT_GL2PS_RECURSIVE;
}
else if(!strcmp(ext,".xpm")){
fp = fopen($2,"wb");
CTX.print.type = PRINT_XDUMP;
CTX.print.format = FORMAT_XPM;
}
if(fp){
CreateImage($2,fp);
fclose(fp);
}
}
}
else if(!strcmp($1, "Merge")){
Macro : FILE *ff = yyin;
tInclude tBIGSTR tEND MergeProblem($2);
yyin = ff;
}
else if(!strcmp($1, "Save")){
Print_Mesh(THEM, $2, CTX.mesh.format);
}
else
vyyerror("Unknown Command '%s'", $1);
}
| tSTRING FExpr tEND
{ {
yyinTab[RecursionLevel++] = yyin; if(!strcmp($1, "Sleep")){
strcpy(tmpstring, ThePathForIncludes);
if((yyin = fopen(strcat(tmpstring,$2),"r"))){ extern long Get_AnimTime();
strcpy(yynameTab[RecursionLevel-1],yyname); long sleep_time = Get_AnimTime();
yylinenoTab[RecursionLevel-1]=yylineno; while(1){
yylineno=1; if(Get_AnimTime() - sleep_time > (long)($2*1.e6)) break;
strcpy(yyname,$2);
while(!feof(yyin)){
yyparse();
} }
fclose(yyin);
yyin = yyinTab[--RecursionLevel];
strcpy(yyname,yynameTab[RecursionLevel]);
yylineno = yylinenoTab[RecursionLevel];
} }
else{ else if(!strcmp($1, "Mesh")){
vyyerror("Unknown File '%s'", $2) ;
yyin = yyinTab[--RecursionLevel]; Maillage_Dimension_0(THEM);
mai3d(THEM,(int)$2);
}
else
vyyerror("Unknown Command '%s'", $1);
}
| tExit tEND
{
exit(0);
}
| tDraw tEND
{
if(!CTX.interactive){ // we're in interactive mode
if(Tree_Nbr(THEM->Points) != Last_NumberOfPoints){
Last_NumberOfPoints = Tree_Nbr(THEM->Points);
Replot();
}
else{
Init();
Draw();
}
} }
} }
;
/* -----------------
C O M M A N D
----------------- */
Command :
tPrintf tBIGSTR tEND
{
if(!CTX.interactive){ // we're in interactive mode
char ext[6];
strcpy(ext,$2+(strlen($2)-4));
Replot();
extern void CreateImage (FILE *fp);
FILE *fp = 0;
if(!strcmp(ext,".gif")){
fp = fopen($2,"wb");
CTX.print.type = PRINT_GL2GIF;
}
else if(!strcmp(ext,".eps")){
fp = fopen($2,"w");
CTX.print.type = PRINT_GL2PS_RECURSIVE;
}
else if(!strcmp(ext,".xpm")){
fp = fopen($2,"wb");
CTX.print.type = PRINT_XDUMP;
CTX.print.format = FORMAT_XPM;
}
if(fp){
CreateImage(fp);
fclose(fp);
}
}
}
| tExit tEND
{
exit(0);
}
| tMerge tBIGSTR tEND
{
FILE *ff = yyin;
MergeProblem($2);
yyin = ff;
}
| tDraw tEND
{
if(!CTX.interactive){ // we're in interactive mode
if(Tree_Nbr(THEM->Points) != Last_NumberOfPoints){
Last_NumberOfPoints = Tree_Nbr(THEM->Points);
Replot();
}
else{
Init();
Draw();
}
}
}
| tSleep FExpr tEND
{
extern long Get_AnimTime();
long sleep_time = Get_AnimTime();
while(1){
if(Get_AnimTime() - sleep_time > (long)($2*1.e6)) break;
}
}
; ;
/* --------------- /* ---------------
...@@ -1844,18 +1862,6 @@ Loop : ...@@ -1844,18 +1862,6 @@ Loop :
skip_until("Return"); skip_until("Return");
} }
; ;
/* ---------------
S C R I P T
---------------
Script :
tScript '(' FExpr ')' '{' GeomFormatList '}' tEND
{
// here put something to close the script which
// number is (int) $3
}
;
*/
/* --------------- /* ---------------
...@@ -2492,7 +2498,7 @@ RecursiveListOfDouble : ...@@ -2492,7 +2498,7 @@ RecursiveListOfDouble :
} }
; ;
Color : ColorExpr :
'{' FExpr ',' FExpr ',' FExpr ',' FExpr '}' '{' FExpr ',' FExpr ',' FExpr ',' FExpr '}'
{ {
$$ = PACK_COLOR((int)$2, (int)$4, (int)$6, (int)$8); $$ = PACK_COLOR((int)$2, (int)$4, (int)$6, (int)$8);
...@@ -2553,7 +2559,7 @@ ListOfColor : ...@@ -2553,7 +2559,7 @@ ListOfColor :
; ;
RecursiveListOfColor : RecursiveListOfColor :
Color ColorExpr
{ {
if(!ListOfColor_L) if(!ListOfColor_L)
ListOfColor_L = List_Create(256,10,sizeof(unsigned int)) ; ListOfColor_L = List_Create(256,10,sizeof(unsigned int)) ;
...@@ -2561,12 +2567,24 @@ RecursiveListOfColor : ...@@ -2561,12 +2567,24 @@ RecursiveListOfColor :
List_Reset(ListOfColor_L) ; List_Reset(ListOfColor_L) ;
List_Add(ListOfColor_L, &($1)) ; List_Add(ListOfColor_L, &($1)) ;
} }
| RecursiveListOfColor ',' Color | RecursiveListOfColor ',' ColorExpr
{ {
List_Add(ListOfColor_L, &($3)) ; List_Add(ListOfColor_L, &($3)) ;
} }
; ;
StringExpr :
tBIGSTR
{
$$ = $1;
}
| tSprintf '(' tBIGSTR ',' FExpr ')'
{
sprintf(tmpstring, $3, $5);
$$ = (char*)Malloc(strlen(tmpstring));
strcpy($$, tmpstring);
}
;
%% %%
......
This diff is collapsed.
/* $Id: CbFile.cpp,v 1.10 2000-12-08 11:16:55 geuzaine Exp $ */ /* $Id: CbFile.cpp,v 1.11 2000-12-09 17:33:40 geuzaine Exp $ */
#include <unistd.h> #include <unistd.h>
...@@ -24,15 +24,15 @@ extern Widgets_T WID; ...@@ -24,15 +24,15 @@ extern Widgets_T WID;
extern Mesh M; extern Mesh M;
static int WARNING_OVERRIDE = 0; static int WARNING_OVERRIDE = 0;
static char KeepFileName[256];
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* C r e a t e I m a g e */ /* C r e a t e I m a g e */
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
void SaveToDisk (char *FileName, Widget warning, void SaveToDisk (char *FileName, Widget warning,
void (*function)(FILE *file)){ void (*function)(char *filename, FILE *file)){
FILE *fp ; FILE *fp ;
static char KeepFileName[256];
if(!WARNING_OVERRIDE){ if(!WARNING_OVERRIDE){
fp = fopen(FileName,"r"); fp = fopen(FileName,"r");
...@@ -54,14 +54,14 @@ void SaveToDisk (char *FileName, Widget warning, ...@@ -54,14 +54,14 @@ void SaveToDisk (char *FileName, Widget warning,
return; return;
} }
function(fp); function(KeepFileName, fp);
fclose(fp); fclose(fp);
WARNING_OVERRIDE = 0; WARNING_OVERRIDE = 0;
} }
void CreateImage (FILE *fp) { void CreateImage (char *name, FILE *fp) {
FILE *tmp; FILE *tmp;
GLint size3d; GLint size3d;
char cmd[1000]; char cmd[1000];
...@@ -79,14 +79,14 @@ void CreateImage (FILE *fp) { ...@@ -79,14 +79,14 @@ void CreateImage (FILE *fp) {
tmp = fopen(tmpFileName,"w"); tmp = fopen(tmpFileName,"w");
Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), tmp); Window_Dump(XCTX.display, XCTX.scrnum, XtWindow(WID.G.glw), tmp);
fclose(tmp); fclose(tmp);
sprintf(cmd, "xpr -device ps -gray 4 %s >%s", tmpFileName, KeepFileName); sprintf(cmd, "xpr -device ps -gray 4 %s >%s", tmpFileName, name);
Msg(INFOS, "Executing '%s'", cmd); Msg(INFOS, "Executing '%s'", cmd);
system(cmd); system(cmd);
unlink(tmpFileName); unlink(tmpFileName);
break; break;
} }
Msg(INFOS, "X Image Dump Complete '%s'", KeepFileName); Msg(INFOS, "XPM Creation Complete '%s'", name);
Msg (INFO, "Wrote File '%s'", KeepFileName); Msg (INFO, "Wrote File '%s'", name);
break ; break ;
case PRINT_GL2GIF : case PRINT_GL2GIF :
...@@ -94,8 +94,8 @@ void CreateImage (FILE *fp) { ...@@ -94,8 +94,8 @@ void CreateImage (FILE *fp) {
Replot(); Replot();
create_gif(fp, CTX.viewport[2]-CTX.viewport[0], create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]); CTX.viewport[3]-CTX.viewport[1]);
Msg(INFOS, "GIF Dump Complete '%s'", KeepFileName); Msg(INFOS, "GIF Creation Complete '%s'", name);
Msg (INFO, "Wrote File '%s'", KeepFileName); Msg (INFO, "Wrote File '%s'", name);
break; break;
case PRINT_GL2PS_SIMPLE : case PRINT_GL2PS_SIMPLE :
...@@ -115,8 +115,8 @@ void CreateImage (FILE *fp) { ...@@ -115,8 +115,8 @@ void CreateImage (FILE *fp) {
CTX.stream = TO_SCREEN ; CTX.stream = TO_SCREEN ;
res = gl2psEndPage(); res = gl2psEndPage();
} }
Msg(INFOS, "GL2PS Output Complete '%s'", KeepFileName); Msg(INFOS, "EPS Creation Complete '%s'", name);
Msg (INFO, "Wrote File '%s'", KeepFileName); Msg (INFO, "Wrote File '%s'", name);
break; break;
default : default :
......
/* $Id: Main.cpp,v 1.26 2000-12-08 22:17:48 geuzaine Exp $ */ /* $Id: Main.cpp,v 1.27 2000-12-09 17:33:40 geuzaine Exp $ */
#include <signal.h> #include <signal.h>
...@@ -46,7 +46,6 @@ char gmsh_help[] = ...@@ -46,7 +46,6 @@ char gmsh_help[] =
" -0 parse input files, output flattened geometry, and exit\n" " -0 parse input files, output flattened geometry, and exit\n"
"Mesh options:\n" "Mesh options:\n"
" -1, -2, -3 perform batch 1D, 2D and 3D mesh generation\n" " -1, -2, -3 perform batch 1D, 2D and 3D mesh generation\n"
// " -script gmsh in script mode\n"
" -format msh|unv|gref set output mesh format (default: msh)\n" " -format msh|unv|gref set output mesh format (default: msh)\n"
" -algo iso|aniso select 2D mesh algorithm (default: iso)\n" " -algo iso|aniso select 2D mesh algorithm (default: iso)\n"
" -smooth int set mesh smoothing (default: 0)\n" " -smooth int set mesh smoothing (default: 0)\n"
...@@ -209,9 +208,6 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { ...@@ -209,9 +208,6 @@ void Get_Options (int argc, char *argv[], int *nbfiles) {
else if(!strcmp(argv[i]+1, "3")){ else if(!strcmp(argv[i]+1, "3")){
CTX.interactive = 3; i++; CTX.interactive = 3; i++;
} }
else if(!strcmp(argv[i]+1, "script")){
CTX.script = 1; i++;
}
else if(!strcmp(argv[i]+1, "path")){ else if(!strcmp(argv[i]+1, "path")){
i++; i++;
/* we need to make a copy because of bison */ /* we need to make a copy because of bison */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment