00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4HisDrawOptions.h"
00015
00016 #include "Riostream.h"
00017 #include "TROOT.h"
00018 #include "TColor.h"
00019 #include "TAttLine.h"
00020 #include "TAttFill.h"
00021 #include "TAttMarker.h"
00022
00023 #include "TGo4Picture.h"
00024 #include "TGo4ViewPanel.h"
00025 #include "TGo4MdiArea.h"
00026
00027 #include <QColorDialog>
00028
00029 TGo4HisDrawOptions::TGo4HisDrawOptions( QWidget* parent, const char* name, Qt::WindowFlags fl )
00030 : QWidget( parent, fl )
00031 {
00032 setObjectName( name ? name : "Go4HisDrawOptions");
00033 setupUi(this);
00034 fbSettingPanelData = true;
00035
00036 connect(TGo4MdiArea::Instance(), SIGNAL(panelSignal(TGo4ViewPanel*, TPad*, int)),
00037 this, SLOT(panelSlot(TGo4ViewPanel*, TPad*, int)));
00038
00039 UpdateView(view_Histo1);
00040
00041 AutoScaleBox->setVisible(false);
00042
00043 LineColor->setEnabled(false);
00044 FillColor->setEnabled(false);
00045 MarkerColor->setEnabled(false);
00046
00047 fbSettingPanelData = false;
00048 }
00049
00050 void TGo4HisDrawOptions::panelSlot(TGo4ViewPanel* panel, TPad* pad, int signalid)
00051 {
00052 switch (signalid) {
00053 case QGo4Widget::panel_Modified:
00054 case QGo4Widget::panel_Updated:
00055 break;
00056 case QGo4Widget::panel_Activated:
00057 case QGo4Widget::panel_ActiveUpdated: {
00058 TGo4Picture* padopt = panel->GetPadOptions(pad);
00059 if (padopt==0) break;
00060
00061 int ndim = padopt->GetFullRangeDim();
00062 if (ndim<=0) ndim = 1;
00063
00064 const char* drawopt = 0;
00065 TObject* obj = panel->GetSelectedObject(pad, &drawopt);
00066
00067 int viewtype = view_Histo1;
00068
00069 TString buf(drawopt);
00070 buf.ToLower();
00071
00072 if ((obj!=0) && obj->InheritsFrom("TGraphPolar"))
00073 viewtype = view_Polar;
00074 else
00075 if ((obj!=0) && (obj->InheritsFrom("TGraph") || obj->InheritsFrom("TMultiGraph")))
00076 viewtype = view_Graph;
00077 else
00078 if (ndim==1)
00079 viewtype = view_Histo1;
00080 else
00081 if (buf.Contains("lego") || buf.Contains("surf"))
00082 viewtype = view_Histo2ext;
00083 else
00084 viewtype = view_Histo2;
00085
00086 fbSettingPanelData = true;
00087
00088 if (fiLastView!=viewtype) UpdateView(viewtype);
00089
00090 int ErrorStyle = 0, CoordStyle = 0, DrawStyle = 0;
00091 DecodeDrawOption(drawopt, ErrorStyle, CoordStyle, DrawStyle);
00092
00093 DrawOption->setCurrentIndex(DrawStyle);
00094 ErrorBars->setCurrentIndex(ErrorStyle);
00095 Coordinates->setCurrentIndex(CoordStyle);
00096 XStyle->setCurrentIndex(padopt->GetLogScale(0));
00097 YStyle->setCurrentIndex(padopt->GetLogScale(1));
00098 ZStyle->setCurrentIndex(padopt->GetLogScale(2));
00099 ZStyle->setEnabled(ndim>1);
00100 AutoScaleBox->setChecked(padopt->IsAutoScale());
00101
00102 LineColor->setEnabled(dynamic_cast<TAttLine*>(obj)!=0);
00103 FillColor->setEnabled(dynamic_cast<TAttFill*>(obj)!=0);
00104 MarkerColor->setEnabled(dynamic_cast<TAttMarker*>(obj)!=0);
00105
00106 fbSettingPanelData = false;
00107
00108 break; }
00109 default:
00110 break;
00111 }
00112 }
00113
00114 void TGo4HisDrawOptions::UpdateView(int viewtype)
00115 {
00116 int lines=30;
00117 ErrorBars->clear();
00118 DrawOption->clear();
00119 Coordinates->clear();
00120
00121 switch(viewtype) {
00122 case view_Histo1:
00123 DrawOption->addItem( QIcon(":/icons/h1_t.png"), " scatter");
00124 DrawOption->addItem( QIcon(""), "AH no axis");
00125 DrawOption->addItem( QIcon(""), "*H stars");
00126 DrawOption->addItem( QIcon(""), "L lines");
00127 DrawOption->addItem( QIcon(""), "LF2 lines+fill");
00128 DrawOption->addItem( QIcon(""), "C curve");
00129 DrawOption->addItem( QIcon(""), "B barchart");
00130 DrawOption->addItem( QIcon(""), "P polymarkers");
00131 DrawOption->addItem( QIcon(""), "P0 polymarkers");
00132 DrawOption->addItem( QIcon(""), "9H high resol");
00133 DrawOption->addItem( QIcon(""), "][ no right");
00134 DrawOption->addItem( QIcon(""), "TEXT digits b/w");
00135 DrawOption->addItem( QIcon(""), "BAR barchart");
00136 DrawOption->addItem( QIcon(":/icons/lego.png"), " lego b/w");
00137 DrawOption->addItem( QIcon(":/icons/lego1.png"), " lego1 shadow");
00138 DrawOption->addItem( QIcon(":/icons/lego2.png"), " lego2 color");
00139 DrawOption->addItem( QIcon(":/icons/surf.png"), " mesh b/w");
00140 DrawOption->addItem( QIcon(":/icons/surf1.png"), " mesh color");
00141 DrawOption->addItem( QIcon(":/icons/surf2.png"), " surf c");
00142 DrawOption->addItem( QIcon(":/icons/surf3.png"), " mesh+contour");
00143 DrawOption->addItem( QIcon(":/icons/surf4.png"), " gourand");
00144 DrawOption->addItem( QIcon(":/icons/surf5.png"), " col contour");
00145 DrawOption->addItem( QIcon(""), "");
00146 lines=30;
00147 break;
00148 case view_Histo2:
00149 case view_Histo2ext:
00150 DrawOption->addItem( QIcon(":/icons/h1_t.png"), " scatter");
00151 DrawOption->addItem( QIcon(":/icons/col.png"), " pixel c");
00152 DrawOption->addItem( QIcon(":/icons/cont0.png")," cont0 c");
00153 DrawOption->addItem( QIcon(":/icons/lego2.png")," lego2 color");
00154 DrawOption->addItem( QIcon(":/icons/surf2.png")," surf c");
00155 DrawOption->addItem( QIcon(":/icons/surf1.png")," mesh color");
00156 DrawOption->addItem( QIcon(":/icons/cont1.png")," cont1 c");
00157 DrawOption->addItem( QIcon(":/icons/cont1.png")," cont4");
00158 DrawOption->addItem( QIcon(":/icons/lego1.png")," lego1 shadow");
00159 DrawOption->addItem( QIcon(":/icons/lego.png"), " lego b/w");
00160 DrawOption->addItem( QIcon(":/icons/cont2.png")," cont2 dot b/w");
00161 DrawOption->addItem( QIcon(":/icons/cont3.png")," cont3 b/w");
00162 DrawOption->addItem( QIcon(":/icons/surf.png"), " mesh b/w");
00163 DrawOption->addItem( QIcon(":/icons/surf3.png")," mesh+contour");
00164 DrawOption->addItem( QIcon(":/icons/surf4.png")," gourand");
00165 DrawOption->addItem( QIcon(":/icons/surf5.png")," col contour");
00166 DrawOption->addItem( QIcon(""), "ARR arrow mode");
00167 DrawOption->addItem( QIcon(""), "BOX boxes");
00168 DrawOption->addItem( QIcon(""), "TEXT content");
00169 lines=30;
00170 #ifndef __NOGO4ASI__
00171 DrawOption->addItem( QIcon(":/icons/asimage.png"), " ASImage");
00172 DrawOption->addItem( QIcon(""), "");
00173 #else
00174 DrawOption->addItem( QIcon(""), "");
00175 #endif
00176 break;
00177 case view_Graph:
00178 DrawOption->addItem("P: default");
00179 DrawOption->addItem("*: stars");
00180 DrawOption->addItem("L: line");
00181 DrawOption->addItem("F: fill");
00182 DrawOption->addItem("F1: fill 1");
00183 DrawOption->addItem("F2: fill 2");
00184 DrawOption->addItem("C: smooth");
00185 DrawOption->addItem("B: bar");
00186 DrawOption->addItem("LP: line + mark");
00187 DrawOption->addItem("L*: line + *");
00188 DrawOption->addItem("FP: fill + mark");
00189 DrawOption->addItem("F*: fill + *");
00190 DrawOption->addItem("CP: smooth + mark");
00191 DrawOption->addItem("C*: smooth + *");
00192 DrawOption->addItem("BP: smooth + mark");
00193 DrawOption->addItem("B*: smooth + *");
00194 lines=30;
00195 break;
00196 case view_Polar:
00197 DrawOption->addItem(": opt as is");
00198 DrawOption->addItem("P: polym");
00199 DrawOption->addItem("F: fill");
00200 DrawOption->addItem("PF: P+F");
00201 lines = 10;
00202 break;
00203 }
00204
00205 DrawOption->setMaxVisibleItems(lines);
00206
00207 switch(viewtype) {
00208 case view_Histo1:
00209 ErrorBars->addItem("No Errors");
00210 ErrorBars->addItem("E: simple");
00211 ErrorBars->addItem("E1: edges");
00212 ErrorBars->addItem("E2: rectangles");
00213 ErrorBars->addItem("E3: fill");
00214 ErrorBars->addItem("E4: contour");
00215 break;
00216 case view_Histo2:
00217 ErrorBars->addItem("No palette");
00218 ErrorBars->addItem(QIcon(":/icons/colz.png")," +scale");
00219 break;
00220 case view_Histo2ext:
00221 ErrorBars->addItem("No palette");
00222 ErrorBars->addItem(QIcon(":/icons/colz.png")," +scale");
00223 ErrorBars->addItem(" - front");
00224 ErrorBars->addItem(" - back");
00225 ErrorBars->addItem(" - fr & bk");
00226 ErrorBars->addItem(QIcon(":/icons/colz.png")," scale - fr");
00227 ErrorBars->addItem(QIcon(":/icons/colz.png"), " scale - bk");
00228 ErrorBars->addItem(QIcon(":/icons/colz.png"), " scale - fr & bk");
00229 break;
00230 case view_Graph:
00231 ErrorBars->addItem("errors as is");
00232 ErrorBars->addItem("X: no errors");
00233 ErrorBars->addItem(">: arrow");
00234 ErrorBars->addItem("|>: full arrow");
00235 ErrorBars->addItem("2: err opt 2");
00236 ErrorBars->addItem("3: err opt 3");
00237 ErrorBars->addItem("4: err opt 4");
00238 ErrorBars->addItem("[]: asym err");
00239 break;
00240 case view_Polar:
00241 ErrorBars->addItem(": err as is");
00242 ErrorBars->addItem("E: error bars");
00243 ErrorBars->addItem("N: no labels");
00244 ErrorBars->addItem("EN: E+N");
00245 break;
00246 }
00247
00248 switch(viewtype) {
00249 case view_Histo1:
00250 case view_Histo2:
00251 case view_Histo2ext:
00252 Coordinates->addItem("Cartesian");
00253 Coordinates->addItem("Polar");
00254 Coordinates->addItem("Spheric");
00255 Coordinates->addItem("Rapidity");
00256 Coordinates->addItem("Cylindric");
00257 break;
00258 case view_Graph:
00259 Coordinates->addItem("A: norm axis");
00260 Coordinates->addItem("supp. axis");
00261 Coordinates->addItem("AX+: top");
00262 Coordinates->addItem("AY+: right");
00263 Coordinates->addItem("AX+Y+: x & y");
00264 Coordinates->addItem("A1: ylow = ymin");
00265 break;
00266 case view_Polar:
00267 Coordinates->addItem(": axis as is");
00268 Coordinates->addItem("A: force axis");
00269 Coordinates->addItem("O: orthogonal");
00270 Coordinates->addItem("AO: A+O");
00271 break;
00272 }
00273
00274 fiLastView = viewtype;
00275 }
00276
00277 void TGo4HisDrawOptions::ChangeDrawOptionForCurrentPanel(int kind, int value)
00278 {
00279 if (fbSettingPanelData) return;
00280
00281 TGo4ViewPanel* panel = TGo4MdiArea::Instance()->GetActivePanel();
00282 if (panel==0) return;
00283
00284 TPad* pad = panel->GetActivePad();
00285
00286 TString buf;
00287 const char* drawopt = 0;
00288
00289 if ((kind>=0) && (kind<=2)) {
00290 CodeDrawOptions(ErrorBars->currentIndex(),
00291 Coordinates->currentIndex(),
00292 DrawOption->currentIndex(), buf);
00293 if (buf.Length()>0) drawopt = buf.Data();
00294 }
00295
00296 panel->ChangeDrawOption(kind, value, drawopt);
00297 }
00298
00299 void TGo4HisDrawOptions::SetDrawOptions( int t )
00300 {
00301 ChangeDrawOptionForCurrentPanel(0, t);
00302 }
00303
00304 void TGo4HisDrawOptions::SetErrorBars( int t )
00305 {
00306 ChangeDrawOptionForCurrentPanel(1, t);
00307 }
00308
00309 void TGo4HisDrawOptions::SetCoordinates( int t )
00310 {
00311 ChangeDrawOptionForCurrentPanel(2, t);
00312 }
00313
00314 void TGo4HisDrawOptions::XaxisStyle( int t )
00315 {
00316 ChangeDrawOptionForCurrentPanel(3, t);
00317 }
00318
00319 void TGo4HisDrawOptions::YaxisStyle( int t )
00320 {
00321 ChangeDrawOptionForCurrentPanel(4, t);
00322 }
00323
00324 void TGo4HisDrawOptions::ZaxisStyle( int t )
00325 {
00326 ChangeDrawOptionForCurrentPanel(5, t);
00327 }
00328
00329 void TGo4HisDrawOptions::SetAutoScale( bool on )
00330 {
00331 ChangeDrawOptionForCurrentPanel(10, on ? 1 : 0);
00332 }
00333
00334 void TGo4HisDrawOptions::DecodeDrawOption(const char* drawopt,
00335 int& HisErrorStyle,
00336 int& HisCoordStyle,
00337 int& HisDrawStyle)
00338 {
00339 HisDrawStyle = 0;
00340 HisErrorStyle = 0;
00341 HisCoordStyle = 0;
00342 if (fiLastView==view_Histo2) HisDrawStyle = 1;
00343
00344 if ((drawopt==0) || (*drawopt==0)) return;
00345
00346 TString buf(drawopt);
00347 buf.ToLower();
00348
00349
00350
00351 if (fiLastView==view_Polar) {
00352 if (buf.Contains("p") && buf.Contains("f")) HisDrawStyle = 3; else
00353 if (buf.Contains("f")) HisDrawStyle = 2; else
00354 if (buf.Contains("p")) HisDrawStyle = 1; else HisDrawStyle = 0;
00355
00356 if (buf.Contains("a") && buf.Contains("o")) HisCoordStyle = 3; else
00357 if (buf.Contains("o")) HisCoordStyle = 2; else
00358 if (buf.Contains("a")) HisCoordStyle = 1; else HisCoordStyle = 0;
00359
00360 if (buf.Contains("e") && buf.Contains("n")) HisErrorStyle = 3; else
00361 if (buf.Contains("n")) HisErrorStyle = 2; else
00362 if (buf.Contains("e")) HisErrorStyle = 1; else HisErrorStyle = 0;
00363
00364 return;
00365 }
00366
00367 if (fiLastView==view_Graph) {
00368
00369 if (buf.Contains("b") && buf.Contains("*")) HisDrawStyle = 15; else
00370 if (buf.Contains("b") && buf.Contains("p")) HisDrawStyle = 14; else
00371 if (buf.Contains("c") && buf.Contains("*")) HisDrawStyle = 13; else
00372 if (buf.Contains("c") && buf.Contains("p")) HisDrawStyle = 12; else
00373 if (buf.Contains("f") && buf.Contains("*")) HisDrawStyle = 11; else
00374 if (buf.Contains("f") && buf.Contains("p")) HisDrawStyle = 10; else
00375 if (buf.Contains("l") && buf.Contains("*")) HisDrawStyle = 9; else
00376 if (buf.Contains("l") && buf.Contains("p")) HisDrawStyle = 8; else
00377 if (buf.Contains("b")) HisDrawStyle = 7; else
00378 if (buf.Contains("c")) HisDrawStyle = 6; else
00379 if (buf.Contains("f2")) HisDrawStyle = 5; else
00380 if (buf.Contains("f1")) HisDrawStyle = 4; else
00381 if (buf.Contains("f")) HisDrawStyle = 3; else
00382 if (buf.Contains("l")) HisDrawStyle = 2; else
00383 if (buf.Contains("*")) HisDrawStyle = 1;
00384
00385 if (buf.Contains("x+") && buf.Contains("y+")) HisCoordStyle = 4; else
00386 if (buf.Contains("y+")) HisCoordStyle = 3; else
00387 if (buf.Contains("x+")) HisCoordStyle = 2; else
00388 if (buf.Contains("a1")) HisCoordStyle = 5; else
00389 if (buf.Contains("a")) HisCoordStyle = 0; else HisCoordStyle = 1;
00390
00391 if (buf.Contains("x") && (HisCoordStyle!=4) && (HisCoordStyle!=2)) HisErrorStyle = 1; else
00392 if (buf.Contains("|>")) HisErrorStyle = 3; else
00393 if (buf.Contains(">")) HisErrorStyle = 2; else
00394 if (buf.Contains("2") && (HisDrawStyle != 5)) HisErrorStyle = 4; else
00395 if (buf.Contains("3")) HisErrorStyle = 5; else
00396 if (buf.Contains("4")) HisErrorStyle = 6; else
00397 if (buf.Contains("[]")) HisErrorStyle = 7;
00398
00399 return;
00400 }
00401
00402 if (fiLastView==view_Histo1) {
00403 if(buf.Contains("e1")) HisErrorStyle = 2; else
00404 if(buf.Contains("e2")) HisErrorStyle = 3; else
00405 if(buf.Contains("e3")) HisErrorStyle = 4; else
00406 if(buf.Contains("e4")) HisErrorStyle = 5; else
00407 if(buf.Contains("e") && !buf.Contains("text") && !buf.Contains("lego") && !buf.Contains("image")) HisErrorStyle = 1;
00408 } else {
00409 if (buf.Contains("lego") || buf.Contains("surf")) {
00410 if (buf.Contains("fb") && buf.Contains("bb") && buf.Contains("z")) HisErrorStyle = 7; else
00411 if (buf.Contains("bb") && buf.Contains("z")) HisErrorStyle = 6; else
00412 if (buf.Contains("fb") && buf.Contains("z")) HisErrorStyle = 5; else
00413 if (buf.Contains("fb") && buf.Contains("bb")) HisErrorStyle = 4; else
00414 if (buf.Contains("bb")) HisErrorStyle = 3; else
00415 if (buf.Contains("fb")) HisErrorStyle = 2; else
00416 if (buf.Contains("z")) HisErrorStyle = 1;
00417 } else
00418 if (buf.Contains("z")) HisErrorStyle = 1;
00419 }
00420
00421
00422 if(buf.Contains(",pol")) HisCoordStyle = 1; else
00423 if(buf.Contains(",sph")) HisCoordStyle = 2; else
00424 if(buf.Contains(",psr")) HisCoordStyle = 3; else
00425 if(buf.Contains(",cyl")) HisCoordStyle = 4;
00426
00427
00428
00429 if (fiLastView==view_Histo1) {
00430 if(buf.Contains("surf5")) HisDrawStyle = 21; else
00431 if(buf.Contains("surf4")) HisDrawStyle = 20; else
00432 if(buf.Contains("surf3")) HisDrawStyle = 19; else
00433 if(buf.Contains("surf2")) HisDrawStyle = 18; else
00434 if(buf.Contains("surf1")) HisDrawStyle = 17; else
00435 if(buf.Contains("surf")) HisDrawStyle = 16; else
00436 if(buf.Contains("lego2")) HisDrawStyle = 15; else
00437 if(buf.Contains("lego1")) HisDrawStyle = 14; else
00438 if(buf.Contains("lego")) HisDrawStyle = 13; else
00439 if(buf.Contains("lego3")) HisDrawStyle = 13; else
00440 if(buf.Contains("bar")) HisDrawStyle = 12; else
00441 if(buf.Contains("text")) HisDrawStyle = 11; else
00442 if(buf.Contains("][")) HisDrawStyle = 10; else
00443 if(buf.Contains("9h")) HisDrawStyle = 9; else
00444 if(buf.Contains("p0")) HisDrawStyle = 8; else
00445 if(*drawopt == 'p') HisDrawStyle = 7; else
00446 if(*drawopt == 'P') HisDrawStyle = 7; else
00447 if(*drawopt == 'b') HisDrawStyle = 6; else
00448 if(*drawopt == 'B') HisDrawStyle = 6; else
00449 if((*drawopt == 'c') && !buf.Contains("nostack")) HisDrawStyle = 5; else
00450 if((*drawopt == 'C') && !buf.Contains("nostack")) HisDrawStyle = 5; else
00451 if(buf.Contains("lf2")) HisDrawStyle = 4; else
00452 if(*drawopt == 'l') HisDrawStyle = 3; else
00453 if(*drawopt == 'L') HisDrawStyle = 3; else
00454 if(buf.Contains("*h")) HisDrawStyle = 2; else
00455 if(buf.Contains("ah")) HisDrawStyle = 1;
00456
00457 if ((HisDrawStyle>=16) && ((HisCoordStyle==0) || (HisCoordStyle==2)))
00458 HisCoordStyle = 1;
00459 } else {
00460 if(buf.Contains("hist")) HisDrawStyle = 0; else
00461 if(buf.Contains("col")) HisDrawStyle = 1; else
00462 if(buf.Contains("lego3")) HisDrawStyle = 9; else
00463 if(buf.Contains("lego1")) HisDrawStyle = 8; else
00464 if(buf.Contains("lego2")) HisDrawStyle = 3; else
00465 if(buf.Contains("lego")) HisDrawStyle = 9; else
00466 if(buf.Contains("cont0")) HisDrawStyle = 2; else
00467 if(buf.Contains("cont1")) HisDrawStyle = 6; else
00468 if(buf.Contains("cont2")) HisDrawStyle = 10; else
00469 if(buf.Contains("cont3")) HisDrawStyle = 11; else
00470 if(buf.Contains("cont4")) HisDrawStyle = 7; else
00471 if(buf.Contains("cont")) HisDrawStyle = 2; else
00472 if(buf.Contains("surf1")) HisDrawStyle = 5; else
00473 if(buf.Contains("surf2")) HisDrawStyle = 4; else
00474 if(buf.Contains("surf3")) HisDrawStyle = 13; else
00475 if(buf.Contains("surf4")) HisDrawStyle = 14; else
00476 if(buf.Contains("surf5")) HisDrawStyle = 15; else
00477 if(buf.Contains("surf")) HisDrawStyle = 12; else
00478 if(buf.Contains("arr")) HisDrawStyle = 16; else
00479 if(buf.Contains("box")) HisDrawStyle = 17; else
00480 if(buf.Contains("text")) HisDrawStyle = 18; else
00481 if(buf.Contains("asimage")) HisDrawStyle = 19;
00482 }
00483
00484
00485 }
00486
00487 void TGo4HisDrawOptions::CodeDrawOptions(int HisErrorStyle,
00488 int HisCoordStyle,
00489 int HisDrawStyle,
00490 TString& buf)
00491 {
00492 buf = "";
00493
00494 if (fiLastView==view_Polar) {
00495 switch (HisDrawStyle) {
00496 case 0: buf = ""; break;
00497 case 1: buf = "P"; break;
00498 case 2: buf = "F"; break;
00499 case 3: buf = "PF"; break;
00500 }
00501
00502 switch (HisErrorStyle) {
00503 case 0: break;
00504 case 1: buf.Append("E"); break;
00505 case 2: buf.Append("N"); break;
00506 case 3: buf.Append("EN"); break;
00507 }
00508
00509 switch (HisCoordStyle) {
00510 case 0: break;
00511 case 1: buf.Append("A"); break;
00512 case 2: buf.Append("O"); break;
00513 case 3: buf.Append("AO"); break;
00514 }
00515 return;
00516 }
00517
00518
00519 if (fiLastView==view_Graph) {
00520
00521 switch (HisDrawStyle) {
00522 case 0: buf = "P"; break;
00523 case 1: buf = "*"; break;
00524 case 2: buf = "L"; break;
00525 case 3: buf = "F"; break;
00526 case 4: buf = "F1"; break;
00527 case 5: buf = "F2"; break;
00528 case 6: buf = "C"; break;
00529 case 7: buf = "B"; break;
00530 case 8: buf = "LP"; break;
00531 case 9: buf = "L*"; break;
00532 case 10: buf = "FP"; break;
00533 case 11: buf = "F*"; break;
00534 case 12: buf = "CP"; break;
00535 case 13: buf = "C*"; break;
00536 case 14: buf = "BP"; break;
00537 case 15: buf = "B*"; break;
00538 default: buf = "P";
00539 }
00540
00541 switch (HisErrorStyle) {
00542 case 0: break;
00543 case 1: buf.Append("X"); break;
00544 case 2: buf.Append(">"); break;
00545 case 3: buf.Append("|>"); break;
00546 case 4: buf.Append("2"); break;
00547 case 5: buf.Append("3"); break;
00548 case 6: buf.Append("4"); break;
00549 case 7: buf.Append("[]"); break;
00550 }
00551
00552 switch (HisCoordStyle) {
00553 case 0: buf.Append("A"); break;
00554 case 1: break;
00555 case 2: buf.Append("AX+"); break;
00556 case 3: buf.Append("AY+"); break;
00557 case 4: buf.Append("AX+Y+"); break;
00558 case 5: buf.Append("A1"); break;
00559 }
00560
00561 return;
00562 }
00563
00564 if (fiLastView==view_Histo1) {
00565
00566 switch (HisDrawStyle) {
00567 case 0: buf=""; break;
00568 case 1: buf="ah"; break;
00569 case 2: buf="*h"; break;
00570 case 3: buf="l"; break;
00571 case 4: buf="lf2"; break;
00572 case 5: buf="c"; break;
00573 case 6: buf="b"; break;
00574 case 7: buf="p"; break;
00575 case 8: buf="p0"; break;
00576 case 9: buf="9h"; break;
00577 case 10: buf="]["; break;
00578 case 11: buf="text"; break;
00579 case 12: buf="bar"; break;
00580 case 13: buf="lego3"; break;
00581 case 14: buf="lego1"; break;
00582 case 15: buf="lego2"; break;
00583 case 16: buf="surf"; break;
00584 case 17: buf="surf1"; break;
00585 case 18: buf="surf2"; break;
00586 case 19: buf="surf3"; break;
00587 case 20: buf="surf4"; break;
00588 case 21: buf="surf5"; break;
00589 }
00590 if ((HisDrawStyle>=16) && ((HisCoordStyle==0) || (HisCoordStyle==2)))
00591 HisCoordStyle = 1;
00592 } else
00593
00594 switch (HisDrawStyle) {
00595 case 0: buf="hist"; break;
00596 case 1: buf="col"; break;
00597 case 9: buf="lego3"; break;
00598 case 8: buf="lego1"; break;
00599 case 3: buf="lego2"; break;
00600 case 2: buf="cont0"; break;
00601 case 6: buf="cont1"; break;
00602 case 10: buf="cont2"; break;
00603 case 11: buf="cont3"; break;
00604 case 7: buf="cont4"; break;
00605 case 12: buf="surf"; break;
00606 case 5: buf="surf1"; break;
00607 case 4: buf="surf2"; break;
00608 case 13: buf="surf3"; break;
00609 case 14: buf="surf4"; break;
00610 case 15: buf="surf5"; break;
00611 case 16: buf="arr"; break;
00612 case 17: buf="box"; break;
00613 case 18: buf="text"; break;
00614 #ifndef __NOGO4ASI__
00615 case 19: buf="asimage"; break;
00616 #else
00617 case 19: buf=""; break;
00618 #endif
00619 }
00620
00621 switch (HisCoordStyle) {
00622 case 0: break;
00623 case 1: buf.Append(",pol"); break;
00624 case 2: buf.Append(",sph"); break;
00625 case 3: buf.Append(",psr"); break;
00626 case 4: buf.Append(",cyl"); break;
00627 }
00628
00629 if (fiLastView==view_Histo1)
00630 switch (HisErrorStyle) {
00631 case 0: break;
00632 case 1: buf.Append("E"); break;
00633 case 2: buf.Append("E1"); break;
00634 case 3: buf.Append("E2"); break;
00635 case 4: buf.Append("E3"); break;
00636 case 5: buf.Append("E4"); break;
00637 }
00638 else
00639 switch (HisErrorStyle) {
00640 case 0: break;
00641 case 1: buf.Append("Z"); break;
00642 case 2: buf.Append("FB"); break;
00643 case 3: buf.Append("BB"); break;
00644 case 4: buf.Append("BBFB"); break;
00645 case 5: buf.Append("ZFB"); break;
00646 case 6: buf.Append("ZBB"); break;
00647 case 7: buf.Append("ZBBFB"); break;
00648 }
00649 }
00650
00651
00652 void TGo4HisDrawOptions::SetLineColor()
00653 {
00654 ChangeColor(0);
00655 }
00656
00657 void TGo4HisDrawOptions::SetFillColor()
00658 {
00659 ChangeColor(1);
00660 }
00661
00662 void TGo4HisDrawOptions::SetMarkerColor()
00663 {
00664 ChangeColor(2);
00665 }
00666
00667 void TGo4HisDrawOptions::ChangeColor(int kind)
00668 {
00669 TGo4ViewPanel* panel = TGo4MdiArea::Instance()->GetActivePanel();
00670 if (panel==0) return;
00671
00672 TPad* pad = panel->GetActivePad();
00673 TObject* obj = panel->GetSelectedObject(pad, 0);
00674
00675 Color_t icol = 0;
00676
00677 switch (kind) {
00678 case 0: {
00679 TAttLine* att = dynamic_cast<TAttLine*> (obj);
00680 if (att==0) return;
00681 icol = att->GetLineColor();
00682 break;
00683 }
00684 case 1: {
00685 TAttFill* att = dynamic_cast<TAttFill*> (obj);
00686 if (att==0) return;
00687 icol = att->GetFillColor();
00688 break;
00689 }
00690 case 2: {
00691 TAttMarker* att = dynamic_cast<TAttMarker*> (obj);
00692 if (att==0) return;
00693 icol = att->GetMarkerColor();
00694 break;
00695 }
00696 }
00697
00698 TColor* rcol = gROOT->GetColor(icol);
00699
00700 QColor qcol;
00701
00702 if (rcol!=0)
00703 qcol.setRgb(rcol->GetRed(), rcol->GetGreen(), rcol->GetBlue());
00704
00705 QColor c = QColorDialog::getColor(qcol);
00706 if (!c.isValid()) return;
00707
00708 icol = TColor::GetColor(c.red(), c.green(), c.blue());
00709
00710 switch (kind) {
00711 case 0: {
00712 TAttLine* att = dynamic_cast<TAttLine*> (obj);
00713 if (att!=0) att->SetLineColor(icol);
00714 break;
00715 }
00716 case 1: {
00717 TAttFill* att = dynamic_cast<TAttFill*> (obj);
00718 if (att!=0) att->SetFillColor(icol);
00719 break;
00720 }
00721 case 2: {
00722 TAttMarker* att = dynamic_cast<TAttMarker*> (obj);
00723 if (att!=0) att->SetMarkerColor(icol);
00724 break;
00725 }
00726 }
00727
00728 panel->MarkPadModified(pad);
00729
00730 panel->ShootRepaintTimer(pad);
00731
00732 panel->ActivateInGedEditor(obj);
00733 }