00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <string.h>
00013 #include <stdio.h>
00014 #include <ctype.h>
00015 #include <cmath>
00016
00017 #include "Riostream.h"
00018 #include "TApplication.h"
00019 #include "TColor.h"
00020 #include "TROOT.h"
00021 #include "TStyle.h"
00022 #include "TSystem.h"
00023 #include "TVirtualPad.h"
00024 #include "TVirtualMutex.h"
00025
00026 TStyle *gStyle;
00027 const UInt_t kTakeStyle = BIT(17);
00028
00029 ClassImp(TStyle)
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 TStyle::TStyle() :TNamed()
00052 {
00053
00054
00055 Reset();
00056 }
00057
00058
00059
00060 TStyle::TStyle(const char *name, const char *title) : TNamed(name,title)
00061 {
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 delete gROOT->GetStyle(name);
00104
00105 Reset();
00106
00107 {
00108 R__LOCKGUARD2(gROOTMutex);
00109 gROOT->GetListOfStyles()->Add(this);
00110 }
00111
00112
00113 if (strcmp(name,"Plain") == 0) {
00114 SetFrameBorderMode(0);
00115 SetFrameFillColor(0);
00116 SetCanvasBorderMode(0);
00117 SetPadBorderMode(0);
00118 SetPadColor(0);
00119 SetCanvasColor(0);
00120 SetTitleFillColor(0);
00121 SetTitleBorderSize(1);
00122 SetStatColor(0);
00123 SetStatBorderSize(1);
00124 SetLegendBorderSize(1);
00125 return;
00126 }
00127 if (strcmp(name,"Bold") == 0) {
00128
00129 SetPalette(1,0);
00130 SetCanvasColor(10);
00131 SetCanvasBorderMode(0);
00132 SetFrameLineWidth(3);
00133 SetFrameFillColor(10);
00134 SetPadColor(10);
00135 SetPadTickX(1);
00136 SetPadTickY(1);
00137 SetPadBottomMargin(0.15);
00138 SetPadLeftMargin(0.15);
00139 SetHistLineWidth(3);
00140 SetHistLineColor(kRed);
00141 SetFuncWidth(3);
00142 SetFuncColor(kGreen);
00143 SetLineWidth(3);
00144 SetLabelSize(0.05,"xyz");
00145 SetLabelOffset(0.01,"y");
00146 SetLabelColor(kBlue,"xy");
00147 SetTitleSize(0.06,"xyz");
00148 SetTitleOffset(1.3,"Y");
00149 SetTitleFillColor(10);
00150 SetTitleTextColor(kBlue);
00151 SetStatColor(10);
00152 return;
00153 }
00154 if (strcmp(name,"Video") == 0) {
00155
00156 SetPalette(1,0);
00157 SetCanvasColor(10);
00158 SetCanvasBorderMode(0);
00159 SetFrameLineWidth(3);
00160 SetFrameFillColor(10);
00161 SetPadColor(10);
00162 SetPadTickX(1);
00163 SetPadTickY(1);
00164 SetPadBottomMargin(0.2);
00165 SetPadLeftMargin(0.2);
00166 SetHistLineWidth(8);
00167 SetHistLineColor(kRed);
00168 SetLabelSize(0.06,"xyz");
00169 SetLabelColor(kBlue,"xyz");
00170 SetTitleSize(0.08,"xyz");
00171 SetTitleFillColor(10);
00172 SetTitleTextColor(kBlue);
00173 SetStatColor(10);
00174 SetFuncWidth(8);
00175 SetFuncColor(kGreen);
00176 SetLineWidth(3);
00177 return;
00178 }
00179 if (strcmp(name,"Pub") == 0) {
00180
00181 SetOptTitle(0);
00182 SetOptStat(0);
00183 SetPalette(8,0);
00184 SetCanvasColor(10);
00185 SetCanvasBorderMode(0);
00186 SetFrameLineWidth(3);
00187 SetFrameFillColor(10);
00188 SetPadColor(10);
00189 SetPadTickX(1);
00190 SetPadTickY(1);
00191 SetPadBottomMargin(0.15);
00192 SetPadLeftMargin(0.15);
00193 SetHistLineWidth(3);
00194 SetHistLineColor(kRed);
00195 SetFuncWidth(3);
00196 SetFuncColor(kGreen);
00197 SetLineWidth(3);
00198 SetLabelSize(0.05,"xyz");
00199 SetLabelOffset(0.01,"y");
00200 SetLabelColor(kBlack,"xyz");
00201 SetTitleSize(0.06,"xyz");
00202 SetTitleOffset(1.3,"y");
00203 SetTitleFillColor(10);
00204 SetTitleTextColor(kBlue);
00205 return;
00206 }
00207
00208 }
00209
00210
00211
00212 TStyle::~TStyle()
00213 {
00214
00215
00216 R__LOCKGUARD2(gROOTMutex);
00217 gROOT->GetListOfStyles()->Remove(this);
00218 if (gStyle == this) gStyle = (TStyle*)gROOT->GetListOfStyles()->Last();
00219 }
00220
00221
00222
00223 TStyle::TStyle(const TStyle &style) : TNamed(style), TAttLine(style), TAttFill(style), TAttMarker(style), TAttText(style)
00224 {
00225
00226
00227 ((TStyle&)style).Copy(*this);
00228 }
00229
00230
00231
00232 void TStyle::Browse(TBrowser *)
00233 {
00234
00235
00236 cd();
00237 }
00238
00239
00240
00241 void TStyle::BuildStyles()
00242 {
00243
00244
00245 TColor *col = new TColor();
00246 new TStyle("Plain", "Plain Style (no colors/fill areas)");
00247 new TStyle("Bold", "Bold Style");;
00248 new TStyle("Video", "Style for video presentation histograms");
00249 new TStyle("Pub", "Style for Publications");
00250 new TStyle("Default","Default Style");
00251 delete col;
00252 }
00253
00254
00255
00256 void TStyle::cd()
00257 {
00258
00259
00260 gStyle = this;
00261 }
00262
00263
00264
00265 void TStyle::Copy(TObject &obj) const
00266 {
00267
00268
00269 TAttLine::Copy(((TStyle&)obj));
00270 TAttFill::Copy(((TStyle&)obj));
00271 TAttMarker::Copy(((TStyle&)obj));
00272 TAttText::Copy(((TStyle&)obj));
00273 fXaxis.Copy(((TStyle&)obj).fXaxis);
00274 fYaxis.Copy(((TStyle&)obj).fYaxis);
00275 fZaxis.Copy(((TStyle&)obj).fZaxis);
00276 fAttDate.Copy(((TStyle&)obj).fAttDate);
00277 ((TStyle&)obj).fIsReading = fIsReading;
00278 ((TStyle&)obj).fScreenFactor = fScreenFactor;
00279 ((TStyle&)obj).fCanvasPreferGL = fCanvasPreferGL;
00280 ((TStyle&)obj).fCanvasColor = fCanvasColor;
00281 ((TStyle&)obj).fCanvasBorderSize= fCanvasBorderSize;
00282 ((TStyle&)obj).fCanvasBorderMode= fCanvasBorderMode;
00283 ((TStyle&)obj).fCanvasDefH = fCanvasDefH;
00284 ((TStyle&)obj).fCanvasDefW = fCanvasDefW;
00285 ((TStyle&)obj).fCanvasDefX = fCanvasDefX;
00286 ((TStyle&)obj).fCanvasDefY = fCanvasDefY;
00287 ((TStyle&)obj).fPadColor = fPadColor;
00288 ((TStyle&)obj).fPadBorderSize = fPadBorderSize;
00289 ((TStyle&)obj).fPadBorderMode = fPadBorderMode;
00290 ((TStyle&)obj).fPadBottomMargin= fPadBottomMargin;
00291 ((TStyle&)obj).fPadTopMargin = fPadTopMargin;
00292 ((TStyle&)obj).fPadLeftMargin = fPadLeftMargin;
00293 ((TStyle&)obj).fPadRightMargin = fPadRightMargin;
00294 ((TStyle&)obj).fPadGridX = fPadGridX;
00295 ((TStyle&)obj).fPadGridY = fPadGridY;
00296 ((TStyle&)obj).fPadTickX = fPadTickX;
00297 ((TStyle&)obj).fPadTickY = fPadTickY;
00298 ((TStyle&)obj).fPaperSizeX = fPaperSizeX;
00299 ((TStyle&)obj).fPaperSizeY = fPaperSizeY;
00300 ((TStyle&)obj).fFuncColor = fFuncColor;
00301 ((TStyle&)obj).fFuncStyle = fFuncStyle;
00302 ((TStyle&)obj).fFuncWidth = fFuncWidth;
00303 ((TStyle&)obj).fGridColor = fGridColor;
00304 ((TStyle&)obj).fGridStyle = fGridStyle;
00305 ((TStyle&)obj).fGridWidth = fGridWidth;
00306 ((TStyle&)obj).fHatchesSpacing = fHatchesSpacing;
00307 ((TStyle&)obj).fHatchesLineWidth= fHatchesLineWidth;
00308 ((TStyle&)obj).fFrameFillColor = fFrameFillColor;
00309 ((TStyle&)obj).fFrameFillStyle = fFrameFillStyle;
00310 ((TStyle&)obj).fFrameLineColor = fFrameLineColor;
00311 ((TStyle&)obj).fFrameLineStyle = fFrameLineStyle;
00312 ((TStyle&)obj).fFrameLineWidth = fFrameLineWidth;
00313 ((TStyle&)obj).fFrameBorderSize= fFrameBorderSize;
00314 ((TStyle&)obj).fFrameBorderMode= fFrameBorderMode;
00315 ((TStyle&)obj).fHistFillColor = fHistFillColor;
00316 ((TStyle&)obj).fHistFillStyle = fHistFillStyle;
00317 ((TStyle&)obj).fHistLineColor = fHistLineColor;
00318 ((TStyle&)obj).fHistLineStyle = fHistLineStyle;
00319 ((TStyle&)obj).fHistLineWidth = fHistLineWidth;
00320 ((TStyle&)obj).fHistMinimumZero= fHistMinimumZero;
00321 ((TStyle&)obj).fHistTopMargin = fHistTopMargin;
00322 ((TStyle&)obj).fBarWidth = fBarWidth;
00323 ((TStyle&)obj).fBarOffset = fBarOffset;
00324 ((TStyle&)obj).fDrawBorder = fDrawBorder;
00325 ((TStyle&)obj).fOptLogx = fOptLogx;
00326 ((TStyle&)obj).fOptLogy = fOptLogy;
00327 ((TStyle&)obj).fOptLogz = fOptLogz;
00328 ((TStyle&)obj).fOptDate = fOptDate;
00329 ((TStyle&)obj).fOptFit = fOptFit;
00330 ((TStyle&)obj).fOptStat = fOptStat;
00331 ((TStyle&)obj).fOptTitle = fOptTitle;
00332 ((TStyle&)obj).fEndErrorSize = fEndErrorSize;
00333 ((TStyle&)obj).fErrorX = fErrorX;
00334 ((TStyle&)obj).fStatColor = fStatColor;
00335 ((TStyle&)obj).fStatTextColor = fStatTextColor;
00336 ((TStyle&)obj).fStatBorderSize = fStatBorderSize;
00337 ((TStyle&)obj).fStatFont = fStatFont;
00338 ((TStyle&)obj).fStatFontSize = fStatFontSize;
00339 ((TStyle&)obj).fStatStyle = fStatStyle;
00340 ((TStyle&)obj).fStatFormat = fStatFormat;
00341 ((TStyle&)obj).fStatW = fStatW;
00342 ((TStyle&)obj).fStatH = fStatH ;
00343 ((TStyle&)obj).fStatX = fStatX;
00344 ((TStyle&)obj).fStatY = fStatY;
00345 ((TStyle&)obj).fTitleAlign = fTitleAlign;
00346 ((TStyle&)obj).fTitleColor = fTitleColor;
00347 ((TStyle&)obj).fTitleTextColor = fTitleTextColor;
00348 ((TStyle&)obj).fTitleFont = fTitleFont;
00349 ((TStyle&)obj).fTitleFontSize = fTitleFontSize;
00350 ((TStyle&)obj).fTitleStyle = fTitleStyle;
00351 ((TStyle&)obj).fTitleBorderSize= fTitleBorderSize;
00352 ((TStyle&)obj).fTitleW = fTitleW;
00353 ((TStyle&)obj).fTitleH = fTitleH;
00354 ((TStyle&)obj).fTitleX = fTitleX;
00355 ((TStyle&)obj).fTitleY = fTitleY;
00356 ((TStyle&)obj).fDateX = fDateX;
00357 ((TStyle&)obj).fDateY = fDateY;
00358 ((TStyle&)obj).fFitFormat = fFitFormat;
00359 ((TStyle&)obj).fPaintTextFormat= fPaintTextFormat;
00360 ((TStyle&)obj).fShowEventStatus= fShowEventStatus;
00361 ((TStyle&)obj).fShowEditor = fShowEditor;
00362 ((TStyle&)obj).fShowToolBar = fShowToolBar;
00363 ((TStyle&)obj).fLegoInnerR = fLegoInnerR;
00364 ((TStyle&)obj).fStripDecimals = fStripDecimals;
00365 ((TStyle&)obj).fNumberContours = fNumberContours;
00366 ((TStyle&)obj).fLegendBorderSize = fLegendBorderSize;
00367 Int_t i;
00368 for (i=0;i<30;i++) {
00369 ((TStyle&)obj).fLineStyle[i] = fLineStyle[i];
00370 }
00371 ((TStyle&)obj).fHeaderPS = fHeaderPS;
00372 ((TStyle&)obj).fTitlePS = fTitlePS;
00373 ((TStyle&)obj).fLineScalePS = fLineScalePS;
00374 ((TStyle&)obj).fColorModelPS = fColorModelPS;
00375 ((TStyle&)obj).fTimeOffset = fTimeOffset;
00376 }
00377
00378
00379
00380 Int_t TStyle::DistancetoPrimitive(Int_t , Int_t )
00381 {
00382
00383
00384
00385 gPad->SetSelected(this);
00386 return 0;
00387 }
00388
00389
00390
00391 void TStyle::Reset(Option_t *opt)
00392 {
00393
00394
00395 fIsReading = kTRUE;
00396 TAttLine::ResetAttLine();
00397 TAttFill::ResetAttFill();
00398 TAttText::ResetAttText();
00399 TAttMarker::ResetAttMarker();
00400 SetFillStyle(1001);
00401 SetFillColor(19);
00402 fXaxis.ResetAttAxis("X");
00403 fYaxis.ResetAttAxis("Y");
00404 fZaxis.ResetAttAxis("Z");
00405 fCanvasPreferGL = kFALSE;
00406 fCanvasColor = 19;
00407 fCanvasBorderSize= 2;
00408 fCanvasBorderMode= 1;
00409 fCanvasDefH = 500;
00410 fCanvasDefW = 700;
00411 fCanvasDefX = 10;
00412 fCanvasDefY = 10;
00413 fPadColor = fCanvasColor;
00414 fPadBorderSize = fCanvasBorderSize;
00415 fPadBorderMode = fCanvasBorderMode;
00416 fPadBottomMargin= 0.1;
00417 fPadTopMargin = 0.1;
00418 fPadLeftMargin = 0.1;
00419 fPadRightMargin = 0.1;
00420 fPadGridX = kFALSE;
00421 fPadGridY = kFALSE;
00422 fPadTickX = 0;
00423 fPadTickY = 0;
00424 fFuncColor = 1;
00425 fFuncStyle = 1;
00426 fFuncWidth = 3;
00427 fGridColor = 0;
00428 fGridStyle = 3;
00429 fGridWidth = 1;
00430 fHatchesSpacing = 1;
00431 fHatchesLineWidth = 1;
00432 fHistLineColor = 1;
00433 fHistFillColor = 0;
00434 fHistFillStyle = 1001;
00435 fHistLineStyle = 1;
00436 fHistLineWidth = 1;
00437 fHistMinimumZero= kFALSE;
00438 fHistTopMargin = 0.05;
00439 fFrameLineColor = 1;
00440 fFrameFillColor = 0;
00441 fFrameFillStyle = 1001;
00442 fFrameLineStyle = 1;
00443 fFrameLineWidth = 1;
00444 fFrameBorderSize= 1;
00445 fFrameBorderMode= 1;
00446 fBarWidth = 1;
00447 fBarOffset = 0;
00448 fDrawBorder = 0;
00449 fOptLogx = 0;
00450 fOptLogy = 0;
00451 fOptLogz = 0;
00452 fOptDate = 0;
00453 fOptFile = 0;
00454 fOptFit = 0;
00455 fOptStat = 1;
00456 fOptTitle = 1;
00457 fEndErrorSize = 2;
00458 fErrorX = 0.5;
00459 fScreenFactor = 1;
00460 fStatColor = fCanvasColor;
00461 fStatTextColor = 1;
00462 fStatBorderSize = 2;
00463 fStatFont = 62;
00464 fStatFontSize = 0;
00465 fStatStyle = 1001;
00466 fStatW = 0.20;
00467 fStatH = 0.16;
00468 fStatX = 0.98;
00469 fStatY = 0.995;
00470 SetStatFormat();
00471 SetFitFormat();
00472 SetPaintTextFormat();
00473 fTitleAlign = 13;
00474 fTitleColor = fCanvasColor;
00475 fTitleTextColor = 1;
00476 fTitleFont = 62;
00477 fTitleFontSize = 0;
00478 fTitleStyle = 1001;
00479 fTitleBorderSize= 2;
00480 fTitleW = 0;
00481 fTitleH = 0;
00482 fTitleX = 0.01;
00483 fTitleY = 0.995;
00484 fShowEventStatus= 0;
00485 fShowEditor = 0;
00486 fShowToolBar = 0;
00487 fLegoInnerR = 0.5;
00488 fHeaderPS = "";
00489 fTitlePS = "";
00490 fStripDecimals = kTRUE;
00491 fNumberContours = 20;
00492 fLegendBorderSize= 4;
00493
00494 SetDateX();
00495 SetDateY();
00496 fAttDate.SetTextSize(0.025);
00497 fAttDate.SetTextAlign(11);
00498 SetLineScalePS();
00499 SetColorModelPS();
00500 SetLineStyleString(1," ");
00501 SetLineStyleString(2,"12 12");
00502 SetLineStyleString(3,"4 8");
00503 SetLineStyleString(4,"12 16 4 16");
00504 SetLineStyleString(5,"20 12 4 12");
00505 SetLineStyleString(6,"20 12 4 12 4 12 4 12");
00506 SetLineStyleString(7,"20 20");
00507 SetLineStyleString(8,"20 12 4 12 4 12");
00508 SetLineStyleString(9,"80 20");
00509 SetLineStyleString(10,"80 40 4 40");
00510 for (Int_t i=11;i<30;i++) SetLineStyleString(i," ");
00511
00512 SetPaperSize();
00513
00514 SetPalette();
00515
00516 fTimeOffset = 788918400;
00517
00518 if (strcmp(opt,"Plain") == 0) {
00519 SetFrameBorderMode(0);
00520 SetCanvasBorderMode(0);
00521 SetPadBorderMode(0);
00522 SetPadColor(0);
00523 SetCanvasColor(0);
00524 SetTitleFillColor(0);
00525 SetTitleBorderSize(1);
00526 SetStatColor(0);
00527 SetStatBorderSize(1);
00528 SetLegendBorderSize(1);
00529 return;
00530 }
00531 if (strcmp(opt,"Bold") == 0) {
00532 SetPalette(1,0);
00533 SetCanvasColor(10);
00534 SetCanvasBorderMode(0);
00535 SetFrameLineWidth(3);
00536 SetFrameFillColor(10);
00537 SetPadColor(10);
00538 SetPadTickX(1);
00539 SetPadTickY(1);
00540 SetPadBottomMargin(0.15);
00541 SetPadLeftMargin(0.15);
00542 SetHistLineWidth(3);
00543 SetHistLineColor(kRed);
00544 SetFuncWidth(3);
00545 SetFuncColor(kGreen);
00546 SetLineWidth(3);
00547 SetLabelSize(0.05,"xyz");
00548 SetLabelOffset(0.01,"y");
00549 SetLabelColor(kBlue,"xy");
00550 SetTitleSize(0.06,"xyz");
00551 SetTitleOffset(1.3,"Y");
00552 SetTitleFillColor(10);
00553 SetTitleTextColor(kBlue);
00554 SetStatColor(10);
00555 return;
00556 }
00557 if (strcmp(opt,"Video") == 0) {
00558 SetPalette(1,0);
00559 SetCanvasColor(10);
00560 SetCanvasBorderMode(0);
00561 SetFrameLineWidth(3);
00562 SetFrameFillColor(10);
00563 SetPadColor(10);
00564 SetPadTickX(1);
00565 SetPadTickY(1);
00566 SetPadBottomMargin(0.2);
00567 SetPadLeftMargin(0.2);
00568 SetHistLineWidth(8);
00569 SetHistLineColor(kRed);
00570 SetLabelSize(0.06,"xyz");
00571 SetLabelColor(kBlue,"xyz");
00572 SetTitleSize(0.08,"xyz");
00573 SetTitleFillColor(10);
00574 SetTitleTextColor(kBlue);
00575 SetStatColor(10);
00576 SetFuncWidth(8);
00577 SetFuncColor(kGreen);
00578 SetLineWidth(3);
00579 return;
00580 }
00581 if (strcmp(opt,"Pub") == 0) {
00582 SetOptTitle(0);
00583 SetOptStat(0);
00584 SetPalette(8,0);
00585 SetCanvasColor(10);
00586 SetCanvasBorderMode(0);
00587 SetFrameLineWidth(3);
00588 SetFrameFillColor(10);
00589 SetPadColor(10);
00590 SetPadTickX(1);
00591 SetPadTickY(1);
00592 SetPadBottomMargin(0.15);
00593 SetPadLeftMargin(0.15);
00594 SetHistLineWidth(3);
00595 SetHistLineColor(kRed);
00596 SetFuncWidth(3);
00597 SetFuncColor(kGreen);
00598 SetLineWidth(3);
00599 SetLabelSize(0.05,"xyz");
00600 SetLabelOffset(0.01,"y");
00601 SetLabelColor(kBlack,"xyz");
00602 SetTitleSize(0.06,"xyz");
00603 SetTitleOffset(1.3,"y");
00604 SetTitleFillColor(10);
00605 SetTitleTextColor(kBlue);
00606 return;
00607 }
00608 }
00609
00610
00611
00612 Int_t TStyle::AxisChoice( Option_t *axis) const
00613 {
00614
00615
00616 char achoice = toupper(axis[0]);
00617 if (achoice == 'X') return 1;
00618 if (achoice == 'Y') return 2;
00619 if (achoice == 'Z') return 3;
00620 return 0;
00621 }
00622
00623
00624
00625 Int_t TStyle::GetNdivisions( Option_t *axis) const
00626 {
00627
00628
00629 Int_t ax = AxisChoice(axis);
00630 if (ax == 1) return fXaxis.GetNdivisions();
00631 if (ax == 2) return fYaxis.GetNdivisions();
00632 if (ax == 3) return fZaxis.GetNdivisions();
00633 return 0;
00634 }
00635
00636
00637
00638 Color_t TStyle::GetAxisColor( Option_t *axis) const
00639 {
00640
00641
00642 Int_t ax = AxisChoice(axis);
00643 if (ax == 1) return fXaxis.GetAxisColor();
00644 if (ax == 2) return fYaxis.GetAxisColor();
00645 if (ax == 3) return fZaxis.GetAxisColor();
00646 return 0;
00647 }
00648
00649
00650
00651 Int_t TStyle::GetColorPalette(Int_t i) const
00652 {
00653
00654
00655 return TColor::GetColorPalette(i);
00656 }
00657
00658
00659
00660 Color_t TStyle::GetLabelColor( Option_t *axis) const
00661 {
00662
00663
00664 Int_t ax = AxisChoice(axis);
00665 if (ax == 1) return fXaxis.GetLabelColor();
00666 if (ax == 2) return fYaxis.GetLabelColor();
00667 if (ax == 3) return fZaxis.GetLabelColor();
00668 return 0;
00669 }
00670
00671
00672
00673 Style_t TStyle::GetLabelFont( Option_t *axis) const
00674 {
00675
00676
00677 Int_t ax = AxisChoice(axis);
00678 if (ax == 1) return fXaxis.GetLabelFont();
00679 if (ax == 2) return fYaxis.GetLabelFont();
00680 if (ax == 3) return fZaxis.GetLabelFont();
00681 return 0;
00682 }
00683
00684
00685
00686 Float_t TStyle::GetLabelOffset( Option_t *axis) const
00687 {
00688
00689
00690 Int_t ax = AxisChoice(axis);
00691 if (ax == 1) return fXaxis.GetLabelOffset();
00692 if (ax == 2) return fYaxis.GetLabelOffset();
00693 if (ax == 3) return fZaxis.GetLabelOffset();
00694 return 0;
00695 }
00696
00697
00698
00699 Float_t TStyle::GetLabelSize( Option_t *axis) const
00700 {
00701
00702
00703 Int_t ax = AxisChoice(axis);
00704 if (ax == 1) return fXaxis.GetLabelSize();
00705 if (ax == 2) return fYaxis.GetLabelSize();
00706 if (ax == 3) return fZaxis.GetLabelSize();
00707 return 0;
00708 }
00709
00710
00711
00712 const char *TStyle::GetLineStyleString(Int_t i) const
00713 {
00714
00715
00716
00717 if (i < 1 || i > 29) return fLineStyle[0].Data();
00718 return fLineStyle[i].Data();
00719 }
00720
00721
00722
00723 Int_t TStyle::GetNumberOfColors() const
00724 {
00725
00726
00727 return TColor::GetNumberOfColors();
00728 }
00729
00730
00731
00732 void TStyle::GetPaperSize(Float_t &xsize, Float_t &ysize) const
00733 {
00734
00735
00736 xsize = fPaperSizeX;
00737 ysize = fPaperSizeY;
00738 }
00739
00740
00741
00742 Float_t TStyle::GetTickLength( Option_t *axis) const
00743 {
00744
00745
00746 Int_t ax = AxisChoice(axis);
00747 if (ax == 1) return fXaxis.GetTickLength();
00748 if (ax == 2) return fYaxis.GetTickLength();
00749 if (ax == 3) return fZaxis.GetTickLength();
00750 return 0;
00751 }
00752
00753
00754
00755 Color_t TStyle::GetTitleColor( Option_t *axis) const
00756 {
00757
00758
00759 Int_t ax = AxisChoice(axis);
00760 if (ax == 1) return fXaxis.GetTitleColor();
00761 if (ax == 2) return fYaxis.GetTitleColor();
00762 if (ax == 3) return fZaxis.GetTitleColor();
00763 return fTitleTextColor;
00764 }
00765
00766
00767
00768 Style_t TStyle::GetTitleFont( Option_t *axis) const
00769 {
00770
00771
00772 Int_t ax = AxisChoice(axis);
00773 if (ax == 1) return fXaxis.GetTitleFont();
00774 if (ax == 2) return fYaxis.GetTitleFont();
00775 if (ax == 3) return fZaxis.GetTitleFont();
00776 return fTitleFont;
00777 }
00778
00779
00780
00781 Float_t TStyle::GetTitleOffset( Option_t *axis) const
00782 {
00783
00784
00785 Int_t ax = AxisChoice(axis);
00786 if (ax == 1) return fXaxis.GetTitleOffset();
00787 if (ax == 2) return fYaxis.GetTitleOffset();
00788 if (ax == 3) return fZaxis.GetTitleOffset();
00789 return 0;
00790 }
00791
00792
00793
00794 Float_t TStyle::GetTitleSize( Option_t *axis) const
00795 {
00796
00797
00798 Int_t ax = AxisChoice(axis);
00799 if (ax == 1) return fXaxis.GetTitleSize();
00800 if (ax == 2) return fYaxis.GetTitleSize();
00801 if (ax == 3) return fZaxis.GetTitleSize();
00802 return fTitleFontSize;
00803 }
00804
00805
00806
00807 void TStyle::Paint(Option_t *option)
00808 {
00809
00810
00811
00812 gROOT->ProcessLine(Form("TStyleManager::PaintStyle((TStyle*)0x%lx,\"%s\")",
00813 (ULong_t)this,option));
00814 }
00815
00816
00817
00818 void TStyle::SetColorModelPS(Int_t c)
00819 {
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837 fColorModelPS = c;
00838 }
00839
00840
00841
00842 void TStyle::SetHistMinimumZero(Bool_t zero)
00843 {
00844
00845
00846
00847
00848
00849 fHistMinimumZero = zero;
00850 }
00851
00852
00853
00854 void TStyle::SetNdivisions(Int_t n, Option_t *axis)
00855 {
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870 TString opt = axis;
00871 opt.ToLower();
00872 if (opt.Contains("x")) fXaxis.SetNdivisions(n);
00873 if (opt.Contains("y")) fYaxis.SetNdivisions(n);
00874 if (opt.Contains("z")) fZaxis.SetNdivisions(n);
00875 }
00876
00877
00878
00879 void TStyle::SetAxisColor(Color_t color, Option_t *axis)
00880 {
00881
00882
00883
00884
00885 TString opt = axis;
00886 opt.ToLower();
00887
00888 if (opt.Contains("x")) fXaxis.SetAxisColor(color);
00889 if (opt.Contains("y")) fYaxis.SetAxisColor(color);
00890 if (opt.Contains("z")) fZaxis.SetAxisColor(color);
00891 }
00892
00893
00894
00895 void TStyle::SetEndErrorSize(Float_t np)
00896 {
00897
00898
00899
00900
00901
00902 if (np >= 0) fEndErrorSize = np;
00903 else fEndErrorSize = 0;
00904 }
00905
00906
00907
00908 void TStyle::SetHeaderPS(const char *header)
00909 {
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920 fHeaderPS = header;
00921 }
00922
00923
00924
00925 void TStyle::SetIsReading(Bool_t reading)
00926 {
00927
00928
00929
00930
00931
00932 fIsReading = reading;
00933 }
00934
00935
00936
00937 void TStyle::SetTitlePS(const char *pstitle)
00938 {
00939
00940
00941
00942 fTitlePS = pstitle;
00943 }
00944
00945
00946
00947 void TStyle::SetLabelColor(Color_t color, Option_t *axis)
00948 {
00949
00950
00951
00952
00953 TString opt = axis;
00954 opt.ToLower();
00955
00956 if (opt.Contains("x")) fXaxis.SetLabelColor(color);
00957 if (opt.Contains("y")) fYaxis.SetLabelColor(color);
00958 if (opt.Contains("z")) fZaxis.SetLabelColor(color);
00959 }
00960
00961
00962
00963 void TStyle::SetLabelFont(Style_t font, Option_t *axis)
00964 {
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974 TString opt = axis;
00975 opt.ToLower();
00976
00977 if (opt.Contains("x")) fXaxis.SetLabelFont(font);
00978 if (opt.Contains("y")) fYaxis.SetLabelFont(font);
00979 if (opt.Contains("z")) fZaxis.SetLabelFont(font);
00980 }
00981
00982
00983
00984 void TStyle::SetLabelOffset(Float_t offset, Option_t *axis)
00985 {
00986
00987
00988
00989
00990
00991 TString opt = axis;
00992 opt.ToLower();
00993
00994 if (opt.Contains("x")) fXaxis.SetLabelOffset(offset);
00995 if (opt.Contains("y")) fYaxis.SetLabelOffset(offset);
00996 if (opt.Contains("z")) fZaxis.SetLabelOffset(offset);
00997 }
00998
00999
01000
01001 void TStyle::SetLabelSize(Float_t size, Option_t *axis)
01002 {
01003
01004
01005
01006
01007 TString opt = axis;
01008 opt.ToLower();
01009
01010 if (opt.Contains("x")) fXaxis.SetLabelSize(size);
01011 if (opt.Contains("y")) fYaxis.SetLabelSize(size);
01012 if (opt.Contains("z")) fZaxis.SetLabelSize(size);
01013 }
01014
01015
01016
01017 void TStyle::SetLineStyleString(Int_t i, const char *text)
01018 {
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052 char *l;
01053 Int_t nch = strlen(text);
01054 char *st = new char[nch+10];
01055 snprintf(st,nch+10," ");
01056 strlcat(st,text,nch+10);
01057 l = strstr(st,"["); if (l) l[0] = ' ';
01058 l = strstr(st,"]"); if (l) l[0] = ' ';
01059 if (i >= 1 && i <= 29) fLineStyle[i] = st;
01060 delete [] st;
01061 }
01062
01063
01064
01065 void TStyle::SetNumberContours(Int_t number)
01066 {
01067
01068
01069 if (number > 0 && number < 1000) {
01070 fNumberContours = number;
01071 return;
01072 }
01073
01074 Error("SetNumberContours","Illegal number of contours: %d, must be > 0 and < 1000",number);
01075 }
01076
01077
01078
01079 void TStyle::SetOptDate(Int_t optdate)
01080 {
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114 fOptDate = optdate;
01115 Int_t mode = optdate%10;
01116 if (mode == 1) {
01117 SetDateX(0.01);
01118 SetDateY(0.01);
01119 fAttDate.SetTextAlign(11);
01120 }
01121 if (mode == 2) {
01122 SetDateX(0.99);
01123 SetDateY(0.01);
01124 fAttDate.SetTextAlign(31);
01125 }
01126 if (mode == 3) {
01127 SetDateX(0.99);
01128 SetDateY(0.99);
01129 fAttDate.SetTextAlign(33);
01130 }
01131 }
01132
01133
01134
01135 void TStyle::SetOptFit(Int_t mode)
01136 {
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154 fOptFit = mode;
01155 if (gPad) {
01156 TObject *obj;
01157 TIter next(gPad->GetListOfPrimitives());
01158 while ((obj = next())) {
01159 TObject *stats = obj->FindObject("stats");
01160 if (stats) stats->SetBit(kTakeStyle);
01161 }
01162 gPad->Modified(); gPad->Update();
01163 }
01164 }
01165
01166
01167
01168 void TStyle::SetOptStat(Int_t mode)
01169 {
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198 fOptStat = mode;
01199 if (gPad) {
01200 TObject *obj;
01201 TIter next(gPad->GetListOfPrimitives());
01202 while ((obj = next())) {
01203 TObject *stats = obj->FindObject("stats");
01204 if (stats) stats->SetBit(kTakeStyle);
01205 }
01206 gPad->Modified(); gPad->Update();
01207 }
01208 }
01209
01210
01211
01212 void TStyle::SetOptStat(Option_t *stat)
01213 {
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233 Int_t mode=0;
01234
01235 TString opt = stat;
01236
01237 if (opt.Contains("n")) mode+=1;
01238 if (opt.Contains("e")) mode+=10;
01239 if (opt.Contains("m")) mode+=100;
01240 if (opt.Contains("M")) mode+=200;
01241 if (opt.Contains("r")) mode+=1000;
01242 if (opt.Contains("R")) mode+=2000;
01243 if (opt.Contains("u")) mode+=10000;
01244 if (opt.Contains("o")) mode+=100000;
01245 if (opt.Contains("i")) mode+=1000000;
01246 if (opt.Contains("s")) mode+=10000000;
01247 if (opt.Contains("S")) mode+=20000000;
01248 if (opt.Contains("k")) mode+=100000000;
01249 if (opt.Contains("K")) mode+=200000000;
01250 if (mode == 1) mode = 1000000001;
01251
01252 SetOptStat(mode);
01253 }
01254
01255
01256
01257 void TStyle::SetPaperSize(EPaperSize size)
01258 {
01259
01260
01261 switch (size) {
01262 case kA4:
01263 SetPaperSize(20, 26);
01264 break;
01265 case kUSLetter:
01266 SetPaperSize(20, 24);
01267 break;
01268 default:
01269 Error("SetPaperSize", "illegal paper size %d\n", (int)size);
01270 break;
01271 }
01272 }
01273
01274
01275
01276 void TStyle::SetPaperSize(Float_t xsize, Float_t ysize)
01277 {
01278
01279
01280
01281
01282 fPaperSizeX = xsize;
01283 fPaperSizeY = ysize;
01284 }
01285
01286
01287
01288 void TStyle::SetTickLength(Float_t length, Option_t *axis)
01289 {
01290
01291
01292
01293
01294 TString opt = axis;
01295 opt.ToLower();
01296
01297 if (opt.Contains("x")) fXaxis.SetTickLength(length);
01298 if (opt.Contains("y")) fYaxis.SetTickLength(length);
01299 if (opt.Contains("z")) fZaxis.SetTickLength(length);
01300 }
01301
01302
01303
01304 void TStyle::SetTitleColor(Color_t color, Option_t *axis)
01305 {
01306
01307
01308
01309
01310
01311
01312
01313 TString opt = axis;
01314 opt.ToLower();
01315
01316 Bool_t set = kFALSE;
01317 if (opt.Contains("x")) {fXaxis.SetTitleColor(color); set = kTRUE;}
01318 if (opt.Contains("y")) {fYaxis.SetTitleColor(color); set = kTRUE;}
01319 if (opt.Contains("z")) {fZaxis.SetTitleColor(color); set = kTRUE;}
01320 if (!set) fTitleColor = color;
01321 }
01322
01323
01324
01325 void TStyle::SetTitleFont(Style_t font, Option_t *axis)
01326 {
01327
01328
01329
01330
01331
01332
01333
01334 TString opt = axis;
01335 opt.ToLower();
01336
01337 Bool_t set = kFALSE;
01338 if (opt.Contains("x")) {fXaxis.SetTitleFont(font); set = kTRUE;}
01339 if (opt.Contains("y")) {fYaxis.SetTitleFont(font); set = kTRUE;}
01340 if (opt.Contains("z")) {fZaxis.SetTitleFont(font); set = kTRUE;}
01341 if (!set) fTitleFont = font;
01342 }
01343
01344
01345
01346 void TStyle::SetTitleOffset(Float_t offset, Option_t *axis)
01347 {
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357 TString opt = axis;
01358 opt.ToLower();
01359
01360 if (opt.Contains("x")) fXaxis.SetTitleOffset(offset);
01361 if (opt.Contains("y")) fYaxis.SetTitleOffset(offset);
01362 if (opt.Contains("z")) fZaxis.SetTitleOffset(offset);
01363 }
01364
01365
01366
01367 void TStyle::SetTitleSize(Float_t size, Option_t *axis)
01368 {
01369
01370
01371
01372
01373
01374
01375
01376 TString opt = axis;
01377 opt.ToLower();
01378
01379 Bool_t set = kFALSE;
01380 if (opt.Contains("x")) {fXaxis.SetTitleSize(size); set = kTRUE;}
01381 if (opt.Contains("y")) {fYaxis.SetTitleSize(size); set = kTRUE;}
01382 if (opt.Contains("z")) {fZaxis.SetTitleSize(size); set = kTRUE;}
01383 if (!set) fTitleFontSize = size;
01384 }
01385
01386
01387
01388 void TStyle::SetPalette(Int_t ncolors, Int_t *colors)
01389 {
01390
01391
01392 TColor::SetPalette(ncolors,colors);
01393 }
01394
01395
01396
01397 void TStyle::SetTimeOffset(Double_t toffset)
01398 {
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411 fTimeOffset = toffset;
01412 }
01413
01414
01415
01416 void TStyle::SetStripDecimals(Bool_t strip)
01417 {
01418
01419
01420
01421
01422
01423
01424
01425 fStripDecimals = strip;
01426 }
01427
01428
01429
01430 void TStyle::SaveSource(const char *filename, Option_t *option)
01431 {
01432
01433
01434
01435 TString ff = strlen(filename) ? filename : "Rootstyl.C";
01436
01437
01438 const char *fname = gSystem->BaseName(ff.Data());
01439 Int_t lenfname = strlen(fname);
01440 char *sname = new char[lenfname + 1];
01441 Int_t i = 0;
01442 while ((fname[i] != '.') && (i < lenfname)) {
01443 sname[i] = fname[i];
01444 i++;
01445 }
01446 if (i == lenfname) ff += ".C";
01447 sname[i] = 0;
01448
01449
01450 ofstream out;
01451 out.open(ff.Data(), ios::out);
01452 if (!out.good()) {
01453 delete [] sname;
01454 Error("SaveSource", "cannot open file: %s", ff.Data());
01455 return;
01456 }
01457
01458
01459 TDatime t;
01460 out <<"// Mainframe macro generated from application: " << gApplication->Argv(0) << endl;
01461 out <<"// By ROOT version " << gROOT->GetVersion() << " on " << t.AsSQLString() << endl;
01462 out << endl;
01463
01464 char quote = '"';
01465
01466
01467 out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << endl << endl;
01468 out << "#ifndef ROOT_TStyle" << endl;
01469 out << "#include " << quote << "TStyle.h" << quote << endl;
01470 out << "#endif" << endl;
01471 out << endl << "#endif" << endl;
01472
01473
01474 out << endl;
01475 out << "void " << sname << "()" << endl;
01476 out << "{" << endl;
01477 delete [] sname;
01478
01479 TStyle::SavePrimitive(out, option);
01480
01481 out << "}" << endl;
01482 out.close();
01483
01484 printf(" C++ macro file %s has been generated\n", gSystem->BaseName(ff.Data()));
01485 }
01486
01487
01488
01489 void TStyle::SavePrimitive(ostream &out, Option_t * )
01490 {
01491
01492
01493 char quote = '"';
01494
01495 out << " // Add the saved style to the current ROOT session." << endl;
01496 out << endl;
01497 out<<" "<<"delete gROOT->GetStyle("<<quote<<GetName()<<quote<<");"<< endl;
01498 out << endl;
01499 out<<" "<<"TStyle *tmpStyle = new TStyle("
01500 << quote << GetName() << quote << ", "
01501 << quote << GetTitle() << quote << ");" << endl;
01502
01503
01504 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("x") <<", \"x\");"<<endl;
01505 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("y") <<", \"y\");"<<endl;
01506 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("z") <<", \"z\");"<<endl;
01507 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("x") <<", \"x\");"<<endl;
01508 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("y") <<", \"y\");"<<endl;
01509 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("z") <<", \"z\");"<<endl;
01510 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("x") <<", \"x\");"<<endl;
01511 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("y") <<", \"y\");"<<endl;
01512 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("z") <<", \"z\");"<<endl;
01513 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("x") <<", \"x\");"<<endl;
01514 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("y") <<", \"y\");"<<endl;
01515 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("z") <<", \"z\");"<<endl;
01516 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("x")<<", \"x\");"<<endl;
01517 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("y")<<", \"y\");"<<endl;
01518 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("z")<<", \"z\");"<<endl;
01519 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("x") <<", \"x\");"<<endl;
01520 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("y") <<", \"y\");"<<endl;
01521 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("z") <<", \"z\");"<<endl;
01522 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("x") <<", \"x\");"<<endl;
01523 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("y") <<", \"y\");"<<endl;
01524 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("z") <<", \"z\");"<<endl;
01525 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("x")<<", \"x\");"<<endl;
01526 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("y")<<", \"y\");"<<endl;
01527 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("z")<<", \"z\");"<<endl;
01528 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("x") <<", \"x\");"<<endl;
01529 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("y") <<", \"y\");"<<endl;
01530 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("z") <<", \"z\");"<<endl;
01531 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("x") <<", \"x\");"<<endl;
01532 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("y") <<", \"y\");"<<endl;
01533 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("z") <<", \"z\");"<<endl;
01534 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("x") <<", \"x\");"<<endl;
01535 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("y") <<", \"y\");"<<endl;
01536 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("z") <<", \"z\");"<<endl;
01537
01538 out<<" "<<"tmpStyle->SetBarWidth(" <<GetBarWidth() <<");"<<endl;
01539 out<<" "<<"tmpStyle->SetBarOffset(" <<GetBarOffset() <<");"<<endl;
01540 out<<" "<<"tmpStyle->SetDrawBorder(" <<GetDrawBorder() <<");"<<endl;
01541 out<<" "<<"tmpStyle->SetOptLogx(" <<GetOptLogx() <<");"<<endl;
01542 out<<" "<<"tmpStyle->SetOptLogy(" <<GetOptLogy() <<");"<<endl;
01543 out<<" "<<"tmpStyle->SetOptLogz(" <<GetOptLogz() <<");"<<endl;
01544 out<<" "<<"tmpStyle->SetOptDate(" <<GetOptDate() <<");"<<endl;
01545 out<<" "<<"tmpStyle->SetOptStat(" <<GetOptStat() <<");"<<endl;
01546
01547 if (GetOptTitle()) out << " tmpStyle->SetOptTitle(kTRUE);" << endl;
01548 else out << " tmpStyle->SetOptTitle(kFALSE);" << endl;
01549 out<<" "<<"tmpStyle->SetOptFit(" <<GetOptFit() <<");"<<endl;
01550 out<<" "<<"tmpStyle->SetNumberContours(" <<GetNumberContours() <<");"<<endl;
01551
01552
01553 out<<" "<<"tmpStyle->GetAttDate()->SetTextFont(" <<GetAttDate()->GetTextFont() <<");"<<endl;
01554 out<<" "<<"tmpStyle->GetAttDate()->SetTextSize(" <<GetAttDate()->GetTextSize() <<");"<<endl;
01555 out<<" "<<"tmpStyle->GetAttDate()->SetTextAngle("<<GetAttDate()->GetTextAngle()<<");"<<endl;
01556 out<<" "<<"tmpStyle->GetAttDate()->SetTextAlign("<<GetAttDate()->GetTextAlign()<<");"<<endl;
01557 out<<" "<<"tmpStyle->GetAttDate()->SetTextColor("<<GetAttDate()->GetTextColor()<<");"<<endl;
01558
01559 out<<" "<<"tmpStyle->SetDateX(" <<GetDateX() <<");"<<endl;
01560 out<<" "<<"tmpStyle->SetDateY(" <<GetDateY() <<");"<<endl;
01561 out<<" "<<"tmpStyle->SetEndErrorSize(" <<GetEndErrorSize() <<");"<<endl;
01562 out<<" "<<"tmpStyle->SetErrorX(" <<GetErrorX() <<");"<<endl;
01563 out<<" "<<"tmpStyle->SetFuncColor(" <<GetFuncColor() <<");"<<endl;
01564 out<<" "<<"tmpStyle->SetFuncStyle(" <<GetFuncStyle() <<");"<<endl;
01565 out<<" "<<"tmpStyle->SetFuncWidth(" <<GetFuncWidth() <<");"<<endl;
01566 out<<" "<<"tmpStyle->SetGridColor(" <<GetGridColor() <<");"<<endl;
01567 out<<" "<<"tmpStyle->SetGridStyle(" <<GetGridStyle() <<");"<<endl;
01568 out<<" "<<"tmpStyle->SetGridWidth(" <<GetGridWidth() <<");"<<endl;
01569 out<<" "<<"tmpStyle->SetLegendBorderSize("<<GetLegendBorderSize()<<");"<<endl;
01570 out<<" "<<"tmpStyle->SetHatchesLineWidth("<<GetHatchesLineWidth()<<");"<<endl;
01571 out<<" "<<"tmpStyle->SetHatchesSpacing(" <<GetHatchesSpacing() <<");"<<endl;
01572 out<<" "<<"tmpStyle->SetFrameFillColor(" <<GetFrameFillColor() <<");"<<endl;
01573 out<<" "<<"tmpStyle->SetFrameLineColor(" <<GetFrameLineColor() <<");"<<endl;
01574 out<<" "<<"tmpStyle->SetFrameFillStyle(" <<GetFrameFillStyle() <<");"<<endl;
01575 out<<" "<<"tmpStyle->SetFrameLineStyle(" <<GetFrameLineStyle() <<");"<<endl;
01576 out<<" "<<"tmpStyle->SetFrameLineWidth(" <<GetFrameLineWidth() <<");"<<endl;
01577 out<<" "<<"tmpStyle->SetFrameBorderSize(" <<GetFrameBorderSize() <<");"<<endl;
01578 out<<" "<<"tmpStyle->SetFrameBorderMode(" <<GetFrameBorderMode() <<");"<<endl;
01579 out<<" "<<"tmpStyle->SetHistFillColor(" <<GetHistFillColor() <<");"<<endl;
01580 out<<" "<<"tmpStyle->SetHistLineColor(" <<GetHistLineColor() <<");"<<endl;
01581 out<<" "<<"tmpStyle->SetHistFillStyle(" <<GetHistFillStyle() <<");"<<endl;
01582 out<<" "<<"tmpStyle->SetHistLineStyle(" <<GetHistLineStyle() <<");"<<endl;
01583 out<<" "<<"tmpStyle->SetHistLineWidth(" <<GetHistLineWidth() <<");"<<endl;
01584 if (GetHistMinimumZero()) out<<" tmpStyle->SetHistMinimumZero(kTRUE);" <<endl;
01585 else out<<" tmpStyle->SetHistMinimumZero(kFALSE);"<<endl;
01586 if (GetCanvasPreferGL()) out<<" tmpStyle->SetCanvasPreferGL(kTRUE);" <<endl;
01587 else out<<" tmpStyle->SetCanvasPreferGL(kFALSE);"<<endl;
01588 out<<" "<<"tmpStyle->SetCanvasColor(" <<GetCanvasColor() <<");"<<endl;
01589 out<<" "<<"tmpStyle->SetCanvasBorderSize("<<GetCanvasBorderSize()<<");"<<endl;
01590 out<<" "<<"tmpStyle->SetCanvasBorderMode("<<GetCanvasBorderMode()<<");"<<endl;
01591 out<<" "<<"tmpStyle->SetCanvasDefH(" <<GetCanvasDefH() <<");"<<endl;
01592 out<<" "<<"tmpStyle->SetCanvasDefW(" <<GetCanvasDefW() <<");"<<endl;
01593 out<<" "<<"tmpStyle->SetCanvasDefX(" <<GetCanvasDefX() <<");"<<endl;
01594 out<<" "<<"tmpStyle->SetCanvasDefY(" <<GetCanvasDefY() <<");"<<endl;
01595 out<<" "<<"tmpStyle->SetPadColor(" <<GetPadColor() <<");"<<endl;
01596 out<<" "<<"tmpStyle->SetPadBorderSize(" <<GetPadBorderSize() <<");"<<endl;
01597 out<<" "<<"tmpStyle->SetPadBorderMode(" <<GetPadBorderMode() <<");"<<endl;
01598 out<<" "<<"tmpStyle->SetPadBottomMargin(" <<GetPadBottomMargin() <<");"<<endl;
01599 out<<" "<<"tmpStyle->SetPadTopMargin(" <<GetPadTopMargin() <<");"<<endl;
01600 out<<" "<<"tmpStyle->SetPadLeftMargin(" <<GetPadLeftMargin() <<");"<<endl;
01601 out<<" "<<"tmpStyle->SetPadRightMargin(" <<GetPadRightMargin() <<");"<<endl;
01602 if (GetPadGridX()) out<<" tmpStyle->SetPadGridX(kTRUE);" <<endl;
01603 else out<<" tmpStyle->SetPadGridX(kFALSE);"<<endl;
01604 if (GetPadGridY()) out<<" tmpStyle->SetPadGridY(kTRUE);" <<endl;
01605 else out<<" tmpStyle->SetPadGridY(kFALSE);"<<endl;
01606 out<<" "<<"tmpStyle->SetPadTickX(" <<GetPadTickX() <<");"<<endl;
01607 out<<" "<<"tmpStyle->SetPadTickY(" <<GetPadTickY() <<");"<<endl;
01608
01609
01610 out<<" "<<"tmpStyle->SetPaperSize(" <<fPaperSizeX <<", "
01611 <<fPaperSizeY <<");"<<endl;
01612
01613 out<<" "<<"tmpStyle->SetScreenFactor(" <<GetScreenFactor() <<");"<<endl;
01614 out<<" "<<"tmpStyle->SetStatColor(" <<GetStatColor() <<");"<<endl;
01615 out<<" "<<"tmpStyle->SetStatTextColor(" <<GetStatTextColor() <<");"<<endl;
01616 out<<" "<<"tmpStyle->SetStatBorderSize(" <<GetStatBorderSize() <<");"<<endl;
01617 out<<" "<<"tmpStyle->SetStatFont(" <<GetStatFont() <<");"<<endl;
01618 out<<" "<<"tmpStyle->SetStatFontSize(" <<GetStatFontSize() <<");"<<endl;
01619 out<<" "<<"tmpStyle->SetStatStyle(" <<GetStatStyle() <<");"<<endl;
01620 out<<" "<<"tmpStyle->SetStatFormat(" <<quote << GetStatFormat()
01621 <<quote <<");"<<endl;
01622 out<<" "<<"tmpStyle->SetStatX(" <<GetStatX() <<");"<<endl;
01623 out<<" "<<"tmpStyle->SetStatY(" <<GetStatY() <<");"<<endl;
01624 out<<" "<<"tmpStyle->SetStatW(" <<GetStatW() <<");"<<endl;
01625 out<<" "<<"tmpStyle->SetStatH(" <<GetStatH() <<");"<<endl;
01626 if (GetStripDecimals()) out<<" tmpStyle->SetStripDecimals(kTRUE);" <<endl;
01627 else out<<" tmpStyle->SetStripDecimals(kFALSE);"<<endl;
01628 out<<" "<<"tmpStyle->SetTitleAlign(" <<GetTitleAlign() <<");"<<endl;
01629 out<<" "<<"tmpStyle->SetTitleFillColor(" <<GetTitleFillColor() <<");"<<endl;
01630 out<<" "<<"tmpStyle->SetTitleTextColor(" <<GetTitleTextColor() <<");"<<endl;
01631 out<<" "<<"tmpStyle->SetTitleBorderSize("<<GetTitleBorderSize()<<");"<<endl;
01632 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont() <<");"<<endl;
01633 out<<" "<<"tmpStyle->SetTitleFontSize(" <<GetTitleFontSize() <<");"<<endl;
01634 out<<" "<<"tmpStyle->SetTitleStyle(" <<GetTitleStyle() <<");"<<endl;
01635 out<<" "<<"tmpStyle->SetTitleX(" <<GetTitleX() <<");"<<endl;
01636 out<<" "<<"tmpStyle->SetTitleY(" <<GetTitleY() <<");"<<endl;
01637 out<<" "<<"tmpStyle->SetTitleW(" <<GetTitleW() <<");"<<endl;
01638 out<<" "<<"tmpStyle->SetTitleH(" <<GetTitleH() <<");"<<endl;
01639 out<<" "<<"tmpStyle->SetLegoInnerR(" <<GetLegoInnerR() <<");"<<endl;
01640 out<<endl;
01641
01642
01643 out<<" "<<"Int_t fPaletteColor[" <<GetNumberOfColors() <<"] = {";
01644 for (Int_t ci=0; ci<GetNumberOfColors()-1; ++ci) {
01645 if (ci % 10 == 9)
01646 out<<endl<<" ";
01647 out<<GetColorPalette(ci)<<", ";
01648 }
01649 out<<GetColorPalette(GetNumberOfColors() - 1) <<"};"<<endl;
01650 out<<" "<<"tmpStyle->SetPalette(" << GetNumberOfColors()
01651 << ", fPaletteColor);" << endl;
01652 out<<endl;
01653
01654
01655 out<<" "<<"TString fLineStyleArrayTmp[30] = {";
01656 for (Int_t li=0; li<29; ++li) {
01657 if (li % 5 == 4)
01658 out<<endl<<" ";
01659 out<<quote << fLineStyle[li].Data() << quote << ", ";
01660 }
01661 out<<quote<<fLineStyle[29].Data()<<quote<<"};"<<endl;
01662 out<<" "<<"for (Int_t i=0; i<30; i++)"<<endl;
01663 out<<" "<<" tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);"<<endl;
01664 out<<endl;
01665
01666 out<<" "<<"tmpStyle->SetHeaderPS(" <<quote<<GetHeaderPS()
01667 <<quote <<");"<<endl;
01668 out<<" "<<"tmpStyle->SetTitlePS(" <<quote<<GetTitlePS()
01669 <<quote <<");"<<endl;
01670 out<<" "<<"tmpStyle->SetFitFormat(" <<quote<<GetFitFormat()
01671 <<quote <<");"<<endl;
01672 out<<" "<<"tmpStyle->SetPaintTextFormat("<<quote<<GetPaintTextFormat()
01673 <<quote <<");"<<endl;
01674 out<<" "<<"tmpStyle->SetLineScalePS(" <<GetLineScalePS() <<");"<<endl;
01675 out<<" "<<"tmpStyle->SetColorModelPS(" <<GetColorModelPS() <<");"<<endl;
01676 out<<" "<<Form("tmpStyle->SetTimeOffset(%9.0f);", GetTimeOffset()) <<endl;
01677 out<<endl;
01678
01679
01680
01681 out <<" " <<"tmpStyle->SetLineColor(" <<GetLineColor() <<");" <<endl;
01682 out <<" " <<"tmpStyle->SetLineStyle(" <<GetLineStyle() <<");" <<endl;
01683 out <<" " <<"tmpStyle->SetLineWidth(" <<GetLineWidth() <<");" <<endl;
01684
01685
01686 out <<" " <<"tmpStyle->SetFillColor(" <<GetFillColor() <<");" <<endl;
01687 out <<" " <<"tmpStyle->SetFillStyle(" <<GetFillStyle() <<");" <<endl;
01688
01689
01690 out <<" " <<"tmpStyle->SetMarkerColor(" <<GetMarkerColor() <<");" <<endl;
01691 out <<" " <<"tmpStyle->SetMarkerSize(" <<GetMarkerSize() <<");" <<endl;
01692 out <<" " <<"tmpStyle->SetMarkerStyle(" <<GetMarkerStyle() <<");" <<endl;
01693
01694
01695 out <<" " <<"tmpStyle->SetTextAlign(" <<GetTextAlign() <<");" <<endl;
01696 out <<" " <<"tmpStyle->SetTextAngle(" <<GetTextAngle() <<");" <<endl;
01697 out <<" " <<"tmpStyle->SetTextColor(" <<GetTextColor() <<");" <<endl;
01698 out <<" " <<"tmpStyle->SetTextFont(" <<GetTextFont() <<");" <<endl;
01699 out <<" " <<"tmpStyle->SetTextSize(" <<GetTextSize() <<");" <<endl;
01700 }