CMS 3D CMS Logo

FWGUIManager.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWGUIManager
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Feb 11 11:06:40 EST 2008
11 // system include files
12 #include <boost/bind.hpp>
13 #include <stdexcept>
14 #include <iostream>
15 #include <cstdio>
16 #include <sstream>
17 #include <thread>
18 #include <future>
19 
20 #include "TGButton.h"
21 #include "TGLabel.h"
22 #include "TSystem.h"
23 #include "TGLIncludes.h"
24 #include "TGLViewer.h"
25 #include "TEveBrowser.h"
26 #include "TEveManager.h"
27 #include "TGPack.h"
28 #include "TEveWindow.h"
29 #include "TEveViewer.h"
30 #include "TEveWindowManager.h"
31 #include "TEveSelection.h"
32 #include "TVirtualX.h"
33 #include "TFile.h"
34 
35 // user include files
40 
51 
53 
56 
59 
61 
63 
69 
71 
73 
77 
79 
81 
85 
87 
90 
91 // constants, enums and typedefs
92 //
93 //
94 // static data member definitions
95 //
97 
98 //
99 // constructors and destructor
100 //
101 
103  : m_context(ctx),
104  m_summaryManager(nullptr),
105  m_detailViewManager(nullptr),
106  m_viewManagerManager(iVMMgr),
107  m_contextMenuHandler(nullptr),
108  m_navigator(navigator),
109  m_dataAdder(nullptr),
110  m_ediFrame(nullptr),
111  m_modelPopup(nullptr),
112  m_viewPopup(nullptr),
113  m_commonPopup(nullptr),
114  m_invMassDialog(nullptr),
115  m_helpPopup(nullptr),
116  m_shortcutPopup(nullptr),
117  m_helpGLPopup(nullptr),
118  m_tasks(new CmsShowTaskExecutor),
119  m_WMOffsetX(0),
120  m_WMOffsetY(0),
121  m_WMDecorH(0) {
122  m_guiManager = this;
123 
125 
127  im->newItem_.connect(boost::bind(&FWGUIManager::newItem, this, _1));
128 
130 
131  TEveCompositeFrame::IconBarCreator_foo foo = &FWGUIManager::makeGUIsubview;
132  TEveCompositeFrame::SetupFrameMarkup(foo, 20, 4, false);
133 
134  {
135  m_cmsShowMainFrame = new CmsShowMainFrame(gClient->GetRoot(), 950, 750, this);
136 
137  m_cmsShowMainFrame->SetCleanup(kDeepCleanup);
138 
139  /*
140  int mlist[FWViewType::kTypeSize] = {FWViewType::kRhoPhi, FWViewType::kRhoZ, FWViewType::k3D, FWViewType::kISpy, FWViewType::kLego, FWViewType::kLegoHF, FWViewType::kGlimpse,
141  FWViewType::kTable, FWViewType::kTableL1, FWViewType::kTableHLT,
142  FWViewType::kGeometryTable,
143  FWViewType::kRhoPhiPF, FWViewType::kLegoPFECAL}; */
144 
145  for (int i = 0; i < FWViewType::kTypeSize; ++i) {
147  continue;
148 
151  action->activated.connect(boost::bind(&FWGUIManager::newViewSlot, this, FWViewType::idToName(i)));
152  }
153 
157 
161  ->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForLoadConfigurationFile));
163  ->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForPartialLoadConfigurationFile));
166  ->activated.connect(sigc::mem_fun(this, &FWGUIManager::savePartialToConfigurationFile));
168  ->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForSaveConfigurationFile));
170  ->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForPartialSaveConfigurationFile));
174 
176  ->activated.connect(sigc::mem_fun(m_context->colorManager(), &FWColorManager::switchBackground));
178 
180  ->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showInvMassDialog));
181 
183  assert(getAction(cmsshow::sHelp) != nullptr);
185  assert(getAction(cmsshow::sKeyboardShort) != nullptr);
187  ->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::createShortcutPopup));
189 
190  // toolbar special widget with non-void actions
192  boost::bind(&FWGUIManager::delaySliderChanged, this, _1));
193 
194  TQObject::Connect(m_cmsShowMainFrame->m_runEntry, "ReturnPressed()", "FWGUIManager", this, "runIdChanged()");
195  TQObject::Connect(m_cmsShowMainFrame->m_lumiEntry, "ReturnPressed()", "FWGUIManager", this, "lumiIdChanged()");
196  TQObject::Connect(m_cmsShowMainFrame->m_eventEntry, "ReturnPressed()", "FWGUIManager", this, "eventIdChanged()");
197 
198  TQObject::Connect(
199  m_cmsShowMainFrame->m_filterShowGUIBtn, "Clicked()", "FWGUIManager", this, "showEventFilterGUI()");
200  TQObject::Connect(
201  m_cmsShowMainFrame->m_filterEnableBtn, "Clicked()", "FWGUIManager", this, "filterButtonClicked()");
202 
203  TQObject::Connect(gEve->GetWindowManager(),
204  "WindowSelected(TEveWindow*)",
205  "FWGUIManager",
206  this,
207  "checkSubviewAreaIconState(TEveWindow*)");
208  TQObject::Connect(gEve->GetWindowManager(),
209  "WindowDocked(TEveWindow*)",
210  "FWGUIManager",
211  this,
212  "checkSubviewAreaIconState(TEveWindow*)");
213  TQObject::Connect(gEve->GetWindowManager(),
214  "WindowUndocked(TEveWindow*)",
215  "FWGUIManager",
216  this,
217  "checkSubviewAreaIconState(TEveWindow*)");
218  }
219 }
220 
222  a->goingToBeDestroyed_.connect(boost::bind(&FWGUIManager::subviewIsBeingDestroyed, this, _1));
223  a->selected_.connect(boost::bind(&FWGUIManager::subviewInfoSelected, this, _1));
224  a->unselected_.connect(boost::bind(&FWGUIManager::subviewInfoUnselected, this, _1));
225  a->swap_.connect(boost::bind(&FWGUIManager::subviewSwapped, this, _1));
226 }
227 
228 //
229 // Destructor
230 //
232  delete m_invMassDialog;
233  delete m_summaryManager;
234  delete m_detailViewManager;
235  delete m_cmsShowMainFrame;
236  delete m_viewPopup;
237  delete m_ediFrame;
238  delete m_contextMenuHandler;
239 }
240 
242  gEve->GetWindowManager()->Disconnect("WindowSelected(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
243  gEve->GetWindowManager()->Disconnect("WindowDocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
244  gEve->GetWindowManager()->Disconnect("WindowUndocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
245 
246  // avoid emit signals at end
247  gEve->GetSelection()->Disconnect();
248  gEve->GetHighlight()->Disconnect();
249  gEve->GetSelection()->RemoveElements();
250  gEve->GetHighlight()->RemoveElements();
251 
252  m_cmsShowMainFrame->UnmapWindow();
253  for (ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt) {
254  TEveCompositeFrameInMainFrame* mainFrame =
255  dynamic_cast<TEveCompositeFrameInMainFrame*>((*wIt).first->GetEveFrame());
256  // main frames not to watch dying
257  if (mainFrame)
258  mainFrame->UnmapWindow();
259  // destroy
260  (*wIt).second->destroy();
261  }
262 }
263 
264 //______________________________________________________________________________
265 // subviews construction
266 //
267 
268 TGFrame* FWGUIManager::makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height) {
269  TGFrame* frame = new FWGUISubviewArea(cp, parent, height);
270  return frame;
271 }
272 
274  m_nameToViewBuilder[iName] = iBuilder;
275 }
276 
278  // this function have to exist, becuse CSGAction binds to void functions
279  createView(iName);
280 }
281 
282 FWGUIManager::ViewMap_i FWGUIManager::createView(const std::string& iName, TEveWindowSlot* slot) {
283  NameToViewBuilder::iterator itFind = m_nameToViewBuilder.find(iName);
284  assert(itFind != m_nameToViewBuilder.end());
285  if (itFind == m_nameToViewBuilder.end()) {
286  throw std::runtime_error(std::string("Unable to create view named ") + iName + " because it is unknown");
287  }
288 
289  if (!slot) {
290  if (m_viewSecPack) {
291  slot = m_viewSecPack->NewSlot();
292  } else {
293  slot = m_viewPrimPack->NewSlot();
294  m_viewSecPack = m_viewPrimPack->NewSlot()->MakePack();
295  m_viewSecPack->SetShowTitleBar(kFALSE);
296  }
297  }
298  TEveCompositeFrame* ef = slot->GetEveFrame();
299  FWViewBase* viewBase = itFind->second(slot, iName);
300  //in future, get context from 'view'
302  viewBase->openSelectedModelContextMenu_.connect(
303  boost::bind(&FWGUIManager::showSelectedModelContextMenu, m_guiManager, _1, _2, base));
304 
305  TEveWindow* eveWindow = ef->GetEveWindow();
306  eveWindow->SetElementName(iName.c_str());
307 
308  std::pair<ViewMap_i, bool> insertPair = m_viewMap.insert(std::make_pair(eveWindow, viewBase));
309  return insertPair.first;
310 }
311 
312 //
313 // actions
314 //
315 
317 
318 void FWGUIManager::titleChanged(const char* subtitle) {
319  char title[128];
320  snprintf(title, 127, "cmsShow: %s", subtitle);
321  m_cmsShowMainFrame->SetWindowName(title);
322 }
323 
325  // To be replaced when we can get index from fwlite::Event
326 
327  TEveViewerList* viewers = gEve->GetViewers();
328  for (TEveElement::List_i i = viewers->BeginChildren(); i != viewers->EndChildren(); ++i) {
329  TEveViewer* ev = dynamic_cast<TEveViewer*>(*i);
330  if (ev)
331  ev->GetGLViewer()->DeleteOverlayAnnotations();
332  }
333 
334  for (auto reg : m_regionViews) {
335  for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it) {
336  if (it->second == reg) {
337  m_viewMap.erase(it);
338  reg->destroy();
339  break;
340  }
341  }
342  }
343 
346 }
347 
349 
351 
354 }
355 
357 
359 
361 
362 void FWGUIManager::setPlayMode(bool play) {
363  m_cmsShowMainFrame->m_runEntry->SetEnabled(!play);
364  m_cmsShowMainFrame->m_eventEntry->SetEnabled(!play);
365 }
366 
368 
370 
371 void FWGUIManager::newItem(const FWEventItem* iItem) {
372 #if defined(THIS_WILL_NEVER_BE_DEFINED)
373  m_selectionItemsComboBox->AddEntry(iItem->name().c_str(), iItem->id());
374  if (iItem->id() == 0) {
375  m_selectionItemsComboBox->Select(0);
376  }
377 #endif
378 }
379 
381  if (nullptr == m_dataAdder) {
383  100,
387  }
388  m_dataAdder->show();
389 }
390 
391 // subview actions
392 //
393 
395  TEveWindow* swapCandidate = nullptr;
396 
397  if (gEve->GetWindowManager()->GetCurrentWindow()) {
398  swapCandidate = gEve->GetWindowManager()->GetCurrentWindow();
399  } else {
400  // swap with first docked view
401  TEveCompositeFrame* pef;
402  TGFrameElementPack* pel;
403 
404  // check if there is view in prim pack
405  TGPack* pp = m_viewPrimPack->GetPack();
406  if (pp->GetList()->GetSize() > 2) {
407  pel = (TGFrameElementPack*)pp->GetList()->At(1);
408  if (pel->fState) // is first undocked
409  {
410  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
411  if (pef && pef->GetEveWindow())
412  swapCandidate = pef->GetEveWindow();
413  }
414  }
415  if (swapCandidate == nullptr) {
416  // no eve window found in primary, check secondary
417  TGPack* sp = m_viewSecPack->GetPack();
418  TIter frame_iterator(sp->GetList());
419  while ((pel = (TGFrameElementPack*)frame_iterator())) {
420  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
421  if (pef && pef->GetEveWindow() && pel->fState) {
422  swapCandidate = pef->GetEveWindow();
423  break;
424  }
425  }
426  }
427  }
428  return swapCandidate;
429 }
430 
431 void FWGUIManager::checkSubviewAreaIconState(TEveWindow* /*ew*/) {
432  // First argumet is needed for signals/slot symetry
433 
434  // disable swap on the first left TEveCompositeFrame
435  // check info button
436  TEveWindow* current = getSwapCandidate();
437  bool checkInfoBtn = m_viewPopup ? m_viewPopup->mapped() : false;
438  TEveWindow* selected = m_viewPopup ? m_viewPopup->getEveWindow() : nullptr;
439 
440  for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); it++) {
442  ar->setSwapIcon(current != it->first);
443  if (checkInfoBtn && selected)
444  ar->setInfoButton(selected == it->first);
445  }
446 }
447 
449  if (sva->isSelected())
450  setViewPopup(nullptr);
451 
453  f = boost::bind(&FWGUIManager::subviewDestroy, this, sva);
454  m_tasks->addTask(f);
455  m_tasks->startDoingTasks();
456 }
457 
459  TEveWindow* ew = sva->getEveWindow();
460  FWViewBase* viewBase = m_viewMap[ew];
461  m_viewMap.erase(ew);
462  viewBase->destroy();
463 }
464 
466  std::vector<FWGUISubviewArea*> sd;
467  for (ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt) {
469  sd.push_back(ar);
470  }
471 
472  for (std::vector<FWGUISubviewArea*>::iterator i = sd.begin(); i != sd.end(); ++i) {
473  if ((*i)->isSelected())
474  setViewPopup(nullptr);
475  subviewDestroy(*i);
476  }
477 
478  gSystem->ProcessEvents();
479  gSystem->Sleep(200);
480 
481  while (m_viewPrimPack->HasChildren()) {
482  TEveWindow* w = dynamic_cast<TEveWindow*>(m_viewPrimPack->FirstChild());
483  if (w)
484  w->DestroyWindowAndSlot();
485  }
486 
487  gSystem->Sleep(200);
488  m_viewSecPack = nullptr;
489  gSystem->ProcessEvents();
490 }
491 
493  // release button on previously selected
494  TEveWindow* ew = sva->getEveWindow();
495  for (ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt) {
496  if (wIt->first != ew)
498  }
499  setViewPopup(sva->getEveWindow());
500 }
501 
503 
505  TEveWindow* curr = getSwapCandidate();
506  TEveWindow* swap = sva->getEveWindow();
507  if (curr)
508  swap->SwapWindow(curr);
509 
510  checkSubviewAreaIconState(nullptr);
511 }
512 
513 TGVerticalFrame* FWGUIManager::createList(TGCompositeFrame* p) {
514  TGVerticalFrame* listFrame = new TGVerticalFrame(p, p->GetWidth(), p->GetHeight());
515 
516  TGHorizontalFrame* addFrame = new TGHorizontalFrame(listFrame, p->GetWidth(), 10, kRaisedFrame);
517  TGLabel* addLabel = new TGLabel(addFrame, "Summary View");
518  addFrame->AddFrame(addLabel, new TGLayoutHints(kLHintsCenterX, 0, 0, 2, 2));
519  listFrame->AddFrame(addFrame, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
520 
521  m_summaryManager = new FWSummaryManager(listFrame,
524  this,
527 
528  const unsigned int backgroundColor = 0x2f2f2f;
529  TGTextButton* addDataButton = new TGTextButton(m_summaryManager->widget(), "Add Collection");
530  addDataButton->ChangeOptions(kRaisedFrame);
531  addDataButton->SetBackgroundColor(backgroundColor);
532  addDataButton->SetTextColor(0xFFFFFF);
533  addDataButton->SetToolTipText("Show additional collections");
534  addDataButton->Connect("Clicked()", "FWGUIManager", this, "addData()");
535  m_summaryManager->widget()->AddFrame(addDataButton, new TGLayoutHints(kLHintsExpandX | kLHintsLeft | kLHintsTop));
536  listFrame->AddFrame(m_summaryManager->widget(), new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
537 
538  return listFrame;
539 }
540 
541 void FWGUIManager::createViews(TEveWindowSlot* slot) {
542  m_viewPrimPack = slot->MakePack();
543  m_viewPrimPack->SetHorizontal();
544  m_viewPrimPack->SetElementName("Views");
545  m_viewPrimPack->SetShowTitleBar(kFALSE);
546  m_viewSecPack = nullptr;
547 }
548 
550  if (m_ediFrame == nullptr) {
552  m_ediFrame->CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
554  }
555 }
556 
557 void FWGUIManager::showEDIFrame(int iToShow) {
558  createEDIFrame();
559  if (-1 != iToShow) {
560  m_ediFrame->show(static_cast<FWDataCategories>(iToShow));
561  }
562  m_ediFrame->MapRaised();
563 }
564 
566  try {
567  FWModelId id = *(m_context->selectionManager()->selected().begin());
568  float theta = 0, phi = 0;
569  edm::TypeWithDict type = edm::TypeWithDict((TClass*)id.item()->modelType());
570  using namespace boost::spirit::classic;
572  reco::parser::Grammar grammar(tmpPtr, type);
573  edm::ObjectWithDict o(type, (void*)id.item()->modelData(id.index()));
574  if (parse("theta()", grammar.use_parser<1>() >> end_p, space_p).full)
575  theta = tmpPtr->value(o);
576  else
577  throw FWExpressionException("syntax error", -1);
578  if (parse("phi()", grammar.use_parser<1>() >> end_p, space_p).full)
579  phi = tmpPtr->value(o);
580  else
581  throw FWExpressionException("syntax error", -1);
582  ViewMap_i it = createView("3D Tower", m_viewSecPack->NewSlot());
583  FW3DViewBase* v = static_cast<FW3DViewBase*>(it->second);
584  v->setClip(theta, phi);
585  it->first->UndockWindow();
586  } catch (const reco::parser::BaseException& e) {
587  std::cout << " FWModelFilter failed to base " << e.what() << std::endl;
588  }
589 }
590 
592  if (!m_commonPopup) {
596  }
597  m_commonPopup->MapRaised();
598 }
599 
603  m_modelPopup->CenterOnParent(kTRUE, TGTransientFrame::kRight);
605 }
606 
608  if (!m_modelPopup)
610  m_modelPopup->MapRaised();
611 }
612 
614  if (m_viewPopup->getEveWindow()) {
616  sa->setInfoButton(kFALSE);
617  }
618 }
619 
621  // CSG action.
622  setViewPopup(nullptr);
623 }
624 
625 void FWGUIManager::setViewPopup(TEveWindow* ew) {
626  FWViewBase* vb = ew ? m_viewMap[ew] : nullptr;
627  if (m_viewPopup == nullptr) {
628  m_viewPopup = new CmsShowViewPopup(nullptr, 200, 200, m_context->colorManager(), vb, ew);
630  } else {
632  }
633  m_viewPopup->reset(vb, ew);
634  m_viewPopup->MapRaised();
635 }
636 
638  if (!m_invMassDialog) {
641  }
642  m_invMassDialog->MapRaised();
643 }
644 
646  if (m_helpPopup == nullptr) {
647  m_helpPopup = new CmsShowHelpPopup("help.html", "CmsShow Help", m_cmsShowMainFrame, 800, 600);
648  m_helpPopup->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight);
649  }
650  m_helpPopup->MapWindow();
651 }
652 
654  if (m_shortcutPopup == nullptr) {
656  "shortcuts.html", getAction(cmsshow::sKeyboardShort)->getName(), m_cmsShowMainFrame, 800, 600);
657 
658  m_shortcutPopup->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight);
659  }
660  m_shortcutPopup->MapWindow();
661 }
662 
664  if (m_helpGLPopup == nullptr) {
665  m_helpGLPopup =
666  new CmsShowHelpPopup("helpGL.html", getAction(cmsshow::sHelpGL)->getName(), m_cmsShowMainFrame, 800, 600);
667 
668  m_helpGLPopup->CenterOnParent(kTRUE, TGTransientFrame::kBottomRight);
669  }
670  m_helpGLPopup->MapWindow();
671 }
672 
674  Int_t iGlobalY,
675  FWViewContextMenuHandlerBase* iHandler) {
676  if (!m_context->selectionManager()->selected().empty()) {
677  m_contextMenuHandler->showSelectedModelContext(iGlobalX, iGlobalY, iHandler);
678  }
679 }
680 
681 //
682 // const member functions
683 //
684 
686 
688 
698  const static char* kFileTypes[] = {"Fireworks Configuration files", "*.fwc", "All Files", "*", nullptr, nullptr};
699 
700  static TString dir(".");
701 
702  TGFileInfo fi;
703  fi.fFileTypes = kFileTypes;
704  fi.fIniDir = StrDup(dir);
705  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame, mode, &fi);
706  dir = fi.fIniDir;
707  if (fi.fFilename == nullptr) // to handle "cancel" button properly
708  return false;
709  std::string name = fi.fFilename;
710  // if the extension isn't already specified by hand, specify it now
711  std::string ext = kFileTypes[fi.fFileTypeIdx + 1] + 1;
712  if (!ext.empty() && name.find(ext) == name.npos)
713  name += ext;
714  result = name;
715  return true;
716 }
717 
723  if (!promptForConfigurationFile(name, kFDOpen))
724  return;
725 
727 }
728 
731  if (!promptForConfigurationFile(name, kFDOpen))
732  return;
733 
735  //
736 }
737 
743  if (!promptForConfigurationFile(name, kFDSave))
744  return;
745 
747 }
748 
751  if (!promptForConfigurationFile(name, kFDSave))
752  return;
753 
755 }
756 
758 
760  if (m_viewPrimPack->GetPack()->GetList()->GetSize() > 2) {
761  TGFrameElementPack* frameEL = (TGFrameElementPack*)m_viewPrimPack->GetPack()->GetList()->At(1);
762  TEveCompositeFrame* ef = dynamic_cast<TEveCompositeFrame*>(frameEL->fFrame);
763  m_viewMap[ef->GetEveWindow()]->promptForSaveImageTo(m_cmsShowMainFrame);
764  } else {
765  fwLog(fwlog::kError) << "Main view has been destroyed." << std::endl;
766  }
767 }
768 
770  try {
771  static TString dir(".");
772  const char* kImageExportTypes[] = {"PNG",
773  "*.png",
774  "GIF",
775  "*.gif",
776  "JPEG",
777  "*.jpg",
778  "PDF",
779  "*.pdf",
780  "Encapsulated PostScript",
781  "*.eps",
782  nullptr,
783  nullptr};
784 
785  TGFileInfo fi;
786  fi.fFileTypes = kImageExportTypes;
787  fi.fIniDir = StrDup(dir);
788  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame, kFDSave, &fi);
789  dir = fi.fIniDir;
790  if (fi.fFilename != nullptr) {
791  std::string name = fi.fFilename;
792  // fi.fFileTypeIdx points to the name of the file type
793  // selected in the drop-down menu, so fi.fFileTypeIdx gives us
794  // the extension
795  std::string ext = kImageExportTypes[fi.fFileTypeIdx + 1] + 1;
796  if (name.find(ext) == name.npos)
797  name += ext;
798  // now add format trailing before the extension
799  name.insert(name.rfind('.'), "-%u_%u_%u_%s");
800  exportAllViews(name, -1);
801  }
802  } catch (std::runtime_error& e) {
803  std::cout << e.what() << std::endl;
804  }
805 }
806 
808  // Save all GL views.
809  // Expects format to have "%u %u %llu %s" which are replaced with
810  // run-number, event number, lumi block and view-name.
811  // Blanks in view-name are removed.
812  // If several views shave the same name, they are post-fixed
813  // with "_%d". They are sorted by view diagonal.
814 
815  typedef std::list<FWTEveViewer*> viewer_list_t;
816  typedef viewer_list_t::iterator viewer_list_i;
817 
818  typedef std::map<TString, viewer_list_t> name_map_t;
819  typedef name_map_t::iterator name_map_i;
820 
821  name_map_t vls;
822 
823  for (ViewMap_i i = m_viewMap.begin(); i != m_viewMap.end(); ++i) {
824  FWTEveViewer* ev = dynamic_cast<FWTEveViewer*>(i->first);
825  if (ev) {
826  TString name(ev->GetElementName());
827  name.ReplaceAll(" ", "");
828  viewer_list_t& l = vls[name];
829  viewer_list_i li = l.begin();
830  while (li != l.end() && (*li)->GetGLViewer()->ViewportDiagonal() < ev->GetGLViewer()->ViewportDiagonal())
831  ++li;
832  l.insert(li, ev);
833  }
834  }
835 
836  std::vector<std::future<int>> futures;
837 
838  const edm::EventBase* event = getCurrentEvent();
839  for (name_map_i i = vls.begin(); i != vls.end(); ++i) {
840  bool multi_p = (i->second.size() > 1);
841  int view_count = 1;
842  for (viewer_list_i j = i->second.begin(); j != i->second.end(); ++j, ++view_count) {
843  TString view_name(i->first);
844  if (multi_p) {
845  view_name += "_";
846  view_name += view_count;
847  }
848  TString file;
849  file.Form(format.c_str(), event->id().run(), event->id().event(), event->luminosityBlock(), view_name.Data());
850 
851  if (GLEW_EXT_framebuffer_object) {
852  // Multi-threaded save
853  futures.push_back((*j)->CaptureAndSaveImage(file, height));
854  } else {
855  // Single-threaded save
856  if (height == -1)
857  (*j)->GetGLViewer()->SavePicture(file);
858  else
859  (*j)->GetGLViewer()->SavePictureHeight(file, height);
860  }
861  }
862  }
863 
864  for (auto& f : futures) {
865  f.get();
866  }
867 }
868 
869 static const std::string kMainWindow("main window");
870 static const std::string kViews("views");
871 static const std::string kViewArea("view area");
872 static const std::string kUndocked("undocked views");
873 static const std::string kControllers("controllers");
874 static const std::string kCollectionController("collection");
875 static const std::string kViewController("view");
876 static const std::string kObjectController("object");
877 static const std::string kCommonController("common");
878 
879 static void addWindowInfoTo(const TGFrame* iMain, FWConfiguration& oTo) {
880  Window_t wdummy;
881  Int_t ax, ay;
882  gVirtualX->TranslateCoordinates(iMain->GetId(),
883  gClient->GetDefaultRoot()->GetId(),
884  0,
885  0, //0,0 in local coordinates
886  ax,
887  ay, //coordinates of screen
888  wdummy);
889  {
890  std::stringstream s;
891  s << ax;
892  oTo.addKeyValue("x", FWConfiguration(s.str()));
893  }
894  {
895  std::stringstream s;
896  s << ay;
897  oTo.addKeyValue("y", FWConfiguration(s.str()));
898  }
899  {
900  std::stringstream s;
901  s << iMain->GetWidth();
902  oTo.addKeyValue("width", FWConfiguration(s.str()));
903  }
904  {
905  std::stringstream s;
906  s << iMain->GetHeight();
907  oTo.addKeyValue("height", FWConfiguration(s.str()));
908  }
909 }
910 
911 class areaInfo {
912  // helper class to save and restore view area
913 public:
914  areaInfo(TGFrameElementPack* frameElement) {
915  eveWindow = nullptr;
916  originalSlot = nullptr;
917  undockedMainFrame = nullptr;
918  weight = frameElement->fWeight;
919  undocked = !frameElement->fState;
920 
921  TEveCompositeFrame* eveFrame = dynamic_cast<TEveCompositeFrame*>(frameElement->fFrame);
922  assert(eveFrame);
923 
924  if (frameElement->fState)
925  eveWindow = eveFrame->GetEveWindow();
926  else
927  originalSlot = eveFrame->GetEveWindow();
928  }
929 
930  areaInfo() : weight(0), undocked(false) {}
931 
932  Float_t weight;
933  Bool_t undocked;
934  TEveWindow* eveWindow;
935  TGMainFrame* undockedMainFrame; // cached to help find original slot for undocked windows
936  TEveWindow* originalSlot;
937 };
938 
939 static void addAreaInfoTo(areaInfo& pInfo, FWConfiguration& oTo) {
940  {
941  std::stringstream s;
942  s << pInfo.weight;
943  oTo.addKeyValue("weight", FWConfiguration(s.str()));
944  }
945  {
946  std::stringstream s;
947  s << pInfo.undocked;
948  oTo.addKeyValue("undocked", FWConfiguration(s.str()));
949  }
950 
951  if (pInfo.undockedMainFrame) {
952  FWConfiguration temp(oTo);
953  addWindowInfoTo(pInfo.undockedMainFrame, temp);
954  oTo.addKeyValue("UndockedWindowPos", temp);
955  }
956 }
957 
958 //______________________________________________________________________________
960  Int_t cfgVersion = 3;
961 
962  FWConfiguration mainWindow(cfgVersion);
963  float leftWeight, rightWeight;
964  addWindowInfoTo(m_cmsShowMainFrame, mainWindow);
965  {
966  // write summary view weight
967  {
968  std::stringstream ss;
970  mainWindow.addKeyValue("summaryWeight", FWConfiguration(ss.str()));
971  }
972 
973  // write proportions of horizontal pack (can be standalone item outside main frame)
974  if (m_viewPrimPack->GetPack()->GetList()->GetSize() > 2) {
975  TGFrameElementPack* frameEL;
976  frameEL = (TGFrameElementPack*)m_viewPrimPack->GetPack()->GetList()->At(
977  1); // read every second element, first on is splitter
978  leftWeight = frameEL->fWeight;
979  frameEL = (TGFrameElementPack*)m_viewPrimPack->GetPack()->GetList()->At(3);
980  rightWeight = frameEL->fWeight;
981  } else {
982  leftWeight = 0;
983  rightWeight = 1;
984  }
985  std::stringstream sL;
986  sL << leftWeight;
987  mainWindow.addKeyValue("leftWeight", FWConfiguration(sL.str()));
988  std::stringstream sR;
989  sR << rightWeight;
990  mainWindow.addKeyValue("rightWeight", FWConfiguration(sR.str()));
991  }
992  oTo.addKeyValue(kMainWindow, mainWindow, true);
993 
994  //------------------------------------------------------------
995  // organize info about all docked frames includding hidden, which point to undocked
996  std::vector<areaInfo> wpacked;
997  if (leftWeight > 0) {
998  TGPack* pp = m_viewPrimPack->GetPack();
999  TGFrameElementPack* frameEL = (TGFrameElementPack*)pp->GetList()->At(1);
1000  if (frameEL->fWeight > 0)
1001  wpacked.push_back(areaInfo(frameEL));
1002  }
1003  TGPack* sp = m_viewSecPack->GetPack();
1004  TGFrameElementPack* seFE;
1005  TIter frame_iterator(sp->GetList());
1006  while ((seFE = (TGFrameElementPack*)frame_iterator())) {
1007  if (seFE->fWeight)
1008  wpacked.push_back(areaInfo(seFE));
1009  }
1010 
1011  // undocked info
1012 
1013  for (ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt) {
1014  TEveWindow* ew = wIt->first;
1015  TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
1016  if (mainFrame) {
1017  for (std::vector<areaInfo>::iterator pIt = wpacked.begin(); pIt != wpacked.end(); ++pIt) {
1018  if ((*pIt).originalSlot && mainFrame->GetOriginalSlot() == (*pIt).originalSlot) {
1019  (*pIt).eveWindow = wIt->first;
1020  (*pIt).undockedMainFrame = (TGMainFrame*)mainFrame;
1021  // printf("found original slot for docked view %s\n", pInfo->viewBase->typeName().c_str());
1022  break;
1023  } // found match
1024  }
1025  } // end main frames
1026  }
1027 
1028  //------------------------------------------------------------
1029  // add sorted list in view area and FW-views configuration
1030  FWConfiguration views(1);
1031  FWConfiguration viewArea(cfgVersion);
1032  for (std::vector<areaInfo>::iterator it = wpacked.begin(); it != wpacked.end(); ++it) {
1033  TEveWindow* ew = (*it).eveWindow;
1034  if (ew) {
1035  FWViewBase* wb = m_viewMap[ew];
1036  FWConfiguration tempWiew(wb->version());
1037  wb->addTo(tempWiew);
1038  views.addKeyValue(wb->typeName(), tempWiew, true);
1039  FWConfiguration tempArea(cfgVersion);
1040  addAreaInfoTo((*it), tempArea);
1041  viewArea.addKeyValue(wb->typeName(), tempArea, true);
1042  }
1043  }
1044  oTo.addKeyValue(kViews, views, true);
1045  oTo.addKeyValue(kViewArea, viewArea, true);
1046 
1047  //------------------------------------------------------------
1048  //Remember where controllers were placed if they are open
1049  FWConfiguration controllers(1);
1050  {
1051  if (nullptr != m_ediFrame && m_ediFrame->IsMapped()) {
1052  FWConfiguration temp(1);
1053  addWindowInfoTo(m_ediFrame, temp);
1054  controllers.addKeyValue(kCollectionController, temp, true);
1055  }
1056  if (nullptr != m_viewPopup && m_viewPopup->IsMapped()) {
1057  FWConfiguration temp(1);
1059  controllers.addKeyValue(kViewController, temp, true);
1060  }
1061  if (nullptr != m_modelPopup && m_modelPopup->IsMapped()) {
1062  FWConfiguration temp(1);
1064  controllers.addKeyValue(kObjectController, temp, true);
1065  }
1066  if (nullptr != m_commonPopup && m_commonPopup->IsMapped()) {
1067  FWConfiguration temp(1);
1069  controllers.addKeyValue(kCommonController, temp, true);
1070  }
1071  }
1072  oTo.addKeyValue(kControllers, controllers, true);
1073 }
1074 
1075 //----------------------------------------------------------------
1076 void FWGUIManager::setWindowInfoFrom(const FWConfiguration& iFrom, TGMainFrame* iFrame) {
1077  int x = atoi(iFrom.valueForKey("x")->value().c_str()) + m_WMOffsetX;
1078  int y = atoi(iFrom.valueForKey("y")->value().c_str()) + m_WMOffsetY;
1079  if (y < m_WMDecorH)
1080  y = m_WMDecorH;
1081  int width = atoi(iFrom.valueForKey("width")->value().c_str());
1082  int height = atoi(iFrom.valueForKey("height")->value().c_str());
1083  iFrame->MoveResize(x, y, width, height);
1084  iFrame->SetWMPosition(x, y);
1085 }
1086 
1088  gEve->DisableRedraw();
1089  // main window
1090  if (m_viewSecPack)
1092 
1093  const FWConfiguration* mw = iFrom.valueForKey(kMainWindow);
1094  assert(mw != nullptr);
1095  // Window needs to mapped before moving, otherwise move can lead
1096  // to wrong results on some window managers.
1097 
1098  // set from view reading area info nd view info
1099  float_t leftWeight = 1;
1100  float_t rightWeight = 1;
1101  if (mw->version() >= 2) {
1102  leftWeight = atof(mw->valueForKey("leftWeight")->value().c_str());
1103  rightWeight = atof(mw->valueForKey("rightWeight")->value().c_str());
1104  }
1105 
1106  if (mw->version() >= 3) {
1107  float summaryWeight = atof(mw->valueForKey("summaryWeight")->value().c_str());
1108  m_cmsShowMainFrame->setSummaryViewWeight(summaryWeight);
1109  }
1110 
1111  TEveWindowSlot* primSlot = (leftWeight > 0) ? m_viewPrimPack->NewSlotWithWeight(leftWeight) : nullptr;
1112  m_viewSecPack = m_viewPrimPack->NewSlotWithWeight(rightWeight)->MakePack();
1113  m_viewSecPack->SetVertical();
1114  m_viewSecPack->SetShowTitleBar(kFALSE);
1115 
1116  // views list
1117  const FWConfiguration* views = iFrom.valueForKey(kViews);
1118  assert(nullptr != views);
1119  const FWConfiguration::KeyValues* keyVals = views->keyValues();
1120  const FWConfiguration* viewArea = iFrom.valueForKey(kViewArea);
1121 
1122  // area list (ignored in older version)
1123  if (viewArea->version() > 1) {
1124  const FWConfiguration::KeyValues* akv = viewArea->keyValues();
1125  FWConfiguration::KeyValuesIt areaIt = akv->begin();
1126 
1127  for (FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it) {
1128  float weight = atof((areaIt->second).valueForKey("weight")->value().c_str());
1129  TEveWindowSlot* slot =
1130  (!m_viewMap.empty() || (primSlot == nullptr)) ? m_viewSecPack->NewSlotWithWeight(weight) : primSlot;
1131  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1132  ViewMap_i lastViewIt = createView(name, slot);
1133  lastViewIt->second->setFrom(it->second);
1134 
1135  bool undocked = atof((areaIt->second).valueForKey("undocked")->value().c_str());
1136  if (undocked) {
1137  TEveWindow* lastWindow = lastViewIt->first;
1138  lastWindow->UndockWindow();
1139  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(lastWindow->GetEveFrame());
1140  if (emf) {
1141  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
1142  if (mf) {
1144  TGMainFrame* mfp = (TGMainFrame*)mf; // have to cast in non-const
1145  const FWConfiguration* mwc = (areaIt->second).valueForKey("UndockedWindowPos");
1146  setWindowInfoFrom(*mwc, mfp);
1147  }
1148  }
1149  }
1150  areaIt++;
1151  }
1152  } else { // create views with same weight in old version
1153  for (FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it) {
1154  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1155  createView(name, !m_viewMap.empty() ? m_viewSecPack->NewSlot() : primSlot);
1156 
1157  ViewMap_i lastViewIt = m_viewMap.end();
1158  lastViewIt--;
1159  lastViewIt->second->setFrom(it->second);
1160  }
1161  // handle undocked windows in old version
1162  const FWConfiguration* undocked = iFrom.valueForKey(kUndocked);
1163  if (nullptr != undocked) {
1164  fwLog(fwlog::kWarning) << "Restrore of undocked windows with old window management not supported." << std::endl;
1165  }
1166  }
1167 
1168  //handle controllers
1169  const FWConfiguration* controllers = iFrom.valueForKey(kControllers);
1170  if (nullptr != controllers) {
1171  const FWConfiguration::KeyValues* keyVals = controllers->keyValues();
1172  if (nullptr != keyVals) {
1173  //we have open controllers
1174  for (FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it) {
1175  const std::string& controllerName = it->first;
1176  // std::cout <<"found controller "<<controllerName<<std::endl;
1177  if (controllerName == kCollectionController) {
1178  showEDIFrame();
1179  setWindowInfoFrom(it->second, m_ediFrame);
1180  } else if (controllerName == kViewController) {
1181  setViewPopup(nullptr);
1182  setWindowInfoFrom(it->second, m_viewPopup);
1183  } else if (controllerName == kObjectController) {
1184  showModelPopup();
1185  setWindowInfoFrom(it->second, m_modelPopup);
1186  } else if (controllerName == kCommonController) {
1187  showCommonPopup();
1188  setWindowInfoFrom(it->second, m_commonPopup);
1189  }
1190  }
1191  }
1192  }
1193 
1194  for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it) {
1195  if (it->second->typeId() >= FWViewType::kGeometryTable) {
1198  }
1199  }
1200 
1201  gEve->EnableRedraw();
1202  // disable first docked view
1203  checkSubviewAreaIconState(nullptr);
1204 
1205  m_cmsShowMainFrame->MapWindow();
1207  m_cmsShowMainFrame->MapSubwindows();
1208  m_cmsShowMainFrame->Layout();
1209  m_cmsShowMainFrame->MapRaised();
1210 }
1211 
1212 void FWGUIManager::openEveBrowserForDebugging() const { gEve->GetBrowser()->MapWindow(); }
1213 
1214 //
1215 // toolbar widgets callbacks
1216 //
1218  Float_t sec = val * 0.001;
1219  m_cmsShowMainFrame->setPlayDelayGUI(sec, kFALSE);
1220  changedDelayBetweenEvents_.emit(sec);
1221 }
1222 
1224 
1228  }
1229 
1230  m_cmsShowMainFrame->m_lumiEntry->SetText("", kFALSE);
1231  m_cmsShowMainFrame->m_lumiEntry->SetFocus();
1232 }
1233 
1237  }
1238 
1239  m_cmsShowMainFrame->m_eventEntry->SetText("", kFALSE);
1240  m_cmsShowMainFrame->m_eventEntry->SetFocus();
1241 }
1242 
1246  }
1247 
1251 }
1252 
1254  if (m_commonPopup)
1256  if (m_modelPopup)
1258  if (m_ediFrame)
1260 
1261  gEve->FullRedraw3D();
1262 }
1263 //______________________________________________________________________________
1264 
1266 
1268 
1270 
1272  int i = state * 3;
1276 }
1277 
1279  m_cmsShowMainFrame->m_filterEnableBtn->SetEnabled(btnEnabled);
1280 }
1281 
1283  const Int_t x = 100, y = 100;
1284 
1285  TGMainFrame* mf1 = new TGMainFrame(nullptr, 0, 0);
1286  mf1->MapWindow();
1287  mf1->Move(x, y);
1288 
1289  // This seems to be the only reliable way to make sure Move() has been processed.
1290  {
1291  TGMainFrame* mf2 = new TGMainFrame(nullptr, 0, 0);
1292  mf2->MapWindow();
1293  while (!mf2->IsMapped())
1294  gClient->HandleInput();
1295  delete mf2;
1296  }
1297  {
1298  Int_t xm, ym;
1299  Window_t childdum;
1300  WindowAttributes_t attr;
1301  gVirtualX->TranslateCoordinates(mf1->GetId(), gClient->GetDefaultRoot()->GetId(), 0, 0, xm, ym, childdum);
1302  gVirtualX->GetWindowAttributes(mf1->GetId(), attr);
1303  m_WMOffsetX = x - xm;
1304  m_WMOffsetY = y - ym;
1305  m_WMDecorH = attr.fY;
1306  fwLog(fwlog::kDebug) << Form(
1307  "FWGUIManager::measureWMOffsets: required (%d,%d), measured(%d, %d) => dx=%d, dy=%d; decor_h=%d.\n",
1308  x,
1309  y,
1310  xm,
1311  ym,
1312  m_WMOffsetX,
1313  m_WMOffsetY,
1314  m_WMDecorH);
1315  }
1316  delete mf1;
1317 }
1318 
1320 
1322  int x = 150 + m_WMOffsetX;
1323  int y = 50 + m_WMOffsetY;
1324  m_cmsShowMainFrame->Move(x, y);
1325  m_cmsShowMainFrame->SetWMPosition(x, y < m_WMDecorH ? m_WMDecorH : y);
1326 
1327  createView("Rho Phi");
1328  createView("Rho Z");
1329 
1330  m_cmsShowMainFrame->MapSubwindows();
1331  m_cmsShowMainFrame->Layout();
1332  m_cmsShowMainFrame->MapRaised();
1333 }
const std::string sKeyboardShort
Definition: ActionsList.cc:45
TGVerticalFrame * createList(TGCompositeFrame *p)
const std::set< FWModelId > & selected() const
const std::string sSavePartialConfig
Definition: ActionsList.cc:21
TEveWindow * getEveWindow()
TGMainFrame * undockedMainFrame
void promptForPartialSaveConfigurationFile()
type
Definition: HCALResponse.h:21
FWNumberEntryField * m_lumiEntry
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:210
TGCompositeFrame * widget() const
void popupViewClosed()
void setFrom(const FWConfiguration &) override
void addTo(FWConfiguration &) const override
void bindCSGActionKeys(const TGMainFrame *f) const
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:102
const std::string sShowCommonInsp
Definition: ActionsList.cc:29
string separator
Definition: mps_merge.py:79
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:202
ViewMap_t m_viewMap
Definition: FWGUIManager.h:271
void UnmapWindow() override
virtual ULong64_t GetULong64Number()
virtual void SetUIntNumber(UInt_t n)
void showModelPopup()
const std::string sHelp
Definition: ActionsList.cc:44
sigc::signal< void, FWGUISubviewArea * > unselected_
const KeyValues * keyValues() const
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:205
void colorSetChanged()
Definition: CmsShowEDI.cc:500
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:272
const std::string sSavePartialConfigAs
Definition: ActionsList.cc:22
void addTo(FWConfiguration &) const override
void loadEvent(const edm::EventBase &event)
const double w
Definition: UKUtility.cc:23
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:56
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:259
CSGContinuousAction * playEventsBackwardsAction() const
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:246
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
boost::spirit::classic::parser_error< reco::parser::SyntaxErrors > BaseException
Definition: Exception.h:33
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:207
void setFilterButtonIcon(int)
void open3DRegion()
sigc::signal< void > closed_
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:263
void setClip(float eta, float phi)
void setViewPopup(TEveWindow *)
RunNumber_t const invalidRunNumber
const std::string & name() const
Definition: FWEventItem.cc:435
TEveWindow * eveWindow
static void addAreaInfoTo(areaInfo &pInfo, FWConfiguration &oTo)
const std::string sBackgroundColor
Definition: ActionsList.cc:30
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
Definition: FWViewBase.h:57
static const std::string kViewController("view")
std::shared_ptr< ExpressionBase > ExpressionPtr
base
Main Program
Definition: newFWLiteAna.py:92
FWColorManager * colorManager() const
Definition: Context.h:58
sigc::signal< void > activated
Definition: CSGAction.h:100
#define nullptr
static void addWindowInfoTo(const TGFrame *iMain, FWConfiguration &oTo)
Geom::Theta< T > theta() const
const std::string & typeName() const
Definition: FWViewBase.cc:107
void newViewSlot(const std::string &iName)
Definition: weight.py:1
unsigned int version() const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:241
bool ev
FWCustomIconsButton * m_filterEnableBtn
CSGContinuousAction * loopAction() const
void enableNext(bool enable=true)
static const std::string kViews("views")
void delaySliderChanged(Int_t)
static const std::string kObjectController("object")
void updateStatus(const char *status)
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:249
FWIntValueListener * m_delaySliderListener
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:274
void showEDIFrame(int iInfoToShow=-1)
Allowed values are -1 or ones from FWDataCategories enum.
static const std::string kCommonController("common")
const std::string sSaveConfigAs
Definition: ActionsList.cc:18
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
void setInfoButton(bool downp)
void enableActions(bool enable=true)
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:275
void setWindowInfoFrom(const FWConfiguration &iFrom, TGMainFrame *iFrame)
ViewMap_i createView(const std::string &iName, TEveWindowSlot *slot=nullptr)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
void checkSubviewAreaIconState(TEveWindow *)
void connectSubviewAreaSignals(FWGUISubviewArea *)
void createShortcutPopup()
const std::string sSaveConfig
Definition: ActionsList.cc:17
~FWGUIManager() override
void setPlayMode(bool)
static const std::string kCollectionController("collection")
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:261
EventNumber_t const invalidEventNumber
const TGPicture * m_filterIcons[9]
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:214
TEveWindow * getSwapCandidate()
void resetWMOffsets()
static const std::string kMainWindow("main window")
virtual void SetULong64Number(ULong64_t n)
sigc::signal< void > colorsHaveChangedFinished_
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
TEveWindow * getEveWindow() const
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:252
static const std::string kUndocked("undocked views")
emf
the use of emf in the JEC is not yet implemented
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:203
void setDelayBetweenEvents(Float_t)
CSGAction * createNewViewerAction(const std::string &iActionName, bool seaprator)
void exportImagesOfAllViews()
TEveWindow * originalSlot
void subviewDestroy(FWGUISubviewArea *)
FWNumberEntryField * m_eventEntry
sigc::signal< void, FWGUISubviewArea * > goingToBeDestroyed_
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:253
sigc::signal< void, FWEventItem * > newItem_
static FWGUISubviewArea * getToolBarFromWindow(TEveWindow *)
void newItem(const FWEventItem *)
void updateStatusBar(const char *status)
void reset(FWViewBase *, TEveWindow *ew)
virtual UInt_t GetUIntNumber()
void filterButtonClicked()
sigc::signal< void, Int_t > valueChanged_
bool getHidePFBuilders() const
Definition: Context.h:80
const std::string sShowAddCollection
Definition: ActionsList.cc:41
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:256
void exportImageOfMainView()
double f[11][100]
unsigned int id() const
Definition: FWEventItem.cc:433
virtual FWViewContextMenuHandlerBase * contextMenuHandler() const
Definition: FWViewBase.cc:102
const std::string sExportImage
Definition: ActionsList.cc:24
FWSelectionManager * selectionManager() const
Definition: Context.h:54
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:260
static const std::string kViewArea("view area")
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:262
static const std::string & checkNameWithViewVersion(const std::string &name, unsigned int viewVersion)
Definition: FWViewType.cc:79
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:53
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:268
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:280
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
const std::string sShowMainViewCtl
Definition: ActionsList.cc:40
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
void eventChangedCallback()
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:97
void setIcons(const TGPicture *iUpIcon, const TGPicture *iDownIcon, const TGPicture *iDisabledIcon, const TGPicture *ibelowMouseIcon=nullptr)
FWNumberEntryField * m_runEntry
void savePartialToConfigurationFile()
const std::string & value(unsigned int iIndex=0) const
void clearStatus()
CSGAction * getAction(const std::string &name)
const edm::EventBase * getCurrentEvent() const
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:236
void showSelectedModelContext(Int_t iX, Int_t iY, FWViewContextMenuHandlerBase *) const
NOTE: iX and iY are in global coordinates.
void enableActions(bool enable=true) override
const std::string sShowObjInsp
Definition: ActionsList.cc:38
bool isSelected() const
def parse(path, config)
Definition: dumpparser.py:13
CSGAction * getAction(const std::string name)
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
#define fwLog(_level_)
Definition: fwLog.h:45
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:244
double sd
FWJobMetadataManager * metadataManager() const
Definition: Context.h:60
bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode)
CSGContinuousAction * playEventsBackwardsAction()
void finishUpColorChange()
void exportAllViews(const std::string &format, int height)
sigc::signal< void, FWGUISubviewArea * > swap_
void setFilterButtonText(const char *txt)
const std::string sShowInvMassDialog
Definition: ActionsList.cc:42
std::unique_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:279
CmsShowCommon * commonPrefs() const
Definition: Context.cc:160
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:204
KeyValues::const_iterator KeyValuesIt
void setSummaryViewWeight(float)
const std::string sShowEventDisplayInsp
Definition: ActionsList.cc:39
CSGContinuousAction * playEventsAction()
void enablePrevious(bool enable=true)
void subviewSwapped(FWGUISubviewArea *)
virtual const edm::EventBase * getCurrentEvent() const =0
float getSummaryViewWeight() const
boost::function0< void > TaskFunctor
double a
Definition: hdecay.h:119
FWGUIManager(fireworks::Context *ctx, const FWViewManagerManager *iVMMgr, FWNavigatorBase *navigator)
void showEventFilterGUI()
static const std::string & idToName(int)
Definition: FWViewType.cc:72
Bool_t undocked
void evePreTerminate()
void promptForPartialLoadConfigurationFile()
void subviewInfoUnselected(FWGUISubviewArea *)
void promptForSaveConfigurationFile()
const std::string sLoadConfig
Definition: ActionsList.cc:16
void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
void destroy()
Definition: FWViewBase.cc:57
const FWConfiguration * valueForKey(const std::string &iKey) const
void createEDIFrame()
const std::string sExportAllImages
Definition: ActionsList.cc:25
void setView(CmsShowCommonPopup *x)
Definition: CmsShowCommon.h:78
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:206
sigc::signal< void, FWGUISubviewArea * > selected_
TGTextButton * m_filterShowGUIBtn
Definition: memstream.h:15
areaInfo(TGFrameElementPack *frameElement)
Float_t weight
void titleChanged(const char *title)
const std::string sHelpGL
Definition: ActionsList.cc:46
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:251
void disableNext()
void setPlayDelayGUI(Float_t val, Bool_t sliderChanged)
const std::string sLoadPartialConfig
Definition: ActionsList.cc:20
CSGContinuousAction * playEventsAction() const
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:208
void measureWMOffsets()
void showCommonPopup()
static const std::string kControllers("controllers")
void runIdChanged()
void showViewPopup()
void show(FWDataCategories)
Definition: CmsShowEDI.cc:497
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:266
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:267