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