ROOT
Version master
master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
v6.04
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
eval.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// \notebook -js
4
/// This macro produces the flowchart of TFormula::Eval.
5
///
6
/// \macro_image
7
/// \macro_code
8
///
9
/// \author Rene Brun
10
11
void
eval()
12
{
13
14
TCanvas
*
c1
=
new
TCanvas
(
"c1"
);
15
c1
->Range(0, 0, 20, 10);
16
TPaveLabel
*
pt1
=
new
TPaveLabel
(0.2, 4, 3, 6,
"Eval"
);
17
pt1
->SetTextSize(0.5);
18
pt1
->SetFillColor(42);
19
pt1
->Draw();
20
TPaveText
*
pt2
=
new
TPaveText
(4.5, 4, 7.8, 6);
21
pt2
->Draw();
22
TText
*
t1
=
pt2
->AddText(
"Read Operator"
);
23
TText
*
t2
=
pt2
->AddText(
"number i"
);
24
TPaveText
*
pt3
=
new
TPaveText
(9, 3.5, 17.5, 6.5);
25
TText
*
t4
=
pt3
->AddText(
"Apply Operator to current stack values"
);
26
TText
*
t5
=
pt3
->AddText(
"Example: if operator +"
);
27
TText
*
t6
=
pt3
->AddText(
"value[i] += value[i-1]"
);
28
t4
->SetTextAlign(22);
29
t5
->SetTextAlign(22);
30
t6
->SetTextAlign(22);
31
t5
->SetTextColor(4);
32
t6
->SetTextColor(2);
33
pt3
->Draw();
34
TPaveLabel
*
pt4
=
new
TPaveLabel
(4, 0.5, 12, 2.5,
"return result = value[i]"
);
35
pt4
->Draw();
36
TArrow
*
ar1
=
new
TArrow
(6, 4, 6, 2.7, 0.02,
"|>"
);
37
ar1
->Draw();
38
TText
*
t7
=
new
TText
(6.56, 2.7,
"if i = number of stack elements"
);
39
t7
->SetTextSize(0.04);
40
t7
->Draw();
41
ar1
->DrawArrow(6, 8, 6, 6.2, 0.02,
"|>"
);
42
TLine
*
l1
=
new
TLine
(12, 6.6, 12, 8);
43
l1
->Draw();
44
l1
->DrawLine(12, 8, 6, 8);
45
ar1
->DrawArrow(3, 5, 4.4, 5, 0.02,
"|>"
);
46
ar1
->DrawArrow(7.8, 5, 8.9, 5, 0.02,
"|>"
);
47
}
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TArrow
Draw all kinds of Arrows.
Definition
TArrow.h:29
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TLine
Use the TLine constructor to create a simple line.
Definition
TLine.h:22
TPaveLabel
A Pave (see TPave) with a text centered in the Pave.
Definition
TPaveLabel.h:20
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition
TPaveText.h:21
TText
Base class for several text objects.
Definition
TText.h:22
c1
return c1
Definition
legend1.C:41
t1
auto * t1
Definition
textangle.C:20
tutorials
visualisation
graphics
eval.C
ROOT master - Reference Guide Generated on Mon Feb 17 2025 15:03:49 (GVA Time) using Doxygen 1.10.0