GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4HisDrawOptions.cpp
Go to the documentation of this file.
1 // $Id: TGo4HisDrawOptions.cpp 1134 2014-01-22 14:53:40Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4HisDrawOptions.h"
15 
16 #include "Riostream.h"
17 #include "TROOT.h"
18 #include "TColor.h"
19 #include "TAttLine.h"
20 #include "TAttFill.h"
21 #include "TAttMarker.h"
22 
23 #include "TGo4Picture.h"
24 #include "TGo4ViewPanel.h"
25 #include "TGo4MdiArea.h"
26 
27 #include <QColorDialog>
28 
29 TGo4HisDrawOptions::TGo4HisDrawOptions( QWidget* parent, const char* name, Qt::WindowFlags fl )
30  : QWidget( parent, fl )
31 {
32  setObjectName( name ? name : "Go4HisDrawOptions");
33  setupUi(this);
34  fbSettingPanelData = true;
35 
36  connect(TGo4MdiArea::Instance(), SIGNAL(panelSignal(TGo4ViewPanel*, TPad*, int)),
37  this, SLOT(panelSlot(TGo4ViewPanel*, TPad*, int)));
38 
40 
41  AutoScaleBox->setVisible(false);
42 
43  LineColor->setEnabled(false);
44  FillColor->setEnabled(false);
45  MarkerColor->setEnabled(false);
46 
47  fbSettingPanelData = false;
48 }
49 
50 void TGo4HisDrawOptions::panelSlot(TGo4ViewPanel* panel, TPad* pad, int signalid)
51 {
52  switch (signalid) {
55  break;
58  TGo4Picture* padopt = panel->GetPadOptions(pad);
59  if (padopt==0) break;
60 
61  int ndim = padopt->GetFullRangeDim();
62  if (ndim<=0) ndim = 1;
63 
64  const char* drawopt = 0;
65  TObject* obj = panel->GetSelectedObject(pad, &drawopt);
66 
67  int viewtype = view_Histo1;
68 
69  TString buf(drawopt);
70  buf.ToLower();
71 
72  if ((obj!=0) && obj->InheritsFrom("TGraphPolar"))
73  viewtype = view_Polar;
74  else
75  if ((obj!=0) && (obj->InheritsFrom("TGraph") || obj->InheritsFrom("TMultiGraph")))
76  viewtype = view_Graph;
77  else
78  if (ndim==1)
79  viewtype = view_Histo1;
80  else
81  if (buf.Contains("lego") || buf.Contains("surf"))
82  viewtype = view_Histo2ext;
83  else
84  viewtype = view_Histo2;
85 
86  fbSettingPanelData = true;
87 
88  if (fiLastView!=viewtype) UpdateView(viewtype);
89 
90  int ErrorStyle = 0, CoordStyle = 0, DrawStyle = 0;
91  DecodeDrawOption(drawopt, ErrorStyle, CoordStyle, DrawStyle);
92 
93  DrawOption->setCurrentIndex(DrawStyle);
94  ErrorBars->setCurrentIndex(ErrorStyle);
95  Coordinates->setCurrentIndex(CoordStyle);
96  XStyle->setCurrentIndex(padopt->GetLogScale(0));
97  YStyle->setCurrentIndex(padopt->GetLogScale(1));
98  ZStyle->setCurrentIndex(padopt->GetLogScale(2));
99  ZStyle->setEnabled(ndim>1);
100  AutoScaleBox->setChecked(padopt->IsAutoScale());
101 
102  LineColor->setEnabled(dynamic_cast<TAttLine*>(obj)!=0);
103  FillColor->setEnabled(dynamic_cast<TAttFill*>(obj)!=0);
104  MarkerColor->setEnabled(dynamic_cast<TAttMarker*>(obj)!=0);
105 
106  fbSettingPanelData = false;
107 
108  break; }
109  default:
110  break;
111  }
112 }
113 
115 {
116  int lines=30;
117  ErrorBars->clear();
118  DrawOption->clear();
119  Coordinates->clear();
120 
121  switch(viewtype) {
122  case view_Histo1:
123  DrawOption->addItem( QIcon(":/icons/h1_t.png"), " scatter");
124  DrawOption->addItem( QIcon(""), "AH no axis");
125  DrawOption->addItem( QIcon(""), "*H stars");
126  DrawOption->addItem( QIcon(""), "L lines");
127  DrawOption->addItem( QIcon(""), "LF2 lines+fill");
128  DrawOption->addItem( QIcon(""), "C curve");
129  DrawOption->addItem( QIcon(""), "B barchart");
130  DrawOption->addItem( QIcon(""), "P polymarkers");
131  DrawOption->addItem( QIcon(""), "P0 polymarkers");
132  DrawOption->addItem( QIcon(""), "9H high resol");
133  DrawOption->addItem( QIcon(""), "][ no right");
134  DrawOption->addItem( QIcon(""), "TEXT digits b/w");
135  DrawOption->addItem( QIcon(""), "BAR barchart");
136  DrawOption->addItem( QIcon(":/icons/lego.png"), " lego b/w");
137  DrawOption->addItem( QIcon(":/icons/lego1.png"), " lego1 shadow");
138  DrawOption->addItem( QIcon(":/icons/lego2.png"), " lego2 color");
139  DrawOption->addItem( QIcon(":/icons/surf.png"), " mesh b/w");
140  DrawOption->addItem( QIcon(":/icons/surf1.png"), " mesh color");
141  DrawOption->addItem( QIcon(":/icons/surf2.png"), " surf c");
142  DrawOption->addItem( QIcon(":/icons/surf3.png"), " mesh+contour");
143  DrawOption->addItem( QIcon(":/icons/surf4.png"), " gourand");
144  DrawOption->addItem( QIcon(":/icons/surf5.png"), " col contour");
145  DrawOption->addItem( QIcon(""), "");
146  lines=30;
147  break;
148  case view_Histo2:
149  case view_Histo2ext:
150  DrawOption->addItem( QIcon(":/icons/h1_t.png"), " scatter");
151  DrawOption->addItem( QIcon(":/icons/col.png"), " pixel c");
152  DrawOption->addItem( QIcon(":/icons/cont0.png")," cont0 c");
153  DrawOption->addItem( QIcon(":/icons/lego2.png")," lego2 color");
154  DrawOption->addItem( QIcon(":/icons/surf2.png")," surf c");
155  DrawOption->addItem( QIcon(":/icons/surf1.png")," mesh color");
156  DrawOption->addItem( QIcon(":/icons/cont1.png")," cont1 c");
157  DrawOption->addItem( QIcon(":/icons/cont1.png")," cont4");
158  DrawOption->addItem( QIcon(":/icons/lego1.png")," lego1 shadow");
159  DrawOption->addItem( QIcon(":/icons/lego.png"), " lego b/w");
160  DrawOption->addItem( QIcon(":/icons/cont2.png")," cont2 dot b/w");
161  DrawOption->addItem( QIcon(":/icons/cont3.png")," cont3 b/w");
162  DrawOption->addItem( QIcon(":/icons/surf.png"), " mesh b/w");
163  DrawOption->addItem( QIcon(":/icons/surf3.png")," mesh+contour");
164  DrawOption->addItem( QIcon(":/icons/surf4.png")," gourand");
165  DrawOption->addItem( QIcon(":/icons/surf5.png")," col contour");
166  DrawOption->addItem( QIcon(""), "ARR arrow mode");
167  DrawOption->addItem( QIcon(""), "BOX boxes");
168  DrawOption->addItem( QIcon(""), "TEXT content");
169  lines=30;
170 #ifndef __NOGO4ASI__
171  DrawOption->addItem( QIcon(":/icons/asimage.png"), " ASImage");
172  DrawOption->addItem( QIcon(""), "");
173 #else
174  DrawOption->addItem( QIcon(""), "");
175 #endif
176  break;
177  case view_Graph:
178  DrawOption->addItem("P: default");
179  DrawOption->addItem("*: stars");
180  DrawOption->addItem("L: line");
181  DrawOption->addItem("F: fill");
182  DrawOption->addItem("F1: fill 1");
183  DrawOption->addItem("F2: fill 2");
184  DrawOption->addItem("C: smooth");
185  DrawOption->addItem("B: bar");
186  DrawOption->addItem("LP: line + mark");
187  DrawOption->addItem("L*: line + *");
188  DrawOption->addItem("FP: fill + mark");
189  DrawOption->addItem("F*: fill + *");
190  DrawOption->addItem("CP: smooth + mark");
191  DrawOption->addItem("C*: smooth + *");
192  DrawOption->addItem("BP: smooth + mark");
193  DrawOption->addItem("B*: smooth + *");
194  lines=30;
195  break;
196  case view_Polar:
197  DrawOption->addItem(": opt as is");
198  DrawOption->addItem("P: polym");
199  DrawOption->addItem("F: fill");
200  DrawOption->addItem("PF: P+F");
201  lines = 10;
202  break;
203  }
204 
205  DrawOption->setMaxVisibleItems(lines);
206 
207  switch(viewtype) {
208  case view_Histo1:
209  ErrorBars->addItem("No Errors");
210  ErrorBars->addItem("E: simple");
211  ErrorBars->addItem("E1: edges");
212  ErrorBars->addItem("E2: rectangles");
213  ErrorBars->addItem("E3: fill");
214  ErrorBars->addItem("E4: contour");
215  break;
216  case view_Histo2:
217  ErrorBars->addItem("No palette");
218  ErrorBars->addItem(QIcon(":/icons/colz.png")," +scale");
219  break;
220  case view_Histo2ext:
221  ErrorBars->addItem("No palette");
222  ErrorBars->addItem(QIcon(":/icons/colz.png")," +scale");
223  ErrorBars->addItem(" - front");
224  ErrorBars->addItem(" - back");
225  ErrorBars->addItem(" - fr & bk");
226  ErrorBars->addItem(QIcon(":/icons/colz.png")," scale - fr");
227  ErrorBars->addItem(QIcon(":/icons/colz.png"), " scale - bk");
228  ErrorBars->addItem(QIcon(":/icons/colz.png"), " scale - fr & bk");
229  break;
230  case view_Graph:
231  ErrorBars->addItem("errors as is");
232  ErrorBars->addItem("X: no errors");
233  ErrorBars->addItem(">: arrow");
234  ErrorBars->addItem("|>: full arrow");
235  ErrorBars->addItem("2: err opt 2");
236  ErrorBars->addItem("3: err opt 3");
237  ErrorBars->addItem("4: err opt 4");
238  ErrorBars->addItem("[]: asym err");
239  break;
240  case view_Polar:
241  ErrorBars->addItem(": err as is");
242  ErrorBars->addItem("E: error bars");
243  ErrorBars->addItem("N: no labels");
244  ErrorBars->addItem("EN: E+N");
245  break;
246  }
247 
248  switch(viewtype) {
249  case view_Histo1:
250  case view_Histo2:
251  case view_Histo2ext:
252  Coordinates->addItem("Cartesian");
253  Coordinates->addItem("Polar");
254  Coordinates->addItem("Spheric");
255  Coordinates->addItem("Rapidity");
256  Coordinates->addItem("Cylindric");
257  break;
258  case view_Graph:
259  Coordinates->addItem("A: norm axis");
260  Coordinates->addItem("supp. axis");
261  Coordinates->addItem("AX+: top");
262  Coordinates->addItem("AY+: right");
263  Coordinates->addItem("AX+Y+: x & y");
264  Coordinates->addItem("A1: ylow = ymin");
265  break;
266  case view_Polar:
267  Coordinates->addItem(": axis as is");
268  Coordinates->addItem("A: force axis");
269  Coordinates->addItem("O: orthogonal");
270  Coordinates->addItem("AO: A+O");
271  break;
272  }
273 
274  fiLastView = viewtype;
275 }
276 
278 {
279  if (fbSettingPanelData) return;
280 
282  if (panel==0) return;
283 
284  TPad* pad = panel->GetActivePad();
285 
286  TString buf;
287  const char* drawopt = 0;
288 
289  if ((kind>=0) && (kind<=2)) {
290  CodeDrawOptions(ErrorBars->currentIndex(),
291  Coordinates->currentIndex(),
292  DrawOption->currentIndex(), buf);
293  if (buf.Length()>0) drawopt = buf.Data();
294  }
295 
296  panel->ChangeDrawOption(kind, value, drawopt);
297 }
298 
300 {
302 }
303 
305 {
307 }
308 
310 {
312 }
313 
315 {
317 }
318 
320 {
322 }
323 
325 {
327 }
328 
330 {
331  ChangeDrawOptionForCurrentPanel(10, on ? 1 : 0);
332 }
333 
334 void TGo4HisDrawOptions::DecodeDrawOption(const char* drawopt,
335  int& HisErrorStyle,
336  int& HisCoordStyle,
337  int& HisDrawStyle)
338 {
339  HisDrawStyle = 0;
340  HisErrorStyle = 0;
341  HisCoordStyle = 0;
342  if (fiLastView==view_Histo2) HisDrawStyle = 1;
343 
344  if ((drawopt==0) || (*drawopt==0)) return;
345 
346  TString buf(drawopt);
347  buf.ToLower();
348 
349 // check for error options in string:
350 
351  if (fiLastView==view_Polar) {
352  if (buf.Contains("p") && buf.Contains("f")) HisDrawStyle = 3; else
353  if (buf.Contains("f")) HisDrawStyle = 2; else
354  if (buf.Contains("p")) HisDrawStyle = 1; else HisDrawStyle = 0;
355 
356  if (buf.Contains("a") && buf.Contains("o")) HisCoordStyle = 3; else
357  if (buf.Contains("o")) HisCoordStyle = 2; else
358  if (buf.Contains("a")) HisCoordStyle = 1; else HisCoordStyle = 0;
359 
360  if (buf.Contains("e") && buf.Contains("n")) HisErrorStyle = 3; else
361  if (buf.Contains("n")) HisErrorStyle = 2; else
362  if (buf.Contains("e")) HisErrorStyle = 1; else HisErrorStyle = 0;
363 
364  return;
365  }
366 
367  if (fiLastView==view_Graph) {
368 
369  if (buf.Contains("b") && buf.Contains("*")) HisDrawStyle = 15; else
370  if (buf.Contains("b") && buf.Contains("p")) HisDrawStyle = 14; else
371  if (buf.Contains("c") && buf.Contains("*")) HisDrawStyle = 13; else
372  if (buf.Contains("c") && buf.Contains("p")) HisDrawStyle = 12; else
373  if (buf.Contains("f") && buf.Contains("*")) HisDrawStyle = 11; else
374  if (buf.Contains("f") && buf.Contains("p")) HisDrawStyle = 10; else
375  if (buf.Contains("l") && buf.Contains("*")) HisDrawStyle = 9; else
376  if (buf.Contains("l") && buf.Contains("p")) HisDrawStyle = 8; else
377  if (buf.Contains("b")) HisDrawStyle = 7; else
378  if (buf.Contains("c")) HisDrawStyle = 6; else
379  if (buf.Contains("f2")) HisDrawStyle = 5; else
380  if (buf.Contains("f1")) HisDrawStyle = 4; else
381  if (buf.Contains("f")) HisDrawStyle = 3; else
382  if (buf.Contains("l")) HisDrawStyle = 2; else
383  if (buf.Contains("*")) HisDrawStyle = 1;
384 
385  if (buf.Contains("x+") && buf.Contains("y+")) HisCoordStyle = 4; else
386  if (buf.Contains("y+")) HisCoordStyle = 3; else
387  if (buf.Contains("x+")) HisCoordStyle = 2; else
388  if (buf.Contains("a1")) HisCoordStyle = 5; else
389  if (buf.Contains("a")) HisCoordStyle = 0; else HisCoordStyle = 1;
390 
391  if (buf.Contains("x") && (HisCoordStyle!=4) && (HisCoordStyle!=2)) HisErrorStyle = 1; else
392  if (buf.Contains("|>")) HisErrorStyle = 3; else
393  if (buf.Contains(">")) HisErrorStyle = 2; else
394  if (buf.Contains("2") && (HisDrawStyle != 5)) HisErrorStyle = 4; else
395  if (buf.Contains("3")) HisErrorStyle = 5; else
396  if (buf.Contains("4")) HisErrorStyle = 6; else
397  if (buf.Contains("[]")) HisErrorStyle = 7;
398 
399  return;
400  }
401 
402  if (fiLastView==view_Histo1) {
403  if(buf.Contains("e1")) HisErrorStyle = 2; else
404  if(buf.Contains("e2")) HisErrorStyle = 3; else
405  if(buf.Contains("e3")) HisErrorStyle = 4; else
406  if(buf.Contains("e4")) HisErrorStyle = 5; else
407  if(buf.Contains("e") && !buf.Contains("text") && !buf.Contains("lego") && !buf.Contains("image")) HisErrorStyle = 1;
408  } else { // Histo2
409  if (buf.Contains("lego") || buf.Contains("surf")) {
410  if (buf.Contains("fb") && buf.Contains("bb") && buf.Contains("z")) HisErrorStyle = 7; else
411  if (buf.Contains("bb") && buf.Contains("z")) HisErrorStyle = 6; else
412  if (buf.Contains("fb") && buf.Contains("z")) HisErrorStyle = 5; else
413  if (buf.Contains("fb") && buf.Contains("bb")) HisErrorStyle = 4; else
414  if (buf.Contains("bb")) HisErrorStyle = 3; else
415  if (buf.Contains("fb")) HisErrorStyle = 2; else
416  if (buf.Contains("z")) HisErrorStyle = 1;
417  } else
418  if (buf.Contains("z")) HisErrorStyle = 1;
419  }
420 
421  // check coordinate specs in string:
422  if(buf.Contains(",pol")) HisCoordStyle = 1; else
423  if(buf.Contains(",sph")) HisCoordStyle = 2; else
424  if(buf.Contains(",psr")) HisCoordStyle = 3; else
425  if(buf.Contains(",cyl")) HisCoordStyle = 4;
426 
427  // check draw options itself:
428 
429  if (fiLastView==view_Histo1) {
430  if(buf.Contains("surf5")) HisDrawStyle = 21; else
431  if(buf.Contains("surf4")) HisDrawStyle = 20; else
432  if(buf.Contains("surf3")) HisDrawStyle = 19; else
433  if(buf.Contains("surf2")) HisDrawStyle = 18; else
434  if(buf.Contains("surf1")) HisDrawStyle = 17; else
435  if(buf.Contains("surf")) HisDrawStyle = 16; else
436  if(buf.Contains("lego2")) HisDrawStyle = 15; else
437  if(buf.Contains("lego1")) HisDrawStyle = 14; else
438  if(buf.Contains("lego")) HisDrawStyle = 13; else
439  if(buf.Contains("lego3")) HisDrawStyle = 13; else // from gededitor
440  if(buf.Contains("bar")) HisDrawStyle = 12; else
441  if(buf.Contains("text")) HisDrawStyle = 11; else
442  if(buf.Contains("][")) HisDrawStyle = 10; else
443  if(buf.Contains("9h")) HisDrawStyle = 9; else
444  if(buf.Contains("p0")) HisDrawStyle = 8; else
445  if(*drawopt == 'p') HisDrawStyle = 7; else
446  if(*drawopt == 'P') HisDrawStyle = 7; else
447  if(*drawopt == 'b') HisDrawStyle = 6; else
448  if(*drawopt == 'B') HisDrawStyle = 6; else
449  if((*drawopt == 'c') && !buf.Contains("nostack")) HisDrawStyle = 5; else
450  if((*drawopt == 'C') && !buf.Contains("nostack")) HisDrawStyle = 5; else
451  if(buf.Contains("lf2")) HisDrawStyle = 4; else
452  if(*drawopt == 'l') HisDrawStyle = 3; else
453  if(*drawopt == 'L') HisDrawStyle = 3; else
454  if(buf.Contains("*h")) HisDrawStyle = 2; else
455  if(buf.Contains("ah")) HisDrawStyle = 1;
456 
457  if ((HisDrawStyle>=16) && ((HisCoordStyle==0) || (HisCoordStyle==2)))
458  HisCoordStyle = 1;
459  } else { // Histo2
460  if(buf.Contains("hist")) HisDrawStyle = 0; else
461  if(buf.Contains("col")) HisDrawStyle = 1; else
462  if(buf.Contains("lego3")) HisDrawStyle = 9; else // from gededitor
463  if(buf.Contains("lego1")) HisDrawStyle = 8; else
464  if(buf.Contains("lego2")) HisDrawStyle = 3; else
465  if(buf.Contains("lego")) HisDrawStyle = 9; else
466  if(buf.Contains("cont0")) HisDrawStyle = 2; else
467  if(buf.Contains("cont1")) HisDrawStyle = 6; else
468  if(buf.Contains("cont2")) HisDrawStyle = 10; else
469  if(buf.Contains("cont3")) HisDrawStyle = 11; else
470  if(buf.Contains("cont4")) HisDrawStyle = 7; else
471  if(buf.Contains("cont")) HisDrawStyle = 2; else
472  if(buf.Contains("surf1")) HisDrawStyle = 5; else
473  if(buf.Contains("surf2")) HisDrawStyle = 4; else
474  if(buf.Contains("surf3")) HisDrawStyle = 13; else
475  if(buf.Contains("surf4")) HisDrawStyle = 14; else
476  if(buf.Contains("surf5")) HisDrawStyle = 15; else
477  if(buf.Contains("surf")) HisDrawStyle = 12; else
478  if(buf.Contains("arr")) HisDrawStyle = 16; else
479  if(buf.Contains("box")) HisDrawStyle = 17; else
480  if(buf.Contains("text")) HisDrawStyle = 18; else
481  if(buf.Contains("asimage")) HisDrawStyle = 19;
482  }
483  //std::cout << *drawopt << " Decode " << buf << " Error " << HisErrorStyle
484  // << " Coord " << HisCoordStyle << " Draw " <<HisDrawStyle<< std::endl;
485 }
486 
487 void TGo4HisDrawOptions::CodeDrawOptions(int HisErrorStyle,
488  int HisCoordStyle,
489  int HisDrawStyle,
490  TString& buf)
491 {
492  buf = "";
493 
494  if (fiLastView==view_Polar) {
495  switch (HisDrawStyle) {
496  case 0: buf = ""; break;
497  case 1: buf = "P"; break;
498  case 2: buf = "F"; break;
499  case 3: buf = "PF"; break;
500  }
501 
502  switch (HisErrorStyle) {
503  case 0: break;
504  case 1: buf.Append("E"); break;
505  case 2: buf.Append("N"); break;
506  case 3: buf.Append("EN"); break;
507  }
508 
509  switch (HisCoordStyle) {
510  case 0: break;
511  case 1: buf.Append("A"); break;
512  case 2: buf.Append("O"); break;
513  case 3: buf.Append("AO"); break;
514  }
515  return;
516  }
517 
518 
519  if (fiLastView==view_Graph) {
520 
521  switch (HisDrawStyle) {
522  case 0: buf = "P"; break;
523  case 1: buf = "*"; break;
524  case 2: buf = "L"; break;
525  case 3: buf = "F"; break;
526  case 4: buf = "F1"; break;
527  case 5: buf = "F2"; break;
528  case 6: buf = "C"; break;
529  case 7: buf = "B"; break;
530  case 8: buf = "LP"; break;
531  case 9: buf = "L*"; break;
532  case 10: buf = "FP"; break;
533  case 11: buf = "F*"; break;
534  case 12: buf = "CP"; break;
535  case 13: buf = "C*"; break;
536  case 14: buf = "BP"; break;
537  case 15: buf = "B*"; break;
538  default: buf = "P";
539  }
540 
541  switch (HisErrorStyle) {
542  case 0: break;
543  case 1: buf.Append("X"); break;
544  case 2: buf.Append(">"); break;
545  case 3: buf.Append("|>"); break;
546  case 4: buf.Append("2"); break;
547  case 5: buf.Append("3"); break;
548  case 6: buf.Append("4"); break;
549  case 7: buf.Append("[]"); break;
550  }
551 
552  switch (HisCoordStyle) {
553  case 0: buf.Append("A"); break;
554  case 1: break;
555  case 2: buf.Append("AX+"); break;
556  case 3: buf.Append("AY+"); break;
557  case 4: buf.Append("AX+Y+"); break;
558  case 5: buf.Append("A1"); break;
559  }
560 
561  return;
562  }
563 
564  if (fiLastView==view_Histo1) {
565 
566  switch (HisDrawStyle) {
567  case 0: buf=""; break;
568  case 1: buf="ah"; break;
569  case 2: buf="*h"; break;
570  case 3: buf="l"; break;
571  case 4: buf="lf2"; break;
572  case 5: buf="c"; break;
573  case 6: buf="b"; break;
574  case 7: buf="p"; break;
575  case 8: buf="p0"; break;
576  case 9: buf="9h"; break;
577  case 10: buf="]["; break;
578  case 11: buf="text"; break;
579  case 12: buf="bar"; break;
580  case 13: buf="lego3"; break; // for geditor, "lego"
581  case 14: buf="lego1"; break;
582  case 15: buf="lego2"; break;
583  case 16: buf="surf"; break;
584  case 17: buf="surf1"; break;
585  case 18: buf="surf2"; break;
586  case 19: buf="surf3"; break;
587  case 20: buf="surf4"; break;
588  case 21: buf="surf5"; break;
589  }
590  if ((HisDrawStyle>=16) && ((HisCoordStyle==0) || (HisCoordStyle==2)))
591  HisCoordStyle = 1;
592  } else // Histo2
593 
594  switch (HisDrawStyle) {
595  case 0: buf="hist"; break;
596  case 1: buf="col"; break;
597  case 9: buf="lego3"; break;
598  case 8: buf="lego1"; break;
599  case 3: buf="lego2"; break;
600  case 2: buf="cont0"; break;
601  case 6: buf="cont1"; break;
602  case 10: buf="cont2"; break;
603  case 11: buf="cont3"; break;
604  case 7: buf="cont4"; break;
605  case 12: buf="surf"; break;
606  case 5: buf="surf1"; break;
607  case 4: buf="surf2"; break;
608  case 13: buf="surf3"; break;
609  case 14: buf="surf4"; break;
610  case 15: buf="surf5"; break;
611  case 16: buf="arr"; break;
612  case 17: buf="box"; break;
613  case 18: buf="text"; break;
614 #ifndef __NOGO4ASI__
615  case 19: buf="asimage"; break;
616 #else
617  case 19: buf=""; break;
618 #endif
619  }
620 
621  switch (HisCoordStyle) {
622  case 0: break;
623  case 1: buf.Append(",pol"); break;
624  case 2: buf.Append(",sph"); break;
625  case 3: buf.Append(",psr"); break;
626  case 4: buf.Append(",cyl"); break;
627  }
628 
629  if (fiLastView==view_Histo1)
630  switch (HisErrorStyle) {
631  case 0: break;
632  case 1: buf.Append("E"); break;
633  case 2: buf.Append("E1"); break;
634  case 3: buf.Append("E2"); break;
635  case 4: buf.Append("E3"); break;
636  case 5: buf.Append("E4"); break;
637  }
638  else
639  switch (HisErrorStyle) {
640  case 0: break;
641  case 1: buf.Append("Z"); break;
642  case 2: buf.Append("FB"); break;
643  case 3: buf.Append("BB"); break;
644  case 4: buf.Append("BBFB"); break;
645  case 5: buf.Append("ZFB"); break;
646  case 6: buf.Append("ZBB"); break;
647  case 7: buf.Append("ZBBFB"); break;
648  }
649 }
650 
651 
653 {
654  ChangeColor(0);
655 }
656 
658 {
659  ChangeColor(1);
660 }
661 
663 {
664  ChangeColor(2);
665 }
666 
668 {
670  if (panel==0) return;
671 
672  TPad* pad = panel->GetActivePad();
673  TObject* obj = panel->GetSelectedObject(pad, 0);
674 
675  Color_t icol = 0;
676 
677  switch (kind) {
678  case 0: {
679  TAttLine* att = dynamic_cast<TAttLine*> (obj);
680  if (att==0) return;
681  icol = att->GetLineColor();
682  break;
683  }
684  case 1: {
685  TAttFill* att = dynamic_cast<TAttFill*> (obj);
686  if (att==0) return;
687  icol = att->GetFillColor();
688  break;
689  }
690  case 2: {
691  TAttMarker* att = dynamic_cast<TAttMarker*> (obj);
692  if (att==0) return;
693  icol = att->GetMarkerColor();
694  break;
695  }
696  }
697 
698  TColor* rcol = gROOT->GetColor(icol);
699 
700  QColor qcol;
701 
702  if (rcol!=0)
703  qcol.setRgb(rcol->GetRed(), rcol->GetGreen(), rcol->GetBlue());
704 
705  QColor c = QColorDialog::getColor(qcol);
706  if (!c.isValid()) return;
707 
708  icol = TColor::GetColor(c.red(), c.green(), c.blue());
709 
710  switch (kind) {
711  case 0: {
712  TAttLine* att = dynamic_cast<TAttLine*> (obj);
713  if (att!=0) att->SetLineColor(icol);
714  break;
715  }
716  case 1: {
717  TAttFill* att = dynamic_cast<TAttFill*> (obj);
718  if (att!=0) att->SetFillColor(icol);
719  break;
720  }
721  case 2: {
722  TAttMarker* att = dynamic_cast<TAttMarker*> (obj);
723  if (att!=0) att->SetMarkerColor(icol);
724  break;
725  }
726  }
727 
728  panel->MarkPadModified(pad);
729 
730  panel->ShootRepaintTimer(pad);
731 
732  panel->ActivateInGedEditor(obj);
733 }
virtual void ShootRepaintTimer()
virtual void SetMarkerColor()
virtual void ZaxisStyle(int t)
virtual void SetCoordinates(int t)
virtual void XaxisStyle(int t)
virtual void ActivateInGedEditor(TObject *obj)
virtual void panelSlot(TGo4ViewPanel *panel, TPad *pad, int signalid)
virtual void SetDrawOptions(int t)
Int_t GetLogScale(Int_t nscale=0)
static TGo4MdiArea * Instance()
Definition: TGo4MdiArea.cpp:27
bool IsAutoScale() const
virtual void ChangeColor(int kind)
virtual void SetFillColor()
virtual void CodeDrawOptions(int HisErrorStyle, int HisCoordStyle, int HisDrawStyle, TString &buf)
virtual void UpdateView(int viewtype)
virtual void MarkPadModified(TPad *pad)
TGo4ViewPanel * GetActivePanel()
Definition: TGo4MdiArea.cpp:64
virtual void SetAutoScale(bool on)
virtual TGo4Picture * GetPadOptions(TPad *pad)
virtual void DecodeDrawOption(const char *drawopt, int &HisErrorStyle, int &HisCoordStyle, int &HisDrawStyle)
virtual void ChangeDrawOptionForCurrentPanel(int kind, int value)
virtual void SetLineColor()
virtual void ChangeDrawOption(int kind, int value, const char *drawopt)
Int_t GetFullRangeDim() const
virtual TPad * GetActivePad()
TGo4HisDrawOptions(QWidget *parent=0, const char *name=0, Qt::WindowFlags fl=0)
virtual TObject * GetSelectedObject(TPad *pad, const char **drawopt)
virtual void YaxisStyle(int t)
virtual void SetErrorBars(int t)