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