GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4ConditionEditor.cpp
Go to the documentation of this file.
1 // $Id$
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 fuer 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 
15 #include "TGo4ConditionEditor.h"
16 
17 #include <QMessageBox>
18 #include <QMenu>
19 
20 #include "TH1.h"
21 #include "TMath.h"
22 #include "TCutG.h"
23 #include "TClass.h"
24 #include "TPad.h"
25 #include "TArrayD.h"
26 #include "TGo4Slot.h"
27 #include "TGo4WinCond.h"
28 #include "TGo4PolyCond.h"
29 #include "TGo4ShapedCond.h"
30 #include "TGo4ListCond.h"
31 #include "TGo4CondArray.h"
32 #include "TGo4ViewPanel.h"
33 #include "TGo4BrowserProxy.h"
34 #include "TGo4AnalysisProxy.h"
35 
36 
37 TGo4ConditionEditor::TGo4ConditionEditor(QWidget *parent, const char *name) :
38  QGo4Widget(parent, name)
39 {
40  setupUi(this);
41 
42  QObject::connect(CloseWin, &QPushButton::clicked, this, &TGo4ConditionEditor::CloseMDIParentSlot);
43  QObject::connect(UpdateCon, &QPushButton::clicked, this, &TGo4ConditionEditor::UpdatePressed);
44  QObject::connect(ArrayElements, QOverload<int>::of(&QSpinBox::valueChanged), this, &TGo4ConditionEditor::SelectedCond);
45  QObject::connect(ResultCombo, QOverload<int>::of(&QComboBox::activated), this, &TGo4ConditionEditor::SetResultMode);
46  QObject::connect(InvertCombo, QOverload<int>::of(&QComboBox::activated), this, &TGo4ConditionEditor::SetInvertMode);
47  QObject::connect(ClearCondCount, &QPushButton::clicked, this, &TGo4ConditionEditor::ClearCounters);
48  QObject::connect(DisplayB, &QPushButton::clicked, this, &TGo4ConditionEditor::DisplayPressed);
49  QObject::connect(RefreshButton, &QPushButton::clicked, this, &TGo4ConditionEditor::RefreshClicked);
50  QObject::connect(Win1_low, &QLineEdit::returnPressed, this, &TGo4ConditionEditor::LimitsReturnPressed);
51  QObject::connect(Win1_up, &QLineEdit::returnPressed, this, &TGo4ConditionEditor::LimitsReturnPressed);
52  QObject::connect(Win2_low, &QLineEdit::returnPressed, this, &TGo4ConditionEditor::LimitsReturnPressed);
53  QObject::connect(Win2_up, &QLineEdit::returnPressed, this, &TGo4ConditionEditor::LimitsReturnPressed);
54  QObject::connect(Win1_low, &QLineEdit::textChanged, this, &TGo4ConditionEditor::LimitsChanged);
55  QObject::connect(Win1_up, &QLineEdit::textChanged, this, &TGo4ConditionEditor::LimitsChanged);
56  QObject::connect(Win2_low, &QLineEdit::textChanged, this, &TGo4ConditionEditor::LimitsChanged);
57  QObject::connect(Win2_up, &QLineEdit::textChanged, this, &TGo4ConditionEditor::LimitsChanged);
58  QObject::connect(CondLimits, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetDrawLimits);
59  QObject::connect(CondLabel, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetLabel);
60  QObject::connect(IntBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetIntDraw);
61  QObject::connect(MaxXBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetXMaxDraw);
62  QObject::connect(MaxYBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetYMaxDraw);
63  QObject::connect(MaxCBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetCMaxDraw);
64  QObject::connect(ArrayAllButton, &QPushButton::clicked, this, &TGo4ConditionEditor::ArrayAll);
65  QObject::connect(PrintLog, &QPushButton::clicked, this, &TGo4ConditionEditor::PrintConditionLog);
66  QObject::connect(SaveCon, &QPushButton::clicked, this, &TGo4ConditionEditor::SaveCondition);
67  QObject::connect(XMeanBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetXMeanDraw);
68  QObject::connect(YMeanBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetYMeanDraw);
69  QObject::connect(XRMSBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetXRMSDraw);
70  QObject::connect(YRMSBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetYRMSDraw);
71  QObject::connect(CondVisibleChk, &QCheckBox::toggled, this, &TGo4ConditionEditor::SetCondVisible);
72  QObject::connect(ModifyButton, &QPushButton::clicked, this, &TGo4ConditionEditor::ModifyButton_clicked);
73  QObject::connect(NPointsSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &TGo4ConditionEditor::NPointsSpin_valueChanged);
74  QObject::connect(CutTable, &QTableWidget::cellChanged, this, &TGo4ConditionEditor::CutTable_valueChanged);
75  QObject::connect(CutTable, &QTableWidget::customContextMenuRequested, this, &TGo4ConditionEditor::CutTable_contextMenuRequested);
76  QObject::connect(EllipseTiltDial, &QDial::valueChanged, this, &TGo4ConditionEditor::EllipseTheta_valueChanged);
77  QObject::connect(AutoRefreshBox, &QCheckBox::toggled, this, &TGo4ConditionEditor::EllipseRefreshBox_toggled);
78  QObject::connect(EllipseA1Spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &TGo4ConditionEditor::EllipseA1_valueChanged);
79  QObject::connect(EllipseA2Spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &TGo4ConditionEditor::EllipseA2_valueChanged);
80  QObject::connect(EllipseCxSpinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &TGo4ConditionEditor::EllipseCx_valueChanged);
81  QObject::connect(EllipseCySpinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &TGo4ConditionEditor::EllipseCy_valueChanged);
82  QObject::connect(EllipseTiltEdit, &QLineEdit::returnPressed, this, &TGo4ConditionEditor::EllipseTheta_returnPressed);
83  QObject::connect(EllipseNptsSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &TGo4ConditionEditor::EllipseNPoints_valueChanged);
84  QObject::connect(CircleBox, &QCheckBox::toggled, EllipseA2Spinbox, &QDoubleSpinBox::setDisabled);
85  QObject::connect(CircleBox, &QCheckBox::toggled, EllipseTiltDial, &QDial::setDisabled);
86  QObject::connect(CircleBox, &QCheckBox::toggled, EllipseTiltEdit, &QLineEdit::setDisabled);
87  QObject::connect(BoxshapeBox, &QCheckBox::toggled, EllipseNptsSpin, &QSpinBox::setDisabled);
88  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseCxSpinbox, &QDoubleSpinBox::setDisabled);
89  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseCySpinbox, &QDoubleSpinBox::setDisabled);
90  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseA1Spinbox, &QDoubleSpinBox::setDisabled);
91  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseA2Spinbox, &QDoubleSpinBox::setDisabled);
92  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseTiltDial, &QDial::setDisabled);
93  QObject::connect(FreeshapeBox, &QCheckBox::toggled, EllipseTiltEdit, &QLineEdit::setDisabled);
94  QObject::connect(CircleBox, &QCheckBox::clicked, this, &TGo4ConditionEditor::EllipseCircleBox_toggled);
95  QObject::connect(BoxshapeBox, &QCheckBox::clicked, this, &TGo4ConditionEditor::EllipseCircleBox_toggled);
96  QObject::connect(EllipseBox, &QCheckBox::clicked, this, &TGo4ConditionEditor::EllipseCircleBox_toggled);
97  QObject::connect(FreeshapeBox, &QCheckBox::clicked, this, &TGo4ConditionEditor::EllipseCircleBox_toggled);
98 
99  LCDCounts->setDigitCount(10);
100  LCDTrueCounts->setDigitCount(10);
101 
102  setWindowTitle("Condition editor");
103  ResetWidget();
104  fiSelectedIndex = -1;
105  parentWidget()->adjustSize();
106  fbDrawOnNextRefresh = false;
107  fbEllipseAutoRefresh = false;
108  fiLastChangeValue = -1;
109  CutTable->setContextMenuPolicy(Qt::CustomContextMenu);
110  fbNewWindow=true;
111 }
112 
113 
114 bool TGo4ConditionEditor::IsAcceptDrag(const char *itemname, TClass *cl, int kind)
115 {
116  if (!cl) return false;
117  bool res = cl->InheritsFrom(TGo4Condition::Class());
118 // res = res || cl->InheritsFrom(TH1::Class());
119  return res;
120 }
121 
122 void TGo4ConditionEditor::DropItem(const char *itemname, TClass *cl, int kind)
123 {
124  if (!cl) return;
125 
126  if (cl->InheritsFrom(TGo4Condition::Class()))
127  WorkWithCondition(itemname);
128 
129 // uncomment this to enable histogram drop on condition editor
130 
131 // else
132 // if (cl->InheritsFrom(TH1::Class()) && (fiSelectedIndex==-1)) {
133 // RemoveLink("Histogram");
134 // AddLink(itemname, "Histogram");
135 // GetLinked("Histogram", 1);
136 //
137 // auto cond = GetLinkedCast<TGo4Condition>("Condition");
138 // if (cond) {
139 // cond->SetHistogram(itemname);
140 // cond->SetHistogramLink(kTRUE);
141 // }
142 // CondTabs->setCurrentIndex(1);
143 // PleaseUpdateSlot();
144 // RefreshWidget();
145 // }
146 
147 }
148 
149 void TGo4ConditionEditor::linkedObjectUpdated(const char *linkname, TObject *obj)
150 {
151  if (strcmp(linkname,"Condition") == 0) {
152  TGo4Condition *cond = dynamic_cast<TGo4Condition *> (obj);
153  if (cond) cond->SetChanged(kFALSE);
154  }
155 
156  RefreshWidget(false);
157 }
158 
160 {
161  if (strcmp(linkname,"Condition") == 0)
162  ShootCloseWidget(true);
163 }
164 
165 void TGo4ConditionEditor::WorkWithCondition(const char *itemname)
166 {
167  const char *conditemname = GetLinkedName("Condition");
168 
169  auto con = GetLinkedCast<TGo4Condition>("Condition");
170  if (con && (con->IsChanged() != 0) && (strcmp(conditemname,itemname) != 0)) {
171  QMessageBox msgBox(QMessageBox::Question, "Condition editor",
172  QString("Current condition %1 is modified!\nNew condition %2 is selected.").arg(conditemname).arg(itemname));
173 
174  auto btnContinue = msgBox.addButton("Continue with current", QMessageBox::ActionRole);
175  /*auto btnNew = */ msgBox.addButton("Start with new", QMessageBox::ActionRole);
176  msgBox.setDefaultButton(btnContinue);
177 
178  msgBox.exec();
179  if (msgBox.clickedButton() == btnContinue)
180  return;
181  }
182 
183  if (!conditemname || (strcmp(conditemname,itemname) != 0)) {
184  ResetWidget();
185  CondNameLbl->setText(itemname);
186  AddLink(itemname, "Condition");
187  }
188 
189  QString iconname = ":/icons/right.png";
190  QString tooltip = "Refresh condition from analysis";
191  if (!BrowserItemRemote(itemname)) {
192  iconname = ":/icons/refresh.png";
193  tooltip = "Refresh condition from source";
194  }
195  RefreshButton->setIcon( QIcon(iconname) );
196  RefreshButton->setToolTip(tooltip);
197 
198  TGo4ViewPanel *panel = WhereItemDrawn(itemname);
199 
200  if (!panel) {
201  GetLinked("Condition", 2);
202  fbDrawOnNextRefresh = true;
203  fiSelectedIndex = -1;
204  } else {
205  TPad *pad = panel->FindPadWithItem(itemname);
207  panel->setFocus();
208  }
209 
210  RefreshWidget(false);
211  setFocus();
212 }
213 
215 {
217  CondNameLbl->setText("");
218  CondClassLbl->setText("");
219 
220  PleaseUpdateLabel->setVisible(false);
221 
222  ArrayAllButton->setVisible(false);
223  ArrayElements->setVisible(false);
224 
225  HistogramChk->setVisible(false);
226  HistogramChk->setChecked(false);
227  HistogramChk->setText("null");
228  HistogramChk->setEnabled(false);
229 
230  CondVisibleChk->setVisible(false);
231  DrawInfoLbl->setText("");
232  CondTabs->setEnabled(false);
233 
234  LCDCounts->display(0);
235  LCDTrueCounts->display(0);
236 
237  Win1_low->setDisabled(true);
238  Win1_up->setDisabled(true);
239  Win2_low->setDisabled(true);
240  Win2_up->setDisabled(true);
241 
242  ResultCombo->setEnabled(false);
243  InvertCombo->setEnabled(false);
244 
245  //CondTabs->setTabEnabled(1, false);
246  //CondTabs->setTabEnabled(2, false);
247 }
248 
250 {
251  auto cond = GetLinkedCast<TGo4Condition>("Condition");
252  if (!cond) return;
253  const char *conditemname = GetLinkedName("Condition");
254  TGo4ViewPanel *panel = WhereItemDrawn(conditemname);
255  TPad *pad = !panel ? nullptr : panel->FindPadWithItem(conditemname);
256 
257  TGo4BrowserProxy *br = Browser();
258  TGo4ServerProxy *serv = br ? br->DefineServerObject(conditemname) : nullptr;
259  UpdateCon->setEnabled(!serv || serv->CanSubmitObjects());
260 
261  PleaseUpdateLabel->setVisible(cond->IsChanged() != 0);
262  fiLastChangeValue = cond->IsChanged();
263 
264  QString hitemname;
265  TH1 *histo = nullptr;
266  if (panel && pad) {
267  histo = panel->GetPadHistogram(pad);
268  hitemname = panel->GetDrawObjectLinkName(pad, histo);
269  if (checkindex) {
270  QString selname = panel->GetSelectedMarkerName(pad);
271  int selindex = panel->GetSelectedMarkerIndex(pad);
272  if (selname == cond->GetName())
273  fiSelectedIndex = selindex;
274  }
275  }
276  if (!histo) histo = GetLinkedCast<TH1>("Histogram");
277 
278  fbTypingMode = false;
279 
280  TGo4CondArray* arr = dynamic_cast<TGo4CondArray*> (cond);
281 
282  ArrayAllButton->setVisible(arr != nullptr);
283  ArrayElements->setVisible(arr != nullptr);
284  if (!arr) {
285  fiSelectedIndex = -1;
286  } else {
287  ArrayElements->setMaximum(arr->GetNumber()-1);
288  if (fiSelectedIndex >= arr->GetNumber()-1)
289  fiSelectedIndex = arr->GetNumber()-1;
290  ArrayElements->setValue(fiSelectedIndex);
291 
292  cond = SelectedCondition();
293  }
294 
295  ModifyButton->setVisible(panel && (!arr || (fiSelectedIndex >= 0)));
296 
297  TGo4WinCond *wcond = dynamic_cast<TGo4WinCond*> (cond);
298  TGo4PolyCond *pcond = dynamic_cast<TGo4PolyCond*> (cond);
299  TGo4ShapedCond *econd = dynamic_cast<TGo4ShapedCond*> (cond);
300  TGo4ListCond *lcond = dynamic_cast<TGo4ListCond*> (cond);
301 
302  if (wcond) {
303  if (wcond->GetDimension() == 2)
304  CondClassLbl->setText("Win 2-D ");
305  else
306  CondClassLbl->setText("Win 1-D ");
307  } else if (econd) {
308  if (econd->IsEllipse())
309  CondClassLbl->setText("Ellipse ");
310  else if (econd->IsCircle())
311  CondClassLbl->setText("Circle ");
312  else if (econd->IsBox())
313  CondClassLbl->setText("Box ");
314  else
315  CondClassLbl->setText("Free shape ");
316  } else if (pcond)
317  CondClassLbl->setText("Polygon ");
318  else if (lcond)
319  CondClassLbl->setText("Value list ");
320  else
321  CondClassLbl->setText("");
322 
323  QString infolbl;
324 
325  const char *hname = cond->GetLinkedHistogram();
326  if (!hname || (*hname == 0)) {
327  HistogramChk->setChecked(false);
328  HistogramChk->setText("null");
329  HistogramChk->setEnabled(false);
330 // DisplayB->setEnabled(false);
331  } else {
332  HistogramChk->setChecked(cond->IsHistogramLink());
333  HistogramChk->setText(hname);
334  HistogramChk->setEnabled(true);
335  infolbl = "Hist: ";
336  if (hitemname.length()>0)
337  infolbl += hitemname;
338  else
339  infolbl += hname;
340 // DisplayB->setEnabled(true);
341  }
342 
343  CondVisibleChk->setVisible(true);
344  CondVisibleChk->setChecked(cond->IsVisible());
345 
346  if (panel) {
347  if (infolbl.length() > 0)
348  infolbl += " ";
349  infolbl += "Drawn: ";
350  infolbl += panel->objectName();
351  if (pad && (pad != (TPad *) panel->GetCanvas())) {
352  infolbl += ", ";
353  infolbl += pad->GetName();
354  }
355  }
356  DrawInfoLbl->setText(infolbl);
357 
358  CondTabs->setEnabled(true);
359 
360  ResultCombo->setEnabled(true);
361  InvertCombo->setEnabled(true);
362 
363  if (cond->IsEnabled())
364  ResultCombo->setCurrentIndex(0);
365  else if (cond->FixedResult())
366  ResultCombo->setCurrentIndex(1);
367  else
368  ResultCombo->setCurrentIndex(2);
369 
370  if(cond->IsTrue()) InvertCombo->setCurrentIndex(0);
371  else InvertCombo->setCurrentIndex(1);
372 
373  LCDCounts->display(cond->Counts());
374  LCDTrueCounts->display(cond->TrueCounts());
375 
376  double ratio = 0;
377  if (cond->Counts()>0)
378  ratio = 1.*cond->TrueCounts() / cond->Counts();
379  QString sratio;
380  if ((ratio >= 0.) && (ratio <= 100.))
381  sratio = QString("%1%2").arg(ratio * 100, 4, 'f', 2).arg("%");
382  else
383  sratio = "?.?? %";
384  PercentLabel->setText(sratio);
385 
386  CondLimits->setChecked(cond->IsLimitsDraw());
387  CondLabel->setChecked(cond->IsLabelDraw());
388 
389  Win1_low->setText(QString::number(cond->GetXLow()));
390  Win1_up->setText(QString::number(cond->GetXUp()));
391 
392  if (cond->GetDimension()==2) {
393  Win2_low->setText(QString::number(cond->GetYLow()));
394  Win2_up->setText(QString::number(cond->GetYUp()));
395  } else {
396  Win2_low->setText("");
397  Win2_up->setText("");
398  }
399 
400  if (wcond) {
401  Win1_low->setEnabled(true);
402  Win1_up->setEnabled(true);
403  Win2_low->setEnabled(wcond->GetDimension()==2);
404  Win2_up->setEnabled(wcond->GetDimension()==2);
405  } else {
406  Win1_low->setDisabled(true);
407  Win1_up->setDisabled(true);
408  Win2_low->setDisabled(true);
409  Win2_up->setDisabled(true);
410  }
411 
412  ShowEllipseWidget(econd != nullptr); // hide all elements on shape tab to reduce minimum window size
413  int oldindex = CondTabs->currentIndex();
414  CondTabs->setCurrentIndex(2); // JAM: need this trick to retrieve actual tab limits with hidden icons?
415  CondTabs->setCurrentIndex(oldindex);
416 
417  if (!pcond && ((CondTabs->currentIndex()==1) || (CondTabs->currentIndex()==2)))
418  CondTabs->setCurrentIndex(0); // switch to wincond defaults when changing from polycond type
419 
420  if (!econd && pcond && (CondTabs->currentIndex()==2))
421  CondTabs->setCurrentIndex(1); // switch to polycond defaults when changing from shape type
422 
423  if(lcond)
424  CondTabs->setCurrentIndex(1);
425 
426  CondTabs->setTabEnabled(1, pcond || lcond);
427  CondTabs->setTabEnabled(2, econd != nullptr);
428 
429  CondTabs->setTabEnabled(3, !lcond);
430  CondTabs->setTabEnabled(4, !lcond);
431  CondTabs->setTabEnabled(5, !lcond);
432 
433  if (pcond) {
434  FillCutWidget(pcond->GetCut(kFALSE));
435  CondTabs->setTabText(1, "Cut");
436  if (econd) {
437  FillEllipseWidget(econd);
438  if (fbNewWindow)
439  CondTabs->setCurrentIndex(2);
440  } else {
441  if (fbNewWindow)
442  CondTabs->setCurrentIndex(1);
443  }
444  } else if (lcond) {
445  FillListWidget(lcond);
446  CondTabs->setTabText(1, "Values");
447  if (fbNewWindow)
448  CondTabs->setCurrentIndex(1);
449  } else {
450  if (fbNewWindow)
451  CondTabs->setCurrentIndex(0);
452  }
453 
454  IntBox->setChecked(cond->IsIntDraw());
455  MaxCBox->setChecked(cond->IsCMaxDraw());
456  MaxXBox->setChecked(cond->IsXMaxDraw());
457  MaxYBox->setChecked(cond->IsYMaxDraw());
458 
459  XMeanBox->setChecked(cond->IsXMeanDraw());
460  YMeanBox->setChecked(cond->IsYMeanDraw());
461  XRMSBox->setChecked(cond->IsXRMSDraw());
462  YRMSBox->setChecked(cond->IsYRMSDraw());
463 
464  IntBox->setText(QString("Integr: ") + QString::number(cond->GetIntegral(histo,"")));
465  MaxXBox->setText(QString("MaxX: ") + QString::number(cond->GetXMax(histo)));
466  MaxYBox->setText(QString("MaxY: ") + QString::number(cond->GetYMax(histo)));
467  MaxCBox->setText(QString("Max: ") + QString::number(cond->GetCMax(histo)));
468 
469  XMeanBox->setText(QString("XMean: ") + QString::number(cond->GetMean(histo, 1)));
470  XRMSBox->setText(QString("XRMS: ") + QString::number(cond->GetRMS(histo, 1)));
471  YMeanBox->setText(QString("YMean: ") + QString::number(cond->GetMean(histo, 2)));
472  YRMSBox->setText(QString("YRMS: ") + QString::number(cond->GetRMS(histo, 2)));
473 
474  fbTypingMode = true;
475 
476  if (fbDrawOnNextRefresh) {
477  fbDrawOnNextRefresh = false;
478  TString hitemname;
479  if (!panel && HistogramChk->isChecked() &&
480  Browser()->DefineRelatedObject(conditemname, hname, hitemname))
481  DrawCondition(false);
482  }
483  fbNewWindow = false;
484 }
485 
487 {
488  auto cond = GetLinkedCast<TGo4Condition>("Condition");
489  if (!cond) return nullptr;
490 
491  TGo4CondArray* arr = dynamic_cast<TGo4CondArray*> (cond);
492 
493  if (!arr || (fiSelectedIndex==-1)) {
494  if(arr) arr->SetMultiEdit(kTRUE);
495  return cond;
496  }
497  if (fiSelectedIndex<arr->GetNumber()) {
498  arr->SetMultiEdit(kFALSE);
500  return arr->At(fiSelectedIndex);
501  }
502  return cond;
503 }
504 
506 {
507  // GetLinked("Condition", 0);
508  SetChangeFlag(true);
509  PleaseUpdateLabel->setVisible(true);
510 }
511 
513 {
514  if (!fbTypingMode) return;
515  if (fiSelectedIndex==t) return;
516 
517  fiSelectedIndex = t;
518  RefreshWidget(false);
519  RedrawCondition();
520 }
521 
523 {
524  ArrayElements->setValue(-1);
525 }
526 
528 {
530  if (!fbTypingMode || !cond) return;
531  switch (mode) {
532  case 0: cond->Enable(); break;
533  case 1: cond->Disable(kTRUE); break;
534  case 2: cond->Disable(kFALSE ); break;
535  default: cond->Enable(); break;
536  }
538 }
539 
541 {
543  if (!fbTypingMode || !cond) return;
544  cond->Invert(mode==1);
546 }
547 
549 {
550  const char *conditemname = GetLinkedName("Condition");
551  auto con = GetLinkedCast<TGo4Condition>("Condition");
552  if (!con || !conditemname) return;
553 
554  TString objname;
555  TGo4ServerProxy *an = Browser()->DefineAnalysisObject(conditemname, objname);
556  if (an) {
557  an->ClearAnalysisObject(objname.Data());
558  GetLinked("Condition", 2);
559  } else {
560  con->ResetCounts();
562  RefreshWidget(false);
563  }
564 }
565 
567 {
568  UpdateLimits();
569 }
570 
572 {
573  if (UpdateLimits())
574  RedrawCondition();
575 
576  setFocus();
577 }
578 
580 {
582  if (!fbTypingMode || !cond) return false;
583 
584  bool okx1, okx2, res = false;
585  Double_t x1 = Win1_low->text().toDouble(&okx1);
586  Double_t x2 = Win1_up->text().toDouble(&okx2);
587 
588  if (cond->GetDimension()==2) {
589  bool oky1, oky2;
590  Double_t y1 = Win2_low->text().toDouble(&oky1);
591  Double_t y2 = Win2_up->text().toDouble(&oky2);
592  if (okx1 && okx2 && oky1 && oky2) {
593  cond->SetValues(x1, x2, y1, y2);
594  res = true;
595  }
596  } else
597  if (okx1 && okx2) {
598  cond->SetValues(x1, x2);
599  res = true;
600  }
601  if (res) PleaseUpdateSlot();
602  return res;
603 }
604 
606 {
608  if (!fbTypingMode || !cond) return;
609  switch(id) {
610  case 0: cond->SetLabelDraw(on); break;
611  case 1: cond->SetLimitsDraw(on); break;
612  case 2: cond->SetIntDraw(on); break;
613  case 3: cond->SetXMeanDraw(on); break;
614  case 4: cond->SetXRMSDraw(on); break;
615  case 5: cond->SetYRMSDraw(on); break;
616  case 6: cond->SetYMeanDraw(on); break;
617  case 7: cond->SetXMaxDraw(on); break;
618  case 8: cond->SetYMaxDraw(on); break;
619  case 9: cond->SetCMaxDraw(on); break;
620  case 10: cond->SetVisible(on); break;
621  default: return;
622  }
624  RedrawCondition();
625 }
626 
627 
629 {
631 }
632 
633 
635 {
637 }
638 
640 {
642 }
643 
645 {
647 }
648 
650 {
652 }
653 
655 {
657 }
658 
660 {
662 }
663 
665 {
667 }
668 
670 {
672 }
673 
675 {
677 }
678 
680 {
681  ChangeConditionProperty(10, on);
682 }
683 
684 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
685 void TGo4ConditionEditor::enterEvent(QEvent *)
686 #else
688 #endif
689 {
690  auto cond = GetLinkedCast<TGo4Condition>("Condition");
691  if (cond && (fiLastChangeValue != cond->IsChanged()))
692  RefreshWidget(true);
693 }
694 
696 {
697 }
698 
700 {
701  GetLinked("Condition", 2);
702  RefreshWidget(false);
703 }
704 
706 {
707  DrawCondition(true);
708 }
709 
711 {
712  auto cond = GetLinkedCast<TGo4Condition>("Condition");
713  if (cond) cond->SetChanged(changed);
714 }
715 
717 {
718  if (PrepareForAnalysis()) {
719  const char *conditem = GetLinkedName("Condition");
720  if (UpdateItemInAnalysis(conditem) && BrowserItemRemote(conditem))
721  RefreshClicked();
722  else {
723  SetChangeFlag(false);
724  RefreshWidget(false);
725  }
726  }
727 }
728 
730 {
731  if (PrepareForAnalysis())
732  if (SaveItemToFile(GetLinkedName("Condition"), "Conditions")) {
733  SetChangeFlag(false);
734  RefreshWidget(false);
735  }
736 }
737 
739 {
740  auto cond = GetLinkedCast<TGo4Condition>("Condition");
741  if (!cond) return;
742 
743  const char *conditemname = GetLinkedName("Condition");
744  if (!conditemname) return;
745 
746  TGo4ViewPanel *panel = nullptr;
747 
748  if (useactive)
749  panel = LastActivePanel();
750  if (panel) {
751  DrawItem(conditemname, panel, nullptr, false, 0);
752  RedrawCondition();
753  RefreshWidget(false);
754  panel->setFocus();
755  setFocus();
756  return;
757  }
758 
759  panel = WhereItemDrawn(conditemname);
760  TPad *pad = panel ? panel->FindPadWithItem(conditemname) : nullptr;
761 
762  if (panel) {
763  if (pad)
764  RedrawCondition();
765  else {
766  DrawItem(conditemname, panel, panel->GetActivePad(), false, 0);
767  panel->SetSelectedMarker(pad, cond->GetName(), fiSelectedIndex);
768  panel->MarkPadModified(pad);
769  panel->ShootRepaintTimer(pad);
770  }
771  panel->setFocus();
772  setFocus();
773  return;
774  }
775 
776  const char *hname = nullptr;
777  if (cond->IsHistogramLink())
778  hname = cond->GetLinkedHistogram();
779  TString hitemname;
780 
781  TGo4BrowserProxy *br = Browser();
782 
783  if (hname && br->DefineRelatedObject(conditemname, hname, hitemname)) {
784  panel = DrawItem(hitemname.Data(), nullptr);
785  RemoveLink("Histogram");
786  AddLink(hitemname.Data(), "Histogram");
787  DrawItem(conditemname, panel, nullptr, false, 0);
788  RefreshWidget(false);
789  RedrawCondition();
790  panel->setFocus();
791  setFocus();
792  }
793 }
794 
796 {
797  const char *conditemname = GetLinkedName("Condition");
798  if (!conditemname) return;
799 
800  auto cond = GetLinkedCast<TGo4Condition>("Condition");
801  if (!cond) return;
802 
803  TGo4ViewPanel *panel = WhereItemDrawn(conditemname);
804  if (!panel) return;
805 
806  TPad *pad = panel->FindPadWithItem(conditemname);
807  if (!pad) return;
808 
809  panel->SetSelectedMarker(pad, cond->GetName(), fiSelectedIndex);
810  panel->MarkPadModified(pad);
811  panel->ShootRepaintTimer(pad);
812 }
813 
815 {
816  auto cond = GetLinkedCast<TGo4Condition>("Condition");
817  if (cond) {
818  cond->PrintCondition(kFALSE); // JAM want additional output of specific infos, no poly coords
819  cond->Print("go4log-limits-stats");
820  }
821 }
822 
824 {
825  auto cond = GetLinkedCast<TGo4Condition>("Condition");
826  if (!cond) return false;
827 
828  SetChangeFlag(false);
829 
830  const char *hname = cond->GetLinkedHistogram();
831  if (hname && (strlen(hname) != 0)) {
832  TString foldername, objname;
833  TGo4Slot::ProduceFolderAndName(hname, foldername, objname);
834  cond->SetHistogram(objname.Data());
835  }
836  return true;
837 }
838 
840 {
841  auto cond = GetLinkedCast<TGo4Condition>("Condition");
842  if (!cond) return;
843 
844  const char *conditemname = GetLinkedName("Condition");
845  TGo4ViewPanel *panel = WhereItemDrawn(conditemname);
846  TPad *pad = !panel ? nullptr : panel->FindPadWithItem(conditemname);
847 
848  if (!panel || !pad) return;
849 
850  panel->SetActivePad(pad);
851 
852  panel->setFocus();
853 
854  panel->SetSelectedMarker(pad, cond->GetName(), fiSelectedIndex);
855 
856  panel->StartConditionEditing(pad);
857 }
858 
860 {
861  bool old = fbTypingMode;
862  fbTypingMode = false;
863  CutTable->setColumnCount(2);
864  if (!cut) {
865  CutTable->setRowCount(0);
866  NPointsSpin->setValue(0);
867  } else {
868  CutTable->setRowCount(cut->GetN());
869  NPointsSpin->setValue(cut->GetN());
870  for (int n = 0; n < cut->GetN(); n++) {
871  Double_t x, y;
872  cut->GetPoint(n, x,y);
873  CutTable->setItem(n, 0, new QTableWidgetItem(QString::number(x)));
874  CutTable->setItem(n, 1, new QTableWidgetItem(QString::number(y)));
875  CutTable->setVerticalHeaderItem(n, new QTableWidgetItem(QString::number(n)));
876  }
877  }
878 
879  fbTypingMode = old;
880 }
881 
883 {
884  if(!elli) return;
885  bool old = fbTypingMode;
886  fbTypingMode = false;
887  double a1 = 0, a2 = 0, x = 0, y = 0;
888  int theta = 0;
889 
890  elli->GetRadius(a1,a2);
891  elli-> GetCenter(x,y);
892  theta= (int) elli->GetTheta();
893 
894  EllipseCxSpinbox->setValue(x);
895  EllipseCySpinbox->setValue(y);
896  EllipseA1Spinbox->setValue(a1);
897  EllipseA2Spinbox->setValue(a2);
898  EllipseTiltDial->setValue(theta);
899  EllipseTiltEdit->setText(QString::number(theta));
900 
901  CircleBox->setChecked(elli->IsCircle());
902  EllipseBox->setChecked(elli->IsEllipse());
903  BoxshapeBox->setChecked(elli->IsBox());
904  FreeshapeBox->setChecked(elli->IsFreeShape());
905  EllipseNptsSpin->setValue(elli->GetResolution());
906  fbTypingMode = old;
907 }
908 
910 {
911  EllipseCxSpinbox->setVisible(show);
912  EllipseCySpinbox->setVisible(show);
913  EllipseA1Spinbox->setVisible(show);
914  EllipseA2Spinbox->setVisible(show);
915  EllipseTiltDial->setVisible(show);
916  EllipseTiltEdit->setVisible(show);
917 
918  ShapegroupBox->setVisible(show);
919  CircleBox->setVisible(show);
920  EllipseBox->setVisible(show);
921  BoxshapeBox->setVisible(show);
922  FreeshapeBox->setVisible(show);
923  EllipseNptsSpin->setVisible(show);
924 
925  AutoRefreshBox->setVisible(show);
926  EllipseCenterLabel->setVisible(show);
927  EllipseTitlLabel->setVisible(show);
928  EllipseRadiusLabel->setVisible(show);
929  EllipseNptsLabel->setVisible(show);
930  EllipsCxLabel->setVisible(show);
931  EllipsCyLabel->setVisible(show);
932  EllipsA1Label->setVisible(show);
933  EllipsA2Label->setVisible(show);
934 
935  verticalLayout_2->setEnabled(show);
936  verticalLayout_5->setEnabled(show);
937  horizontalLayout_4->setEnabled(show);
938 
939 }
940 
942 {
943  bool old = fbTypingMode;
944  fbTypingMode = false;
945  CutTable->setColumnCount(1);
946  if (!lcon) {
947  CutTable->setRowCount(0);
948  NPointsSpin->setValue(0);
949  } else {
950  int points = lcon->GetNumValues();
951  CutTable->setRowCount(points);
952  NPointsSpin->setValue(points);
953  for (int n = 0; n < points; n++) {
954  int val = lcon->GetValue(n);
955  CutTable->setItem(n, 0, new QTableWidgetItem(QString::number(val)));
956  //CutTable->setItem(n, 1, new QTableWidgetItem(QString::number(y)));
957  CutTable->setVerticalHeaderItem(n, new QTableWidgetItem(QString::number(n)));
958  }
959  }
960 
961  fbTypingMode = old;
962 }
963 
964 
966 {
967  if (!fbTypingMode) return;
968  TGo4PolyCond *pcond = dynamic_cast<TGo4PolyCond*> (SelectedCondition());
969  TGo4ListCond *lcond = dynamic_cast<TGo4ListCond*> (SelectedCondition());
970  if (pcond) {
971  TCutG *cut = pcond->GetCut(kFALSE);
972 
973  if (!cut) {
974  cut = new TCutG("conditioncut", npoint);
975  Double_t x = 0., y = 0.;
976  for (int n = 0; n < npoint - 1; n++)
977  cut->SetPoint(n, n * 10, n * 10);
978  cut->GetPoint(0, x, y);
979  cut->SetPoint(npoint - 1, x, y);
980  pcond->SetValues(cut);
981  } else {
982  if (npoint == 0) {
983  pcond->SetValues(nullptr);
984  cut = nullptr;
985  } else {
986  int old = cut->GetN();
987  Double_t x = 0., y = 0.;
988  if (old > 1)
989  cut->GetPoint(old - 2, x, y);
990  cut->Set(npoint);
991  for (int n = (old - 1 >= 0 ? old - 1 : 0); n < npoint - 1; n++)
992  cut->SetPoint(n, x, y + (n - old + 2) * 10);
993  cut->GetPoint(0, x, y);
994  cut->SetPoint(npoint - 1, x, y);
995  }
996  }
998  FillCutWidget(cut);
999 
1000  } else if (lcond) {
1001  lcond->Resize(npoint);
1002  PleaseUpdateSlot();
1003  FillListWidget(lcond);
1004  }
1005  RedrawCondition();
1006 }
1007 
1009 {
1010  if (!fbTypingMode) return;
1011  TGo4PolyCond *pcond = dynamic_cast<TGo4PolyCond*> (SelectedCondition());
1012  TGo4ListCond *lcond = dynamic_cast<TGo4ListCond*> (SelectedCondition());
1013  bool ok = false;
1014  double zn = CutTable->item(nrow, ncol)->text().toDouble(&ok);
1015  if (!ok) return;
1016 
1017  if (pcond) {
1018  TCutG *cut = pcond->GetCut(kFALSE);
1019  if (!cut)
1020  return;
1021  if (ncol == 0)
1022  cut->GetX()[nrow] = zn;
1023  else
1024  cut->GetY()[nrow] = zn;
1025  if ((nrow == 0) || (nrow == cut->GetN() - 1)) {
1026  int nrow1 = (nrow == 0) ? cut->GetN() - 1 : 0;
1027  fbTypingMode = false;
1028  CutTable->setItem(nrow1, ncol, new QTableWidgetItem(CutTable->item(nrow, ncol)->text()));
1029  if (ncol == 0)
1030  cut->GetX()[nrow1] = zn;
1031  else
1032  cut->GetY()[nrow1] = zn;
1033  fbTypingMode = true;
1034  }
1035  } else if (lcond) {
1036  lcond->SetValue(nrow, zn);
1037  int numvals = lcond->GetNumValues();
1038  if ((nrow == 0) || (nrow == numvals - 1)) {
1039  int nrow1 = (nrow == 0) ? numvals - 1 : 0;
1040  fbTypingMode = false;
1041  CutTable->setItem(nrow1, ncol, new QTableWidgetItem(CutTable->item(nrow, ncol)->text()));
1042  lcond->SetValue(nrow1, zn);
1043  fbTypingMode = true;
1044  }
1045  } else {
1046  return;
1047  }
1048 
1049  PleaseUpdateSlot();
1050 
1051  RedrawCondition();
1052 }
1053 
1055 {
1056  if (!fbTypingMode) return;
1057  QTableWidgetItem* item = CutTable->itemAt (pos);
1058  if (!item) return;
1059 
1060  TGo4PolyCond *pcond = dynamic_cast<TGo4PolyCond*> (SelectedCondition());
1061  TGo4ListCond *lcond = dynamic_cast<TGo4ListCond*> (SelectedCondition());
1062 
1063  if(!pcond && !lcond) return;
1064 
1065  int maxn = 0;
1066  if (pcond) {
1067  TCutG *cut = pcond->GetCut(kFALSE);
1068  if (!cut)
1069  return;
1070  maxn = cut->GetN();
1071  // only internal points should be allowed to deleted
1072  } else if (lcond) {
1073  maxn = lcond->GetNumValues();
1074  } else {
1075  return;
1076  }
1077  int nrow = CutTable->row(item);
1078 
1079  QMenu menu;
1080 
1081  auto actInsert = new QAction("Insert point", &menu);
1082  menu.addAction(actInsert);
1083  QObject::connect(actInsert, &QAction::triggered, [this, nrow]() { CutTable_contextMenuHandler(nrow, false); });
1084 
1085  auto actDelete = new QAction("Delete point", &menu);
1086  menu.addAction(actDelete);
1087  QObject::connect(actDelete, &QAction::triggered, [this, nrow]() { CutTable_contextMenuHandler(nrow, true); });
1088  actDelete->setEnabled((nrow > 0) && (nrow < maxn - 1));
1089 
1090  menu.exec(CutTable->mapToGlobal(pos));
1091 }
1092 
1094 {
1095  TGo4PolyCond *pcond = dynamic_cast<TGo4PolyCond*> (SelectedCondition());
1096  TGo4ListCond *lcond = dynamic_cast<TGo4ListCond*> (SelectedCondition());
1097 
1098  if (pcond) {
1099  TCutG *cut = pcond->GetCut(kFALSE);
1100  if (!cut)
1101  return;
1102 
1103  if (is_delete) {
1104  cut->RemovePoint(id);
1105  } else { // insert point
1106  Int_t npoints = cut->GetN();
1107  if (id >= npoints)
1108  return;
1109  cut->Set(npoints + 1);
1110 
1111  Double_t x, y;
1112  for (int n = npoints; n > id; n--) {
1113  cut->GetPoint(n - 1, x, y);
1114  cut->SetPoint(n, x, y);
1115  }
1116 
1117  if (id > 0) {
1118  Double_t x1, y1;
1119  cut->GetPoint(id - 1, x1, y1);
1120  cut->SetPoint(id, (x1 + x) / 2., (y + y1) / 2.);
1121  }
1122  }
1123 
1124  FillCutWidget(cut);
1125 
1126  } else if (lcond) {
1127  if (is_delete) {
1128  lcond->RemoveValue(id);
1129  } else { // insert point
1130  Int_t npoints = lcond->GetNumValues();
1131  if (id >= npoints)
1132  return;
1133  int x1 = lcond->GetValue(id);
1134  int x2 = lcond->GetValue(id - 1);
1135  lcond->InsertValue(id, ((x1 + x2) / 2));
1136  }
1137  FillListWidget(lcond);
1138  }
1139  PleaseUpdateSlot();
1140  RedrawCondition();
1141 }
1142 
1144 {
1145  if (!fbTypingMode)
1146  return;
1147  EllipseTiltEdit->setText(QString::number(deg));
1148  if (fbEllipseAutoRefresh) {
1149  TGo4ShapedCond *econd = dynamic_cast<TGo4ShapedCond *>(SelectedCondition());
1150  if (econd)
1151  econd->SetTheta((double)deg);
1152  PleaseUpdateSlot();
1153  RedrawCondition();
1154  }
1155 }
1156 
1158 {
1159  if (!fbTypingMode)
1160  return;
1161  if (fbEllipseAutoRefresh) {
1162  TGo4ShapedCond *econd = dynamic_cast<TGo4ShapedCond *>(SelectedCondition());
1163  if (econd) {
1164  double y = EllipseCySpinbox->value();
1165  econd->SetCenter(x, y);
1166  PleaseUpdateSlot();
1167  RedrawCondition();
1168  }
1169  }
1170 }
1172 {
1173  if (!fbTypingMode)
1174  return;
1175  if (fbEllipseAutoRefresh) {
1176  TGo4ShapedCond *econd = dynamic_cast<TGo4ShapedCond *>(SelectedCondition());
1177  if (econd) {
1178  double x = EllipseCxSpinbox->value();
1179  econd->SetCenter(x, y);
1180  }
1181  PleaseUpdateSlot();
1182  RedrawCondition();
1183  }
1184 }
1185 
1187 {
1188  if (!fbTypingMode)
1189  return;
1191  UpdateEllipse();
1192 }
1193 
1195 {
1196  if (!fbTypingMode)
1197  return;
1199  UpdateEllipse();
1200 }
1201 
1203 {
1204  if (!fbTypingMode) return;
1207 }
1208 
1209 
1211 {
1212  if (!fbTypingMode) return;
1214 }
1215 
1216 
1218 {
1219  if (!fbTypingMode) return;
1220  bool ok = false;
1221  Int_t theta = EllipseTiltEdit->text().toInt(&ok);
1222  if(theta < 0) theta = 0;
1223  theta = theta % 360;
1224  if(ok)
1225  {
1226  EllipseTiltDial->setValue(theta);
1227  }
1229 
1230 }
1231 
1233 {
1234  if (!fbTypingMode) return;
1236 }
1237 
1239 {
1240  TGo4ShapedCond *econd = dynamic_cast<TGo4ShapedCond *>(SelectedCondition());
1241  if (!econd) {
1242  std::cout << "UpdateEllipse did not find ellipse condition!!!" << std::endl;
1243  return;
1244  }
1245 
1246  if (FreeshapeBox->isChecked()) {
1247  econd->SetFreeShape();
1248  } else {
1249  double cx = EllipseCxSpinbox->value();
1250  double cy = EllipseCySpinbox->value();
1251  double a1 = EllipseA1Spinbox->value();
1252  double a2 = EllipseA2Spinbox->value();
1253  double th = EllipseTiltDial->value();
1254  if (econd->IsFreeShape()) {
1255  // transition from free shape to other form: use polygon geometry to init pars:
1256  cx = (econd->GetXUp() + econd->GetXLow()) / 2; // mean of coordinates is center
1257  cy = (econd->GetYUp() + econd->GetYLow()) / 2;
1258  // a1=(econd->GetXUp() - econd->GetXLow())/2; // half diameter is radius
1259  // a2=(econd->GetYUp() - econd->GetYLow())/2;
1260  // better: use minimum and maximum radial distance
1261  TCutG *cut = econd->GetCut(false);
1262  Int_t n = cut->GetN();
1263  Double_t *xarr = cut->GetX();
1264  Double_t *yarr = cut->GetY();
1265  TArrayD rarr(n);
1266  for (int i = 0; i < n; ++i) {
1267  rarr[i] = TMath::Sqrt(TMath::Power((xarr[i] - cx), 2) + TMath::Power((yarr[i] - cy), 2));
1268  }
1269  Int_t nrmax = TMath::LocMax(n, rarr.GetArray());
1270  Int_t nrmin = TMath::LocMin(n, rarr.GetArray());
1271  a1 = rarr[nrmax];
1272  a2 = rarr[nrmin];
1273  // now evaluate angle:
1274  th = 0;
1275  if (a1) {
1276  th = TMath::ACos((econd->GetXUp() - cx) / a1) * 180 / TMath::Pi();
1277  }
1278  }
1279 
1280  if (CircleBox->isChecked())
1281  econd->SetCircle(cx, cy, a1, EllipseNptsSpin->value());
1282  else if (EllipseBox->isChecked())
1283  econd->SetEllipse(cx, cy, a1, a2, th, EllipseNptsSpin->value());
1284  else if (BoxshapeBox->isChecked()) {
1285  if (econd->IsFreeShape()) {
1286  // transition to box will use different defaults for extensions, otherwise we always get increasing box
1287  a1 = (econd->GetXUp() - econd->GetXLow()) / 2; // half diameter is radius
1288  a2 = (econd->GetYUp() - econd->GetYLow()) / 2;
1289  th = 0; // todo: correctly conserve tilt angle when switching to/fro between free and box
1290  }
1291 
1292  econd->SetBox(cx, cy, a1, a2, th);
1293  }
1294  } // no freeshape selected
1295  PleaseUpdateSlot();
1296  RedrawCondition();
1297  FillEllipseWidget(econd);
1298 }
virtual void ShootRepaintTimer()
virtual void ResetWidget()
Definition: QGo4Widget.cpp:52
void SetTheta(Double_t angle)
virtual void SetYMeanDraw(bool on)
virtual void LimitsReturnPressed()
virtual void SetIntDraw(Bool_t on)
void DropItem(const char *itemname, TClass *cl, int kind) override
void SetEllipse(Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0, Int_t npoints=0)
TCutG * GetCut(Bool_t changeowner) override
virtual const char * GetDrawObjectLinkName(TPad *pad, TObject *obj)
virtual void SelectedCond(int t)
void enterEvent(QEnterEvent *) override
virtual void SetYMaxDraw(Bool_t on)
virtual void RefreshWidget(bool checkindex)
virtual void SetActivePad(TPad *pad)
virtual void PrintConditionLog()
void RemoveValue(UInt_t ix)
Definition: TGo4ListCond.h:59
TGo4ServerProxy * DefineServerObject(const char *itemname, TString *objname=nullptr, Bool_t onlyanalysis=kTRUE)
void ShootCloseWidget(bool closeparent=false)
Definition: QGo4Widget.cpp:70
void SetValues(Double_t *x, Double_t *y, Int_t len) override
void linkedObjectRemoved(const char *linkname) override
virtual QString GetSelectedMarkerName(TPad *pad)
bool SaveItemToFile(const char *itemname, const char *subfolder=nullptr)
Definition: QGo4Widget.cpp:368
virtual void StartConditionEditing(TPad *pad)
void leaveEvent(QEvent *) override
virtual void SetCMaxDraw(Bool_t on)
bool UpdateItemInAnalysis(const char *itemname, TObject *obj=nullptr)
Definition: QGo4Widget.cpp:379
virtual void SetXMeanDraw(bool on)
void InsertValue(UInt_t ix, Int_t val)
Definition: TGo4ListCond.h:57
virtual void SetChangeFlag(bool changed)
Double_t GetYLow() const override
virtual void EllipseTheta_valueChanged(int deg)
void linkedObjectUpdated(const char *linkname, TObject *obj) override
virtual bool PrepareForAnalysis()
virtual void SetYRMSDraw(Bool_t on)
virtual void EllipseNPoints_valueChanged(int npoint)
virtual void EllipseA1_valueChanged(double r1)
virtual Bool_t CanSubmitObjects() const
virtual void SetValues()
Definition: TGo4Condition.h:93
virtual TGo4Condition * SelectedCondition()
virtual void SetYRMSDraw(bool on)
void SetCenter(Double_t x, Double_t y)
virtual void SetXMeanDraw(Bool_t on)
virtual void SetYMaxDraw(bool on)
Bool_t IsCircle() const
const char * GetLinkedName(const char *linkname)
Definition: QGo4Widget.cpp:153
TGo4ViewPanel * DrawItem(const QString &itemname, TGo4ViewPanel *panel=nullptr, TPad *pad=nullptr, bool activate=true, int updatelevel=-1)
Definition: QGo4Widget.cpp:305
virtual void ChangeConditionProperty(int id, bool on)
virtual void SetIntDraw(bool on)
virtual void ShowEllipseWidget(bool show)
TGo4BrowserProxy * Browser()
Definition: QGo4Widget.cpp:219
virtual void FillListWidget(TGo4ListCond *lcon)
virtual void ClearAnalysisObject(const char *fullpath)
virtual void LimitsChanged(const QString &)
TObject * GetLinked(const char *linkname, int updatelevel=0)
Definition: QGo4Widget.cpp:172
Double_t GetXLow() const override
virtual void EllipseCircleBox_toggled(bool on)
Int_t GetValue(UInt_t ix) const
Definition: TGo4ListCond.h:48
Bool_t IsBox() const
Bool_t IsEllipse() const
void SetCurrentIndex(Int_t ix) override
virtual void SetInvertMode(int mode)
virtual void Enable()
virtual void RedrawCondition()
virtual void ModifyButton_clicked()
Double_t GetXUp() const override
bool BrowserItemRemote(const char *itemname)
Definition: QGo4Widget.cpp:212
Double_t GetYUp() const override
virtual void SetXMaxDraw(Bool_t on)
virtual void SetSelectedMarker(TPad *pad, const QString &selname, int selindex)
const char * GetLinkedHistogram() const
void SetValue(UInt_t ix, Int_t val)
Definition: TGo4ListCond.h:50
void RemoveLink(const char *linkname, bool blockreset=true)
Definition: QGo4Widget.cpp:188
virtual void MarkPadModified(TPad *pad)
virtual void EllipseCy_valueChanged(double y)
virtual void DrawCondition(bool useactive)
void SetCircle(Double_t cx, Double_t cy, Double_t r, Int_t npoints=0)
virtual void SetCMaxDraw(bool on)
UInt_t GetNumValues() const
Definition: TGo4ListCond.h:46
Int_t GetNumber() const
virtual TPad * FindPadWithItem(const char *itemname)
virtual void SetXRMSDraw(bool on)
virtual void Disable(Bool_t result)
Double_t GetTheta() const
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
virtual void FillCutWidget(TCutG *cut)
Int_t GetResolution() const
virtual int GetSelectedMarkerIndex(TPad *pad)
virtual void SetXRMSDraw(Bool_t on)
virtual void SetLimitsDraw(Bool_t on)
void GetRadius(Double_t &a1, Double_t &a2) const
void SetMultiEdit(Bool_t on)
virtual void CutTable_valueChanged(int ncol, int nrow)
TGo4ViewPanel * LastActivePanel()
Definition: QGo4Widget.cpp:338
virtual void EllipseRefreshBox_toggled(bool on)
static void ProduceFolderAndName(const char *fullname, TString &foldername, TString &objectname)
Definition: TGo4Slot.cxx:646
virtual void EllipseTheta_returnPressed()
virtual void EllipseA2_valueChanged(double r2)
virtual void SetChanged(Bool_t on=kTRUE)
virtual TH1 * GetPadHistogram(TPad *pad)
TGo4ViewPanel * WhereItemDrawn(const char *itemname)
Definition: QGo4Widget.cpp:316
virtual void FillEllipseWidget(TGo4ShapedCond *elli)
void CutTable_contextMenuHandler(int, bool)
virtual void EllipseCx_valueChanged(double x)
virtual void SetDrawLimits(bool on)
Bool_t IsFreeShape() const
virtual void SetLabel(bool on)
virtual void PleaseUpdateSlot()
TGo4ServerProxy * DefineAnalysisObject(const char *itemname, TString &analysisname)
virtual void SetXMaxDraw(bool on)
virtual void NPointsSpin_valueChanged(int npoint)
void AddLink(const char *itemname, const char *linkname)
Definition: QGo4Widget.cpp:117
Int_t GetDimension() const
virtual void SetResultMode(int mode)
void SetBox(Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0)
virtual void SetYMeanDraw(Bool_t on)
virtual void SetCondVisible(bool on)
virtual TPad * GetActivePad()
void Resize(size_t newsize)
Definition: TGo4ListCond.h:61
TGo4ConditionEditor(QWidget *parent=nullptr, const char *name=nullptr)
virtual void CutTable_contextMenuRequested(const QPoint &)
TGo4Condition * At(Int_t i) const
virtual TCanvas * GetCanvas()
virtual void SetLabelDraw(Bool_t on)
bool IsAcceptDrag(const char *itemname, TClass *cl, int kind) override
virtual void SetVisible(Bool_t on)
virtual void WorkWithCondition(const char *itemname)
virtual void Invert(Bool_t on)
void CloseMDIParentSlot()
Definition: QGo4Widget.cpp:79