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

TextAttributes

parent f0063eb1
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,7 @@ SyncModel return tSyncModel;
T2 return tText2D;
T3 return tText3D;
TextAttributes return tTextAttributes;
TIME return tTime;
Transfinite return tTransfinite;
Transf[qQ]uad[tT]ri return tTransfQuadTri;
......
This diff is collapsed.
......@@ -78,106 +78,107 @@
tStrPrefix = 295,
tStrRelative = 296,
tStrFind = 297,
tBoundingBox = 298,
tDraw = 299,
tToday = 300,
tSyncModel = 301,
tCreateTopology = 302,
tCreateTopologyNoHoles = 303,
tDistanceFunction = 304,
tDefineConstant = 305,
tPoint = 306,
tCircle = 307,
tEllipse = 308,
tLine = 309,
tSphere = 310,
tPolarSphere = 311,
tSurface = 312,
tSpline = 313,
tVolume = 314,
tCharacteristic = 315,
tLength = 316,
tParametric = 317,
tElliptic = 318,
tRefineMesh = 319,
tPlane = 320,
tRuled = 321,
tTransfinite = 322,
tComplex = 323,
tPhysical = 324,
tCompound = 325,
tPeriodic = 326,
tUsing = 327,
tPlugin = 328,
tDegenerated = 329,
tRotate = 330,
tTranslate = 331,
tSymmetry = 332,
tDilate = 333,
tExtrude = 334,
tLevelset = 335,
tRecombine = 336,
tSmoother = 337,
tSplit = 338,
tDelete = 339,
tCoherence = 340,
tIntersect = 341,
tMeshAlgorithm = 342,
tLayers = 343,
tHole = 344,
tAlias = 345,
tAliasWithOptions = 346,
tQuadTriDbl = 347,
tQuadTriSngl = 348,
tRecombLaterals = 349,
tTransfQuadTri = 350,
tText2D = 351,
tText3D = 352,
tInterpolationScheme = 353,
tTime = 354,
tCombine = 355,
tBSpline = 356,
tBezier = 357,
tNurbs = 358,
tNurbsOrder = 359,
tNurbsKnots = 360,
tColor = 361,
tColorTable = 362,
tFor = 363,
tIn = 364,
tEndFor = 365,
tIf = 366,
tEndIf = 367,
tExit = 368,
tAbort = 369,
tField = 370,
tReturn = 371,
tCall = 372,
tFunction = 373,
tShow = 374,
tHide = 375,
tGetValue = 376,
tGetEnv = 377,
tGetString = 378,
tHomology = 379,
tCohomology = 380,
tBetti = 381,
tGMSH_MAJOR_VERSION = 382,
tGMSH_MINOR_VERSION = 383,
tGMSH_PATCH_VERSION = 384,
tAFFECTDIVIDE = 385,
tAFFECTTIMES = 386,
tAFFECTMINUS = 387,
tAFFECTPLUS = 388,
tOR = 389,
tAND = 390,
tNOTEQUAL = 391,
tEQUAL = 392,
tGREATEROREQUAL = 393,
tLESSOREQUAL = 394,
UNARYPREC = 395,
tMINUSMINUS = 396,
tPLUSPLUS = 397
tTextAttributes = 298,
tBoundingBox = 299,
tDraw = 300,
tToday = 301,
tSyncModel = 302,
tCreateTopology = 303,
tCreateTopologyNoHoles = 304,
tDistanceFunction = 305,
tDefineConstant = 306,
tPoint = 307,
tCircle = 308,
tEllipse = 309,
tLine = 310,
tSphere = 311,
tPolarSphere = 312,
tSurface = 313,
tSpline = 314,
tVolume = 315,
tCharacteristic = 316,
tLength = 317,
tParametric = 318,
tElliptic = 319,
tRefineMesh = 320,
tPlane = 321,
tRuled = 322,
tTransfinite = 323,
tComplex = 324,
tPhysical = 325,
tCompound = 326,
tPeriodic = 327,
tUsing = 328,
tPlugin = 329,
tDegenerated = 330,
tRotate = 331,
tTranslate = 332,
tSymmetry = 333,
tDilate = 334,
tExtrude = 335,
tLevelset = 336,
tRecombine = 337,
tSmoother = 338,
tSplit = 339,
tDelete = 340,
tCoherence = 341,
tIntersect = 342,
tMeshAlgorithm = 343,
tLayers = 344,
tHole = 345,
tAlias = 346,
tAliasWithOptions = 347,
tQuadTriDbl = 348,
tQuadTriSngl = 349,
tRecombLaterals = 350,
tTransfQuadTri = 351,
tText2D = 352,
tText3D = 353,
tInterpolationScheme = 354,
tTime = 355,
tCombine = 356,
tBSpline = 357,
tBezier = 358,
tNurbs = 359,
tNurbsOrder = 360,
tNurbsKnots = 361,
tColor = 362,
tColorTable = 363,
tFor = 364,
tIn = 365,
tEndFor = 366,
tIf = 367,
tEndIf = 368,
tExit = 369,
tAbort = 370,
tField = 371,
tReturn = 372,
tCall = 373,
tFunction = 374,
tShow = 375,
tHide = 376,
tGetValue = 377,
tGetEnv = 378,
tGetString = 379,
tHomology = 380,
tCohomology = 381,
tBetti = 382,
tGMSH_MAJOR_VERSION = 383,
tGMSH_MINOR_VERSION = 384,
tGMSH_PATCH_VERSION = 385,
tAFFECTDIVIDE = 386,
tAFFECTTIMES = 387,
tAFFECTMINUS = 388,
tAFFECTPLUS = 389,
tOR = 390,
tAND = 391,
tNOTEQUAL = 392,
tEQUAL = 393,
tGREATEROREQUAL = 394,
tLESSOREQUAL = 395,
UNARYPREC = 396,
tMINUSMINUS = 397,
tPLUSPLUS = 398
};
#endif
......@@ -201,7 +202,7 @@ typedef union YYSTYPE
/* Line 1685 of yacc.c */
#line 205 "Gmsh.tab.hpp"
#line 206 "Gmsh.tab.hpp"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
......
......@@ -107,6 +107,7 @@ struct doubleXstring{
%token tAtan tAtan2 tSinh tCosh tTanh tFabs tFloor tCeil
%token tFmod tModulo tHypot tList
%token tPrintf tError tSprintf tStrCat tStrPrefix tStrRelative tStrFind
%token tTextAttributes
%token tBoundingBox tDraw tToday tSyncModel tCreateTopology tCreateTopologyNoHoles
%token tDistanceFunction tDefineConstant
%token tPoint tCircle tEllipse tLine tSphere tPolarSphere tSurface tSpline tVolume
......@@ -4242,6 +4243,30 @@ FExpr_Single :
$$ = 0.;
Free($3); Free($5);
}
| tTextAttributes '(' RecursiveListOfStringExprVar ')'
{
int align = 0, font = 0, fontsize = CTX::instance()->glFontSize;
if(List_Nbr($3) % 2){
yyerror("Number of text attributes should be even");
}
else{
for(int i = 0 ; i < List_Nbr($3); i += 2){
char *s1, *s2; List_Read($3, i, &s1); List_Read($3, i + 1, &s2);
std::string key(s1), val(s2);
Free(s1); Free(s2);
#if defined(HAVE_OPENGL)
if(key == "Font")
font = drawContext::global()->getFontIndex(val.c_str());
else if(key == "FontSize")
fontsize = atoi(val.c_str());
else if(key == "Align")
align = drawContext::global()->getFontAlign(val.c_str());
#endif
}
}
List_Delete($3);
$$ = (double)((align<<16)|(font<<8)|(fontsize));
}
;
VExpr :
......
This diff is collapsed.
......@@ -979,6 +979,7 @@ parsing of the script file:
@var{built-in-function} |
@var{real-option} |
StrFind(@var{char-expression}, @var{char-expression}) |
TextAttributes(@var{char-expression}<,@var{char-expression}@dots>)|
GetValue("@var{string}", @var{expression})
@end example
......@@ -992,7 +993,8 @@ in @ref{Operators}. For the definition of @w{@var{built-in-function}s},
see @ref{Built-in functions}. The various @w{@var{real-option}s} are
listed in @ref{Options}. @code{StrFind} searches the first
@var{char-expression} for any occurrence of the second
@var{char-expression}.
@var{char-expression}. @code{TextAttributes} creates attributes for text
strings.
The last case in the definition allows to ask the user for a value
interactively. For example, inserting @code{GetValue("Value of parameter
......
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