CMS 3D CMS Logo

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