CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
12 
13 
14 
15 // system include files
16 #include <boost/bind.hpp>
17 #include <stdexcept>
18 #include <iostream>
19 #include <cstdio>
20 #include <sstream>
21 #include <thread>
22 #include <future>
23 
24 #include "TGButton.h"
25 #include "TGLabel.h"
26 #include "TSystem.h"
27 #include "TGLIncludes.h"
28 #include "TGLViewer.h"
29 #include "TEveBrowser.h"
30 #include "TEveManager.h"
31 #include "TGPack.h"
32 #include "TEveWindow.h"
33 #include "TEveViewer.h"
34 #include "TEveWindowManager.h"
35 #include "TEveSelection.h"
36 #include "TVirtualX.h"
37 #include "TFile.h"
38 
39 // user include files
44 
55 
57 
60 
63 
65 
67 
72 
74 
76 
80 
82 
85 
86 
87 
88 // constants, enums and typedefs
89 //
90 //
91 // static data member definitions
92 //
94 
95 //
96 // constructors and destructor
97 //
98 
99 
101  const FWViewManagerManager* iVMMgr,
103  m_context(ctx),
104  m_summaryManager(0),
105  m_detailViewManager(0),
106  m_viewManagerManager(iVMMgr),
107  m_contextMenuHandler(0),
108  m_navigator(navigator),
109  m_dataAdder(0),
110  m_ediFrame(0),
111  m_modelPopup(0),
112  m_viewPopup(0),
113  m_commonPopup(0),
114  m_invMassDialog(0),
115  m_helpPopup(0),
116  m_shortcutPopup(0),
117  m_helpGLPopup(0),
118  m_tasks(new CmsShowTaskExecutor),
119  m_WMOffsetX(0), m_WMOffsetY(0), m_WMDecorH(0)
120 {
121  m_guiManager = this;
122 
124 
126  im->newItem_.connect(boost::bind(&FWGUIManager::newItem, this, _1) );
127 
129 
130 
131  TEveCompositeFrame::IconBarCreator_foo foo = &FWGUIManager::makeGUIsubview;
132  TEveCompositeFrame::SetupFrameMarkup(foo, 20, 4, false);
133 
134  {
135  //NOTE: by making sure we defaultly open to a fraction of the full screen size we avoid
136  // causing the program to go into full screen mode under default SL4 window manager
137  UInt_t width = gClient->GetDisplayWidth();
138  UInt_t height = static_cast<UInt_t>(gClient->GetDisplayHeight()*.8);
139  //try to deal with multiple horizontally placed monitors. Since present monitors usually
140  // have less than 2000 pixels horizontally, when we see more it is a good indicator that
141  // we are dealing with more than one monitor.
142  while(width > 2000) {
143  width /= 2;
144  }
145  width = static_cast<UInt_t>(width*.8);
146  m_cmsShowMainFrame = new CmsShowMainFrame(gClient->GetRoot(),
147  width,
148  height,
149  this);
150  m_cmsShowMainFrame->SetCleanup(kDeepCleanup);
151 
152  /*
153  int mlist[FWViewType::kTypeSize] = {FWViewType::kRhoPhi, FWViewType::kRhoZ, FWViewType::k3D, FWViewType::kISpy, FWViewType::kLego, FWViewType::kLegoHF, FWViewType::kGlimpse,
154  FWViewType::kTable, FWViewType::kTableL1, FWViewType::kTableHLT,
155  FWViewType::kGeometryTable,
156  FWViewType::kRhoPhiPF, FWViewType::kLegoPFECAL}; */
157 
158  for (int i = 0 ; i < FWViewType::kTypeSize; ++i)
159  {
160  bool separator = (i == FWViewType::kGlimpse || i == FWViewType::kTableHLT || i == FWViewType::kLegoPFECAL);
162  action->activated.connect(boost::bind(&FWGUIManager::newViewSlot, this, FWViewType::idToName(i)));
163  }
164 
167 
168 
180 
183 
185 
192 
193  // toolbar special widget with non-void actions
195 
196  TQObject::Connect(m_cmsShowMainFrame->m_runEntry, "ReturnPressed()", "FWGUIManager", this, "runIdChanged()");
197  TQObject::Connect(m_cmsShowMainFrame->m_lumiEntry, "ReturnPressed()", "FWGUIManager", this, "lumiIdChanged()");
198  TQObject::Connect(m_cmsShowMainFrame->m_eventEntry, "ReturnPressed()", "FWGUIManager", this, "eventIdChanged()");
199 
200  TQObject::Connect(m_cmsShowMainFrame->m_filterShowGUIBtn, "Clicked()", "FWGUIManager", this, "showEventFilterGUI()");
201  TQObject::Connect(m_cmsShowMainFrame->m_filterEnableBtn, "Clicked()", "FWGUIManager", this, "filterButtonClicked()");
202 
203  TQObject::Connect(gEve->GetWindowManager(), "WindowSelected(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
204  TQObject::Connect(gEve->GetWindowManager(), "WindowDocked(TEveWindow*)" , "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
205  TQObject::Connect(gEve->GetWindowManager(), "WindowUndocked(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
206  }
207 }
208 
210 {
211  a->goingToBeDestroyed_.connect(boost::bind(&FWGUIManager::subviewIsBeingDestroyed, this, _1));
212  a->selected_.connect(boost::bind(&FWGUIManager::subviewInfoSelected, this, _1));
213  a->unselected_.connect(boost::bind(&FWGUIManager::subviewInfoUnselected, this, _1));
214  a->swap_.connect(boost::bind(&FWGUIManager::subviewSwapped, this, _1));
215 }
216 
217 //
218 // Destructor
219 //
221 {
222  delete m_invMassDialog;
223  delete m_summaryManager;
224  delete m_detailViewManager;
225  delete m_cmsShowMainFrame;
226  delete m_viewPopup;
227  delete m_ediFrame;
228  delete m_contextMenuHandler;
229 
230 }
231 
232 void
234 {
235  gEve->GetWindowManager()->Disconnect("WindowSelected(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
236  gEve->GetWindowManager()->Disconnect("WindowDocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
237  gEve->GetWindowManager()->Disconnect("WindowUndocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
238 
239  // avoid emit signals at end
240  gEve->GetSelection()->Disconnect();
241  gEve->GetHighlight()->Disconnect();
242  gEve->GetSelection()->RemoveElements();
243  gEve->GetHighlight()->RemoveElements();
244 
245  m_cmsShowMainFrame->UnmapWindow();
246  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
247  {
248  TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>((*wIt).first->GetEveFrame());
249  // main frames not to watch dying
250  if (mainFrame) mainFrame->UnmapWindow();
251  // destroy
252  (*wIt).second->destroy();
253  }
254 }
255 
256 //______________________________________________________________________________
257 // subviews construction
258 //
259 
260 TGFrame*
261 FWGUIManager::makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height)
262 {
263  TGFrame* frame = new FWGUISubviewArea(cp, parent, height);
264  return frame;
265 }
266 
267 void
269  ViewBuildFunctor& iBuilder)
270 {
271  m_nameToViewBuilder[iName]=iBuilder;
272 }
273 
274 
275 void
277 {
278  // this function have to exist, becuse CSGAction binds to void functions
279  createView(iName);
280 }
281 
283 FWGUIManager::createView(const std::string& iName, TEveWindowSlot* slot)
284 {
285  NameToViewBuilder::iterator itFind = m_nameToViewBuilder.find(iName);
286  assert (itFind != m_nameToViewBuilder.end());
287  if(itFind == m_nameToViewBuilder.end()) {
288  throw std::runtime_error(std::string("Unable to create view named ")+iName+" because it is unknown");
289  }
290 
291  if (!slot)
292  {
293  if (m_viewSecPack)
294  {
295  slot = m_viewSecPack->NewSlot();
296  }
297  else
298  {
299  slot = m_viewPrimPack->NewSlot();
300  m_viewSecPack = m_viewPrimPack->NewSlot()->MakePack();
301  m_viewSecPack->SetShowTitleBar(kFALSE);
302  }
303  }
304  TEveCompositeFrame *ef = slot->GetEveFrame();
305  FWViewBase* viewBase = itFind->second(slot, iName);
306  //in future, get context from 'view'
309 
310  TEveWindow *eveWindow = ef->GetEveWindow();
311  eveWindow->SetElementName(iName.c_str());
312 
313  std::pair<ViewMap_i,bool> insertPair = m_viewMap.insert(std::make_pair(eveWindow, viewBase));
314  return insertPair.first;
315 }
316 
317 
318 //
319 // actions
320 //
321 
322 void
324 {
326 }
327 
328 void
329 FWGUIManager::titleChanged(const char *subtitle)
330 {
331  char title[128];
332  snprintf(title,127,"cmsShow: %s", subtitle);
333  m_cmsShowMainFrame->SetWindowName(title);
334 }
335 
336 void
338  // To be replaced when we can get index from fwlite::Event
339 
340  TEveViewerList* viewers = gEve->GetViewers();
341  for (TEveElement::List_i i=viewers->BeginChildren(); i!= viewers->EndChildren(); ++i)
342  {
343  TEveViewer* ev = dynamic_cast<TEveViewer*>(*i);
344  if (ev)
345  ev->GetGLViewer()->DeleteOverlayAnnotations();
346  }
347 
350 }
351 
352 CSGAction*
354 {
355  return m_cmsShowMainFrame->getAction(name);
356 }
357 
360 {
362 }
363 
366 {
368 }
369 
372 {
373  return m_cmsShowMainFrame->loopAction();
374 }
375 
376 void
378 {
380 }
381 
382 void
384 {
386 }
387 
388 void
390 {
391  m_cmsShowMainFrame->m_runEntry->SetEnabled(!play);
392  m_cmsShowMainFrame->m_eventEntry->SetEnabled(!play);
393 }
394 
395 void
398 }
399 
400 void
402 {
404 }
405 
406 void
408 {
409 #if defined(THIS_WILL_NEVER_BE_DEFINED)
410  m_selectionItemsComboBox->AddEntry(iItem->name().c_str(),iItem->id());
411  if(iItem->id()==0) {
412  m_selectionItemsComboBox->Select(0);
413  }
414 #endif
415 }
416 
417 void
419 {
420  if (0==m_dataAdder) {
421  m_dataAdder = new FWGUIEventDataAdder(100,100,
425  }
426  m_dataAdder->show();
427 }
428 
429 
430 // subview actions
431 //
432 
433 TEveWindow*
435 {
436  TEveWindow* swapCandidate =0;
437 
438  if ( gEve->GetWindowManager()->GetCurrentWindow())
439  {
440  swapCandidate = gEve->GetWindowManager()->GetCurrentWindow();
441  }
442  else
443  {
444  // swap with first docked view
445  TEveCompositeFrame* pef;
446  TGFrameElementPack *pel;
447 
448  // check if there is view in prim pack
449  TGPack* pp = m_viewPrimPack->GetPack();
450  if ( pp->GetList()->GetSize() > 2)
451  {
452  pel = (TGFrameElementPack*) pp->GetList()->At(1);
453  if (pel->fState) // is first undocked
454  {
455  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
456  if ( pef && pef->GetEveWindow())
457  swapCandidate = pef->GetEveWindow();
458  }
459  }
460  if (swapCandidate == 0)
461  {
462  // no eve window found in primary, check secondary
463  TGPack* sp = m_viewSecPack->GetPack();
464  TIter frame_iterator(sp->GetList());
465  while ((pel = (TGFrameElementPack*)frame_iterator()))
466  {
467  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
468  if ( pef && pef->GetEveWindow() && pel->fState)
469  {
470  swapCandidate = pef->GetEveWindow() ;
471  break;
472  }
473  }
474  }
475  }
476  return swapCandidate;
477 }
478 
479 void
481 {
482  // First argumet is needed for signals/slot symetry
483 
484  // disable swap on the first left TEveCompositeFrame
485  // check info button
486  TEveWindow* current = getSwapCandidate();
487  bool checkInfoBtn = m_viewPopup ? m_viewPopup->mapped() : 0;
488  TEveWindow* selected = m_viewPopup ? m_viewPopup->getEveWindow() : 0;
489 
490  for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); it++)
491  {
493  ar->setSwapIcon(current != it->first);
494  if (checkInfoBtn && selected)
495  ar->setInfoButton(selected == it->first);
496  }
497 }
498 
499 void
501 {
502  if (sva->isSelected())
503  setViewPopup(0);
504 
506  f = boost::bind(&FWGUIManager::subviewDestroy, this, sva);
507  m_tasks->addTask(f);
508  m_tasks->startDoingTasks();
509 }
510 
511 void
513 {
514  TEveWindow* ew = sva->getEveWindow();
515  FWViewBase* viewBase = m_viewMap[ew];
516  m_viewMap.erase(ew);
517  viewBase->destroy();
518 }
519 
520 void
522 {
523  std::vector<FWGUISubviewArea*> sd;
524  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
525  {
527  sd.push_back(ar);
528  }
529 
530  for (std::vector<FWGUISubviewArea*>::iterator i= sd.begin(); i !=sd.end(); ++i)
531  {
532  if ((*i)->isSelected())
533  setViewPopup(0);
534  subviewDestroy(*i);
535  }
536 
537  gSystem->ProcessEvents();
538  gSystem->Sleep(200);
539 
540 
541 
542  while (m_viewPrimPack->HasChildren())
543  {
544  TEveWindow* w = dynamic_cast<TEveWindow*>(m_viewPrimPack->FirstChild());
545  if (w) w->DestroyWindowAndSlot();
546  }
547 
548  gSystem->Sleep(200);
549  m_viewSecPack = 0;
550  gSystem->ProcessEvents();
551 
552 }
553 
554 void
556 {
557  // release button on previously selected
558  TEveWindow* ew = sva->getEveWindow();
559  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
560  {
561  if (wIt->first != ew)
563  }
564  setViewPopup(sva->getEveWindow());
565 }
566 
567 void
569 {
571 }
572 
573 void
575 {
576  TEveWindow* curr = getSwapCandidate();
577  TEveWindow* swap = sva->getEveWindow();
578  if (curr) swap->SwapWindow(curr);
579 
581 }
582 
583 TGVerticalFrame*
584 FWGUIManager::createList(TGCompositeFrame *p)
585 {
586  TGVerticalFrame *listFrame = new TGVerticalFrame(p, p->GetWidth(), p->GetHeight());
587 
588  TGHorizontalFrame* addFrame = new TGHorizontalFrame(listFrame, p->GetWidth(), 10, kRaisedFrame);
589  TGLabel* addLabel = new TGLabel(addFrame,"Summary View");
590  addFrame->AddFrame(addLabel, new TGLayoutHints(kLHintsCenterX, 0,0,2,2));
591  listFrame->AddFrame(addFrame, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
592 
593  m_summaryManager = new FWSummaryManager(listFrame,
596  this,
599 
600  const unsigned int backgroundColor=0x2f2f2f;
601  TGTextButton* addDataButton = new TGTextButton(m_summaryManager->widget(), "Add Collection");
602  addDataButton->ChangeOptions(kRaisedFrame);
603  addDataButton->SetBackgroundColor(backgroundColor);
604  addDataButton->SetTextColor(0xFFFFFF);
605  addDataButton->SetToolTipText("Show additional collections");
606  addDataButton->Connect("Clicked()", "FWGUIManager", this, "addData()");
607  m_summaryManager->widget()->AddFrame(addDataButton, new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsTop));
608  listFrame->AddFrame(m_summaryManager->widget(), new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
609 
610  return listFrame;
611 }
612 
613 void
614 FWGUIManager::createViews(TEveWindowSlot *slot)
615 {
616  m_viewPrimPack = slot->MakePack();
617  m_viewPrimPack->SetHorizontal();
618  m_viewPrimPack->SetElementName("Views");
619  m_viewPrimPack->SetShowTitleBar(kFALSE);
620  m_viewSecPack = 0;
621 }
622 
623 void
625 {
626  if (m_ediFrame == 0)
627  {
629  m_ediFrame->CenterOnParent(kTRUE,TGTransientFrame::kTopRight);
631  }
632 }
633 
634 void
636 {
637  createEDIFrame();
638  if (-1 != iToShow)
639  {
640  m_ediFrame->show(static_cast<FWDataCategories>(iToShow));
641  }
642  m_ediFrame->MapRaised();
643 }
644 
645 void
647 {
648  if (! m_commonPopup)
649  {
652  }
653  m_commonPopup->MapRaised();
654 }
655 
656 void
658 {
660  m_modelPopup->CenterOnParent(kTRUE,TGTransientFrame::kRight);
662 }
663 
664 void
666 {
668  m_modelPopup->MapRaised();
669 }
670 
671 void
673 {
674  if (m_viewPopup->getEveWindow())
675  {
677  sa->setInfoButton(kFALSE);
678  }
679 }
680 
681 void
683 {
684  // CSG action.
685  setViewPopup(0);
686 }
687 
688 void
690 {
691  FWViewBase* vb = ew ? m_viewMap[ew] : 0;
692  if (m_viewPopup == 0)
693  {
694  m_viewPopup = new CmsShowViewPopup(0, 200, 200, m_context->colorManager(), vb, ew);
696  }
697  else
698  {
700  }
701  m_viewPopup->reset(vb, ew);
702  m_viewPopup->MapRaised();
703 }
704 
705 void
707 {
708  if (! m_invMassDialog)
709  {
712  }
713  m_invMassDialog->MapRaised();
714 }
715 
716 void
718 {
719  if (m_helpPopup == 0)
720  {
721  m_helpPopup = new CmsShowHelpPopup("help.html", "CmsShow Help",
723  800, 600);
724  m_helpPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
725  }
726  m_helpPopup->MapWindow();
727 }
728 
729 
730 void
732 {
733  if (m_shortcutPopup == 0)
734  {
735  m_shortcutPopup = new CmsShowHelpPopup("shortcuts.html",
736  getAction(cmsshow::sKeyboardShort)->getName().c_str(),
737  m_cmsShowMainFrame, 800, 600);
738 
739  m_shortcutPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
740  }
741  m_shortcutPopup->MapWindow();
742 }
743 
745 {
746  if (m_helpGLPopup == 0)
747  {
748  m_helpGLPopup = new CmsShowHelpPopup("helpGL.html",
749  getAction(cmsshow::sHelpGL)->getName().c_str(),
750  m_cmsShowMainFrame, 800, 600);
751 
752  m_helpGLPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
753  }
754  m_helpGLPopup->MapWindow();
755 }
756 
757 void
759 {
760  if (! m_context->selectionManager()->selected().empty())
761  {
762  m_contextMenuHandler->showSelectedModelContext(iGlobalX,iGlobalY, iHandler);
763  }
764 }
765 
766 //
767 // const member functions
768 //
769 
772 {
773  return m_guiManager;
774 }
775 
776 const edm::EventBase*
778 {
779  return m_navigator->getCurrentEvent();
780 }
781 
790 bool
792 {
793 
794  const static char* kFileTypes[] = {"Fireworks Configuration files","*.fwc",
795  "All Files","*",
796  0,0};
797 
798  static TString dir(".");
799 
800  TGFileInfo fi;
801  fi.fFileTypes = kFileTypes;
802  fi.fIniDir = StrDup(dir);
803  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame, mode, &fi);
804  dir = fi.fIniDir;
805  if (fi.fFilename == 0) // to handle "cancel" button properly
806  return false;
807  std::string name = fi.fFilename;
808  // if the extension isn't already specified by hand, specify it now
809  std::string ext = kFileTypes[fi.fFileTypeIdx + 1] + 1;
810  if (ext.size() != 0 && name.find(ext) == name.npos)
811  name += ext;
812  result = name;
813  return true;
814 }
815 
816 
820 void
822 {
824  if (!promptForConfigurationFile(name, kFDOpen))
825  return;
826 
827 
829 }
830 
831 
832 void
834 {
836  if (!promptForConfigurationFile(name, kFDOpen))
837  return;
838 
839 
841  //
842 }
843 
844 
848 void
850 {
852  if (!promptForConfigurationFile(name, kFDSave))
853  return;
854 
856 }
857 
858 void
860 {
862  if (!promptForConfigurationFile(name, kFDSave))
863  return;
864 
866 }
867 
868 void
870 {
872 }
873 
874 void
876 {
877  if (m_viewPrimPack->GetPack()->GetList()->GetSize() > 2)
878  {
879  TGFrameElementPack* frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1);
880  TEveCompositeFrame* ef = dynamic_cast<TEveCompositeFrame*>(frameEL->fFrame);
881  m_viewMap[ef->GetEveWindow()]->promptForSaveImageTo(m_cmsShowMainFrame);
882  }
883  else
884  {
885  fwLog(fwlog::kError) << "Main view has been destroyed." << std::endl;
886  }
887 }
888 
889 void
891 {
892  try {
893  static TString dir(".");
894  const char * kImageExportTypes[] = {"PNG", "*.png",
895  "GIF", "*.gif",
896  "JPEG", "*.jpg",
897  "PDF", "*.pdf",
898  "Encapsulated PostScript", "*.eps",
899  0, 0};
900 
901  TGFileInfo fi;
902  fi.fFileTypes = kImageExportTypes;
903  fi.fIniDir = StrDup(dir);
904  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame,
905  kFDSave,&fi);
906  dir = fi.fIniDir;
907  if (fi.fFilename != 0) {
908  std::string name = fi.fFilename;
909  // fi.fFileTypeIdx points to the name of the file type
910  // selected in the drop-down menu, so fi.fFileTypeIdx gives us
911  // the extension
912  std::string ext = kImageExportTypes[fi.fFileTypeIdx + 1] + 1;
913  if (name.find(ext) == name.npos)
914  name += ext;
915  // now add format trailing before the extension
916  name.insert(name.rfind('.'), "-%u_%u_%u_%s");
917  exportAllViews(name, -1);
918  }
919  }
920  catch (std::runtime_error &e) { std::cout << e.what() << std::endl; }
921 }
922 
923 void
925 {
926  // Save all GL views.
927  // Expects format to have "%u %u %llu %s" which are replaced with
928  // run-number, event number, lumi block and view-name.
929  // Blanks in view-name are removed.
930  // If several views shave the same name, they are post-fixed
931  // with "_%d". They are sorted by view diagonal.
932 
933  typedef std::list<FWTEveViewer*> viewer_list_t;
934  typedef viewer_list_t::iterator viewer_list_i;
935 
936  typedef std::map<TString, viewer_list_t> name_map_t;
937  typedef name_map_t::iterator name_map_i;
938 
939  name_map_t vls;
940 
941  for (ViewMap_i i = m_viewMap.begin(); i != m_viewMap.end(); ++i)
942  {
943  FWTEveViewer *ev = dynamic_cast<FWTEveViewer*>(i->first);
944  if (ev)
945  {
946  TString name(ev->GetElementName());
947  name.ReplaceAll(" ", "");
948  viewer_list_t &l = vls[name];
949  viewer_list_i li = l.begin();
950  while (li != l.end() && (*li)->GetGLViewer()->ViewportDiagonal() < ev->GetGLViewer()->ViewportDiagonal())
951  ++li;
952  l.insert(li, ev);
953  }
954  }
955 
956  std::vector<std::future<int>> futures;
957 
958  const edm::EventBase *event = getCurrentEvent();
959  for (name_map_i i = vls.begin(); i != vls.end(); ++i)
960  {
961  bool multi_p = (i->second.size() > 1);
962  int view_count = 1;
963  for (viewer_list_i j = i->second.begin(); j != i->second.end(); ++j, ++view_count)
964  {
965  TString view_name(i->first);
966  if (multi_p)
967  {
968  view_name += "_";
969  view_name += view_count;
970  }
971  TString file;
972  file.Form(format.c_str(), event->id().run(), event->id().event(),
973  event->luminosityBlock(), view_name.Data());
974 
975  if (GLEW_EXT_framebuffer_object)
976  {
977  // Multi-threaded save
978  futures.push_back((*j)->CaptureAndSaveImage(file, height));
979  }
980  else
981  {
982  // Single-threaded save
983  if (height == -1)
984  (*j)->GetGLViewer()->SavePicture(file);
985  else
986  (*j)->GetGLViewer()->SavePictureHeight(file, height);
987  }
988  }
989  }
990 
991  for (auto &f : futures)
992  {
993  f.get();
994  }
995 }
996 
997 static const std::string kMainWindow("main window");
998 static const std::string kViews("views");
999 static const std::string kViewArea("view area");
1000 static const std::string kUndocked("undocked views");
1001 static const std::string kControllers("controllers");
1002 static const std::string kCollectionController("collection");
1003 static const std::string kViewController("view");
1004 static const std::string kObjectController("object");
1005 static const std::string kCommonController("common");
1006 
1007 static
1008 void
1009 addWindowInfoTo(const TGFrame* iMain,
1010  FWConfiguration& oTo)
1011 {
1012  Window_t wdummy;
1013  Int_t ax,ay;
1014  gVirtualX->TranslateCoordinates(iMain->GetId(),
1015  gClient->GetDefaultRoot()->GetId(),
1016  0,0, //0,0 in local coordinates
1017  ax,ay, //coordinates of screen
1018  wdummy);
1019  {
1020  std::stringstream s;
1021  s<<ax;
1022  oTo.addKeyValue("x",FWConfiguration(s.str()));
1023  }
1024  {
1025  std::stringstream s;
1026  s<<ay;
1027  oTo.addKeyValue("y",FWConfiguration(s.str()));
1028  }
1029  {
1030  std::stringstream s;
1031  s<<iMain->GetWidth();
1032  oTo.addKeyValue("width",FWConfiguration(s.str()));
1033  }
1034  {
1035  std::stringstream s;
1036  s<<iMain->GetHeight();
1037  oTo.addKeyValue("height",FWConfiguration(s.str()));
1038  }
1039 }
1040 
1042 {
1043  // helper class to save and restore view area
1044 public:
1045  areaInfo (TGFrameElementPack* frameElement)
1046  {
1047  eveWindow = 0;
1048  originalSlot = 0;
1049  undockedMainFrame = 0;
1050  weight = frameElement->fWeight;
1051  undocked = !frameElement->fState;
1052 
1053  TEveCompositeFrame *eveFrame = dynamic_cast<TEveCompositeFrame*>(frameElement->fFrame);
1054  assert(eveFrame);
1055 
1056  if (frameElement->fState)
1057  eveWindow = eveFrame->GetEveWindow();
1058  else
1059  originalSlot = eveFrame->GetEveWindow();
1060  }
1061 
1063 
1064  Float_t weight;
1065  Bool_t undocked;
1066  TEveWindow *eveWindow;
1067  TGMainFrame *undockedMainFrame;// cached to help find original slot for undocked windows
1068  TEveWindow *originalSlot;
1069 };
1070 
1071 static
1072 void
1074  FWConfiguration& oTo)
1075 {
1076  {
1077  std::stringstream s;
1078  s << pInfo.weight;
1079  oTo.addKeyValue("weight", FWConfiguration(s.str()));
1080  }
1081  {
1082  std::stringstream s;
1083  s<< pInfo.undocked;
1084  oTo.addKeyValue("undocked", FWConfiguration(s.str()));
1085  }
1086 
1087  if (pInfo.undockedMainFrame)
1088  {
1089  FWConfiguration temp(oTo);
1090  addWindowInfoTo(pInfo.undockedMainFrame, temp);
1091  oTo.addKeyValue("UndockedWindowPos", temp);
1092  }
1093 }
1094 
1095 //______________________________________________________________________________
1096 void
1098 {
1099  Int_t cfgVersion=3;
1100 
1101  FWConfiguration mainWindow(cfgVersion);
1102  float leftWeight, rightWeight;
1103  addWindowInfoTo(m_cmsShowMainFrame, mainWindow);
1104  {
1105  // write summary view weight
1106  {
1107  std::stringstream ss;
1109  mainWindow.addKeyValue("summaryWeight",FWConfiguration(ss.str()));
1110  }
1111 
1112  // write proportions of horizontal pack (can be standalone item outside main frame)
1113  if ( m_viewPrimPack->GetPack()->GetList()->GetSize() > 2)
1114  {
1115  TGFrameElementPack *frameEL;
1116  frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1); // read every second element, first on is splitter
1117  leftWeight = frameEL->fWeight;
1118  frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(3);
1119  rightWeight = frameEL->fWeight;
1120  }
1121  else
1122  {
1123  leftWeight = 0;
1124  rightWeight = 1;
1125  }
1126  std::stringstream sL;
1127  sL<<leftWeight;
1128  mainWindow.addKeyValue("leftWeight",FWConfiguration(sL.str()));
1129  std::stringstream sR;
1130  sR<<rightWeight;
1131  mainWindow.addKeyValue("rightWeight",FWConfiguration(sR.str()));
1132  }
1133  oTo.addKeyValue(kMainWindow, mainWindow, true);
1134 
1135  //------------------------------------------------------------
1136  // organize info about all docked frames includding hidden, which point to undocked
1137  std::vector<areaInfo> wpacked;
1138  if (leftWeight > 0)
1139  {
1140  TGPack* pp = m_viewPrimPack->GetPack();
1141  TGFrameElementPack *frameEL = (TGFrameElementPack*) pp->GetList()->At(1);
1142  if (frameEL->fWeight > 0)
1143  wpacked.push_back(areaInfo(frameEL));
1144  }
1145  TGPack* sp = m_viewSecPack->GetPack();
1146  TGFrameElementPack *seFE;
1147  TIter frame_iterator(sp->GetList());
1148  while ((seFE = (TGFrameElementPack*)frame_iterator() ))
1149  {
1150  if (seFE->fWeight)
1151  wpacked.push_back(areaInfo(seFE));
1152  }
1153 
1154  // undocked info
1155 
1156  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
1157  {
1158  TEveWindow* ew = wIt->first;
1159  TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
1160  if (mainFrame)
1161  {
1162  for(std::vector<areaInfo>::iterator pIt = wpacked.begin(); pIt != wpacked.end(); ++pIt)
1163  {
1164  if ((*pIt).originalSlot && mainFrame->GetOriginalSlot() == (*pIt).originalSlot)
1165  {
1166  (*pIt).eveWindow = wIt->first;
1167  (*pIt).undockedMainFrame = (TGMainFrame*)mainFrame;
1168  // printf("found original slot for docked view %s\n", pInfo->viewBase->typeName().c_str());
1169  break;
1170  }// found match
1171  }
1172  }// end main frames
1173  }
1174 
1175  //------------------------------------------------------------
1176  // add sorted list in view area and FW-views configuration
1177  FWConfiguration views(1);
1178  FWConfiguration viewArea(cfgVersion);
1179  for(std::vector<areaInfo>::iterator it = wpacked.begin(); it != wpacked.end(); ++it)
1180  {
1181  TEveWindow* ew = (*it).eveWindow;
1182  if (ew) {
1183  FWViewBase* wb = m_viewMap[ew];
1184  FWConfiguration tempWiew(wb->version());
1185  wb->addTo(tempWiew);
1186  views.addKeyValue(wb->typeName(), tempWiew, true);
1187  FWConfiguration tempArea(cfgVersion);
1188  addAreaInfoTo((*it), tempArea);
1189  viewArea.addKeyValue(wb->typeName(), tempArea, true);
1190  }
1191  }
1192  oTo.addKeyValue(kViews, views, true);
1193  oTo.addKeyValue(kViewArea, viewArea, true);
1194 
1195  //------------------------------------------------------------
1196  //Remember where controllers were placed if they are open
1197  FWConfiguration controllers(1);
1198  {
1199  if(0!=m_ediFrame && m_ediFrame->IsMapped()) {
1200  FWConfiguration temp(1);
1201  addWindowInfoTo(m_ediFrame, temp);
1202  controllers.addKeyValue(kCollectionController,temp,true);
1203  }
1204  if(0!=m_viewPopup && m_viewPopup->IsMapped()) {
1205  FWConfiguration temp(1);
1207  controllers.addKeyValue(kViewController,temp,true);
1208  }
1209  if(0!=m_modelPopup && m_modelPopup->IsMapped()) {
1210  FWConfiguration temp(1);
1212  controllers.addKeyValue(kObjectController,temp,true);
1213  }
1214  if(0!=m_commonPopup && m_commonPopup->IsMapped()) {
1215  FWConfiguration temp(1);
1217  controllers.addKeyValue(kCommonController,temp,true);
1218  }
1219  }
1220  oTo.addKeyValue(kControllers,controllers,true);
1221 }
1222 
1223 //----------------------------------------------------------------
1224 void
1226  TGMainFrame* iFrame)
1227 {
1228  int x = atoi(iFrom.valueForKey("x")->value().c_str()) + m_WMOffsetX;
1229  int y = atoi(iFrom.valueForKey("y")->value().c_str()) + m_WMOffsetY;
1230  if (y < m_WMDecorH) y = m_WMDecorH;
1231  int width = atoi(iFrom.valueForKey("width")->value().c_str());
1232  int height = atoi(iFrom.valueForKey("height")->value().c_str());
1233  iFrame->MoveResize(x,y,width,height);
1234  iFrame->SetWMPosition(x, y);
1235 }
1236 
1237 void
1239  // main window
1241 
1242  const FWConfiguration* mw = iFrom.valueForKey(kMainWindow);
1243  assert(mw != 0);
1244  // Window needs to mapped before moving, otherwise move can lead
1245  // to wrong results on some window managers.
1246  m_cmsShowMainFrame->MapWindow();
1248  m_cmsShowMainFrame->MapSubwindows();
1249  m_cmsShowMainFrame->Layout();
1250  m_cmsShowMainFrame->MapRaised();
1251 
1252  // set from view reading area info nd view info
1253  float_t leftWeight =1;
1254  float_t rightWeight=1;
1255  if ( mw->version() >= 2 ) {
1256  leftWeight = atof(mw->valueForKey("leftWeight")->value().c_str());
1257  rightWeight = atof(mw->valueForKey("rightWeight")->value().c_str());
1258  }
1259 
1260  if ( mw->version() >= 3 ) {
1261  float summaryWeight = atof(mw->valueForKey("summaryWeight")->value().c_str());
1262  m_cmsShowMainFrame->setSummaryViewWeight(summaryWeight);
1263  }
1264 
1265  TEveWindowSlot* primSlot = (leftWeight > 0) ? m_viewPrimPack->NewSlotWithWeight(leftWeight) : 0;
1266  m_viewSecPack = m_viewPrimPack->NewSlotWithWeight(rightWeight)->MakePack();
1267  m_viewSecPack->SetVertical();
1268  m_viewSecPack->SetShowTitleBar(kFALSE);
1269 
1270  // views list
1271  const FWConfiguration* views = iFrom.valueForKey(kViews); assert(0!=views);
1272  const FWConfiguration::KeyValues* keyVals = views->keyValues();
1273  const FWConfiguration* viewArea = iFrom.valueForKey(kViewArea);
1274 
1275  // area list (ignored in older version)
1276  if ( viewArea->version() > 1)
1277  {
1278  const FWConfiguration::KeyValues* akv = viewArea->keyValues();
1279  FWConfiguration::KeyValuesIt areaIt = akv->begin();
1280 
1281  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
1282  {
1283  float weight = atof((areaIt->second).valueForKey("weight")->value().c_str());
1284  TEveWindowSlot* slot = ( m_viewMap.size() || (primSlot == 0) ) ? m_viewSecPack->NewSlotWithWeight(weight) : primSlot;
1285  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1286  ViewMap_i lastViewIt = createView(name, slot);
1287  lastViewIt->second->setFrom(it->second);
1288 
1289  bool undocked = atof((areaIt->second).valueForKey("undocked")->value().c_str());
1290  if (undocked)
1291  {
1292  TEveWindow* lastWindow = lastViewIt->first;
1293  lastWindow->UndockWindow();
1294  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(lastWindow->GetEveFrame());
1295  if (emf ) {
1296  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
1297  if (mf) {
1299  TGMainFrame* mfp = (TGMainFrame*)mf; // have to cast in non-const
1300  const FWConfiguration* mwc = (areaIt->second).valueForKey("UndockedWindowPos");
1301  setWindowInfoFrom(*mwc, mfp);
1302  }
1303  }
1304  }
1305  areaIt++;
1306  }
1307  }
1308  else
1309  { // create views with same weight in old version
1310  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it) {
1311  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1312  createView(name, m_viewMap.size() ? m_viewSecPack->NewSlot() : primSlot);
1313 
1314  ViewMap_i lastViewIt = m_viewMap.end(); lastViewIt--;
1315  lastViewIt->second->setFrom(it->second);
1316  }
1317  // handle undocked windows in old version
1318  const FWConfiguration* undocked = iFrom.valueForKey(kUndocked);
1319  if(0!=undocked) {
1320  fwLog(fwlog::kWarning) << "Restrore of undocked windows with old window management not supported." << std::endl;
1321  }
1322  }
1323 
1324  //handle controllers
1325  const FWConfiguration* controllers = iFrom.valueForKey(kControllers);
1326  if (0 != controllers)
1327  {
1328  const FWConfiguration::KeyValues* keyVals = controllers->keyValues();
1329  if (0 != keyVals)
1330  {
1331  //we have open controllers
1332  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it)
1333  {
1334  const std::string& controllerName = it->first;
1335  // std::cout <<"found controller "<<controllerName<<std::endl;
1336  if (controllerName == kCollectionController) {
1337  showEDIFrame();
1338  setWindowInfoFrom(it->second,m_ediFrame);
1339  } else if (controllerName == kViewController) {
1340  setViewPopup(0);
1341  setWindowInfoFrom(it->second, m_viewPopup);
1342  } else if (controllerName == kObjectController) {
1343  showModelPopup();
1344  setWindowInfoFrom(it->second, m_modelPopup);
1345  } else if (controllerName == kCommonController) {
1346  showCommonPopup();
1347  setWindowInfoFrom(it->second, m_commonPopup);
1348  }
1349  }
1350  }
1351  }
1352 
1353 
1354  for(ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it)
1355  {
1356  if (it->second->typeId() >= FWViewType::kGeometryTable)
1357  {
1360  }
1361  }
1362 
1363  // disable first docked view
1365 
1366 
1367 }
1368 
1369 void
1371 {
1372  gEve->GetBrowser()->MapWindow();
1373 }
1374 
1375 //
1376 // toolbar widgets callbacks
1377 //
1378 void
1380 {
1381  Float_t sec = val*0.001;
1382  m_cmsShowMainFrame->setPlayDelayGUI(sec, kFALSE);
1383  changedDelayBetweenEvents_.emit(sec);
1384 }
1385 
1386 void
1388 {
1389  m_cmsShowMainFrame->setPlayDelayGUI(val, kTRUE);
1390 }
1391 
1393 {
1395  {
1397  }
1398 
1399  m_cmsShowMainFrame->m_lumiEntry->SetText("", kFALSE);
1400  m_cmsShowMainFrame->m_lumiEntry->SetFocus();
1401 }
1402 
1404 {
1406  {
1408  }
1409 
1410  m_cmsShowMainFrame->m_eventEntry->SetText("", kFALSE);
1411  m_cmsShowMainFrame->m_eventEntry->SetFocus();
1412 }
1413 
1415 {
1417  {
1419  }
1420 
1424 }
1425 
1426 void
1428 {
1432 
1433  gEve->FullRedraw3D();
1434 }
1435 //______________________________________________________________________________
1436 
1437 void
1439 {
1441 }
1442 
1443 void
1445 {
1446  filterButtonClicked_.emit();
1447 }
1448 
1449 void
1451 {
1452  m_cmsShowMainFrame->m_filterShowGUIBtn->SetText(txt);
1453 }
1454 
1455 void
1457 {
1458  int i = state*3;
1462 }
1463 
1464 void
1466 {
1467  m_cmsShowMainFrame->m_filterEnableBtn->SetEnabled(btnEnabled);
1468 }
1469 
1470 void
1472 {
1473  const Int_t x = 100, y = 100;
1474 
1475  TGMainFrame *mf1 = new TGMainFrame(0, 0, 0);
1476  mf1->MapWindow();
1477  mf1->Move(x, y);
1478 
1479  // This seems to be the only reliable way to make sure Move() has been processed.
1480  {
1481  TGMainFrame *mf2 = new TGMainFrame(0, 0, 0);
1482  mf2->MapWindow();
1483  while (!mf2->IsMapped()) gClient->HandleInput();
1484  delete mf2;
1485  }
1486  {
1487  Int_t xm, ym;
1488  Window_t childdum;
1489  WindowAttributes_t attr;
1490  gVirtualX->TranslateCoordinates(mf1->GetId(), gClient->GetDefaultRoot()->GetId(),
1491  0, 0, xm, ym, childdum);
1492  gVirtualX->GetWindowAttributes(mf1->GetId(), attr);
1493  m_WMOffsetX = x - xm;
1494  m_WMOffsetY = y - ym;
1495  m_WMDecorH = attr.fY;
1496  fwLog(fwlog::kDebug) << Form("FWGUIManager::measureWMOffsets: required (%d,%d), measured(%d, %d) => dx=%d, dy=%d; decor_h=%d.\n",
1497  x, y, xm, ym, m_WMOffsetX, m_WMOffsetY, m_WMDecorH);
1498  }
1499  delete mf1;
1500 }
1501 
1502 void
1504 {
1506 }
const std::string sKeyboardShort
Definition: ActionsList.cc:46
TGVerticalFrame * createList(TGCompositeFrame *p)
const std::set< FWModelId > & selected() const
const std::string sSavePartialConfig
Definition: ActionsList.cc:21
TEveWindow * getEveWindow()
tuple base
Main Program
Definition: newFWLiteAna.py:92
TGMainFrame * undockedMainFrame
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
void promptForPartialSaveConfigurationFile()
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
FWNumberEntryField * m_lumiEntry
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:213
TGCompositeFrame * widget() const
void popupViewClosed()
int i
Definition: DBlmapReader.cc:9
void bindCSGActionKeys(const TGMainFrame *f) const
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:103
const std::string sShowCommonInsp
Definition: ActionsList.cc:30
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:205
ViewMap_t m_viewMap
Definition: FWGUIManager.h:274
virtual ULong64_t GetULong64Number()
virtual void SetUIntNumber(UInt_t n)
void showModelPopup()
const std::string sHelp
Definition: ActionsList.cc:45
sigc::signal< void, FWGUISubviewArea * > unselected_
const KeyValues * keyValues() const
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:208
void colorSetChanged()
Definition: CmsShowEDI.cc:530
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:275
list parent
Definition: dbtoconf.py:74
const std::string sSavePartialConfigAs
Definition: ActionsList.cc:22
void loadEvent(const edm::EventBase &event)
const double w
Definition: UKUtility.cc:23
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:61
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:262
CSGContinuousAction * playEventsBackwardsAction() const
tuple pp
Definition: createTree.py:15
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:249
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:210
void setFilterButtonIcon(int)
sigc::signal< void > closed_
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:266
void setViewPopup(TEveWindow *)
RunNumber_t const invalidRunNumber
const std::string & name() const
Definition: FWEventItem.cc:500
TEveWindow * eveWindow
static void addAreaInfoTo(areaInfo &pInfo, FWConfiguration &oTo)
const std::string sBackgroundColor
Definition: ActionsList.cc:31
static const std::string kViewController("view")
FWColorManager * colorManager() const
Definition: Context.h:65
assert(m_qm.get())
sigc::signal< void > activated
Definition: CSGAction.h:88
static void addWindowInfoTo(const TGFrame *iMain, FWConfiguration &oTo)
const std::string & typeName() const
Definition: FWViewBase.cc:120
void newViewSlot(const std::string &iName)
void addTo(FWConfiguration &) const
virtual void UnmapWindow()
unsigned int version() const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:244
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:252
FWIntValueListener * m_delaySliderListener
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:277
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
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:99
void setInfoButton(bool downp)
void enableActions(bool enable=true)
std::auto_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:282
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:278
void setWindowInfoFrom(const FWConfiguration &iFrom, TGMainFrame *iFrame)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
void checkSubviewAreaIconState(TEveWindow *)
void connectSubviewAreaSignals(FWGUISubviewArea *)
void createShortcutPopup()
const std::string sSaveConfig
Definition: ActionsList.cc:17
void setPlayMode(bool)
static const std::string kCollectionController("collection")
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:264
EventNumber_t const invalidEventNumber
const TGPicture * m_filterIcons[9]
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:217
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:255
static const std::string kUndocked("undocked views")
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:206
void setDelayBetweenEvents(Float_t)
CSGAction * createNewViewerAction(const std::string &iActionName, bool seaprator)
void exportImagesOfAllViews()
TEveWindow * originalSlot
void subviewDestroy(FWGUISubviewArea *)
FWNumberEntryField * m_eventEntry
tuple result
Definition: query.py:137
sigc::signal< void, FWGUISubviewArea * > goingToBeDestroyed_
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:256
sigc::signal< void, Int_t > valueChanged_
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()
int j
Definition: DBlmapReader.cc:9
const std::string sShowAddCollection
Definition: ActionsList.cc:42
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:259
void exportImageOfMainView()
double f[11][100]
unsigned int id() const
Definition: FWEventItem.cc:494
virtual FWViewContextMenuHandlerBase * contextMenuHandler() const
Definition: FWViewBase.cc:112
const std::string sExportImage
Definition: ActionsList.cc:25
FWSelectionManager * selectionManager() const
Definition: Context.h:57
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:263
static const std::string kViewArea("view area")
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:265
virtual const edm::EventBase * getCurrentEvent() const =0
static const std::string & checkNameWithViewVersion(const std::string &name, unsigned int viewVersion)
Definition: FWViewType.cc:102
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:54
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:271
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
const std::string sShowMainViewCtl
Definition: ActionsList.cc:41
void setFrom(const FWConfiguration &)
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
void eventChangedCallback()
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
virtual void enableActions(bool enable=true)
void setIcons(const TGPicture *iUpIcon, const TGPicture *iDownIcon, const TGPicture *iDisabledIcon, const TGPicture *ibelowMouseIcon=0)
ViewMap_i createView(const std::string &iName, TEveWindowSlot *slot=0)
void showSelectedModelContext(Int_t iX, Int_t iY, FWViewContextMenuHandlerBase *) const
NOTE: iX and iY are in global coordinates.
const std::string sShowObjInsp
Definition: ActionsList.cc:39
tuple attr
Definition: asciidump.py:432
bool isSelected() const
CSGAction * getAction(const std::string name)
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
#define fwLog(_level_)
Definition: fwLog.h:50
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:247
double sd
FWJobMetadataManager * metadataManager() const
Definition: Context.h:69
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:43
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:207
KeyValues::const_iterator KeyValuesIt
virtual ~FWGUIManager()
void setSummaryViewWeight(float)
const std::string sShowEventDisplayInsp
Definition: ActionsList.cc:40
CSGContinuousAction * playEventsAction()
void enablePrevious(bool enable=true)
void subviewSwapped(FWGUISubviewArea *)
float getSummaryViewWeight() const
boost::function0< void > TaskFunctor
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:89
Bool_t undocked
void evePreTerminate()
void promptForPartialLoadConfigurationFile()
void subviewInfoUnselected(FWGUISubviewArea *)
void promptForSaveConfigurationFile()
const std::string sLoadConfig
Definition: ActionsList.cc:16
tuple cout
Definition: gather_cfg.py:121
void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
void destroy()
Definition: FWViewBase.cc:64
const FWConfiguration * valueForKey(const std::string &iKey) const
void createEDIFrame()
dbl *** dir
Definition: mlp_gen.cc:35
const std::string sExportAllImages
Definition: ActionsList.cc:26
volatile std::atomic< bool > shutdown_flag false
Definition: DDAxes.h:10
int weight
Definition: histoStyle.py:50
tuple status
Definition: ntuplemaker.py:245
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:209
sigc::signal< void, FWGUISubviewArea * > selected_
TGTextButton * m_filterShowGUIBtn
areaInfo(TGFrameElementPack *frameElement)
Float_t weight
void titleChanged(const char *title)
const std::string sHelpGL
Definition: ActionsList.cc:47
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:254
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:211
void measureWMOffsets()
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
Definition: FWViewBase.h:56
void showCommonPopup()
static const std::string kControllers("controllers")
void runIdChanged()
void showViewPopup()
void show(FWDataCategories)
Definition: CmsShowEDI.cc:523
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:269
void openEveBrowserForDebugging() const
void lumiIdChanged()
virtual void addTo(FWConfiguration &) const
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:270