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