ROOT logo

From $ROOTSYS/tutorials/graphics/analyze.C

{
   //
   //This macro produces the flowchart of TFormula::Analyze
   //Author: Rene Brun
   
   gROOT->Reset();
   c1 = new TCanvas("c1","Analyze.mac",620,790);
   c1->Range(-1,0,19,30);
   TPaveLabel pl1(0,27,3.5,29,"Analyze");
   pl1.SetFillColor(42);
   pl1.Draw();
   TPaveText pt1(0,22.8,4,25.2);
   TText *t1=pt1.AddText("Parenthesis matching");
   TText *t2=pt1.AddText("Remove unnecessary");
   TText *t2a=pt1.AddText("parenthesis");
   pt1.Draw();
   TPaveText pt2(6,23,10,25);
   TText *t3=pt2.AddText("break of");
   TText *t4=pt2.AddText("Analyze");
   pt2.Draw();
   TPaveText pt3(0,19,4,21);
   TText *t4=pt3.AddText("look for simple");
   TText *t5=pt3.AddText("operators");
   pt3.Draw();
   TPaveText pt4(0,15,4,17);
   TText *t6=pt4.AddText("look for an already");
   TText *t7=pt4.AddText("defined expression");
   pt4.Draw();
   TPaveText pt5(0,11,4,13);
   TText *t8=pt5.AddText("look for usual");
   TText *t9=pt5.AddText("functions :cos sin ..");
   pt5.Draw();
   TPaveText pt6(0,7,4,9);
   TText *t10=pt6.AddText("look for a");
   TText *t11=pt6.AddText("numeric value");
   pt6.Draw();
   TPaveText pt7(6,18.5,10,21.5);
   TText *t12=pt7.AddText("Analyze left and");
   TText *t13=pt7.AddText("right part of");
   TText *t14=pt7.AddText("the expression");
   pt7.Draw();
   TPaveText pt8(6,15,10,17);
   TText *t15=pt8.AddText("Replace expression");
   pt8.Draw();
   TPaveText pt9(6,11,10,13);
   TText *t16=pt9.AddText("Analyze");
   pt9.SetFillColor(42);
   pt9.Draw();
   TPaveText pt10(6,7,10,9);
   TText *t17=pt10.AddText("Error");
   TText *t18=pt10.AddText("Break of Analyze");
   pt10.Draw();
   TPaveText pt11(14,22,17,24);
   pt11.SetFillColor(42);
   TText *t19=pt11.AddText("Analyze");
   TText *t19a=pt11.AddText("Left");
   pt11.Draw();
   TPaveText pt12(14,19,17,21);
   pt12.SetFillColor(42);
   TText *t20=pt12.AddText("Analyze");
   TText *t20a=pt12.AddText("Right");
   pt12.Draw();
   TPaveText pt13(14,15,18,18);
   TText *t21=pt13.AddText("StackNumber++");
   TText *t22=pt13.AddText("operator[StackNumber]");
   TText *t23=pt13.AddText("= operator found");
   pt13.Draw();
   TPaveText pt14(12,10.8,17,13.2);
   TText *t24=pt14.AddText("StackNumber++");
   TText *t25=pt14.AddText("operator[StackNumber]");
   TText *t26=pt14.AddText("= function found");
   pt14.Draw();
   TPaveText pt15(6,7,10,9);
   TText *t27=pt15.AddText("Error");
   TText *t28=pt15.AddText("break of Analyze");
   pt15.Draw();
   TPaveText pt16(0,2,7,5);
   TText *t29=pt16.AddText("StackNumber++");
   TText *t30=pt16.AddText("operator[StackNumber] = 0");
   TText *t31=pt16.AddText("value[StackNumber] = value found");
   pt16.Draw();
   TArrow ar(2,27,2,25.4,0.012,"|>");
   ar.SetFillColor(1);
   ar.Draw();
   ar.DrawArrow(2,22.8,2,21.2,0.012,"|>");
   ar.DrawArrow(2,19,2,17.2,0.012,"|>");
   ar.DrawArrow(2,15,2,13.2,0.012,"|>");
   ar.DrawArrow(2,11,2, 9.2,0.012,"|>");
   ar.DrawArrow(2, 7,2, 5.2,0.012,"|>");
   ar.DrawArrow(4,24,6,24,0.012,"|>");
   ar.DrawArrow(4,20,6,20,0.012,"|>");
   ar.DrawArrow(4,16,6,16,0.012,"|>");
   ar.DrawArrow(4,12,6,12,0.012,"|>");
   ar.DrawArrow(4, 8,6, 8,0.012,"|>");
   ar.DrawArrow(10,20,14,20,0.012,"|>");
   ar.DrawArrow(12,23,14,23,0.012,"|>");
   ar.DrawArrow(12,16.5,14,16.5,0.012,"|>");
   ar.DrawArrow(10,12,12,12,0.012,"|>");
   TText ta(2.2,22.2,"err = 0");
   ta.SetTextFont(71);
   ta.SetTextSize(0.015);
   ta.SetTextColor(4);
   ta.SetTextAlign(12);
   ta.Draw();
   ta.DrawText(2.2,18.2,"not found");
   ta.DrawText(2.2,6.2,"found");
   TText tb(4.2,24.1,"err != 0");
   tb.SetTextFont(71);
   tb.SetTextSize(0.015);
   tb.SetTextColor(4);
   tb.SetTextAlign(11);
   tb.Draw();
   tb.DrawText(4.2,20.1,"found");
   tb.DrawText(4.2,16.1,"found");
   tb.DrawText(4.2,12.1,"found");
   tb.DrawText(4.2, 8.1,"not found");
   TLine l1(12,16.5,12,23);
   l1.Draw();
}
 analyze.C:1
 analyze.C:2
 analyze.C:3
 analyze.C:4
 analyze.C:5
 analyze.C:6
 analyze.C:7
 analyze.C:8
 analyze.C:9
 analyze.C:10
 analyze.C:11
 analyze.C:12
 analyze.C:13
 analyze.C:14
 analyze.C:15
 analyze.C:16
 analyze.C:17
 analyze.C:18
 analyze.C:19
 analyze.C:20
 analyze.C:21
 analyze.C:22
 analyze.C:23
 analyze.C:24
 analyze.C:25
 analyze.C:26
 analyze.C:27
 analyze.C:28
 analyze.C:29
 analyze.C:30
 analyze.C:31
 analyze.C:32
 analyze.C:33
 analyze.C:34
 analyze.C:35
 analyze.C:36
 analyze.C:37
 analyze.C:38
 analyze.C:39
 analyze.C:40
 analyze.C:41
 analyze.C:42
 analyze.C:43
 analyze.C:44
 analyze.C:45
 analyze.C:46
 analyze.C:47
 analyze.C:48
 analyze.C:49
 analyze.C:50
 analyze.C:51
 analyze.C:52
 analyze.C:53
 analyze.C:54
 analyze.C:55
 analyze.C:56
 analyze.C:57
 analyze.C:58
 analyze.C:59
 analyze.C:60
 analyze.C:61
 analyze.C:62
 analyze.C:63
 analyze.C:64
 analyze.C:65
 analyze.C:66
 analyze.C:67
 analyze.C:68
 analyze.C:69
 analyze.C:70
 analyze.C:71
 analyze.C:72
 analyze.C:73
 analyze.C:74
 analyze.C:75
 analyze.C:76
 analyze.C:77
 analyze.C:78
 analyze.C:79
 analyze.C:80
 analyze.C:81
 analyze.C:82
 analyze.C:83
 analyze.C:84
 analyze.C:85
 analyze.C:86
 analyze.C:87
 analyze.C:88
 analyze.C:89
 analyze.C:90
 analyze.C:91
 analyze.C:92
 analyze.C:93
 analyze.C:94
 analyze.C:95
 analyze.C:96
 analyze.C:97
 analyze.C:98
 analyze.C:99
 analyze.C:100
 analyze.C:101
 analyze.C:102
 analyze.C:103
 analyze.C:104
 analyze.C:105
 analyze.C:106
 analyze.C:107
 analyze.C:108
 analyze.C:109
 analyze.C:110
 analyze.C:111
 analyze.C:112
 analyze.C:113
 analyze.C:114
 analyze.C:115
 analyze.C:116
 analyze.C:117
 analyze.C:118
 analyze.C:119
 analyze.C:120
thumb