Loading [MathJax]/extensions/tex2jax.js
ROOT
6.10/09
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
<
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
<
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
w
x
+
Enumerations
a
e
f
g
m
p
t
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
w
+
All Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
v
w
x
y
z
+
Macros
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tutorials
graphics
eval.C File Reference
Tutorials
»
Graphics tutorials
Detailed Description
This macro produces the flowchart of
TFormula::Eval
.
void
eval(){
TCanvas
*c1 =
new
TCanvas
(
"c1"
);
c1->
Range
(0,0,20,10);
TPaveLabel
*pt1 =
new
TPaveLabel
(0.2,4,3,6,
"Eval"
);
pt1->
SetTextSize
(0.5);
pt1->
SetFillColor
(42);
pt1->
Draw
();
TPaveText
*pt2 =
new
TPaveText
(4.5,4,7.8,6);
pt2->
Draw
();
TText
*t1 = pt2->
AddText
(
"Read Operator"
);
TText
*t2 = pt2->
AddText
(
"number i"
);
TPaveText
*pt3 =
new
TPaveText
(9,3.5,17.5,6.5);
TText
*t4 = pt3->
AddText
(
"Apply Operator to current stack values"
);
TText
*t5 = pt3->
AddText
(
"Example: if operator +"
);
TText
*t6 = pt3->
AddText
(
"value[i] += value[i-1]"
);
t4->
SetTextAlign
(22);
t5->
SetTextAlign
(22);
t6->
SetTextAlign
(22);
t5->
SetTextColor
(4);
t6->
SetTextColor
(2);
pt3->
Draw
();
TPaveLabel
*pt4 =
new
TPaveLabel
(4,0.5,12,2.5,
"return result = value[i]"
);
pt4->
Draw
();
TArrow
*ar1 =
new
TArrow
(6,4,6,2.7,0.02,
"|>"
);
ar1->
Draw
();
TText
*t7 =
new
TText
(6.56,2.7,
"if i = number of stack elements"
);
t7->
SetTextSize
(0.04);
t7->
Draw
();
ar1->
DrawArrow
(6,8,6,6.2,0.02,
"|>"
);
TLine
*l1 =
new
TLine
(12,6.6,12,8);
l1->
Draw
();
l1->
DrawLine
(12,8,6,8);
ar1->
DrawArrow
(3,5,4.4,5,0.02,
"|>"
);
ar1->
DrawArrow
(7.8,5,8.9,5,0.02,
"|>"
);
}
Author
Rene Brun
Definition in file
eval.C
.