18 class TLatex :
public TText,
public TAttLine {
25 Double_t fAngle,fSize;
32 Double_t fWidth, fOver, fUnder;
39 class TLatexFormSize {
41 Double_t fWidth{0}, fOver{0}, fUnder{0};
44 TLatexFormSize() =
default;
45 TLatexFormSize(Double_t x, Double_t y1, Double_t y2) : fWidth(x), fOver(y1), fUnder(y2) { }
48 TLatexFormSize operator+(TLatexFormSize f)
49 {
return TLatexFormSize(f.Width()+fWidth,TMath::Max(f.Over(),fOver),TMath::Max(f.Under(),fUnder)); }
50 void operator+=(TLatexFormSize f)
51 { fWidth += f.Width(); fOver = TMath::Max(fOver,f.Over()); fUnder = TMath::Max(fUnder,f.Under()); }
53 inline void Set(Double_t x, Double_t y1, Double_t y2) { fWidth=x; fOver=y1; fUnder=y2; }
54 TLatexFormSize AddOver(TLatexFormSize f)
55 {
return TLatexFormSize(f.Width()+fWidth,f.Height()+fOver,fUnder); }
56 TLatexFormSize AddUnder(TLatexFormSize f)
57 {
return TLatexFormSize(f.Width()+fWidth,fOver,f.Height()+fUnder); }
58 TLatexFormSize AddOver(TLatexFormSize f1, TLatexFormSize f2)
59 {
return TLatexFormSize(fWidth+TMath::Max(f1.Width(),f2.Width()),fOver+f1.Over(),fUnder+f2.Under()); }
62 inline Double_t Width()
const {
return fWidth; }
63 inline Double_t Over()
const {
return fOver; }
64 inline Double_t Under()
const {
return fUnder; }
65 inline Double_t Height()
const {
return fOver+fUnder; }
70 Int_t fLimitFactorSize;
79 TLatex& operator=(
const TLatex&);
82 TLatexFormSize Analyse(Double_t x, Double_t y, TextSpec_t spec,
const Char_t* t,Int_t length);
83 TLatexFormSize Anal1(TextSpec_t spec,
const Char_t* t,Int_t length);
85 void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TextSpec_t spec);
86 void DrawCircle(Double_t x1, Double_t y1, Double_t r, TextSpec_t spec);
87 void DrawParenthesis(Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, TextSpec_t spec);
89 TLatexFormSize FirstParse(Double_t angle, Double_t size,
const Char_t *text);
91 Int_t PaintLatex1(Double_t x, Double_t y, Double_t angle, Double_t size,
const char *text);
93 void Savefs(TLatexFormSize *fs);
94 TLatexFormSize Readfs();
96 Int_t CheckLatexSyntax(TString &text) ;
105 TLatex(Double_t x, Double_t y,
const char *text);
106 TLatex(
const TLatex &text);
108 void Copy(TObject &text)
const;
110 TLatex *DrawLatex(Double_t x, Double_t y,
const char *text);
111 TLatex *DrawLatexNDC(Double_t x, Double_t y,
const char *text);
113 Double_t GetHeight()
const;
116 void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle = kFALSE);
117 virtual void Paint(Option_t *option=
"");
118 virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size,
const char *text);
120 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
121 virtual void SetIndiceSize(Double_t factorSize);
122 virtual void SetLimitIndiceSize(Int_t limitFactorSize);