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