ATLAS Offline Software
VP1EventDisplayEditor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Header file for class VP1EventDisplayEditor //
9 // //
10 // Description: Event display editor. //
11 // //
12 // Author: Riccardo-Maria BIANCHI (rbianchi@cern.ch) //
13 // Initial version: September 2013 //
14 //
15 // Main updates:
16 // - 2023 Nov, Riccardo.Maria.Bianchi@cern.ch,
17 // Added HTML support in labels
18 // //
20 
22 #include "ui_vp1eventdisplayeditor.h"
23 
26 #include "VP1Base/VP1Serialise.h"
27 #include "VP1Base/VP1Deserialise.h"
28 #include "VP1Gui/VP1MainWindow.h"
29 
30 #include <QRectF>
31 #include <QShortcut>
32 #include <QCloseEvent>
33 #include <QFileDialog>
34 
35 #include <iostream>
36 
37 
38 //____________________________________________________________________
40 
41 public:
42 
44  Ui::VP1EventDisplayEditorForm ui;
45 
46  // VP1ExaminerViewer* viewer;
47 
48  // QGraphicsScene* scene;
49 
50  // QWidget * frameHolderWidget;
51 
52 };
53 
54 
56 //QByteArray VP1EventDisplayEditor::state() const
57 //{
58 // VP1Serialise s(0/*version*/);
59 // QList<QByteArray> frameStates;
60 // foreach(VP1CustomTourFrameWidget*frame,d->frames) {
61 // frameStates << frame->serialise();
62 // s.ignoreWidget(frame);
63 // }
64 // s.save(frameStates);
65 // s.save(d->ui.doubleSpinBox_theta);
66 // s.save(d->ui.doubleSpinBox_radius);
67 // s.save(d->ui.groupBox_utilityZoom);
68 // s.warnUnsaved(this);
69 // return s.result();
70 //}
71 
73 //void VP1EventDisplayEditor::setState(QByteArray ba)
74 //{
75 // foreach(VP1CustomTourFrameWidget*frame,d->frames)
76 // frame->deleteLater();
77 // d->frames.clear();
78 //
79 // VP1Deserialise s(ba);
80 // if (s.version()!=0)
81 // return;
82 // QList<QByteArray> frameStates = s.restore<QList<QByteArray> >();
83 // s.restore(d->ui.doubleSpinBox_theta);
84 // s.restore(d->ui.doubleSpinBox_radius);
85 // s.restore(d->ui.groupBox_utilityZoom);
86 // s.warnUnrestored(this);
87 //
88 // d->ui.widget_utilityZoomContents->setVisible(d->ui.groupBox_utilityZoom->isChecked());
89 //
90 // foreach(QByteArray ba2, frameStates)
91 // d->addFrame(new VP1CustomTourFrameWidget(ba2));
92 // d->updateFrameListVisuals();
93 // enabledFrameListChanged();
94 //}
95 
96 
97 /*
98  * My first, old version
99  */
102 //VP1EventDisplayEditor::VP1EventDisplayEditor()
103 //: QWidget(0,Qt::WindowStaysOnTopHint), d(new Imp)
104 //{
105 // d->theclass = this;
106 // d->ui.setupUi(this);
107 //
108 // scene = new QGraphicsScene(); // the size of the scene is by default infinite. But we will limit the view, here below
109 // scene->setSceneRect(QRectF(0.0, 0.0, 4000., 2641.));
110 //
111 // scene_preview = new QGraphicsScene();
112 //
113 //
114 // d->ui.graphicsView->setScene(scene);
115 // d->ui.graphicsView->setSceneRect(0, 0, 4000, 2641); // the size of a final ATLAS event display
116 // d->ui.graphicsView->setMaximumSize(1000, 660); // the size of the view window on the screen
117 //
118 // d->ui.graphicsView_preview->setScene(scene_preview);
119 // d->ui.graphicsView_preview->setSceneRect(0, 0, 333, 220); // the size of the preview scene
120 // d->ui.graphicsView_preview->setMaximumSize(333, 220); // the size of the preview window
121 //
122 // // set the default bkg color: black
123 // setBackgroundColor();
124 //
125 // setWindowIcon(QIcon(QString(":/vp1/icons/icons/3d_32x32.png")));
126 //
127 // connect(d->ui.pushButton_addText,SIGNAL(clicked()), this,SLOT(addTextLabel()));
128 // connect(d->ui.pushButton_removeObj,SIGNAL(clicked()), this,SLOT(removeObject()));
129 // connect(d->ui.pushButton_addLogo,SIGNAL(clicked()), this,SLOT(addLogo()));
130 //
131 // connect(d->ui.radioButton_black,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
132 // connect(d->ui.radioButton_white,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
133 // connect(d->ui.radioButton_transparent,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
134 //
135 // connect(scene,SIGNAL(changed(const QList<QRectF>&)), this,SLOT(updatePreview(const QList<QRectF>&)));
136 //
137 //}
138 
139 
140 /*
141  * new version
142  */
143 //____________________________________________________________________
144 VP1EventDisplayEditor::VP1EventDisplayEditor(VP1MainWindow* mainWindow, QList<unsigned long long> listRunEventNumberTimestamp)
145 //: QWidget(0,Qt::WindowStaysOnTopHint), d(new Imp)
146 : QWidget(0), m_d(new Imp)
147 {
148  m_mainWindow = mainWindow;
149 
150  m_runNumber = listRunEventNumberTimestamp[0];
151  m_eventNumber = listRunEventNumberTimestamp[1];
152  m_eventTimestamp = listRunEventNumberTimestamp[2];
153 
154 
155  m_d->theclass = this;
156  m_d->ui.setupUi(this);
157 
158  /* initialize the scene
159  *
160  * this is the scene that will be rendered and saved to the file.
161  * By default the scene dimension is 4000x2641 pixels.
162  *
163  */
164  m_scene = new QGraphicsScene();
165  m_scene->setSceneRect(QRectF(0.0, 0.0, 4000., 2641.));
166 
167 
168  VP1EventDisplaySceneView *view = new VP1EventDisplaySceneView("Full-size view");
169  view->view()->setScene(m_scene);
170 
171  m_preview = new VP1EventDisplaySceneView("Preview", true);
172  m_preview->view()->setScene(m_scene);
173 
174  // the right splitter, containing the list of objects in the scene and the preview
175  QSplitter *previewSplitter = new QSplitter;
176  previewSplitter->setOrientation(Qt::Vertical);
177 
178  // the center splitter, containing the main view and the preview splitter
179  QSplitter *viewSplitter = new QSplitter;
180  viewSplitter->setOrientation(Qt::Horizontal);
181 
182  // the center splitter, containing the main view and the preview splitter
183  QSplitter *toolsSplitter = new QSplitter;
184  toolsSplitter->setOrientation(Qt::Vertical);
185 
186  // the main splitter, containing all views
187  QSplitter *mainSplitter = new QSplitter;
188  mainSplitter->setOrientation(Qt::Horizontal);
189 
190 
191  previewSplitter->addWidget(m_d->ui.groupBox_objectList);
192  previewSplitter->addWidget(m_preview);
193  previewSplitter->addWidget(m_d->ui.groupBox_actions);
194 
195 
196  QWidget *containerPreview = new QWidget;
197  QVBoxLayout *containerPreview_layout = new QVBoxLayout;
198 
199  containerPreview_layout->addWidget(previewSplitter);
200  containerPreview->setLayout(containerPreview_layout);
201 
202  viewSplitter->addWidget(view);
203  viewSplitter->addWidget(containerPreview);
204 
205  QWidget *containerAllViews = new QWidget;
206  QHBoxLayout *containerAllViews_layout = new QHBoxLayout;
207  containerAllViews_layout->addWidget(viewSplitter);
208  containerAllViews->setLayout(containerAllViews_layout);
209 
210 
211  toolsSplitter->addWidget(m_d->ui.groupBox_getTab);
212  toolsSplitter->addWidget(m_d->ui.groupBox_bkg);
213  toolsSplitter->addWidget(m_d->ui.groupBox_logo);
214  toolsSplitter->addWidget(m_d->ui.groupBox_labels);
215 
216  QWidget *containerTools = new QWidget;
217  QVBoxLayout *containerTools_layout = new QVBoxLayout;
218  containerTools_layout->addWidget(toolsSplitter);
219  containerTools_layout->addStretch(1);
220  containerTools->setLayout(containerTools_layout);
221 
222 
223  // mainSplitter->addWidget(containerTools);
224  mainSplitter->addWidget(containerAllViews);
225 
226  QGridLayout* grid = static_cast<QGridLayout*>(this->layout());
227  grid->addWidget(containerTools);
228  grid->addWidget(mainSplitter);
229 
230 
231 
232  /*
233  * setting the size of the preview window
234  */
235  //m_preview->view()->setFixedSize(450,302);
236  /*
237  * this triggers a better fitInView() but not enough for our purpose.
238  * See: http://stackoverflow.com/a/17085612
239  */
240  //m_preview->show();
241 
242  /*
243  * setting the size of the viewport
244  *
245  * Details:
246  * The QGraphicsView is not the widget that actually contains the scene,
247  * because the QGraphicsView also manages the scrollbars.
248  * The scene is drawn in the viewport widget,
249  * which is a little smaller than the QGraphicsView.
250  * (http://qt-project.org/forums/viewthread/17504)
251  *
252  * Update: useful, but it's useless here, because we want to use fitInView()
253  * from the view, and that does not match with the viewport size.
254  */
255  // m_preview->view()->viewport()->setFixedSize(400,265);
256 
257 
258  QSize size = m_preview->view()->maximumViewportSize();
259  VP1Msg::message("scene rect: " + QString::number(m_scene->sceneRect().width()) + " - " + QString::number(m_scene->sceneRect().height()) );
260  VP1Msg::message("max preview size: " + QString::number(size.width()) + " - " + QString::number(size.height()) );
261 
262  m_preview->view()->ensureVisible ( m_scene->sceneRect(), 0, 0 );
263  m_preview->view()->fitInView( m_scene->sceneRect(), Qt::KeepAspectRatio);
264 
265  // add a frame to preview to define the the rendering area
267 
268  // set the default m_scene bkg color: black
269  this->setBackgroundColor(); // the "black" checkbox is checked by default in the GUI
270 
271  setWindowIcon(QIcon(QString(":/vp1/icons/icons/3d_32x32.png")));
272 
273  connect(m_d->ui.pushButton_get,SIGNAL(clicked()), this,SLOT(getTabSnapshot()));
274 
275 // connect(m_d->ui.pushButton_eventDetailsLabel,SIGNAL(clicked()), this,SLOT(getEventDetailsLabel()));
276 
277 
278  connect(m_d->ui.radioButton_eventDetails,SIGNAL(toggled(bool)), this,SLOT(enableCustomTextField(bool)));
279  // connect(m_d->ui.radioButton_customText,SIGNAL(toggled()), this,SLOT(showCustomTextField()));
280 
281  connect(m_d->ui.pushButton_addText,SIGNAL(clicked()), this,SLOT(setTextLabel()));
282  connect(m_d->ui.pushButton_removeObj,SIGNAL(clicked()), this,SLOT(removeObject()));
283  connect(m_d->ui.pushButton_addLogo,SIGNAL(clicked()), this,SLOT(addLogo()));
284 
285  connect(m_d->ui.pushButton_save,SIGNAL(clicked()), this,SLOT(savePicture()));
286  connect(m_d->ui.pushButton_print,SIGNAL(clicked()), this,SLOT(printPicture()));
287 
288 
289  connect(m_d->ui.radioButton_black,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
290  connect(m_d->ui.radioButton_white,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
291  connect(m_d->ui.radioButton_transparent,SIGNAL(clicked()), this,SLOT(setBackgroundColor()));
292 
293  this->setWindowTitle(tr("ATLAS VP1 Event Display Editor"));
294 
295  this->getEventDetailsLabel();
296 
297 
298 }
299 
300 /*
301  * Qt example
302  */
303 //VP1EventDisplayEditor::VP1EventDisplayEditor()
305 //: QWidget(0), m_d(new Imp)
306 //{
307 // m_d->theclass = this;
308 // m_d->ui.setupUi(this);
309 //
310 // m_scene = new QGraphicsScene();
311 //
312 // h1Splitter = new QSplitter;
313 // h2Splitter = new QSplitter;
314 //
315 // QSplitter *vSplitter = new QSplitter;
316 // vSplitter->setOrientation(Qt::Vertical);
317 // vSplitter->addWidget(h1Splitter);
318 // vSplitter->addWidget(h2Splitter);
319 //
320 // VP1EventDisplaySceneView *view = new VP1EventDisplaySceneView("Top left view");
321 // view->view()->setScene(m_scene);
322 // h1Splitter->addWidget(view);
323 //
324 // view = new VP1EventDisplaySceneView("Top right view");
325 // view->view()->setScene(m_scene);
326 // h1Splitter->addWidget(view);
327 //
328 // view = new VP1EventDisplaySceneView("Bottom left view");
329 // view->view()->setScene(m_scene);
330 // h2Splitter->addWidget(view);
331 //
332 // view = new VP1EventDisplaySceneView("Bottom right view");
333 // view->view()->setScene(m_scene);
334 // h2Splitter->addWidget(view);
335 //
336 // QLayout *layout = this->layout();
337 // layout->addWidget(vSplitter);
339 //
340 // setWindowTitle(tr("Chip Demo"));
341 //
342 //
343 //}
344 
345 
346 
347 //____________________________________________________________________
349 {
350  // m_d->frameHolderWidget->deleteLater();
351  // foreach(VP1CustomTourFrameWidget*frame,m_d->frames)
352  // frame->deleteLater();
353  delete m_d;
354  delete m_scene;
355  // delete scene_preview;
356 }
357 
358 
359 //____________________________________________________________________
361 {
362 // if (m_d->ui.radioButton_eventDetails->isChecked())
363  if (checked)
364  m_d->ui.lineEdit_customLabelText->setEnabled(false);
365  else
366  m_d->ui.lineEdit_customLabelText->setEnabled(true);
367 }
368 
369 
370 //____________________________________________________________________
372 {
373 
374  QString evtstr = "Run: "+QString::number(m_runNumber)+"\n"
375  + "Event: "+QString::number(m_eventNumber)+"\n"
376  + QString(m_eventTimestamp>0 ? QDateTime::fromTime_t(m_eventTimestamp).toString(Qt::ISODate).replace('T',' ')+ " CEST" : "");
377 
378  //VP1Msg::messageVerbose(evtstr);
379 
380  return evtstr;
381 }
382 
383 
384 //____________________________________________________________________
386 {
387  m_preview->print();
388 }
389 
390 
391 //____________________________________________________________________
393 {
394  VP1Msg::messageVerbose("VP1EventDisplayEditor::savePicture()");
395 
396  // hide the rendering frame, cause we do not want it in the final picture
398 
399  QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
400  "event_display.png",
401  tr("Images (*.png *.jpg)"));
402 
403  QImage image(m_scene->sceneRect().size().toSize(), QImage::Format_ARGB32);
404  image.fill(Qt::transparent);
405 
406  QPainter painter(&image);
407  painter.setRenderHint(QPainter::Antialiasing);
408 
409  m_scene->render(&painter);
410 
411  image.save(fileName);
412 
413  // show the rendering frame again
415 
416 }
417 
418 
419 
420 
421 
422 
423 //____________________________________________________________________
424 void VP1EventDisplayEditor::addPixmapList(QList<QPixmap>& list, QStringList& listNames)
425 {
426  VP1Msg::messageVerbose("VP1EventDisplayEditor::addPixmapList()");
427 
428  if (!list.isEmpty()) {
429  for (QPixmap img : list) {
430  // add and set it movableimage to the scene
431  QGraphicsPixmapItem* item = m_scene->addPixmap(img);
432  item->setFlags(QGraphicsItem::ItemIsMovable);
433  m_sceneItems << item;
434  }
435  }
436 
437  if (!listNames.isEmpty()) {
438  for (QString name : listNames) {
439  // add image name to the list
440  new QListWidgetItem(name, m_d->ui.listWidget);
441  }
442  }
443 }
444 
445 
446 //____________________________________________________________________
448 {
449  QListWidgetItem * currentItem = m_d->ui.listWidget->currentItem();
450  QString text = currentItem->text();
451  int currentPos = m_d->ui.listWidget->row( currentItem );
452 
453  // remove the object from the scene
454  m_scene->removeItem( m_sceneItems[currentPos] );
455  // remove its associated pointer in our list
456  m_sceneItems.removeAt( currentPos );
457  // remove its associated label
458  QListWidgetItem * item = m_d->ui.listWidget->takeItem(currentPos);
459  delete item;
460 
461  VP1Msg::message("Successfully removed the object: " + text);
462 }
463 
466 //void VP1EventDisplayEditor::addTextLabelSlot()
467 //{
468 // this->addTextLabel();
469 //}
470 
471 
472 //____________________________________________________________________
474 {
475  QString text;
476  QFont font;
477 
478 // /* if we use this function programmatically,
479 // * passing text directly
480 // */
481 // if (!textString.isEmpty()) {
482 //
483 // text = textString;
484 //
485 // // default settings
486 // int size = 32;
487 // int weight = QFont::Normal;
488 // bool italics = false;
489 // QString typeface = "Courier";
490 //
491 // // default font
492 // font = QFont(typeface, size, weight, italics);
493 //
494 // // default font family, if Courier is not available
495 // font.setStyleHint(QFont::TypeWriter);
496 //
497 // }
498 
499 // /* if we use this function from the GUI,
500 // * then we get all user's settings from the GUI itself
501 // */
502 // else {
503 
504  if (m_d->ui.radioButton_eventDetails->isChecked()) {
505  // get the event details
506  text = this->getEventDetailsLabel();
507  }
508  else {
509  // get the user's text
510  text = m_d->ui.lineEdit_customLabelText->text();
511  }
512 
513 
514  // get users' settings
515  int size = 0;
516  if (m_d->ui.radioButton_size12->isChecked()) size = 12;
517  else if (m_d->ui.radioButton_size24->isChecked()) size = 24;
518  else if (m_d->ui.radioButton_size32->isChecked()) size = 32;
519  else if (m_d->ui.radioButton_size44->isChecked()) size = 44;
520  else if (m_d->ui.radioButton_sizeCustom->isChecked()) {
521  size = m_d->ui.spinBox_size->value();
522  }
523 
524  QString typeface = "Courier"; // default typeface
525 
526  int weight = QFont::Normal;
527  if (m_d->ui.radioButton_light->isChecked()) weight = QFont::Light;
528  else if (m_d->ui.radioButton_normal->isChecked()) weight = QFont::Normal;
529  else if (m_d->ui.radioButton_bold->isChecked()) weight = QFont::Bold;
530  else if (m_d->ui.radioButton_black_2->isChecked()) weight = QFont::Black;
531 
532  bool italics = false;
533  if (m_d->ui.radioButton_italics->isChecked()) italics = true;
534 
535  font = QFont(typeface, size, weight, italics);
536 
537  if (m_d->ui.radioButton_monaco->isChecked()) {
538  // typeface = "Monaco";
539  typeface = "Courier";
540  font.setStyleHint(QFont::TypeWriter); // this defines the family to choose from, if the preferred typeface is not available on the host system
541  }
542  else if (m_d->ui.radioButton_helvetica->isChecked()) {
543  typeface = "Helvetica";
544  font.setStyleHint(QFont::SansSerif);
545  }
546  else if (m_d->ui.radioButton_times->isChecked()) {
547  typeface = "Times";
548  font.setStyleHint(QFont::Serif);
549  }
550  font.setFamily(typeface);
551 
552 // }
553 
554  this->addTextLabel(text, font);
555 }
556 
557 
558 //____________________________________________________________________
560 {
561 // adding the label to the m_scene
562 QGraphicsTextItem* item = m_scene->addText(text, font);
563 item->setFlags(QGraphicsItem::ItemIsMovable);
564 
565 // The addText() method creates a TextItem with 'plain text.
566 // So, we now set again the text property with the setHtml()
567 // method, so users can use HTML tags to stylize their labels.
568 // That's especially useful in this context, to add labels
569 // with the Pt values of the physics objects.
570 item->setHtml(text);
571 
572 // set the user's preferred color
573 if (m_d->ui.radioButton_whiteText->isChecked()) {
574  item->setDefaultTextColor(Qt::white);
575 } else if (m_d->ui.radioButton_blackText->isChecked()) {
576  item->setDefaultTextColor(Qt::black);
577 }
578 
579 // adding the label to the list of objects
580 QString strippedText = text.replace('\n',' ').replace('\t', ' ').simplified();
581 new QListWidgetItem(strippedText, m_d->ui.listWidget);
582 
583 // adding the label to list of object pointers
584 m_sceneItems << item;
585 }
586 
587 
588 //____________________________________________________________________
590 {
591  int tabN = m_d->ui.comboBox_tabNumber->currentIndex();
592  QString tabName = m_d->ui.comboBox_tabNumber->currentText();
593  VP1Msg::messageVerbose("Got tab: " + tabName + " at idx: " + QString::number(tabN) );
594 
595  int imageWidth = m_d->ui.spinBox_imageWidth->value();
596  VP1Msg::messageVerbose("width: " + QString::number(imageWidth) );
597 
598  QPixmap snap = m_mainWindow->getSingleChannelCustomSnapshot( tabName, imageWidth );
599 
600  tabName = tabName + "_" + QString::number(imageWidth);
601 
602 
603  QList<QPixmap> listPixmap;
604  QStringList listNamesPixmap;
605 
606  listPixmap << snap;
607  listNamesPixmap << tabName;
608 
609  this->addPixmapList(listPixmap, listNamesPixmap);
610 
611 }
612 
613 //____________________________________________________________________
614 void VP1EventDisplayEditor::setTabsList( QStringList listNames )
615 {
616  VP1Msg::messageVerbose("VP1EventDisplayEditor::setTabsList()");
617 
618  m_d->ui.comboBox_tabNumber->addItems(listNames);
619 
620 }
621 
622 
623 //____________________________________________________________________
625 {
626  QPixmap pix;
627  QString name;
628 
629  // load the right version of the ATLAS logo
630  if ( m_d->ui.radioButton_300px->isChecked() ) {
631  if ( m_d->ui.radioButton_logo_white->isChecked() )
632  pix.load(":/vp1/images/images/ATLAS-Logo-New_300pixels.png");
633  if ( m_d->ui.radioButton_logo_main->isChecked() )
634  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-300px.png");
635  name = "logo_300px";
636  }
637  else if ( m_d->ui.radioButton_450px->isChecked() ) {
638  if ( m_d->ui.radioButton_logo_white->isChecked() )
639  pix.load(":/vp1/images/images/ATLAS-Logo-New_450pixels.png");
640  if ( m_d->ui.radioButton_logo_main->isChecked() )
641  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-450px.png");
642  name = "logo_450px";
643  }
644  else if ( m_d->ui.radioButton_600px->isChecked() ) {
645  if ( m_d->ui.radioButton_logo_white->isChecked() )
646  pix.load(":/vp1/images/images/ATLAS-Logo-New_600pixels.png");
647  if ( m_d->ui.radioButton_logo_main->isChecked() )
648  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-600px.png");
649  name = "logo_600px";
650  }
651  else if ( m_d->ui.radioButton_800px->isChecked() ) {
652  if ( m_d->ui.radioButton_logo_white->isChecked() )
653  pix.load(":/vp1/images/images/ATLAS-Logo-New_800pixels.png");
654  if ( m_d->ui.radioButton_logo_main->isChecked() )
655  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-800px.png");
656  name = "logo_800px";
657  }
658  else if ( m_d->ui.radioButton_1000px->isChecked() ) {
659  if ( m_d->ui.radioButton_logo_white->isChecked() )
660  pix.load(":/vp1/images/images/ATLAS-Logo-New_1000pixels.png");
661  if ( m_d->ui.radioButton_logo_main->isChecked() )
662  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-1000px.png");
663  name = "logo_1000px";
664  }
665  else if ( m_d->ui.radioButton_1200px->isChecked() ) {
666  if ( m_d->ui.radioButton_logo_white->isChecked() )
667  pix.load(":/vp1/images/images/ATLAS-Logo-New_1200pixels.png");
668  if ( m_d->ui.radioButton_logo_main->isChecked() )
669  pix.load(":/vp1/images/images/ATLAS-Logo-Ref-RGB-transpBkg-1200px.png");
670  name = "logo_1200px";
671  }
672 
673  // add the logo to the m_scene
674  QGraphicsPixmapItem* item = m_scene->addPixmap(pix);
675  item->setFlags(QGraphicsItem::ItemIsMovable);
676  // add to the list of pointers
677  m_sceneItems << item;
678  // add to the list of object labels
679  new QListWidgetItem(name, m_d->ui.listWidget);
680 }
681 
682 
683 //____________________________________________________________________
685 {
686 
687  // a white background
688  if ( m_d->ui.radioButton_white->isChecked() )
689  m_scene->setBackgroundBrush(Qt::white);
690  // a black background
691  else if ( m_d->ui.radioButton_black->isChecked() )
692  m_scene->setBackgroundBrush(Qt::black);
693  // a transparent background
694  else if ( m_d->ui.radioButton_transparent->isChecked() ) {
695  m_scene->setBackgroundBrush(Qt::NoBrush);
696  // // a gradient background
697  // QRadialGradient gradient(0, 0, 10);
698  // gradient.setSpread(QGradient::RepeatSpread);
699  // m_scene->setBackgroundBrush(gradient);
700  }
701 }
702 
703 
704 
705 //____________________________________________________________________
707 {
708  // if you want to just hide the window when closed, uncomment the lines below
709  ev->ignore();
710  hide();
711 
712  // this, instead, will close the window
713  // ev->accept();
714 }
715 
716 //QGraphicsView* VP1EventDisplayEditor::getView()
717 //{
718 // return m_d->ui.graphicsView;
719 //}
720 
721 
722 
723 
725 //void VP1EventDisplayEditor::buttonClicked()
726 //{
727 // if (m_d->ui.pushButton_addCurrentView==sender()) {
728 // VP1CustomTourFrameWidget * frame = new VP1CustomTourFrameWidget(m_d->viewer->currentCamIsPerspective(),
729 // m_d->viewer->currentCameraState());
730 // m_d->addFrame(frame);
731 // m_d->updateFrameSnapshot(frame);
732 // m_d->updateFrameListVisuals();
733 // } else if (m_d->ui.pushButton_refreshPreviews==sender()) {
734 // foreach(VP1CustomTourFrameWidget*frame,m_d->frames)
735 // m_d->updateFrameSnapshot(frame);
736 // } else if (m_d->ui.pushButton_execute==sender()) {
737 // m_d->viewer->startCustomTour();
738 // } else if (m_d->ui.pushButton_utilityZoomShow==sender()) {
739 // }
740 //}
741 
VP1Serialise.h
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
VP1EventDisplayEditor::m_mainWindow
VP1MainWindow * m_mainWindow
Definition: VP1EventDisplayEditor.h:83
VP1EventDisplayEditor::VP1EventDisplayEditor
VP1EventDisplayEditor(VP1MainWindow *mainWindow, QList< unsigned long long > listRunEventNumberTimestamp)
Definition: VP1EventDisplayEditor.cxx:144
VP1EventDisplayEditor::closeEvent
void closeEvent(QCloseEvent *)
Definition: VP1EventDisplayEditor.cxx:706
VP1Deserialise.h
VP1EventDisplayEditor::addLogo
void addLogo()
Definition: VP1EventDisplayEditor.cxx:624
VP1EventDisplayEditor.h
VP1MainWindow::getSingleChannelCustomSnapshot
QPixmap getSingleChannelCustomSnapshot(IVP1ChannelWidget *tab, int width=0)
Definition: VP1MainWindow.cxx:1162
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
VP1EventDisplayEditor::printPicture
void printPicture()
Definition: VP1EventDisplayEditor.cxx:385
VP1EventDisplayEditor::setTabsList
void setTabsList(QStringList listNames)
Definition: VP1EventDisplayEditor.cxx:614
VP1EventDisplayEditor::m_eventTimestamp
unsigned m_eventTimestamp
Definition: VP1EventDisplayEditor.h:87
VP1EventDisplayEditor::m_d
Imp * m_d
Definition: VP1EventDisplayEditor.h:71
VP1EventDisplayEditor
Definition: VP1EventDisplayEditor.h:34
VP1EventDisplaySceneView::view
QGraphicsView * view() const
Definition: VP1EventDisplaySceneView.cxx:241
VP1EventDisplayEditor::~VP1EventDisplayEditor
virtual ~VP1EventDisplayEditor()
Definition: VP1EventDisplayEditor.cxx:348
VP1EventDisplaySceneView::addRenderingFrame
void addRenderingFrame()
Definition: VP1EventDisplaySceneView.cxx:246
VP1EventDisplayEditor::Imp::theclass
VP1EventDisplayEditor * theclass
Definition: VP1EventDisplayEditor.cxx:43
VP1EventDisplaySceneView::showRenderingFrame
void showRenderingFrame()
Definition: VP1EventDisplaySceneView.cxx:266
VP1EventDisplayEditor::m_scene
QGraphicsScene * m_scene
Definition: VP1EventDisplayEditor.h:73
VP1EventDisplayEditor::addPixmapList
void addPixmapList(QList< QPixmap > &list, QStringList &listNames)
Definition: VP1EventDisplayEditor.cxx:424
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
VP1QtInventorUtils.h
VP1EventDisplayEditor::m_runNumber
int m_runNumber
Definition: VP1EventDisplayEditor.h:85
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
VP1EventDisplayEditor::addTextLabel
void addTextLabel(QString text, QFont font)
Definition: VP1EventDisplayEditor.cxx:559
VP1EventDisplayEditor::savePicture
void savePicture()
Definition: VP1EventDisplayEditor.cxx:392
VP1EventDisplayEditor::m_eventNumber
unsigned long long m_eventNumber
Definition: VP1EventDisplayEditor.h:86
VP1EventDisplayEditor::m_sceneItems
QList< QGraphicsItem * > m_sceneItems
Definition: VP1EventDisplayEditor.h:75
VP1MainWindow.h
VP1ExaminerViewer.h
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
ev
int ev
Definition: globals.cxx:25
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
VP1EventDisplayEditor::setTextLabel
void setTextLabel()
Definition: VP1EventDisplayEditor.cxx:473
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
VP1EventDisplayEditor::enableCustomTextField
void enableCustomTextField(bool checked)
Definition: VP1EventDisplayEditor.cxx:360
VP1EventDisplaySceneView::hideRenderingFrame
void hideRenderingFrame()
Definition: VP1EventDisplaySceneView.cxx:272
VP1EventDisplayEditor::setBackgroundColor
void setBackgroundColor()
Definition: VP1EventDisplayEditor.cxx:684
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1EventDisplayEditor::getTabSnapshot
void getTabSnapshot()
Definition: VP1EventDisplayEditor.cxx:589
item
Definition: ItemListSvc.h:43
MyPlots.image
string image
Definition: MyPlots.py:43
VP1EventDisplayEditor::Imp
Definition: VP1EventDisplayEditor.cxx:39
VP1EventDisplayEditor::getEventDetailsLabel
QString getEventDetailsLabel()
Definition: VP1EventDisplayEditor.cxx:371
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
VP1EventDisplaySceneView
Definition: VP1EventDisplaySceneView.h:66
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
plotBeamSpotMon.font
font
Definition: plotBeamSpotMon.py:80
pix
Definition: PixelMapping.cxx:16
VP1MainWindow
Definition: VP1MainWindow.h:82
VP1EventDisplayEditor::Imp::ui
Ui::VP1EventDisplayEditorForm ui
Definition: VP1EventDisplayEditor.cxx:44
VP1EventDisplaySceneView::print
void print()
Definition: VP1EventDisplaySceneView.cxx:341
VP1EventDisplayEditor::m_preview
VP1EventDisplaySceneView * m_preview
Definition: VP1EventDisplayEditor.h:78
VP1EventDisplayEditor::removeObject
void removeObject()
Definition: VP1EventDisplayEditor.cxx:447
drawFromPickle.view
view
Definition: drawFromPickle.py:294