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  m_cmsShowMainFrame = new CmsShowMainFrame(gClient->GetRoot(),
139  950,
140  750,
141  this);
142 
143  m_cmsShowMainFrame->SetCleanup(kDeepCleanup);
144 
145  /*
146  int mlist[FWViewType::kTypeSize] = {FWViewType::kRhoPhi, FWViewType::kRhoZ, FWViewType::k3D, FWViewType::kISpy, FWViewType::kLego, FWViewType::kLegoHF, FWViewType::kGlimpse,
147  FWViewType::kTable, FWViewType::kTableL1, FWViewType::kTableHLT,
148  FWViewType::kGeometryTable,
149  FWViewType::kRhoPhiPF, FWViewType::kLegoPFECAL}; */
150 
151  for (int i = 0 ; i < FWViewType::kTypeSize; ++i)
152  {
154  continue;
155 
156  bool separator = (i == FWViewType::kGlimpse || i == FWViewType::kTableHLT || i == FWViewType::kLegoPFECAL);
158  action->activated.connect(boost::bind(&FWGUIManager::newViewSlot, this, FWViewType::idToName(i)));
159  }
160 
163 
164 
176 
179 
181 
188 
189  // toolbar special widget with non-void actions
191 
192  TQObject::Connect(m_cmsShowMainFrame->m_runEntry, "ReturnPressed()", "FWGUIManager", this, "runIdChanged()");
193  TQObject::Connect(m_cmsShowMainFrame->m_lumiEntry, "ReturnPressed()", "FWGUIManager", this, "lumiIdChanged()");
194  TQObject::Connect(m_cmsShowMainFrame->m_eventEntry, "ReturnPressed()", "FWGUIManager", this, "eventIdChanged()");
195 
196  TQObject::Connect(m_cmsShowMainFrame->m_filterShowGUIBtn, "Clicked()", "FWGUIManager", this, "showEventFilterGUI()");
197  TQObject::Connect(m_cmsShowMainFrame->m_filterEnableBtn, "Clicked()", "FWGUIManager", this, "filterButtonClicked()");
198 
199  TQObject::Connect(gEve->GetWindowManager(), "WindowSelected(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
200  TQObject::Connect(gEve->GetWindowManager(), "WindowDocked(TEveWindow*)" , "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
201  TQObject::Connect(gEve->GetWindowManager(), "WindowUndocked(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
202  }
203 }
204 
206 {
207  a->goingToBeDestroyed_.connect(boost::bind(&FWGUIManager::subviewIsBeingDestroyed, this, _1));
208  a->selected_.connect(boost::bind(&FWGUIManager::subviewInfoSelected, this, _1));
209  a->unselected_.connect(boost::bind(&FWGUIManager::subviewInfoUnselected, this, _1));
210  a->swap_.connect(boost::bind(&FWGUIManager::subviewSwapped, this, _1));
211 }
212 
213 //
214 // Destructor
215 //
217 {
218  delete m_invMassDialog;
219  delete m_summaryManager;
220  delete m_detailViewManager;
221  delete m_cmsShowMainFrame;
222  delete m_viewPopup;
223  delete m_ediFrame;
224  delete m_contextMenuHandler;
225 
226 }
227 
228 void
230 {
231  gEve->GetWindowManager()->Disconnect("WindowSelected(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
232  gEve->GetWindowManager()->Disconnect("WindowDocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
233  gEve->GetWindowManager()->Disconnect("WindowUndocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
234 
235  // avoid emit signals at end
236  gEve->GetSelection()->Disconnect();
237  gEve->GetHighlight()->Disconnect();
238  gEve->GetSelection()->RemoveElements();
239  gEve->GetHighlight()->RemoveElements();
240 
241  m_cmsShowMainFrame->UnmapWindow();
242  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
243  {
244  TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>((*wIt).first->GetEveFrame());
245  // main frames not to watch dying
246  if (mainFrame) mainFrame->UnmapWindow();
247  // destroy
248  (*wIt).second->destroy();
249  }
250 }
251 
252 //______________________________________________________________________________
253 // subviews construction
254 //
255 
256 TGFrame*
257 FWGUIManager::makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height)
258 {
259  TGFrame* frame = new FWGUISubviewArea(cp, parent, height);
260  return frame;
261 }
262 
263 void
265  ViewBuildFunctor& iBuilder)
266 {
267  m_nameToViewBuilder[iName]=iBuilder;
268 }
269 
270 
271 void
273 {
274  // this function have to exist, becuse CSGAction binds to void functions
275  createView(iName);
276 }
277 
279 FWGUIManager::createView(const std::string& iName, TEveWindowSlot* slot)
280 {
281  NameToViewBuilder::iterator itFind = m_nameToViewBuilder.find(iName);
282  assert (itFind != m_nameToViewBuilder.end());
283  if(itFind == m_nameToViewBuilder.end()) {
284  throw std::runtime_error(std::string("Unable to create view named ")+iName+" because it is unknown");
285  }
286 
287  if (!slot)
288  {
289  if (m_viewSecPack)
290  {
291  slot = m_viewSecPack->NewSlot();
292  }
293  else
294  {
295  slot = m_viewPrimPack->NewSlot();
296  m_viewSecPack = m_viewPrimPack->NewSlot()->MakePack();
297  m_viewSecPack->SetShowTitleBar(kFALSE);
298  }
299  }
300  TEveCompositeFrame *ef = slot->GetEveFrame();
301  FWViewBase* viewBase = itFind->second(slot, iName);
302  //in future, get context from 'view'
305 
306  TEveWindow *eveWindow = ef->GetEveWindow();
307  eveWindow->SetElementName(iName.c_str());
308 
309  std::pair<ViewMap_i,bool> insertPair = m_viewMap.insert(std::make_pair(eveWindow, viewBase));
310  return insertPair.first;
311 }
312 
313 
314 //
315 // actions
316 //
317 
318 void
320 {
322 }
323 
324 void
325 FWGUIManager::titleChanged(const char *subtitle)
326 {
327  char title[128];
328  snprintf(title,127,"cmsShow: %s", subtitle);
329  m_cmsShowMainFrame->SetWindowName(title);
330 }
331 
332 void
334  // To be replaced when we can get index from fwlite::Event
335 
336  TEveViewerList* viewers = gEve->GetViewers();
337  for (TEveElement::List_i i=viewers->BeginChildren(); i!= viewers->EndChildren(); ++i)
338  {
339  TEveViewer* ev = dynamic_cast<TEveViewer*>(*i);
340  if (ev)
341  ev->GetGLViewer()->DeleteOverlayAnnotations();
342  }
343 
344  for (auto reg : m_regionViews)
345  {
346  for(ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it)
347  {
348  if (it->second == reg) {
349  m_viewMap.erase(it);
350  reg->destroy();
351  break;
352  }
353  }
354  }
355 
358 }
359 
360 CSGAction*
362 {
363  return m_cmsShowMainFrame->getAction(name);
364 }
365 
368 {
370 }
371 
374 {
376 }
377 
380 {
381  return m_cmsShowMainFrame->loopAction();
382 }
383 
384 void
386 {
388 }
389 
390 void
392 {
394 }
395 
396 void
398 {
399  m_cmsShowMainFrame->m_runEntry->SetEnabled(!play);
400  m_cmsShowMainFrame->m_eventEntry->SetEnabled(!play);
401 }
402 
403 void
406 }
407 
408 void
410 {
412 }
413 
414 void
416 {
417 #if defined(THIS_WILL_NEVER_BE_DEFINED)
418  m_selectionItemsComboBox->AddEntry(iItem->name().c_str(),iItem->id());
419  if(iItem->id()==0) {
420  m_selectionItemsComboBox->Select(0);
421  }
422 #endif
423 }
424 
425 void
427 {
428  if (0==m_dataAdder) {
429  m_dataAdder = new FWGUIEventDataAdder(100,100,
433  }
434  m_dataAdder->show();
435 }
436 
437 
438 // subview actions
439 //
440 
441 TEveWindow*
443 {
444  TEveWindow* swapCandidate =0;
445 
446  if ( gEve->GetWindowManager()->GetCurrentWindow())
447  {
448  swapCandidate = gEve->GetWindowManager()->GetCurrentWindow();
449  }
450  else
451  {
452  // swap with first docked view
453  TEveCompositeFrame* pef;
454  TGFrameElementPack *pel;
455 
456  // check if there is view in prim pack
457  TGPack* pp = m_viewPrimPack->GetPack();
458  if ( pp->GetList()->GetSize() > 2)
459  {
460  pel = (TGFrameElementPack*) pp->GetList()->At(1);
461  if (pel->fState) // is first undocked
462  {
463  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
464  if ( pef && pef->GetEveWindow())
465  swapCandidate = pef->GetEveWindow();
466  }
467  }
468  if (swapCandidate == 0)
469  {
470  // no eve window found in primary, check secondary
471  TGPack* sp = m_viewSecPack->GetPack();
472  TIter frame_iterator(sp->GetList());
473  while ((pel = (TGFrameElementPack*)frame_iterator()))
474  {
475  pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
476  if ( pef && pef->GetEveWindow() && pel->fState)
477  {
478  swapCandidate = pef->GetEveWindow() ;
479  break;
480  }
481  }
482  }
483  }
484  return swapCandidate;
485 }
486 
487 void
489 {
490  // First argumet is needed for signals/slot symetry
491 
492  // disable swap on the first left TEveCompositeFrame
493  // check info button
494  TEveWindow* current = getSwapCandidate();
495  bool checkInfoBtn = m_viewPopup ? m_viewPopup->mapped() : 0;
496  TEveWindow* selected = m_viewPopup ? m_viewPopup->getEveWindow() : 0;
497 
498  for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); it++)
499  {
501  ar->setSwapIcon(current != it->first);
502  if (checkInfoBtn && selected)
503  ar->setInfoButton(selected == it->first);
504  }
505 }
506 
507 void
509 {
510  if (sva->isSelected())
511  setViewPopup(0);
512 
514  f = boost::bind(&FWGUIManager::subviewDestroy, this, sva);
515  m_tasks->addTask(f);
516  m_tasks->startDoingTasks();
517 }
518 
519 void
521 {
522  TEveWindow* ew = sva->getEveWindow();
523  FWViewBase* viewBase = m_viewMap[ew];
524  m_viewMap.erase(ew);
525  viewBase->destroy();
526 }
527 
528 void
530 {
531  std::vector<FWGUISubviewArea*> sd;
532  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
533  {
535  sd.push_back(ar);
536  }
537 
538  for (std::vector<FWGUISubviewArea*>::iterator i= sd.begin(); i !=sd.end(); ++i)
539  {
540  if ((*i)->isSelected())
541  setViewPopup(0);
542  subviewDestroy(*i);
543  }
544 
545  gSystem->ProcessEvents();
546  gSystem->Sleep(200);
547 
548 
549 
550  while (m_viewPrimPack->HasChildren())
551  {
552  TEveWindow* w = dynamic_cast<TEveWindow*>(m_viewPrimPack->FirstChild());
553  if (w) w->DestroyWindowAndSlot();
554  }
555 
556  gSystem->Sleep(200);
557  m_viewSecPack = 0;
558  gSystem->ProcessEvents();
559 
560 }
561 
562 void
564 {
565  // release button on previously selected
566  TEveWindow* ew = sva->getEveWindow();
567  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
568  {
569  if (wIt->first != ew)
571  }
572  setViewPopup(sva->getEveWindow());
573 }
574 
575 void
577 {
579 }
580 
581 void
583 {
584  TEveWindow* curr = getSwapCandidate();
585  TEveWindow* swap = sva->getEveWindow();
586  if (curr) swap->SwapWindow(curr);
587 
589 }
590 
591 TGVerticalFrame*
592 FWGUIManager::createList(TGCompositeFrame *p)
593 {
594  TGVerticalFrame *listFrame = new TGVerticalFrame(p, p->GetWidth(), p->GetHeight());
595 
596  TGHorizontalFrame* addFrame = new TGHorizontalFrame(listFrame, p->GetWidth(), 10, kRaisedFrame);
597  TGLabel* addLabel = new TGLabel(addFrame,"Summary View");
598  addFrame->AddFrame(addLabel, new TGLayoutHints(kLHintsCenterX, 0,0,2,2));
599  listFrame->AddFrame(addFrame, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
600 
601  m_summaryManager = new FWSummaryManager(listFrame,
604  this,
607 
608  const unsigned int backgroundColor=0x2f2f2f;
609  TGTextButton* addDataButton = new TGTextButton(m_summaryManager->widget(), "Add Collection");
610  addDataButton->ChangeOptions(kRaisedFrame);
611  addDataButton->SetBackgroundColor(backgroundColor);
612  addDataButton->SetTextColor(0xFFFFFF);
613  addDataButton->SetToolTipText("Show additional collections");
614  addDataButton->Connect("Clicked()", "FWGUIManager", this, "addData()");
615  m_summaryManager->widget()->AddFrame(addDataButton, new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsTop));
616  listFrame->AddFrame(m_summaryManager->widget(), new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
617 
618  return listFrame;
619 }
620 
621 void
622 FWGUIManager::createViews(TEveWindowSlot *slot)
623 {
624  m_viewPrimPack = slot->MakePack();
625  m_viewPrimPack->SetHorizontal();
626  m_viewPrimPack->SetElementName("Views");
627  m_viewPrimPack->SetShowTitleBar(kFALSE);
628  m_viewSecPack = 0;
629 }
630 
631 void
633 {
634  if (m_ediFrame == 0)
635  {
637  m_ediFrame->CenterOnParent(kTRUE,TGTransientFrame::kTopRight);
639  }
640 }
641 
642 void
644 {
645  createEDIFrame();
646  if (-1 != iToShow)
647  {
648  m_ediFrame->show(static_cast<FWDataCategories>(iToShow));
649  }
650  m_ediFrame->MapRaised();
651 }
652 
653 
654 void
656 {
657  FWModelId id = *(m_context->selectionManager()->selected().begin());
658  float theta =0, phi = 0;
659  {
660  edm::TypeWithDict type = edm::TypeWithDict((TClass*)id.item()->modelType());
661  using namespace boost::spirit::classic;
663  reco::parser::Grammar grammar(tmpPtr,type);
664  edm::ObjectWithDict o(type, (void*)id.item()->modelData(id.index()));
665  try {
666  parse("theta()", grammar.use_parser<1>() >> end_p, space_p).full;
667  theta = tmpPtr->value(o);
668  parse("phi()", grammar.use_parser<1>() >> end_p, space_p).full;
669  phi = tmpPtr->value(o);
670 
671  ViewMap_i it = createView( "3D Tower", m_viewSecPack->NewSlot());
672  FW3DViewBase* v = static_cast<FW3DViewBase*>(it->second);
673  v->setClip(theta, phi);
674  it->first->UndockWindow();
675  m_regionViews.push_back(v);
676  }
677  catch(const reco::parser::BaseException& e)
678  {
679  std::cout <<" FWModelFilter failed to base "<< e.what() << std::endl;
680  }
681  }
682 }
683 
684 void
686 {
687  if (! m_commonPopup)
688  {
691  }
692  m_commonPopup->MapRaised();
693 }
694 
695 void
697 {
699  m_modelPopup->CenterOnParent(kTRUE,TGTransientFrame::kRight);
701 }
702 
703 void
705 {
707  m_modelPopup->MapRaised();
708 }
709 
710 void
712 {
713  if (m_viewPopup->getEveWindow())
714  {
716  sa->setInfoButton(kFALSE);
717  }
718 }
719 
720 void
722 {
723  // CSG action.
724  setViewPopup(0);
725 }
726 
727 void
729 {
730  FWViewBase* vb = ew ? m_viewMap[ew] : 0;
731  if (m_viewPopup == 0)
732  {
733  m_viewPopup = new CmsShowViewPopup(0, 200, 200, m_context->colorManager(), vb, ew);
735  }
736  else
737  {
739  }
740  m_viewPopup->reset(vb, ew);
741  m_viewPopup->MapRaised();
742 }
743 
744 void
746 {
747  if (! m_invMassDialog)
748  {
751  }
752  m_invMassDialog->MapRaised();
753 }
754 
755 void
757 {
758  if (m_helpPopup == 0)
759  {
760  m_helpPopup = new CmsShowHelpPopup("help.html", "CmsShow Help",
762  800, 600);
763  m_helpPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
764  }
765  m_helpPopup->MapWindow();
766 }
767 
768 
769 void
771 {
772  if (m_shortcutPopup == 0)
773  {
774  m_shortcutPopup = new CmsShowHelpPopup("shortcuts.html",
775  getAction(cmsshow::sKeyboardShort)->getName().c_str(),
776  m_cmsShowMainFrame, 800, 600);
777 
778  m_shortcutPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
779  }
780  m_shortcutPopup->MapWindow();
781 }
782 
784 {
785  if (m_helpGLPopup == 0)
786  {
787  m_helpGLPopup = new CmsShowHelpPopup("helpGL.html",
788  getAction(cmsshow::sHelpGL)->getName().c_str(),
789  m_cmsShowMainFrame, 800, 600);
790 
791  m_helpGLPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
792  }
793  m_helpGLPopup->MapWindow();
794 }
795 
796 void
798 {
799  if (! m_context->selectionManager()->selected().empty())
800  {
801  m_contextMenuHandler->showSelectedModelContext(iGlobalX,iGlobalY, iHandler);
802  }
803 }
804 
805 //
806 // const member functions
807 //
808 
811 {
812  return m_guiManager;
813 }
814 
815 const edm::EventBase*
817 {
818  return m_navigator->getCurrentEvent();
819 }
820 
829 bool
831 {
832 
833  const static char* kFileTypes[] = {"Fireworks Configuration files","*.fwc",
834  "All Files","*",
835  0,0};
836 
837  static TString dir(".");
838 
839  TGFileInfo fi;
840  fi.fFileTypes = kFileTypes;
841  fi.fIniDir = StrDup(dir);
842  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame, mode, &fi);
843  dir = fi.fIniDir;
844  if (fi.fFilename == 0) // to handle "cancel" button properly
845  return false;
846  std::string name = fi.fFilename;
847  // if the extension isn't already specified by hand, specify it now
848  std::string ext = kFileTypes[fi.fFileTypeIdx + 1] + 1;
849  if (ext.size() != 0 && name.find(ext) == name.npos)
850  name += ext;
851  result = name;
852  return true;
853 }
854 
855 
859 void
861 {
863  if (!promptForConfigurationFile(name, kFDOpen))
864  return;
865 
866 
868 }
869 
870 
871 void
873 {
875  if (!promptForConfigurationFile(name, kFDOpen))
876  return;
877 
878 
880  //
881 }
882 
883 
887 void
889 {
891  if (!promptForConfigurationFile(name, kFDSave))
892  return;
893 
895 }
896 
897 void
899 {
901  if (!promptForConfigurationFile(name, kFDSave))
902  return;
903 
905 }
906 
907 void
909 {
911 }
912 
913 void
915 {
916  if (m_viewPrimPack->GetPack()->GetList()->GetSize() > 2)
917  {
918  TGFrameElementPack* frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1);
919  TEveCompositeFrame* ef = dynamic_cast<TEveCompositeFrame*>(frameEL->fFrame);
920  m_viewMap[ef->GetEveWindow()]->promptForSaveImageTo(m_cmsShowMainFrame);
921  }
922  else
923  {
924  fwLog(fwlog::kError) << "Main view has been destroyed." << std::endl;
925  }
926 }
927 
928 void
930 {
931  try {
932  static TString dir(".");
933  const char * kImageExportTypes[] = {"PNG", "*.png",
934  "GIF", "*.gif",
935  "JPEG", "*.jpg",
936  "PDF", "*.pdf",
937  "Encapsulated PostScript", "*.eps",
938  0, 0};
939 
940  TGFileInfo fi;
941  fi.fFileTypes = kImageExportTypes;
942  fi.fIniDir = StrDup(dir);
943  new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame,
944  kFDSave,&fi);
945  dir = fi.fIniDir;
946  if (fi.fFilename != 0) {
947  std::string name = fi.fFilename;
948  // fi.fFileTypeIdx points to the name of the file type
949  // selected in the drop-down menu, so fi.fFileTypeIdx gives us
950  // the extension
951  std::string ext = kImageExportTypes[fi.fFileTypeIdx + 1] + 1;
952  if (name.find(ext) == name.npos)
953  name += ext;
954  // now add format trailing before the extension
955  name.insert(name.rfind('.'), "-%u_%u_%u_%s");
956  exportAllViews(name, -1);
957  }
958  }
959  catch (std::runtime_error &e) { std::cout << e.what() << std::endl; }
960 }
961 
962 void
964 {
965  // Save all GL views.
966  // Expects format to have "%u %u %llu %s" which are replaced with
967  // run-number, event number, lumi block and view-name.
968  // Blanks in view-name are removed.
969  // If several views shave the same name, they are post-fixed
970  // with "_%d". They are sorted by view diagonal.
971 
972  typedef std::list<FWTEveViewer*> viewer_list_t;
973  typedef viewer_list_t::iterator viewer_list_i;
974 
975  typedef std::map<TString, viewer_list_t> name_map_t;
976  typedef name_map_t::iterator name_map_i;
977 
978  name_map_t vls;
979 
980  for (ViewMap_i i = m_viewMap.begin(); i != m_viewMap.end(); ++i)
981  {
982  FWTEveViewer *ev = dynamic_cast<FWTEveViewer*>(i->first);
983  if (ev)
984  {
985  TString name(ev->GetElementName());
986  name.ReplaceAll(" ", "");
987  viewer_list_t &l = vls[name];
988  viewer_list_i li = l.begin();
989  while (li != l.end() && (*li)->GetGLViewer()->ViewportDiagonal() < ev->GetGLViewer()->ViewportDiagonal())
990  ++li;
991  l.insert(li, ev);
992  }
993  }
994 
995  std::vector<std::future<int>> futures;
996 
997  const edm::EventBase *event = getCurrentEvent();
998  for (name_map_i i = vls.begin(); i != vls.end(); ++i)
999  {
1000  bool multi_p = (i->second.size() > 1);
1001  int view_count = 1;
1002  for (viewer_list_i j = i->second.begin(); j != i->second.end(); ++j, ++view_count)
1003  {
1004  TString view_name(i->first);
1005  if (multi_p)
1006  {
1007  view_name += "_";
1008  view_name += view_count;
1009  }
1010  TString file;
1011  file.Form(format.c_str(), event->id().run(), event->id().event(),
1012  event->luminosityBlock(), view_name.Data());
1013 
1014  if (GLEW_EXT_framebuffer_object)
1015  {
1016  // Multi-threaded save
1017  futures.push_back((*j)->CaptureAndSaveImage(file, height));
1018  }
1019  else
1020  {
1021  // Single-threaded save
1022  if (height == -1)
1023  (*j)->GetGLViewer()->SavePicture(file);
1024  else
1025  (*j)->GetGLViewer()->SavePictureHeight(file, height);
1026  }
1027  }
1028  }
1029 
1030  for (auto &f : futures)
1031  {
1032  f.get();
1033  }
1034 }
1035 
1036 static const std::string kMainWindow("main window");
1037 static const std::string kViews("views");
1038 static const std::string kViewArea("view area");
1039 static const std::string kUndocked("undocked views");
1040 static const std::string kControllers("controllers");
1041 static const std::string kCollectionController("collection");
1042 static const std::string kViewController("view");
1043 static const std::string kObjectController("object");
1044 static const std::string kCommonController("common");
1045 
1046 static
1047 void
1048 addWindowInfoTo(const TGFrame* iMain,
1049  FWConfiguration& oTo)
1050 {
1051  Window_t wdummy;
1052  Int_t ax,ay;
1053  gVirtualX->TranslateCoordinates(iMain->GetId(),
1054  gClient->GetDefaultRoot()->GetId(),
1055  0,0, //0,0 in local coordinates
1056  ax,ay, //coordinates of screen
1057  wdummy);
1058  {
1059  std::stringstream s;
1060  s<<ax;
1061  oTo.addKeyValue("x",FWConfiguration(s.str()));
1062  }
1063  {
1064  std::stringstream s;
1065  s<<ay;
1066  oTo.addKeyValue("y",FWConfiguration(s.str()));
1067  }
1068  {
1069  std::stringstream s;
1070  s<<iMain->GetWidth();
1071  oTo.addKeyValue("width",FWConfiguration(s.str()));
1072  }
1073  {
1074  std::stringstream s;
1075  s<<iMain->GetHeight();
1076  oTo.addKeyValue("height",FWConfiguration(s.str()));
1077  }
1078 }
1079 
1081 {
1082  // helper class to save and restore view area
1083 public:
1084  areaInfo (TGFrameElementPack* frameElement)
1085  {
1086  eveWindow = 0;
1087  originalSlot = 0;
1088  undockedMainFrame = 0;
1089  weight = frameElement->fWeight;
1090  undocked = !frameElement->fState;
1091 
1092  TEveCompositeFrame *eveFrame = dynamic_cast<TEveCompositeFrame*>(frameElement->fFrame);
1093  assert(eveFrame);
1094 
1095  if (frameElement->fState)
1096  eveWindow = eveFrame->GetEveWindow();
1097  else
1098  originalSlot = eveFrame->GetEveWindow();
1099  }
1100 
1101  areaInfo () : weight(0), undocked(false) {}
1102 
1103  Float_t weight;
1104  Bool_t undocked;
1105  TEveWindow *eveWindow;
1106  TGMainFrame *undockedMainFrame;// cached to help find original slot for undocked windows
1107  TEveWindow *originalSlot;
1108 };
1109 
1110 static
1111 void
1113  FWConfiguration& oTo)
1114 {
1115  {
1116  std::stringstream s;
1117  s << pInfo.weight;
1118  oTo.addKeyValue("weight", FWConfiguration(s.str()));
1119  }
1120  {
1121  std::stringstream s;
1122  s<< pInfo.undocked;
1123  oTo.addKeyValue("undocked", FWConfiguration(s.str()));
1124  }
1125 
1126  if (pInfo.undockedMainFrame)
1127  {
1128  FWConfiguration temp(oTo);
1129  addWindowInfoTo(pInfo.undockedMainFrame, temp);
1130  oTo.addKeyValue("UndockedWindowPos", temp);
1131  }
1132 }
1133 
1134 //______________________________________________________________________________
1135 void
1137 {
1138  Int_t cfgVersion=3;
1139 
1140  FWConfiguration mainWindow(cfgVersion);
1141  float leftWeight, rightWeight;
1142  addWindowInfoTo(m_cmsShowMainFrame, mainWindow);
1143  {
1144  // write summary view weight
1145  {
1146  std::stringstream ss;
1148  mainWindow.addKeyValue("summaryWeight",FWConfiguration(ss.str()));
1149  }
1150 
1151  // write proportions of horizontal pack (can be standalone item outside main frame)
1152  if ( m_viewPrimPack->GetPack()->GetList()->GetSize() > 2)
1153  {
1154  TGFrameElementPack *frameEL;
1155  frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1); // read every second element, first on is splitter
1156  leftWeight = frameEL->fWeight;
1157  frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(3);
1158  rightWeight = frameEL->fWeight;
1159  }
1160  else
1161  {
1162  leftWeight = 0;
1163  rightWeight = 1;
1164  }
1165  std::stringstream sL;
1166  sL<<leftWeight;
1167  mainWindow.addKeyValue("leftWeight",FWConfiguration(sL.str()));
1168  std::stringstream sR;
1169  sR<<rightWeight;
1170  mainWindow.addKeyValue("rightWeight",FWConfiguration(sR.str()));
1171  }
1172  oTo.addKeyValue(kMainWindow, mainWindow, true);
1173 
1174  //------------------------------------------------------------
1175  // organize info about all docked frames includding hidden, which point to undocked
1176  std::vector<areaInfo> wpacked;
1177  if (leftWeight > 0)
1178  {
1179  TGPack* pp = m_viewPrimPack->GetPack();
1180  TGFrameElementPack *frameEL = (TGFrameElementPack*) pp->GetList()->At(1);
1181  if (frameEL->fWeight > 0)
1182  wpacked.push_back(areaInfo(frameEL));
1183  }
1184  TGPack* sp = m_viewSecPack->GetPack();
1185  TGFrameElementPack *seFE;
1186  TIter frame_iterator(sp->GetList());
1187  while ((seFE = (TGFrameElementPack*)frame_iterator() ))
1188  {
1189  if (seFE->fWeight)
1190  wpacked.push_back(areaInfo(seFE));
1191  }
1192 
1193  // undocked info
1194 
1195  for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
1196  {
1197  TEveWindow* ew = wIt->first;
1198  TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
1199  if (mainFrame)
1200  {
1201  for(std::vector<areaInfo>::iterator pIt = wpacked.begin(); pIt != wpacked.end(); ++pIt)
1202  {
1203  if ((*pIt).originalSlot && mainFrame->GetOriginalSlot() == (*pIt).originalSlot)
1204  {
1205  (*pIt).eveWindow = wIt->first;
1206  (*pIt).undockedMainFrame = (TGMainFrame*)mainFrame;
1207  // printf("found original slot for docked view %s\n", pInfo->viewBase->typeName().c_str());
1208  break;
1209  }// found match
1210  }
1211  }// end main frames
1212  }
1213 
1214  //------------------------------------------------------------
1215  // add sorted list in view area and FW-views configuration
1216  FWConfiguration views(1);
1217  FWConfiguration viewArea(cfgVersion);
1218  for(std::vector<areaInfo>::iterator it = wpacked.begin(); it != wpacked.end(); ++it)
1219  {
1220  TEveWindow* ew = (*it).eveWindow;
1221  if (ew) {
1222  FWViewBase* wb = m_viewMap[ew];
1223  FWConfiguration tempWiew(wb->version());
1224  wb->addTo(tempWiew);
1225  views.addKeyValue(wb->typeName(), tempWiew, true);
1226  FWConfiguration tempArea(cfgVersion);
1227  addAreaInfoTo((*it), tempArea);
1228  viewArea.addKeyValue(wb->typeName(), tempArea, true);
1229  }
1230  }
1231  oTo.addKeyValue(kViews, views, true);
1232  oTo.addKeyValue(kViewArea, viewArea, true);
1233 
1234  //------------------------------------------------------------
1235  //Remember where controllers were placed if they are open
1236  FWConfiguration controllers(1);
1237  {
1238  if(0!=m_ediFrame && m_ediFrame->IsMapped()) {
1239  FWConfiguration temp(1);
1240  addWindowInfoTo(m_ediFrame, temp);
1241  controllers.addKeyValue(kCollectionController,temp,true);
1242  }
1243  if(0!=m_viewPopup && m_viewPopup->IsMapped()) {
1244  FWConfiguration temp(1);
1246  controllers.addKeyValue(kViewController,temp,true);
1247  }
1248  if(0!=m_modelPopup && m_modelPopup->IsMapped()) {
1249  FWConfiguration temp(1);
1251  controllers.addKeyValue(kObjectController,temp,true);
1252  }
1253  if(0!=m_commonPopup && m_commonPopup->IsMapped()) {
1254  FWConfiguration temp(1);
1256  controllers.addKeyValue(kCommonController,temp,true);
1257  }
1258  }
1259  oTo.addKeyValue(kControllers,controllers,true);
1260 }
1261 
1262 //----------------------------------------------------------------
1263 void
1265  TGMainFrame* iFrame)
1266 {
1267  int x = atoi(iFrom.valueForKey("x")->value().c_str()) + m_WMOffsetX;
1268  int y = atoi(iFrom.valueForKey("y")->value().c_str()) + m_WMOffsetY;
1269  if (y < m_WMDecorH) y = m_WMDecorH;
1270  int width = atoi(iFrom.valueForKey("width")->value().c_str());
1271  int height = atoi(iFrom.valueForKey("height")->value().c_str());
1272  iFrame->MoveResize(x,y,width,height);
1273  iFrame->SetWMPosition(x, y);
1274 }
1275 
1276 void
1278  // main window
1280 
1281  const FWConfiguration* mw = iFrom.valueForKey(kMainWindow);
1282  assert(mw != 0);
1283  // Window needs to mapped before moving, otherwise move can lead
1284  // to wrong results on some window managers.
1285  m_cmsShowMainFrame->MapWindow();
1287  m_cmsShowMainFrame->MapSubwindows();
1288  m_cmsShowMainFrame->Layout();
1289  m_cmsShowMainFrame->MapRaised();
1290 
1291  // set from view reading area info nd view info
1292  float_t leftWeight =1;
1293  float_t rightWeight=1;
1294  if ( mw->version() >= 2 ) {
1295  leftWeight = atof(mw->valueForKey("leftWeight")->value().c_str());
1296  rightWeight = atof(mw->valueForKey("rightWeight")->value().c_str());
1297  }
1298 
1299  if ( mw->version() >= 3 ) {
1300  float summaryWeight = atof(mw->valueForKey("summaryWeight")->value().c_str());
1301  m_cmsShowMainFrame->setSummaryViewWeight(summaryWeight);
1302  }
1303 
1304  TEveWindowSlot* primSlot = (leftWeight > 0) ? m_viewPrimPack->NewSlotWithWeight(leftWeight) : 0;
1305  m_viewSecPack = m_viewPrimPack->NewSlotWithWeight(rightWeight)->MakePack();
1306  m_viewSecPack->SetVertical();
1307  m_viewSecPack->SetShowTitleBar(kFALSE);
1308 
1309  // views list
1310  const FWConfiguration* views = iFrom.valueForKey(kViews); assert(0!=views);
1311  const FWConfiguration::KeyValues* keyVals = views->keyValues();
1312  const FWConfiguration* viewArea = iFrom.valueForKey(kViewArea);
1313 
1314  // area list (ignored in older version)
1315  if ( viewArea->version() > 1)
1316  {
1317  const FWConfiguration::KeyValues* akv = viewArea->keyValues();
1318  FWConfiguration::KeyValuesIt areaIt = akv->begin();
1319 
1320  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
1321  {
1322  float weight = atof((areaIt->second).valueForKey("weight")->value().c_str());
1323  TEveWindowSlot* slot = ( m_viewMap.size() || (primSlot == 0) ) ? m_viewSecPack->NewSlotWithWeight(weight) : primSlot;
1324  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1325  ViewMap_i lastViewIt = createView(name, slot);
1326  lastViewIt->second->setFrom(it->second);
1327 
1328  bool undocked = atof((areaIt->second).valueForKey("undocked")->value().c_str());
1329  if (undocked)
1330  {
1331  TEveWindow* lastWindow = lastViewIt->first;
1332  lastWindow->UndockWindow();
1333  TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(lastWindow->GetEveFrame());
1334  if (emf ) {
1335  const TGMainFrame* mf = dynamic_cast<const TGMainFrame*>(emf->GetParent());
1336  if (mf) {
1338  TGMainFrame* mfp = (TGMainFrame*)mf; // have to cast in non-const
1339  const FWConfiguration* mwc = (areaIt->second).valueForKey("UndockedWindowPos");
1340  setWindowInfoFrom(*mwc, mfp);
1341  }
1342  }
1343  }
1344  areaIt++;
1345  }
1346  }
1347  else
1348  { // create views with same weight in old version
1349  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it) {
1350  std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
1351  createView(name, m_viewMap.size() ? m_viewSecPack->NewSlot() : primSlot);
1352 
1353  ViewMap_i lastViewIt = m_viewMap.end(); lastViewIt--;
1354  lastViewIt->second->setFrom(it->second);
1355  }
1356  // handle undocked windows in old version
1357  const FWConfiguration* undocked = iFrom.valueForKey(kUndocked);
1358  if(0!=undocked) {
1359  fwLog(fwlog::kWarning) << "Restrore of undocked windows with old window management not supported." << std::endl;
1360  }
1361  }
1362 
1363  //handle controllers
1364  const FWConfiguration* controllers = iFrom.valueForKey(kControllers);
1365  if (0 != controllers)
1366  {
1367  const FWConfiguration::KeyValues* keyVals = controllers->keyValues();
1368  if (0 != keyVals)
1369  {
1370  //we have open controllers
1371  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it)
1372  {
1373  const std::string& controllerName = it->first;
1374  // std::cout <<"found controller "<<controllerName<<std::endl;
1375  if (controllerName == kCollectionController) {
1376  showEDIFrame();
1377  setWindowInfoFrom(it->second,m_ediFrame);
1378  } else if (controllerName == kViewController) {
1379  setViewPopup(0);
1380  setWindowInfoFrom(it->second, m_viewPopup);
1381  } else if (controllerName == kObjectController) {
1382  showModelPopup();
1383  setWindowInfoFrom(it->second, m_modelPopup);
1384  } else if (controllerName == kCommonController) {
1385  showCommonPopup();
1386  setWindowInfoFrom(it->second, m_commonPopup);
1387  }
1388  }
1389  }
1390  }
1391 
1392 
1393  for(ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it)
1394  {
1395  if (it->second->typeId() >= FWViewType::kGeometryTable)
1396  {
1399  }
1400  }
1401 
1402  // disable first docked view
1404 }
1405 
1406 void
1408 {
1409  gEve->GetBrowser()->MapWindow();
1410 }
1411 
1412 //
1413 // toolbar widgets callbacks
1414 //
1415 void
1417 {
1418  Float_t sec = val*0.001;
1419  m_cmsShowMainFrame->setPlayDelayGUI(sec, kFALSE);
1420  changedDelayBetweenEvents_.emit(sec);
1421 }
1422 
1423 void
1425 {
1426  m_cmsShowMainFrame->setPlayDelayGUI(val, kTRUE);
1427 }
1428 
1430 {
1432  {
1434  }
1435 
1436  m_cmsShowMainFrame->m_lumiEntry->SetText("", kFALSE);
1437  m_cmsShowMainFrame->m_lumiEntry->SetFocus();
1438 }
1439 
1441 {
1443  {
1445  }
1446 
1447  m_cmsShowMainFrame->m_eventEntry->SetText("", kFALSE);
1448  m_cmsShowMainFrame->m_eventEntry->SetFocus();
1449 }
1450 
1452 {
1454  {
1456  }
1457 
1461 }
1462 
1463 void
1465 {
1469 
1470  gEve->FullRedraw3D();
1471 }
1472 //______________________________________________________________________________
1473 
1474 void
1476 {
1478 }
1479 
1480 void
1482 {
1483  filterButtonClicked_.emit();
1484 }
1485 
1486 void
1488 {
1489  m_cmsShowMainFrame->m_filterShowGUIBtn->SetText(txt);
1490 }
1491 
1492 void
1494 {
1495  int i = state*3;
1499 }
1500 
1501 void
1503 {
1504  m_cmsShowMainFrame->m_filterEnableBtn->SetEnabled(btnEnabled);
1505 }
1506 
1507 void
1509 {
1510  const Int_t x = 100, y = 100;
1511 
1512  TGMainFrame *mf1 = new TGMainFrame(0, 0, 0);
1513  mf1->MapWindow();
1514  mf1->Move(x, y);
1515 
1516  // This seems to be the only reliable way to make sure Move() has been processed.
1517  {
1518  TGMainFrame *mf2 = new TGMainFrame(0, 0, 0);
1519  mf2->MapWindow();
1520  while (!mf2->IsMapped()) gClient->HandleInput();
1521  delete mf2;
1522  }
1523  {
1524  Int_t xm, ym;
1525  Window_t childdum;
1526  WindowAttributes_t attr;
1527  gVirtualX->TranslateCoordinates(mf1->GetId(), gClient->GetDefaultRoot()->GetId(),
1528  0, 0, xm, ym, childdum);
1529  gVirtualX->GetWindowAttributes(mf1->GetId(), attr);
1530  m_WMOffsetX = x - xm;
1531  m_WMOffsetY = y - ym;
1532  m_WMDecorH = attr.fY;
1533  fwLog(fwlog::kDebug) << Form("FWGUIManager::measureWMOffsets: required (%d,%d), measured(%d, %d) => dx=%d, dy=%d; decor_h=%d.\n",
1534  x, y, xm, ym, m_WMOffsetX, m_WMOffsetY, m_WMDecorH);
1535  }
1536  delete mf1;
1537 }
1538 
1539 void
1541 {
1543 }
1544 
1545 void
1547 {
1548  int x = 150 + m_WMOffsetX ;
1549  int y = 50 + m_WMOffsetY;
1550  m_cmsShowMainFrame->Move(x, y);
1551  m_cmsShowMainFrame->SetWMPosition(x, y < m_WMDecorH ? m_WMDecorH : y);
1552 
1553  createView("Rho Phi");
1554  createView("Rho Z");
1555 
1556  m_cmsShowMainFrame->MapSubwindows();
1557  m_cmsShowMainFrame->Layout();
1558  m_cmsShowMainFrame->MapRaised();
1559 }
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:215
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:207
ViewMap_t m_viewMap
Definition: FWGUIManager.h:276
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:210
void colorSetChanged()
Definition: CmsShowEDI.cc:541
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:277
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:264
CSGContinuousAction * playEventsBackwardsAction() const
tuple pp
Definition: createTree.py:15
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:251
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:212
void setFilterButtonIcon(int)
void open3DRegion()
Evaluator * parse(const T &text)
sigc::signal< void > closed_
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:268
void setClip(float eta, float phi)
void setViewPopup(TEveWindow *)
RunNumber_t const invalidRunNumber
const std::string & name() const
Definition: FWEventItem.cc:513
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)
Geom::Theta< T > theta() const
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:246
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")
void updateStatus(const char *status)
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:254
FWIntValueListener * m_delaySliderListener
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:279
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:284
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:280
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:266
EventNumber_t const invalidEventNumber
const TGPicture * m_filterIcons[9]
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:219
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:257
static const std::string kUndocked("undocked views")
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:208
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:258
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:261
void exportImageOfMainView()
double f[11][100]
unsigned int id() const
Definition: FWEventItem.cc:507
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:265
static const std::string kViewArea("view area")
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:267
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:273
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:285
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:249
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:209
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:211
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:256
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:213
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:534
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:271
void openEveBrowserForDebugging() const
void lumiIdChanged()
virtual void addTo(FWConfiguration &) const
Definition: DDAxes.h:10
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:272