442 fLimitFactorSize = 3;
464 fLimitFactorSize = 3;
465 latex.TLatex::Copy(*
this);
475 TAttLine::operator=(lt);
517 pad->
AbsPixeltoXY( cos_angle * (
x[
n]-xOrigin) + sin_angle * (
y[
n]-yOrigin) + xOrigin,
518 -sin_angle * (
x[
n]-xOrigin) + cos_angle * (
y[
n]-yOrigin) + yOrigin,
532 Rotate(pad, angle, 1, &xx, &yy);
540 return Analyse(0, 0, spec, t, length);
572 const char *tab[] = {
"alpha",
"beta",
"chi",
"delta",
"varepsilon",
"phi",
"gamma",
"eta",
"iota",
"varphi",
"kappa",
"lambda",
573 "mu",
"nu",
"omicron",
"pi",
"theta",
"rho",
"sigma",
"tau",
"upsilon",
"varomega",
"omega",
"xi",
"psi",
"zeta",
574 "Alpha",
"Beta",
"Chi",
"Delta",
"Epsilon",
"Phi",
"Gamma",
"Eta",
"Iota",
"vartheta",
575 "Kappa",
"Lambda",
"Mu",
"Nu",
"Omicron",
"Pi",
"Theta",
"Rho",
"Sigma",
"Tau",
576 "Upsilon",
"varsigma",
"Omega",
"Xi",
"Psi",
"Zeta",
"varUpsilon",
"epsilon"};
578 const char *
tab2[] = {
"leq",
"/",
"infty",
"voidb",
"club",
"diamond",
"heart",
579 "spade",
"leftrightarrow",
"leftarrow",
"uparrow",
"rightarrow",
580 "downarrow",
"circ",
"pm",
"doublequote",
"geq",
"times",
"propto",
581 "partial",
"bullet",
"divide",
"neq",
"equiv",
"approx",
"3dots",
582 "cbar",
"topbar",
"downleftarrow",
"aleph",
"Jgothic",
"Rgothic",
"voidn",
583 "otimes",
"oplus",
"oslash",
"cap",
"cup",
"supset",
"supseteq",
584 "notsubset",
"subset",
"subseteq",
"in",
"notin",
"angle",
"nabla",
585 "oright",
"ocopyright",
"trademark",
"prod",
"surd",
"upoint",
"corner",
"wedge",
586 "vee",
"Leftrightarrow",
"Leftarrow",
"Uparrow",
"Rightarrow",
587 "Downarrow",
"diamond",
"LT",
"void1",
"copyright",
"void3",
"sum",
588 "arctop",
"lbar",
"arcbottom",
"topbar",
"void8",
"bottombar",
"arcbar",
589 "ltbar",
"AA",
"aa",
"void06",
"GT",
"int",
"forall",
"exists" };
591 const char *
tab3[] = {
"bar",
"vec",
"dot",
"hat",
"ddot",
"acute",
"grave",
"check",
"tilde",
"slash"};
595 Int_t nBlancDeb = 0, nBlancFin = 0, l_nBlancDeb = 0, l_nBlancFin = 0;
608 if (nBlancDeb==l_nBlancDeb && nBlancFin==l_nBlancFin) cont =
kFALSE;
611 if (t[nBlancDeb]==
'{' && t[length-nBlancFin-1]==
'}') {
614 for(i=nBlancDeb;i<
length-nBlancFin;i++) {
615 if (t[i] ==
'{' && !(i>0 && t[i-1] ==
'@')) nBrackets++;
616 if (t[i] ==
'}' && t[i-1]!=
'@') nBrackets--;
617 if (nBrackets==0 && i<length-nBlancFin-2) {
633 l_nBlancDeb = nBlancDeb;
634 l_nBlancFin = nBlancFin;
639 length -= nBlancFin+nBlancDeb;
641 Error(
"Analyse",
"It seems there is a syntax error in the TLatex string");
645 strncpy(
text,t+nBlancDeb,length);
651 indiceSize = spec.fSize;
654 specNewSize.
fSize = indiceSize;
663 Int_t opCurlyCurly = -1;
664 Int_t opSquareCurly = -1;
665 Int_t opCloseCurly = -2;
673 Int_t opSquareBracket = 0 ;
674 Int_t opBigCurly = 0 ;
677 Int_t abovePlace = 0 ;
685 Int_t opBackslash = 0;
686 Int_t opParallel = 0;
687 Int_t opSplitLine = -1;
699 case '\'' : quote1 = !quote1 ;
break ;
700 case '"' : quote2 = !quote2 ;
break ;
706 if (!(i>0 &&
text[i-1] ==
'@')) nBrackets++;
711 if (!(i>0 &&
text[i-1] ==
'@')) nBrackets--;
713 if (i<length-1)
if (
text[i+1]==
'{' && opCurlyCurly==-1) opCurlyCurly=i;
715 if (
text[i+1]!=
'{' && !(
text[i+2]==
'{' && (
text[i+1]==
'^' ||
text[i+1]==
'_'))
716 && opCloseCurly==-2) opCloseCurly=i;
718 else if (i<length-1) {
719 if (
text[i+1]!=
'{' && opCloseCurly==-2) opCloseCurly=i;
721 else if (opCloseCurly==-2) opCloseCurly=i;
727 if (!(i>0 &&
text[i-1] ==
'@')) nCroch++;
732 if (!(i>0 &&
text[i-1] ==
'@')) nCroch--;
744 strncpy(buf,&
text[i],2);
745 if (strncmp(buf,
"^{",2)==0) {
746 if (opPower==-1 && nBrackets==0 && nCroch==0) opPower=i;
749 strncpy(buf1,&
text[i-4],4);
750 if (strncmp(buf1,
"#int",4)==0) {
752 if (i>4 && opCloseCurly==-2) opCloseCurly=i-5;
754 if (strncmp(buf1,
"#sum",4)==0) {
756 if (i>4 && opCloseCurly==-2) opCloseCurly=i-5;
760 if (strncmp(buf,
"_{",2)==0) {
761 if (opUnder==-1 && nBrackets==0 && nCroch==0) opUnder=i;
764 strncpy(buf2,&
text[i-4],4);
765 if (strncmp(buf2,
"#int",4)==0) {
767 if (i>4 && opCloseCurly==-2) opCloseCurly=i-5;
769 if (strncmp(buf2,
"#sum",4)==0) {
771 if (i>4 && opCloseCurly==-2) opCloseCurly=i-5;
775 if (strncmp(buf,
"]{",2)==0)
776 if (opSquareCurly==-1 && nBrackets==0 && nCroch==0) opSquareCurly=i;
779 if (
text[i]==
'\\' || (
text[i]==
'#' && !opFound && nBrackets==0 && nCroch==0)) {
783 strncpy(buf,&
text[i+1],10);
784 if (strncmp(buf,
"splitline{",10)==0) {
785 opSplitLine=i; opFound =
kTRUE;
786 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
792 strncpy(buf,&
text[i+1],9);
793 if (!opBackslash && strncmp(buf,
"backslash",9)==0) {
794 opBackslash=1; opFound =
kTRUE;
795 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
801 strncpy(buf,&
text[i+1],8);
802 if (!opParallel && strncmp(buf,
"parallel",8)==0) {
803 opParallel=1; opFound =
kTRUE;
804 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
810 strncpy(buf,&
text[i+1],6);
811 if (strncmp(buf,
"lower[",6)==0 || strncmp(buf,
"lower{",6)==0) {
812 opLower=i; opFound =
kTRUE;
813 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
816 if (strncmp(buf,
"scale[",6)==0 || strncmp(buf,
"scale{",6)==0) {
817 opScale=i; opFound =
kTRUE;
818 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
821 if (strncmp(buf,
"color[",6)==0 || strncmp(buf,
"color{",6)==0) {
822 opColor=i; opFound =
kTRUE;
823 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
829 strncpy(buf,&
text[i+1],5);
830 if (strncmp(buf,
"frac{",5)==0) {
831 opFrac=i; opFound =
kTRUE;
832 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
835 if (strncmp(buf,
"sqrt{",5)==0 || strncmp(buf,
"sqrt[",5)==0) {
836 opSqrt=i; opFound =
kTRUE;
837 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
840 if (strncmp(buf,
"font{",5)==0 || strncmp(buf,
"font[",5)==0) {
841 opFont=i; opFound =
kTRUE;
842 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
845 if (strncmp(buf,
"kern[",5)==0 || strncmp(buf,
"kern{",5)==0) {
846 opKern=i; opFound =
kTRUE;
847 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
850 if (!opMinus && strncmp(buf,
"minus",5)==0) {
851 opMinus=1; opFound =
kTRUE;
852 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
855 if (strncmp(buf,
"mbox[",5)==0 || strncmp(buf,
"mbox{",5)==0) {
856 opMbox=i; opFound =
kTRUE;
857 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
863 strncpy(buf,&
text[i+1],4);
864 if (!opOdot && strncmp(buf,
"odot",4)==0) {
865 opOdot=1; opFound =
kTRUE;
866 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
869 if (!opHbar && strncmp(buf,
"hbar",4)==0) {
870 opHbar=1; opFound =
kTRUE;
871 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
874 if (!opPerp && strncmp(buf,
"perp",4)==0) {
875 opPerp=1; opFound =
kTRUE;
876 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
879 if (!opPlus && strncmp(buf,
"plus",4)==0) {
880 opPlus=1; opFound =
kTRUE;
881 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
884 if (strncmp(buf,
"url[",4)==0 || strncmp(buf,
"url{",4)==0) {
885 opUrl=i; opFound =
kTRUE;
886 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
892 strncpy(buf,&
text[i+1],3);
894 if (strncmp(buf,
"[]{",3)==0) {
895 opSquareBracket=1; opFound =
kTRUE;
896 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
899 if (strncmp(buf,
"{}{",3)==0 ) {
900 opBigCurly=1; opFound =
kTRUE;
901 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
904 if (strncmp(buf,
"||{",3)==0) {
905 opAbs=1; opFound =
kTRUE;
906 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
909 if (strncmp(buf,
"(){",3)==0) {
910 opParen=1; opFound =
kTRUE;
911 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
914 if (!opBox && strncmp(buf,
"Box",3)==0) {
915 opBox=1; opFound =
kTRUE;
916 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
919 if (strncmp(buf,
"bf[",3)==0 || strncmp(buf,
"bf{",3)==0) {
920 opBf=i; opFound =
kTRUE;
921 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
924 if (strncmp(buf,
"it[",3)==0 || strncmp(buf,
"it{",3)==0) {
925 opIt=i; opFound =
kTRUE;
926 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
932 strncpy(buf,&
text[i+1],2);
933 if (!opMp && strncmp(buf,
"mp",2)==0) {
934 opMp=1; opFound =
kTRUE;
935 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
940 if (!opFound &&
UInt_t(length)>i+strlen(tab[k])) {
941 if (strncmp(&
text[i+1],tab[k],strlen(tab[k]))==0) {
944 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
949 if (!opFound &&
UInt_t(length)>i+strlen(
tab3[k])) {
953 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
960 if ((opSpec==-1 || strlen(
tab2[k])>lastsize) &&
UInt_t(length)>i+strlen(
tab2[k])) {
962 lastsize = strlen(
tab2[k]);
965 if (i>0 && opCloseCurly==-2) opCloseCurly=i-1;
978 if (opCloseCurly>-1 && opCloseCurly<length-1) {
981 fs2 =
Anal1(spec,
text+opCloseCurly+1,length-opCloseCurly-1);
985 Analyse(
x+fs1.Width(),
y,spec,
text+opCloseCurly+1,length-opCloseCurly-1);
991 else if (opPower>-1 && opUnder>-1) {
993 max = std::max(opPower,opUnder);
996 switch (abovePlace) {
998 prop = .8 ; propU = 1.75 ;
1001 prop = .9 ; propU = 1.75 ;
1010 if (min >= 2 && strncmp(&
text[min-2],
"{}",2)==0) {
1017 fs2 =
Anal1(specNewSize,
text+min+1,max-min-1);
1018 fs3 =
Anal1(specNewSize,
text+max+1,length-max-1);
1028 Double_t addW = fs1.Width()+xfpos, addH1, addH2;
1029 if (opPower<opUnder) {
1030 addH1 = -fs1.Over()*(
fFactorPos)-fs2.Under();
1034 addH2 = -fs1.Over()*(
fFactorPos)-fs3.Under();
1036 Analyse(
x+addW,
y+addH2,specNewSize,
text+max+1,length-max-1);
1039 Double_t addW1, addW2, addH1, addH2;
1040 Double_t m = std::max(fs1.Width(),std::max(fs2.Width(),fs3.Width()));
1041 pos = (
m-fs1.Width())/2;
1042 if (opPower<opUnder) {
1043 addH1 = -fs1.Over()*propU-fs2.Under();
1044 addW1 = (
m-fs2.Width())/2;
1045 addH2 = fs1.Under()*prop+fs3.Over();
1046 addW2 = (
m-fs3.Width())/2;
1048 addH1 = fs1.Under()*prop+fs2.Over();
1049 addW1 = (
m-fs2.Width())/2;
1050 addH2 = -fs1.Over()*propU-fs3.Under();
1051 addW2 = (
m-fs3.Width())/2;
1054 Analyse(
x+addW2,
y+addH2,specNewSize,
text+max+1,length-max-1);
1058 if (min >= 2 && strncmp(&
text[min-2],
"{}",2)==0) {
1067 if (opPower<opUnder) {
1068 result.Set(fs1.Width()+xfpos+std::max(fs2.Width(),fs3.Width()),
1070 fs1.Under()+fs3.Height()-fs3.Over()*(1-
fFactorPos));
1072 result.Set(fs1.Width()+xfpos+std::max(fs2.Width(),fs3.Width()),
1074 fs1.Under()+fs2.Height()-fs2.Over()*(1-
fFactorPos));
1077 if (opPower<opUnder) {
1078 result.Set(std::max(fs1.Width(),std::max(fs2.Width(),fs3.Width())),
1079 fs1.Over()*propU+fs2.Height(),fs1.Under()*prop+fs3.Height());
1081 result.Set(std::max(fs1.Width(),std::max(fs2.Width(),fs3.Width())),
1082 fs1.Over()*propU+fs3.Height(),fs1.Under()*prop+fs2.Height());
1086 else if (opPower>-1) {
1089 switch (abovePlace) {
1091 prop = 1.75 ;
break ;
1093 prop = 1.75;
break ;
1097 Int_t ltext = opPower ;
1098 if (ltext >= 2 && strncmp(&
text[ltext-2],
"{}",2)==0) {
1105 fs2 =
Anal1(specNewSize,
text+opPower+1,length-opPower-1);
1114 if (over <= 0) over = 1.5*fs2.Over();
1118 if (fs2.Width()>fs1.Width())
1119 pos=
Int_t((fs2.Width()-fs1.Width())/2);
1121 pos2=
Int_t((fs1.Width()-fs2.Width())/2);
1123 Analyse(
x+pos2,
y-fs1.Over()*prop-fs2.Under(),specNewSize,
text+opPower+1,length-opPower-1);
1125 if (opPower >= 2 && strncmp(&
text[opPower-2],
"{}",2)==0) {
1134 result.Set(fs1.Width()+xfpos+fs2.Width(),
1135 fs1.Over()*
fFactorPos+fs2.Over(),fs1.Under());
1137 result.Set(std::max(fs1.Width(),fs2.Width()),fs1.Over()*prop+fs2.Height(),fs1.Under());
1140 else if (opUnder>-1) {
1146 Int_t ltext = opUnder ;
1147 if (ltext >= 2 && strncmp(&
text[ltext-2],
"{}",2)==0) {
1154 fs2 =
Anal1(specNewSize,
text+opUnder+1,length-opUnder-1);
1162 Analyse(
x+fs1.Width()+xfpos,
y+fs1.Under()+fs2.Over()*fpos,specNewSize,
text+opUnder+1,length-opUnder-1);
1165 if (fs2.Width()>fs1.Width())
1166 pos=
Int_t((fs2.Width()-fs1.Width())/2);
1168 pos2=
Int_t((fs1.Width()-fs2.Width())/2);
1170 Analyse(
x+pos2,
y+fs1.Under()*prop+fs2.Over(),specNewSize,
text+opUnder+1,length-opUnder-1);
1172 if (opUnder >= 2 && strncmp(&
text[opUnder-2],
"{}",2)==0) {
1180 result.Set(fs1.Width()+xfpos+fs2.Width(),fs1.Over(),
1181 fs1.Under()+fs2.Under()+fs2.Over()*fpos);
1183 result.Set(std::max(fs1.Width(),fs2.Width()),fs1.Over(),fs1.Under()*prop+fs2.Height());
1285 Rotate(
gPad, spec.fAngle,
x+square,
y-1.25*square, xx, yy);
1306 else if (opBackslash) {
1324 else if (opParallel) {
1339 else if (opGreek>-1) {
1342 char letter = 97 + opGreek;
1344 if (opGreek>25) letter -= 58;
1345 if (opGreek == 52) letter =
'\241';
1346 if (opGreek == 53) letter =
'\316';
1348 fs1 =
Anal1(newSpec,&letter,1);
1349 fs2 =
Anal1(spec,
text+strlen(tab[opGreek])+1,length-strlen(tab[opGreek])-1);
1353 Analyse(
x+fs1.Width(),
y,spec,
text+strlen(tab[opGreek])+1,length-strlen(tab[opGreek])-1);
1360 else if (opSpec > -1) {
1363 char letter =
'\243' + opSpec;
1364 if(opSpec == 75 || opSpec == 76) {
1366 if (
gPad->GetPainter()->IsCocoa()) {
1367 if (opSpec == 75) letter =
'\201';
1368 if (opSpec == 76) letter =
'\214';
1370 if (opSpec == 75) letter =
'\305';
1371 if (opSpec == 76) letter =
'\345';
1374 if(opSpec == 80 || opSpec == 81) {
1375 if (opSpec == 80) letter =
'\042';
1376 if (opSpec == 81) letter =
'\044';
1383 newSpec.fSize = spec.fSize*props;
1384 }
else if (opSpec==79) {
1385 newSpec.fSize = spec.fSize*propi;
1388 fs1 =
Anal1(newSpec,&letter,1);
1389 if (opSpec == 79 || opSpec == 66)
1390 fs1.Set(fs1.Width(),fs1.Over()*0.45,fs1.Over()*0.45);
1397 if (opSpec!=66 && opSpec!=79)
1400 Analyse(
x,
y+fs1.Under()/2.,newSpec,&letter,1);
1405 else if (opAbove>-1) {
1416 xx[0] =
x; xx[1] =
x + fs1.Width();
1417 yy[0] = yy[1] =
y - sub - fs1.Over();
1424 midy =
y - sub - fs1.Over() - dd;
1425 xx[0] =
x; xx[1] =
x + fs1.Width();
1426 yy[0] = yy[1] = midy;
1428 xx[1] =
x + fs1.Width(); xx[0] = xx[2] = xx[1] - 2*dd;
1429 yy[0] = midy - dd; yy[1] = midy; yy[2] = midy + dd;
1435 midx =
x + fs1.Width()/2,
1436 midy =
y - sub - fs1.Over() - dd;
1437 Double_t xx[5] = { midx - dd, midx - dd, midx + dd, midx + dd, midx - dd },
1438 yy[5] = { midy + dd, midy - dd, midy - dd, midy + dd, midy + dd };
1444 xx[1] =
x + fs1.Width()/2;
1445 xx[0] = xx[1] - fs1.Width()/3;
1446 xx[2] = xx[1] + fs1.Width()/3;
1447 yy[0] =
y - sub - fs1.Over();
1448 yy[1] = yy[0] - 2*sub;
1455 midx =
x + fs1.Width()/2 - 1.5*sub,
1456 midy =
y - sub - fs1.Over() - dd;
1457 Double_t xx1[5] = { midx - dd, midx - dd, midx + dd, midx + dd, midx - dd },
1458 yy1[5] = { midy + dd, midy - dd, midy - dd, midy + dd, midy + dd };
1460 midx =
x + fs1.Width()/2 + 1.5*sub;
1461 Double_t xx2[5] = { midx - dd, midx - dd, midx + dd, midx + dd, midx - dd },
1462 yy2[5] = { midy + dd, midy - dd, midy - dd, midy + dd, midy + dd };
1468 xx[0] =
x + fs1.Width()/2; xx[1] = xx[0] + 3*sub;
1469 yy[0] =
y - sub - fs1.Over();
1470 yy[1] = yy[0] - 2.5*sub;
1476 xx[0] =
x + fs1.Width()/2 + sub; xx[1] = xx[0] - 2*sub;
1477 yy[0] =
y - sub - fs1.Over();
1478 yy[1] = yy[0] - 2*sub;
1484 xx[1] =
x+fs1.Width()/2; xx[0] = xx[1] - 2*sub; xx[2] = xx[1] + 2*sub;
1485 yy[1] =
y - sub - fs1.Over();
1486 yy[0] = yy[2] = yy[1] - 2*sub;
1491 Double_t x2 =
x+fs1.Width()/2, y2 =
y -fs1.Over();
1496 if (
auto ps =
gPad->GetPainter()->GetPS()) {
1497 if (!strstr(ps->GetTitle(),
"IMG"))
1500 ps->SetTextAlign(22);
1501 ps->Text(xx, yy,
"~");
1503 if (
gPad->GetPainter()->IsCocoa())
1519 xx[0] =
x + 0.8*fs1.Width();
1520 yy[0] =
y - fs1.Over() - sub;
1521 xx[1] =
x + 0.3*fs1.Width();
1522 yy[1] = yy[0] + fs1.Height() + 2*sub;
1529 if (opAbove==1) div=4;
1530 result.Set(fs1.Width(),fs1.Over()+
GetHeight()*spec.fSize/div,fs1.Under());
1532 else if (opSquareBracket) {
1544 DrawLine(
x+l2+fs1.Width()+2*
l,
y-fs1.Over(),
x+l2+fs1.Width()+2*
l,
y+fs1.Under(),spec);
1545 DrawLine(
x+l2+fs1.Width()+2*
l,
y-fs1.Over(),
x+l2+fs1.Width()+
l,
y-fs1.Over(),spec);
1546 DrawLine(
x+l2+fs1.Width()+2*
l,
y+fs1.Under(),
x+l2+fs1.Width()+
l,
y+fs1.Under(),spec);
1548 result.Set(fs1.Width()+3*
l,fs1.Over(),fs1.Under());
1552 Double_t radius2,radius1 , dw, l2 =
l/2 ;
1557 radius2 = fs1.Height() ;
1558 radius1 = radius2 * 2 / 3;
1562 radius2 = fs1.Height();
1563 radius1 = radius2 * 2 / 3;
1566 Double_t x2 =
x+5*l2+2*dw+fs1.Width()-radius1 ;
1567 Double_t y1 =
y - (fs1.Over() - fs1.Under())/2. ;
1573 result.Set(fs1.Width()+3*
l+2*dw,fs1.Over(),fs1.Under());
1585 DrawLine(
x+l2+fs1.Width()+2*
l,
y-fs1.Over(),
x+l2+fs1.Width()+2*
l,
y+fs1.Under(),spec);
1587 result.Set(fs1.Width()+3*
l,fs1.Over(),fs1.Under());
1589 else if (opBigCurly) {
1596 l8 = fs1.Height()/8 ;
1602 Double_t y2 =
y + (fs1.Under()-fs1.Over())/2 ;
1603 l8 = fs1.Height()/8 ;
1609 DrawLine(
x+l2+ltip,
y-fs1.Over(),
x+l2+ltip,y2-ltip,spec);
1610 DrawLine(
x+l2+ltip,y2+ltip,
x+l2+ltip,
y+fs1.Under(),spec);
1612 DrawLine(
x+l2+ltip,
y-fs1.Over(),
x+l2+ltip+
l,
y-fs1.Over(),spec);
1613 DrawLine(
x+l2+ltip,
y+fs1.Under(),
x+l2+ltip+
l,
y+fs1.Under(),spec);
1620 DrawLine(
x+l2+ltip+fs1.Width()+2*
l,
y-fs1.Over(),
x+l2+ltip+fs1.Width()+2*
l,y2-ltip,spec);
1621 DrawLine(
x+l2+ltip+fs1.Width()+2*
l,y2+ltip,
x+l2+ltip+fs1.Width()+2*
l,
y+fs1.Under(),spec);
1623 DrawLine(
x+l2+fs1.Width()+
l+ltip,
y-fs1.Over(),
x+l2+ltip+fs1.Width()+2*
l,
y-fs1.Over(),spec);
1624 DrawLine(
x+l2+fs1.Width()+
l+ltip,
y+fs1.Under(),
x+l2+ltip+fs1.Width()+2*
l,
y+fs1.Under(),spec);
1626 DrawLine(
x+l2+ltip+2*
l+fs1.Width(),y2-ltip,
x+l2+2*
l+2*ltip+fs1.Width(),y2,spec);
1627 DrawLine(
x+l2+ltip+2*
l+fs1.Width(),y2+ltip,
x+l2+2*
l+2*ltip+fs1.Width(),y2,spec);
1629 result.Set(fs1.Width()+3*
l+2*ltip,fs1.Over(),fs1.Under());
1631 else if (opFrac>-1) {
1632 if (opCurlyCurly==-1) {
1634 fError =
"Missing denominator for #frac";
1640 fs1 =
Anal1(spec,
text+opFrac+6,opCurlyCurly-opFrac-6);
1641 fs2 =
Anal1(spec,
text+opCurlyCurly+2,length-opCurlyCurly-3);
1648 if (fs1.Width()<fs2.Width()) {
1649 addW1 = (fs2.Width()-fs1.Width())/2;
1653 addW2 = (fs1.Width()-fs2.Width())/2;
1655 Analyse(
x+addW2,
y+fs2.Over()-height,spec,
text+opCurlyCurly+2,length-opCurlyCurly-3);
1656 Analyse(
x+addW1,
y-fs1.Under()-3*height,spec,
text+opFrac+6,opCurlyCurly-opFrac-6);
1658 DrawLine(
x,
y-2*height,
x+std::max(fs1.Width(),fs2.Width()),
y-2*height,spec);
1661 result.Set(std::max(fs1.Width(),fs2.Width()),fs1.Height()+3*height,fs2.Height()-height);
1664 else if (opSplitLine>-1) {
1665 if (opCurlyCurly==-1) {
1667 fError =
"Missing second line for #splitline";
1673 fs1 =
Anal1(spec,
text+opSplitLine+11,opCurlyCurly-opSplitLine-11);
1674 fs2 =
Anal1(spec,
text+opCurlyCurly+2,length-opCurlyCurly-3);
1680 Analyse(
x,
y+fs2.Over()-height,spec,
text+opCurlyCurly+2,length-opCurlyCurly-3);
1681 Analyse(
x,
y-fs1.Under()-3*height,spec,
text+opSplitLine+11,opCurlyCurly-opSplitLine-11);
1684 result.Set(std::max(fs1.Width(),fs2.Width()),fs1.Height()+3*height,fs2.Height()-height);
1687 else if (opSqrt>-1) {
1689 if (opSquareCurly>-1) {
1691 fs1 =
Anal1(specNewSize,
text+opSqrt+6,opSquareCurly-opSqrt-6);
1692 fs2 =
Anal1(spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1696 fs2.Over()+fs1.Height()+
GetHeight()*spec.fSize/4,fs2.Under());
1698 fs1 =
Anal1(spec,
text+opSqrt+5,length-opSqrt-5);
1700 result.Set(fs1.Width()+
GetHeight()*spec.fSize/2,fs1.Over()+
GetHeight()*spec.fSize/4,fs1.Under());
1703 if (opSquareCurly>-1) {
1711 Analyse(
x+pas2,
y,spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1712 Analyse(
x,
y-fs2.Over()-fs1.Under(),specNewSize,
text+opSqrt+6,opSquareCurly-opSqrt-6);
1715 DrawLine(
x+pas,y3,
x+pas2+fs2.Width(),y3,spec);
1732 DrawLine(x1-2*dx,y1,x1-dx,y2,spec);
1740 else if (opColor>-1) {
1741 if (opSquareCurly==-1) {
1743 fError =
"Missing color number. Syntax is #color[(Int_t)nb]{ ... }";
1749 strncpy(nb,
text+opColor+7,opSquareCurly-opColor-7);
1750 nb[opSquareCurly-opColor-7] = 0;
1751 if (sscanf(nb,
"%d",&newSpec.fColor) < 1) {
1754 fError =
"Invalid color number. Syntax is #color[(Int_t)nb]{ ... }";
1760 result =
Anal1(newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1762 Analyse(
x,
y,newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1765 else if (opUrl>-1) {
1766 if (opSquareCurly==-1) {
1768 fError =
"Missing url. Syntax is #url[http://...]{ ... }";
1774 strncpy(url,
text+opUrl+5,opSquareCurly-opUrl-5);
1778 result =
Anal1(newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1780 Analyse(
x,
y,newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1784 else if (opFont>-1) {
1785 if (opSquareCurly==-1) {
1787 fError =
"Missing font number. Syntax is #font[nb]{ ... }";
1793 strncpy(nb,
text+opFont+6,opSquareCurly-opFont-6);
1794 nb[opSquareCurly-opFont-6] = 0;
1795 if (sscanf(nb,
"%d",&newSpec.fFont) < 1) {
1798 fError =
"Invalid font number. Syntax is #font[(Int_t)nb]{ ... }";
1804 result =
Anal1(newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1806 Analyse(
x,
y,newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1809 else if (opKern>-1) {
1810 if (opSquareCurly==-1) {
1812 fError =
"Missing horizontal shift number. Syntax is #kern[dx]{ ... }";
1817 strncpy(dxc,
text+opKern+6,opSquareCurly-opKern-6);
1818 dxc[opSquareCurly-opKern-6] = 0;
1820 if (sscanf(dxc,
"%f",&dx) < 1) {
1823 fError =
"Invalid horizontal shift number. Syntax is #kern[(Float_t)dx]{ ... }";
1829 fs1 =
Anal1(spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1832 result =
TLatexFormSize(fs1.Width() + ddx, fs1.Over(), fs1.Under());
1836 Analyse(
x + ddx,
y,spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1839 else if (opLower>-1) {
1840 if (opSquareCurly==-1) {
1842 fError =
"Missing vertical shift number. Syntax is #lower[dy]{ ... }";
1847 strncpy(dyc,
text+opLower+7,opSquareCurly-opLower-7);
1848 dyc[opSquareCurly-opLower-7] = 0;
1850 if (sscanf(dyc,
"%f",&dy) < 1) {
1853 fError =
"Invalid vertical shift number. Syntax is #lower[(Float_t)dy]{ ... }";
1859 fs1 =
Anal1(spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1861 Double_t ddy = dy * (fs1.Over() + fs1.Under());
1862 result =
TLatexFormSize(fs1.Width(), fs1.Over() + ddy, fs1.Under() + ddy);
1865 Double_t ddy = dy * (fs1.Over() + fs1.Under());
1866 Analyse(
x,
y + ddy,spec,
text+opSquareCurly+1,length-opSquareCurly-1);
1869 else if (opScale>-1) {
1870 if (opSquareCurly==-1) {
1872 fError =
"Missing scale factor. Syntax is #scale[(Double_t)nb]{ ... }";
1878 strncpy(nb,
text+opScale+7,opSquareCurly-opScale-7);
1879 nb[opSquareCurly-opScale-7] = 0;
1880 if (sscanf(nb,
"%lf",&newSpec.fSize) < 1) {
1883 fError =
"Invalid scale factor. Syntax is #factor[(Double_t)nb]{ ... }";
1887 newSpec.fSize *= spec.fSize;
1890 result =
Anal1(newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1892 Analyse(
x,
y,newSpec,
text+opSquareCurly+1,length-opSquareCurly-1);
1897 Int_t lut[] = {3, 13, 1, 6, 7, 4, 5, 10, 11, 8, 9, 12, 2, 14, 15};
1898 Int_t fontId = (newSpec.fFont/10);
1899 if ((fontId >= 1) && (fontId <= (
Int_t)(
sizeof(lut)/
sizeof(lut[0])))) fontId = lut[fontId-1];
1900 newSpec.fFont = fontId*10 + newSpec.fFont%10;
1910 else if (opMbox>-1) {
1923 Int_t lut[] = {13, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 15, 1, 14, 12};
1924 Int_t fontId = (newSpec.fFont/10);
1925 if ((fontId >= 1) && (fontId <= (
Int_t)(
sizeof(lut)/
sizeof(lut[0])))) fontId = lut[fontId-1];
1926 newSpec.fFont = fontId*10 + newSpec.fFont%10;
1949 quote1 = quote2 =
kFALSE ;
1951 for (i=0 ; i<leng ; i++) {
1953 case '\'' : quote1 = !quote1 ;
break ;
1954 case '"' : quote2 = !quote2 ;
break ;
1957 if (
text[i] ==
'@') {
1959 if ( *(p+1) ==
'{' || *(p+1) ==
'}' || *(p+1) ==
'[' || *(p+1) ==
']') {
1974 else gPad->PaintText(xx, yy,
text);
2029 if (scale_width >= 1.) {
2030 TAttFill fill(spec.fColor, 1001);
2032 gPad->PaintFillArea(npoints, xx, yy,
"f");
2039 SetLineWidth(lineWidth > prevWidth ? lineWidth : prevWidth);
2045 gPad->PaintPolyLine(npoints, xx, yy);
2062 gPad->PaintLine(xx[0], yy[0], xx[1], yy[1]);
2075 const Int_t np = 40;
2082 for (
Int_t i = 0; i <= np; i++) {
2089 gPad->PaintPolyLine(np+1,
x,
y);
2105 const Int_t np = 40;
2112 for (
Int_t i = 0; i <= np; i++) {
2120 gPad->PaintPolyLine(np+1,
x,
y);
2150 if (
size<=0 || strlen(text1) <= 0)
return;
2154 auto ps =
gPad->GetPainter()->GetPS();
2156 if (ps && ps->InheritsFrom(
"TTeXDump")) {
2158 if (t.Index(
"#")>=0 || t.Index(
"^")>=0 || t.Index(
"\\")>=0) {
2159 t.ReplaceAll(
"#LT",
"\\langle");
2160 t.ReplaceAll(
"#GT",
"\\rangle");
2161 t.ReplaceAll(
"#club",
"\\clubsuit");
2162 t.ReplaceAll(
"#spade",
"\\spadesuit");
2163 t.ReplaceAll(
"#heart",
"\\heartsuit");
2164 t.ReplaceAll(
"#diamond",
"\\diamondsuit");
2165 t.ReplaceAll(
"#voidn",
"\\wp");
2166 t.ReplaceAll(
"#voidb",
"f");
2167 t.ReplaceAll(
"#ocopyright",
"\\copyright");
2168 t.ReplaceAll(
"#trademark",
"TM");
2169 t.ReplaceAll(
"#void3",
"TM");
2170 t.ReplaceAll(
"#oright",
"R");
2171 t.ReplaceAll(
"#void1",
"R");
2172 t.ReplaceAll(
"#3dots",
"\\ldots");
2173 t.ReplaceAll(
"#lbar",
"\\mid");
2174 t.ReplaceAll(
"#bar",
"\\wwbar");
2175 t.ReplaceAll(
"#void8",
"\\mid");
2176 t.ReplaceAll(
"#divide",
"\\div");
2177 t.ReplaceAll(
"#Jgothic",
"\\Im");
2178 t.ReplaceAll(
"#Rgothic",
"\\Re");
2179 t.ReplaceAll(
"#doublequote",
"\"");
2180 t.ReplaceAll(
"#plus",
"+");
2181 t.ReplaceAll(
"#minus",
"-");
2182 t.ReplaceAll(
"#/",
"/");
2183 t.ReplaceAll(
"#upoint",
".");
2184 t.ReplaceAll(
"#aa",
"\\mbox{\\aa}");
2185 t.ReplaceAll(
"#AA",
"\\mbox{\\AA}");
2187 t.ReplaceAll(
"#omicron",
"o");
2188 t.ReplaceAll(
"#Alpha",
"A");
2189 t.ReplaceAll(
"#Beta",
"B");
2190 t.ReplaceAll(
"#Epsilon",
"E");
2191 t.ReplaceAll(
"#Zeta",
"Z");
2192 t.ReplaceAll(
"#Eta",
"H");
2193 t.ReplaceAll(
"#Iota",
"I");
2194 t.ReplaceAll(
"#Kappa",
"K");
2195 t.ReplaceAll(
"#Mu",
"M");
2196 t.ReplaceAll(
"#Nu",
"N");
2197 t.ReplaceAll(
"#Omicron",
"O");
2198 t.ReplaceAll(
"#Rho",
"P");
2199 t.ReplaceAll(
"#Tau",
"T");
2200 t.ReplaceAll(
"#Chi",
"X");
2201 t.ReplaceAll(
"#varomega",
"\\varpi");
2203 t.ReplaceAll(
"#varUpsilon",
"?");
2204 t.ReplaceAll(
"#corner",
"?");
2205 t.ReplaceAll(
"#ltbar",
"?");
2206 t.ReplaceAll(
"#bottombar",
"?");
2207 t.ReplaceAll(
"#notsubset",
"?");
2208 t.ReplaceAll(
"#arcbottom",
"?");
2209 t.ReplaceAll(
"#cbar",
"?");
2210 t.ReplaceAll(
"#arctop",
"?");
2211 t.ReplaceAll(
"#topbar",
"?");
2212 t.ReplaceAll(
"#arcbar",
"?");
2213 t.ReplaceAll(
"#downleftarrow",
"?");
2214 t.ReplaceAll(
"#splitline",
"\\genfrac{}{}{0pt}{}");
2216 t.ReplaceAll(
"#",
"\\");
2217 t.ReplaceAll(
"%",
"\\%");
2219 ps->SetTextAngle(angle);
2220 ps->Text(
x,
y, t.Data());
2233 TString newText = text1;
2234 if(newText.
Length() == 0)
2240 Error(
"PaintLatex1",
"%s\n==> %s",
fError, text1);
2247 gPad->GetPainter()->SetTextAngle(angle);
2248 gPad->PaintText(
x,
y, text1);
2253 if (strstr(text1,
"\\")) {
2254 auto ps =
gPad->GetPainter()->GetPS();
2256 if (ps && (ps->InheritsFrom(
"TPDF") || ps->InheritsFrom(
"TSVG"))) {
2304 newSpec.fSize =
size;
2307 case 0:
y -= fs.Under();
break;
2309 case 2:
y += fs.Height()*0.5-fs.Under() + 1.;
break;
2310 case 3:
y += fs.Over();
break;
2313 case 2:
x -= fs.Width()/2;
break;
2314 case 3:
x -= fs.Width();
break;
2337 const Char_t *kWord1[] = {
"{}^{",
"{}_{",
"^{",
"_{",
"#scale{",
"#color{",
"#url{",
"#font{",
"#sqrt{",
"#[]{",
"#{}{",
"#||{",
2338 "#bar{",
"#vec{",
"#dot{",
"#hat{",
"#ddot{",
"#acute{",
"#grave{",
"#check{",
"#tilde{",
"#slash{",
"#bf{",
"#it{",
"#mbox{",
2339 "\\scale{",
"\\color{",
"\\font{",
"\\sqrt{",
"\\[]{",
"\\{}{",
"\\||{",
"#(){",
"\\(){",
2340 "\\bar{",
"\\vec{",
"\\dot{",
"\\hat{",
"\\ddot{",
"\\acute{",
"\\grave{",
"\\check{",
"\\bf{",
"\\it{",
"\\mbox{"};
2341 const Char_t *kWord2[] = {
"#scale[",
"#color[",
"#url[",
"#font[",
"#sqrt[",
"#kern[",
"#lower[",
"\\scale[",
"\\color[",
"\\font[",
"\\sqrt[",
"\\kern[",
"\\lower["};
2342 const Char_t *kWord3[] = {
"#frac{",
"\\frac{",
"#splitline{",
"\\splitline{"};
2343 const Char_t *kLeft1[] = {
"#left[",
"\\left[",
"#left{",
"\\left{",
"#left|",
"\\left|",
"#left(",
"\\left("};
2344 const Char_t *kLeft2[] = {
"#[]{",
"#[]{",
"#{}{",
"#{}{",
"#||{",
"#||{",
"#(){",
"#(){"};
2345 const Char_t *kRight[] = {
"#right]",
"\\right]",
"#right}",
"\\right}",
"#right|",
"\\right|",
"#right)",
"\\right)"};
2346 const Int_t lkWord1[] = {4,4,2,2,7,7,5,6,6,4,4,4,5,5,5,5,6,7,7,7,7,7,4,4,6,7,7,6,6,4,4,4,4,4,5,5,5,5,6,7,7,7,4,4,6};
2347 const Int_t lkWord2[] = {7,7,5,6,6,6,7,7,7,6,6,6,7} ;
2348 const Int_t lkWord3[] = {6,6,11,11} ;
2349 Int_t nkWord1 = 45, nkWord2 = 13, nkWord3 = 4;
2351 Int_t nLeft1 , nRight , nOfLeft, nOfRight;
2355 nLeft1 = nRight = 8 ;
2356 nOfLeft = nOfRight = 0 ;
2358 Char_t buf[11] ;
for (i=0;i<11;i++) buf[i]=0;
2363 Int_t nOfCurlyBracket, nOfKW1, nOfKW2, nOfKW3, nOfSquareCurly, nOfCurlyCurly ;
2364 Int_t nOfSquareBracket = 0 ;
2371 while (i < length) {
2376 for (k = 0 ; k < nLeft1 ; k++) {
2377 if (strncmp(buf,kLeft1[k],lLeft1)==0) {
2384 if (opFound) continue ;
2386 for(k=0;k<nRight;k++) {
2387 if (strncmp(buf,kRight[k],lRight)==0) {
2396 if (nOfLeft != nOfRight) {
2397 printf(
" nOfLeft = %d, nOfRight = %d\n",nOfLeft,nOfRight) ;
2399 fError =
"Operators \"#left\" and \"#right\" don't match !" ;
2403 for (k = 0 ; k < nLeft1 ; k++) {
2404 text.ReplaceAll(kLeft1[k],lLeft1,kLeft2[k],lLeft2) ;
2406 for (k = 0 ; k < nRight ; k++) {
2407 text.ReplaceAll(kRight[k],lRight,
"}",1) ;
2411 i = nOfCurlyBracket = nOfKW1 = nOfKW2 = nOfKW3 = nOfSquareCurly = nOfCurlyCurly =0 ;
2414 case '"' : quote1 = !quote1 ;
break ;
2415 case '\'': quote2 = !quote2 ;
break ;
2422 for(k=0;k<nkWord1;k++) {
2423 if (strncmp(buf,kWord1[k],lkWord1[k])==0) {
2431 if (opFound) continue ;
2433 for(k=0;k<nkWord2;k++) {
2434 if (strncmp(buf,kWord2[k],lkWord2[k])==0) {
2442 if (opFound) continue ;
2444 for(k=0;k<nkWord3;k++) {
2445 if (strncmp(buf,kWord3[k],lkWord3[k])==0) {
2454 if (opFound) continue ;
2455 if (strncmp(buf,
"}{",2) == 0 && opFrac) {
2460 else if (strncmp(buf,
"]{",2) == 0 && nOfSquareBracket) {
2464 nOfSquareBracket-- ;
2466 else if (strncmp(buf,
"@{",2) == 0 || strncmp(buf,
"@}",2) == 0) {
2469 else if (strncmp(buf,
"@[",2) == 0 || strncmp(buf,
"@]",2) == 0) {
2472 else if (
text[i] ==
']' ) {
2473 text.Insert(i,
"@") ;
2477 else if (
text[i] ==
'[' ) {
2478 text.Insert(i,
"@") ;
2482 else if (
text[i] ==
'{' ) {
2483 text.Insert(i,
"@") ;
2487 else if (
text[i] ==
'}' ) {
2488 if ( nOfCurlyBracket) {
2492 text.Insert(i,
"@") ;
2502 if (nOfKW2 != nOfSquareCurly) {
2504 fError =
"Invalid number of \"]{\"" ;
2506 else if (nOfKW3 != nOfCurlyCurly) {
2508 fError =
"Error in syntax of \"#frac\"" ;
2510 else if (nOfCurlyBracket < 0) {
2512 fError =
"Missing \"{\"" ;
2514 else if (nOfCurlyBracket > 0) {
2516 fError =
"Missing \"}\"" ;
2518 else if (nOfSquareBracket < 0) {
2520 fError =
"Missing \"[\"" ;
2522 else if (nOfSquareBracket > 0) {
2524 fError =
"Missing \"]\"" ;
2569 if (!
gPad)
return 0.;
2584 if (!
gPad)
return 0.;
2586 if( newText.
Length() == 0)
return 0;
2590 TMathText tm(0., 0., newText.
Data());
2606 return std::abs(
gPad->AbsPixeltoX(fs.Width()) -
gPad->AbsPixeltoX(0));
2616 if( newText.
Length() == 0)
return;
2620 TMathText tm(0., 0., newText.
Data());
2633 Int_t cBoxX[4], cBoxY[4];
2636 ptx =
gPad->UtoPixel(
fX);
2637 pty =
gPad->VtoPixel(
fY);
2643 Int_t x1 = cBoxX[0];
2644 Int_t x2 = cBoxX[0];
2645 Int_t y1 = cBoxY[0];
2646 Int_t y2 = cBoxY[0];
2647 for (
Int_t i=1; i<4; i++) {
2648 if (cBoxX[i] < x1) x1 = cBoxX[i];
2649 if (cBoxX[i] > x2) x2 = cBoxX[i];
2650 if (cBoxY[i] < y1) y1 = cBoxY[i];
2651 if (cBoxY[i] > y2) y2 = cBoxY[i];
2670 if (!
gPad)
return 0.;
2672 if( newText.
Length() == 0)
return 0;
2676 TMathText tm(0., 0., newText.
Data());
2692 return std::abs(
gPad->AbsPixeltoY(fs.Height()) -
gPad->AbsPixeltoY(0));
2701 Error(
"Readfs",
"No data in fTabSize stack");
2724 out,
Class(),
"tex",
2731 out <<
" tex->SetNDC();\n";
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void Copy(TAttLine &attline) const
virtual Float_t GetTextSize() const
Return the text size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual Short_t GetTextAlign() const
Return the text alignment.
virtual Font_t GetTextFont() const
Return the text font.
Float_t fTextAngle
Text angle.
virtual Color_t GetTextColor() const
Return the text color.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual Float_t GetTextAngle() const
Return the text angle.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Font_t fTextFont
Text font.
virtual Float_t GetTextSizePercent(Float_t size)
Return the text in percent of the pad size.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
void Copy(TAttText &atttext) const
virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
void Rotate(TVirtualPad *pad, Double_t angle, Int_t np, Double_t *x, Double_t *y)
Double_t GetHeight() const
void Copy(TObject &text) const override
Copy this to obj.
Double_t fFactorPos
! Relative position of subscripts and superscripts
Int_t fLimitFactorSize
lower bound for subscripts/superscripts size
void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const TextSpec_t &spec)
@ kTextNDC
The text position is in NDC coordinates.
void DrawParenthesis(Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, const TextSpec_t &spec)
std::vector< TLatexFormSize > fTabSize
! array of values for the different zones
Int_t PaintLatex1(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Double_t fOriginSize
Font size of the starting font.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
virtual void SetLimitIndiceSize(Int_t limitFactorSize)
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE) override
TLatex * DrawLatexNDC(Double_t x, Double_t y, const char *text)
void DrawCircle(Double_t x1, Double_t y1, Double_t r, const TextSpec_t &spec)
Bool_t fShow
! is true during the second pass (Painting)
virtual void SetIndiceSize(Double_t factorSize)
TLatexFormSize Anal1(const TextSpec_t &spec, const Char_t *t, Int_t length)
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TLatex & operator=(const TLatex &)
void DrawPolyLine(Int_t npoints, Double_t *xx, Double_t *yy, const TextSpec_t &spec, Double_t scale_width=0.)
TLatexFormSize FirstParse(Double_t angle, Double_t size, const Char_t *text)
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
TLatexFormSize Analyse(Double_t x, Double_t y, const TextSpec_t &spec, const Char_t *t, Int_t length)
Double_t fFactorSize
! Relative size of subscripts and superscripts
const Char_t * fError
! error code
Bool_t fItalic
! Currently inside italic operator
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
Int_t CheckLatexSyntax(TString &text)
void Savefs(TLatexFormSize *fs)
Double_t GetYsize()
Get Y size.
void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle=kFALSE) override
Get the text width and height.
Double_t GetXsize()
Get X size.
virtual void PaintMathText(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Paint text (used by Paint()).
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
@ kCanDelete
if object in a list can be deleted
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void GetControlBox(Int_t x, Int_t y, Double_t theta, Int_t cBoxX[4], Int_t cBoxY[4])
Double_t fY
Y position of text (left,center,etc..).
void Copy(TObject &text) const override
Copy this to obj.
TText & operator=(const TText &src)
virtual void SetNDC(Bool_t isNDC=kTRUE)
virtual void PaintText(Double_t x, Double_t y, const char *text)
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Double_t fX
X position of text (left,center,etc..).
virtual void GetTextAscentDescent(UInt_t &a, UInt_t &d, const char *text) const
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void AbsPixeltoXY(Double_t xpixel, Double_t ypixel, Double_t &x, Double_t &y)=0
virtual void XYtoAbsPixel(Double_t x, Double_t y, Int_t &xpixel, Int_t &ypixel) const =0
__device__ AFloat max(AFloat x, AFloat y)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
BVH_ALWAYS_INLINE T length(const Vec< T, N > &v)
TLatex helper struct holding the attributes of a piece of text.