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