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