CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

FWGUIManager Class Reference

#include <Fireworks/Core/interface/FWGUIManager.h>

Inheritance diagram for FWGUIManager:
FWConfigurable

List of all members.

Public Types

typedef std::map< std::string,
ViewBuildFunctor
NameToViewBuilder
typedef boost::function2
< FWViewBase *, TEveWindowSlot
*, const std::string & > 
ViewBuildFunctor

Public Member Functions

void addData ()
void addTo (FWConfiguration &) const
void checkSubviewAreaIconState (TEveWindow *)
void clearStatus ()
void connectSubviewAreaSignals (FWGUISubviewArea *)
void createEDIFrame ()
void createHelpGLPopup ()
void createHelpPopup ()
TGVerticalFrame * createList (TGCompositeFrame *p)
void createModelPopup ()
void createShortcutPopup ()
ViewMap_i createView (const std::string &iName, TEveWindowSlot *slot=0)
void createViews (TEveWindowSlot *slot)
void disableNext ()
void disablePrevious ()
void enableActions (bool enable=true)
void eventChangedCallback ()
void eventIdChanged ()
void evePreTerminate ()
void exportAllViews (const std::string &format)
void exportImageOfMainView ()
void exportImagesOfAllViews ()
void filterButtonClicked ()
 FWGUIManager (fireworks::Context *ctx, const FWViewManagerManager *iVMMgr, FWNavigatorBase *navigator)
CSGActiongetAction (const std::string name)
const edm::EventBasegetCurrentEvent () const
CmsShowMainFramegetMainFrame () const
CSGContinuousActionloopAction ()
void lumiIdChanged ()
void newViewSlot (const std::string &iName)
void openEveBrowserForDebugging () const
CSGContinuousActionplayEventsAction ()
CSGContinuousActionplayEventsBackwardsAction ()
void popupViewClosed ()
void processGUIEvents ()
void registerViewBuilder (const std::string &iName, ViewBuildFunctor &iBuilder)
void resetWMOffsets ()
void runIdChanged ()
void setDelayBetweenEvents (Float_t)
void setFilterButtonIcon (int)
void setFilterButtonText (const char *txt)
void setFrom (const FWConfiguration &)
void setPlayMode (bool)
void setWindowInfoFrom (const FWConfiguration &iFrom, TGMainFrame *iFrame)
void showCommonPopup ()
void showEDIFrame (int iInfoToShow=-1)
 Allowed values are -1 or ones from FWDataCategories enum.
void showEventFilterGUI ()
void showInvMassDialog ()
void showModelPopup ()
void showSelectedModelContextMenu (Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
void showViewPopup ()
void subviewDestroy (FWGUISubviewArea *)
void subviewDestroyAll ()
void subviewInfoSelected (FWGUISubviewArea *)
void subviewInfoUnselected (FWGUISubviewArea *)
void subviewIsBeingDestroyed (FWGUISubviewArea *)
void subviewSwapped (FWGUISubviewArea *)
void titleChanged (const char *title)
void updateEventFilterEnable (bool)
void updateStatus (const char *status)
virtual ~FWGUIManager ()

Static Public Member Functions

static FWGUIManagergetGUIManager ()
static TGFrame * makeGUIsubview (TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)

Public Attributes

sigc::signal< void, Float_t > changedDelayBetweenEvents_
sigc::signal< void > changedEventEntry_
sigc::signal< void,
edm::RunNumber_t,
edm::LuminosityBlockNumber_t,
edm::EventNumber_t
changedEventId_
sigc::signal< void > changedRunEntry_
sigc::signal< void > filterButtonClicked_
sigc::signal< void > goingToQuit_
sigc::signal< void, const
std::string & > 
loadFromConfigurationFile_
sigc::signal< void, const
TGWindow * > 
showEventFilterGUI_
sigc::signal< void, const
std::string & > 
writeToConfigurationFile_
sigc::signal< void > writeToPresentConfigurationFile_

Private Types

typedef ViewMap_t::iterator ViewMap_i
typedef std::map< TEveWindow
*, FWViewBase * > 
ViewMap_t

Private Member Functions

void delaySliderChanged (Int_t)
void finishUpColorChange ()
 FWGUIManager (const FWGUIManager &)
TEveWindow * getSwapCandidate ()
void measureWMOffsets ()
void newItem (const FWEventItem *)
const FWGUIManageroperator= (const FWGUIManager &)
bool promptForConfigurationFile (std::string &result, enum EFileDialogMode mode)
void promptForLoadConfigurationFile ()
void promptForSaveConfigurationFile ()
void setViewPopup (TEveWindow *)

Private Attributes

CmsShowMainFramem_cmsShowMainFrame
CmsShowCommonPopupm_commonPopup
fireworks::Contextm_context
FWModelContextMenuHandlerm_contextMenuHandler
FWGUIEventDataAdderm_dataAdder
FWDetailViewManagerm_detailViewManager
CmsShowEDIm_ediFrame
TGPopupMenu * m_fileMenu
CmsShowHelpPopupm_helpGLPopup
CmsShowHelpPopupm_helpPopup
FWInvMassDialogm_invMassDialog
sigc::connection m_modelChangeConn
CmsShowModelPopupm_modelPopup
NameToViewBuilder m_nameToViewBuilder
FWNavigatorBasem_navigator
CmsShowHelpPopupm_shortcutPopup
FWSummaryManagerm_summaryManager
std::auto_ptr
< CmsShowTaskExecutor
m_tasks
const FWViewManagerManagerm_viewManagerManager
ViewMap_t m_viewMap
CmsShowViewPopupm_viewPopup
TEveWindowPack * m_viewPrimPack
TEveWindowPack * m_viewSecPack
int m_WMDecorH
int m_WMOffsetX
int m_WMOffsetY

Static Private Attributes

static FWGUIManagerm_guiManager = 0

Detailed Description

Description: Manages the GUI

Usage: <usage>

Definition at line 96 of file FWGUIManager.h.


Member Typedef Documentation

typedef std::map<std::string, ViewBuildFunctor > FWGUIManager::NameToViewBuilder

Definition at line 101 of file FWGUIManager.h.

typedef boost::function2<FWViewBase*,TEveWindowSlot*, const std::string& > FWGUIManager::ViewBuildFunctor

Definition at line 100 of file FWGUIManager.h.

typedef ViewMap_t::iterator FWGUIManager::ViewMap_i [private]

Definition at line 104 of file FWGUIManager.h.

typedef std::map<TEveWindow*, FWViewBase*> FWGUIManager::ViewMap_t [private]

Definition at line 103 of file FWGUIManager.h.


Constructor & Destructor Documentation

FWGUIManager::FWGUIManager ( fireworks::Context ctx,
const FWViewManagerManager iVMMgr,
FWNavigatorBase navigator 
)

Definition at line 95 of file FWGUIManager.cc.

References alignmentValidation::action, CSGAction::activated, addData(), fireworks::Context::colorManager(), FWColorManager::colorsHaveChangedFinished_, createHelpGLPopup(), createHelpPopup(), CmsShowMainFrame::createNewViewerAction(), createShortcutPopup(), delaySliderChanged(), fireworks::Context::eventItemsManager(), exportImageOfMainView(), exportImagesOfAllViews(), finishUpColorChange(), getAction(), i, FWViewType::idToName(), FWViewType::kGlimpse, FWViewType::kLegoPFECAL, FWViewType::kTableHLT, FWViewType::kTypeSize, m_cmsShowMainFrame, m_context, m_contextMenuHandler, CmsShowMainFrame::m_delaySliderListener, m_detailViewManager, CmsShowMainFrame::m_eventEntry, CmsShowMainFrame::m_filterEnableBtn, CmsShowMainFrame::m_filterShowGUIBtn, m_guiManager, CmsShowMainFrame::m_lumiEntry, CmsShowMainFrame::m_runEntry, makeGUIsubview(), measureWMOffsets(), newItem(), FWEventItemsManager::newItem_, newViewSlot(), promptForLoadConfigurationFile(), promptForSaveConfigurationFile(), cmsshow::sBackgroundColor, fireworks::Context::selectionManager(), cmsshow::sExportAllImages, cmsshow::sExportImage, cmsshow::sHelp, cmsshow::sHelpGL, showCommonPopup(), showEDIFrame(), showInvMassDialog(), showModelPopup(), showViewPopup(), cmsshow::sKeyboardShort, cmsshow::sLoadConfig, cmsshow::sSaveConfig, cmsshow::sSaveConfigAs, cmsshow::sShowAddCollection, cmsshow::sShowCommonInsp, cmsshow::sShowEventDisplayInsp, cmsshow::sShowInvMassDialog, cmsshow::sShowMainViewCtl, cmsshow::sShowObjInsp, FWColorManager::switchBackground(), FWIntValueListener::valueChanged_, tablePrinter::width, and writeToPresentConfigurationFile_.

                                                      :
   m_context(ctx),
   m_summaryManager(0),
   m_detailViewManager(0),
   m_viewManagerManager(iVMMgr),
   m_contextMenuHandler(0),
   m_navigator(navigator),
   m_dataAdder(0),
   m_ediFrame(0),
   m_modelPopup(0),
   m_viewPopup(0),
   m_commonPopup(0),
   m_invMassDialog(0),
   m_helpPopup(0),
   m_shortcutPopup(0),
   m_helpGLPopup(0),
   m_tasks(new CmsShowTaskExecutor),
   m_WMOffsetX(0), m_WMOffsetY(0), m_WMDecorH(0)
{
   m_guiManager = this;

   measureWMOffsets();

   FWEventItemsManager* im = (FWEventItemsManager*) m_context->eventItemsManager();
   im->newItem_.connect(boost::bind(&FWGUIManager::newItem, this, _1) );

   m_context->colorManager()->colorsHaveChangedFinished_.connect(boost::bind(&FWGUIManager::finishUpColorChange,this));

  
   TEveCompositeFrame::IconBarCreator_foo foo =  &FWGUIManager::makeGUIsubview;
   TEveCompositeFrame::SetupFrameMarkup(foo, 20, 4, false);

   {
      //NOTE: by making sure we defaultly open to a fraction of the full screen size we avoid
      // causing the program to go into full screen mode under default SL4 window manager
      UInt_t width = gClient->GetDisplayWidth();
      UInt_t height = static_cast<UInt_t>(gClient->GetDisplayHeight()*.8);
      //try to deal with multiple horizontally placed monitors.  Since present monitors usually
      // have less than 2000 pixels horizontally, when we see more it is a good indicator that
      // we are dealing with more than one monitor.
      while(width > 2000) {
         width /= 2;
      }
      width = static_cast<UInt_t>(width*.8);
      m_cmsShowMainFrame = new CmsShowMainFrame(gClient->GetRoot(),
                                                width,
                                                height,
                                                this);
      m_cmsShowMainFrame->SetCleanup(kDeepCleanup);
    
      /*
        int mlist[FWViewType::kTypeSize] = {FWViewType::kRhoPhi, FWViewType::kRhoZ, FWViewType::k3D, FWViewType::kISpy, FWViewType::kLego, FWViewType::kLegoHF, FWViewType::kGlimpse, 
        FWViewType::kTable, FWViewType::kTableL1, FWViewType::kTableHLT,
        FWViewType::kGeometryTable,
        FWViewType::kRhoPhiPF, FWViewType::kLegoPFECAL}; */

      for (int i = 0 ; i < FWViewType::kTypeSize; ++i)
      {
         bool separator = (i == FWViewType::kGlimpse || i == FWViewType::kTableHLT || i ==  FWViewType::kLegoPFECAL);
         CSGAction* action = m_cmsShowMainFrame->createNewViewerAction(FWViewType::idToName(i), separator);
         action->activated.connect(boost::bind(&FWGUIManager::newViewSlot, this, FWViewType::idToName(i)));
      }

      m_detailViewManager  = new FWDetailViewManager(m_context->colorManager());
      m_contextMenuHandler = new FWModelContextMenuHandler(m_context->selectionManager(), m_detailViewManager, m_context->colorManager(), this);


      getAction(cmsshow::sExportImage)->activated.connect(sigc::mem_fun(*this, &FWGUIManager::exportImageOfMainView));
      getAction(cmsshow::sExportAllImages)->activated.connect(sigc::mem_fun(*this, &FWGUIManager::exportImagesOfAllViews));
      getAction(cmsshow::sLoadConfig)->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForLoadConfigurationFile));
      getAction(cmsshow::sSaveConfig)->activated.connect(writeToPresentConfigurationFile_);
      getAction(cmsshow::sSaveConfigAs)->activated.connect(sigc::mem_fun(*this,&FWGUIManager::promptForSaveConfigurationFile));
      getAction(cmsshow::sShowEventDisplayInsp)->activated.connect(boost::bind( &FWGUIManager::showEDIFrame,this,-1));
      getAction(cmsshow::sShowMainViewCtl)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showViewPopup));
      getAction(cmsshow::sShowObjInsp)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showModelPopup));

      getAction(cmsshow::sBackgroundColor)->activated.connect(sigc::mem_fun(m_context->colorManager(), &FWColorManager::switchBackground));
      getAction(cmsshow::sShowCommonInsp)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showCommonPopup));

      getAction(cmsshow::sShowInvMassDialog)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showInvMassDialog));

      getAction(cmsshow::sShowAddCollection)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::addData));
      assert(getAction(cmsshow::sHelp) != 0);
      getAction(cmsshow::sHelp)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::createHelpPopup));
      assert(getAction(cmsshow::sKeyboardShort) != 0);
      getAction(cmsshow::sKeyboardShort)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::createShortcutPopup));
      getAction(cmsshow::sHelpGL)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::createHelpGLPopup));

      // toolbar special widget with non-void actions
      m_cmsShowMainFrame->m_delaySliderListener->valueChanged_.connect(boost::bind(&FWGUIManager::delaySliderChanged,this,_1));

      TQObject::Connect(m_cmsShowMainFrame->m_runEntry,   "ReturnPressed()", "FWGUIManager", this, "runIdChanged()");
      TQObject::Connect(m_cmsShowMainFrame->m_lumiEntry,  "ReturnPressed()", "FWGUIManager", this, "lumiIdChanged()");
      TQObject::Connect(m_cmsShowMainFrame->m_eventEntry, "ReturnPressed()", "FWGUIManager", this, "eventIdChanged()");

      TQObject::Connect(m_cmsShowMainFrame->m_filterShowGUIBtn, "Clicked()", "FWGUIManager", this, "showEventFilterGUI()");
      TQObject::Connect(m_cmsShowMainFrame->m_filterEnableBtn,  "Clicked()", "FWGUIManager", this, "filterButtonClicked()"); 

      TQObject::Connect(gEve->GetWindowManager(), "WindowSelected(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
      TQObject::Connect(gEve->GetWindowManager(), "WindowDocked(TEveWindow*)"  , "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
      TQObject::Connect(gEve->GetWindowManager(), "WindowUndocked(TEveWindow*)", "FWGUIManager", this, "checkSubviewAreaIconState(TEveWindow*)");
   }
}
FWGUIManager::~FWGUIManager ( ) [virtual]
FWGUIManager::FWGUIManager ( const FWGUIManager ) [private]

Member Function Documentation

void FWGUIManager::addData ( )
void FWGUIManager::addTo ( FWConfiguration oTo) const [virtual]

Implements FWConfigurable.

Definition at line 1030 of file FWGUIManager.cc.

References addAreaInfoTo(), FWConfiguration::addKeyValue(), FWConfigurableParameterizable::addTo(), addWindowInfoTo(), CmsShowMainFrame::getSummaryViewWeight(), i, kCollectionController(), kCommonController(), kControllers(), kMainWindow(), kObjectController(), kViewArea(), kViewController(), kViews(), m_cmsShowMainFrame, m_commonPopup, m_ediFrame, m_modelPopup, m_viewMap, m_viewPopup, m_viewPrimPack, m_viewSecPack, createTree::pp, cond::rpcobtemp::temp, FWViewBase::typeName(), and FWConfigurableParameterizable::version().

{
   Int_t cfgVersion=3;

   FWConfiguration mainWindow(cfgVersion);
   float leftWeight, rightWeight;
   addWindowInfoTo(m_cmsShowMainFrame, mainWindow);
   {
      // write summary view weight
      {
         std::stringstream ss;
         ss << m_cmsShowMainFrame->getSummaryViewWeight();
         mainWindow.addKeyValue("summaryWeight",FWConfiguration(ss.str()));
      }

      // write proportions of horizontal pack (can be standalone item outside main frame)
      if ( m_viewPrimPack->GetPack()->GetList()->GetSize() > 2)
      {
         TGFrameElementPack *frameEL;
         frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1); // read every second  element, first on is splitter
         leftWeight = frameEL->fWeight;
         frameEL = (TGFrameElementPack*)  m_viewPrimPack->GetPack()->GetList()->At(3);
         rightWeight = frameEL->fWeight;
      }
      else
      {
         leftWeight = 0;
         rightWeight = 1;
      }
      std::stringstream sL;
      sL<<leftWeight;
      mainWindow.addKeyValue("leftWeight",FWConfiguration(sL.str()));
      std::stringstream sR;
      sR<<rightWeight;
      mainWindow.addKeyValue("rightWeight",FWConfiguration(sR.str()));
   }
   oTo.addKeyValue(kMainWindow, mainWindow, true);

   //------------------------------------------------------------
   // organize info about all docked frames includding hidden, which point to undocked
   std::vector<areaInfo> wpacked;
   if (leftWeight > 0)
   {
      TGPack* pp = m_viewPrimPack->GetPack();
      TGFrameElementPack *frameEL = (TGFrameElementPack*) pp->GetList()->At(1);
      if (frameEL->fWeight > 0)
         wpacked.push_back(areaInfo(frameEL));
   }
   TGPack* sp = m_viewSecPack->GetPack();
   Int_t nf = sp->GetList()->GetSize();
   TIter frame_iterator(sp->GetList());
   for (Int_t i=0; i<nf; ++i) {
      TGFrameElementPack *seFE = (TGFrameElementPack*)frame_iterator();
      if (seFE->fWeight)
         wpacked.push_back(areaInfo(seFE));
   }

   //  undocked info
   
   for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
   {
      TEveWindow* ew = wIt->first;
      TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>(ew->GetEveFrame());
      if (mainFrame)
      {
         for(std::vector<areaInfo>::iterator pIt = wpacked.begin(); pIt != wpacked.end(); ++pIt)
         {
            if ((*pIt).originalSlot && mainFrame->GetOriginalSlot() == (*pIt).originalSlot)
            {
               (*pIt).eveWindow = wIt->first;
               (*pIt).undockedMainFrame = (TGMainFrame*)mainFrame;
               // printf("found original slot for docked view %s\n", pInfo->viewBase->typeName().c_str());
               break;
            }// found match
         }
      }// end main frames
   }
   
   //------------------------------------------------------------
   // add sorted list in view area and FW-views configuration
   FWConfiguration views(1);
   FWConfiguration viewArea(cfgVersion);
   for(std::vector<areaInfo>::iterator it = wpacked.begin(); it != wpacked.end(); ++it)
   {
      TEveWindow* ew = (*it).eveWindow;
      if (ew) {
         FWViewBase* wb = m_viewMap[ew];
         FWConfiguration tempWiew(wb->version());
         wb->addTo(tempWiew);
         views.addKeyValue(wb->typeName(), tempWiew, true);
         FWConfiguration tempArea(cfgVersion);
         addAreaInfoTo((*it), tempArea);
         viewArea.addKeyValue(wb->typeName(), tempArea, true);
      }
   }
   oTo.addKeyValue(kViews, views, true);
   oTo.addKeyValue(kViewArea, viewArea, true);

   //------------------------------------------------------------
   //Remember where controllers were placed if they are open
   FWConfiguration controllers(1);
   {
      if(0!=m_ediFrame && m_ediFrame->IsMapped()) {
         FWConfiguration temp(1);
         addWindowInfoTo(m_ediFrame, temp);
         controllers.addKeyValue(kCollectionController,temp,true);
      }
      if(0!=m_viewPopup && m_viewPopup->IsMapped()) {
         FWConfiguration temp(1);
         addWindowInfoTo(m_viewPopup, temp);
         controllers.addKeyValue(kViewController,temp,true);
      }
      if(0!=m_modelPopup && m_modelPopup->IsMapped()) {
         FWConfiguration temp(1);
         addWindowInfoTo(m_modelPopup, temp);
         controllers.addKeyValue(kObjectController,temp,true);
      }
      if(0!=m_commonPopup && m_commonPopup->IsMapped()) {
         FWConfiguration temp(1);
         addWindowInfoTo(m_commonPopup, temp);
         controllers.addKeyValue(kCommonController,temp,true);
      }
   }
   oTo.addKeyValue(kControllers,controllers,true);
}
void FWGUIManager::checkSubviewAreaIconState ( TEveWindow *  )

Definition at line 480 of file FWGUIManager.cc.

References cond::rpcobimon::current, CmsShowViewPopup::getEveWindow(), getSwapCandidate(), FWGUISubviewArea::getToolBarFromWindow(), m_viewMap, m_viewPopup, CmsShowViewPopup::mapped(), FWGUISubviewArea::setInfoButton(), and FWGUISubviewArea::setSwapIcon().

Referenced by setFrom(), and subviewSwapped().

{
   // First argumet is needed for signals/slot symetry

   // disable swap on the first left TEveCompositeFrame
   // check info button
   TEveWindow* current  = getSwapCandidate();
   bool checkInfoBtn    = m_viewPopup ? m_viewPopup->mapped() : 0;
   TEveWindow* selected = m_viewPopup ? m_viewPopup->getEveWindow() : 0;

   for (ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); it++)
   {
      FWGUISubviewArea* ar = FWGUISubviewArea::getToolBarFromWindow(it->first);
      ar->setSwapIcon(current != it->first);
      if (checkInfoBtn && selected)
         ar->setInfoButton(selected == it->first);
   }
}
void FWGUIManager::clearStatus ( )
void FWGUIManager::connectSubviewAreaSignals ( FWGUISubviewArea a)
void FWGUIManager::createEDIFrame ( )
void FWGUIManager::createHelpGLPopup ( )

Definition at line 738 of file FWGUIManager.cc.

References getAction(), edm::getName(), m_cmsShowMainFrame, m_helpGLPopup, and cmsshow::sHelpGL.

Referenced by FWGUIManager().

{
   if (m_helpGLPopup == 0) {
      m_helpGLPopup = new CmsShowHelpPopup("helpGL.html",
                                            getAction(cmsshow::sHelpGL)->getName().c_str(),
                                            m_cmsShowMainFrame, 800, 600);

      m_helpGLPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
   }
   m_helpGLPopup->MapWindow();
}
void FWGUIManager::createHelpPopup ( )

Definition at line 713 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and m_helpPopup.

Referenced by FWGUIManager().

{
   if (m_helpPopup == 0) {
      m_helpPopup = new CmsShowHelpPopup("help.html", "CmsShow Help",
                                         m_cmsShowMainFrame,
                                         800, 600);
      m_helpPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
   }
   m_helpPopup->MapWindow();
}
TGVerticalFrame * FWGUIManager::createList ( TGCompositeFrame *  p)

Definition at line 585 of file FWGUIManager.cc.

References fireworks::Context::colorManager(), fireworks::Context::eventItemsManager(), m_context, m_summaryManager, fireworks::Context::modelChangeManager(), fireworks::Context::selectionManager(), and FWSummaryManager::widget().

Referenced by CmsShowMainFrame::CmsShowMainFrame().

{
   TGVerticalFrame *listFrame = new TGVerticalFrame(p, p->GetWidth(), p->GetHeight());

   TGHorizontalFrame* addFrame = new TGHorizontalFrame(listFrame, p->GetWidth(), 10, kRaisedFrame);
   TGLabel* addLabel = new TGLabel(addFrame,"Summary View");
   addFrame->AddFrame(addLabel, new TGLayoutHints(kLHintsCenterX, 0,0,2,2));
   listFrame->AddFrame(addFrame, new TGLayoutHints(kLHintsExpandX | kLHintsTop));

   m_summaryManager = new FWSummaryManager(listFrame,
                                           m_context->selectionManager(),
                                           (FWEventItemsManager*) m_context->eventItemsManager(),
                                           this,
                                           m_context->modelChangeManager(),
                                           m_context->colorManager());

   const unsigned int backgroundColor=0x2f2f2f;
   TGTextButton* addDataButton = new TGTextButton(m_summaryManager->widget(), "Add Collection");
   addDataButton->ChangeOptions(kRaisedFrame);
   addDataButton->SetBackgroundColor(backgroundColor);
   addDataButton->SetTextColor(0xFFFFFF);
   addDataButton->SetToolTipText("Show additional collections");
   addDataButton->Connect("Clicked()", "FWGUIManager", this, "addData()");
   m_summaryManager->widget()->AddFrame(addDataButton, new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsTop));
   listFrame->AddFrame(m_summaryManager->widget(), new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));

   return listFrame;
}
void FWGUIManager::createModelPopup ( )
void FWGUIManager::createShortcutPopup ( )

Definition at line 726 of file FWGUIManager.cc.

References getAction(), edm::getName(), m_cmsShowMainFrame, m_shortcutPopup, and cmsshow::sKeyboardShort.

Referenced by FWGUIManager().

{
   if (m_shortcutPopup == 0) {
      m_shortcutPopup = new CmsShowHelpPopup("shortcuts.html",
                                             getAction(cmsshow::sKeyboardShort)->getName().c_str(),
                                              m_cmsShowMainFrame, 800, 600);

      m_shortcutPopup->CenterOnParent(kTRUE,TGTransientFrame::kBottomRight);
   }
   m_shortcutPopup->MapWindow();
}
FWGUIManager::ViewMap_i FWGUIManager::createView ( const std::string &  iName,
TEveWindowSlot *  slot = 0 
)

Definition at line 275 of file FWGUIManager.cc.

References FWViewBase::contextMenuHandler(), m_guiManager, m_nameToViewBuilder, m_viewMap, m_viewPrimPack, m_viewSecPack, FWViewBase::openSelectedModelContextMenu_, and showSelectedModelContextMenu().

Referenced by newViewSlot(), and setFrom().

{
   NameToViewBuilder::iterator itFind = m_nameToViewBuilder.find(iName);
   assert (itFind != m_nameToViewBuilder.end());
   if(itFind == m_nameToViewBuilder.end()) {
      throw std::runtime_error(std::string("Unable to create view named ")+iName+" because it is unknown");
   }
   
   if (!slot)
   {
      if (m_viewSecPack)
      {
         slot = m_viewSecPack->NewSlot();
      }
      else
      {
         slot = m_viewPrimPack->NewSlot();
         m_viewSecPack = m_viewPrimPack->NewSlot()->MakePack();
         m_viewSecPack->SetShowTitleBar(kFALSE);
      }
   }
   TEveCompositeFrame *ef = slot->GetEveFrame();
   FWViewBase* viewBase = itFind->second(slot, iName);
   //in future, get context from 'view'
   FWViewContextMenuHandlerBase* base= viewBase->contextMenuHandler();
   viewBase->openSelectedModelContextMenu_.connect(boost::bind(&FWGUIManager::showSelectedModelContextMenu ,m_guiManager,_1,_2,base));
   
   TEveWindow *eveWindow = ef->GetEveWindow();
   eveWindow->SetElementName(iName.c_str());

   std::pair<ViewMap_i,bool> insertPair = m_viewMap.insert(std::make_pair(eveWindow, viewBase));
   return insertPair.first;
}
void FWGUIManager::createViews ( TEveWindowSlot *  slot)

Definition at line 615 of file FWGUIManager.cc.

References m_viewPrimPack, and m_viewSecPack.

Referenced by CmsShowMainFrame::CmsShowMainFrame().

{
   m_viewPrimPack = slot->MakePack();
   m_viewPrimPack->SetHorizontal();
   m_viewPrimPack->SetElementName("Views");
   m_viewPrimPack->SetShowTitleBar(kFALSE);
   m_viewSecPack = 0;
}
void FWGUIManager::delaySliderChanged ( Int_t  val) [private]

Definition at line 1306 of file FWGUIManager.cc.

References changedDelayBetweenEvents_, m_cmsShowMainFrame, and CmsShowMainFrame::setPlayDelayGUI().

Referenced by FWGUIManager().

{
   Float_t sec = val*0.001;
   m_cmsShowMainFrame->setPlayDelayGUI(sec, kFALSE);
   changedDelayBetweenEvents_.emit(sec);
}
void FWGUIManager::disableNext ( )
void FWGUIManager::disablePrevious ( )
void FWGUIManager::enableActions ( bool  enable = true)
void FWGUIManager::eventChangedCallback ( )

Definition at line 329 of file FWGUIManager.cc.

References getCurrentEvent(), i, CmsShowMainFrame::loadEvent(), m_cmsShowMainFrame, m_detailViewManager, and FWDetailViewManager::newEventCallback().

Referenced by CmsShowMainBase::eventChangedImp().

                                   {
   // To be replaced when we can get index from fwlite::Event
   
   TEveViewerList* viewers = gEve->GetViewers();
   for (TEveElement::List_i i=viewers->BeginChildren(); i!= viewers->EndChildren(); ++i)
   {
      TEveViewer* ev = dynamic_cast<TEveViewer*>(*i);
      if (ev)
         ev->GetGLViewer()->DeleteOverlayAnnotations();
   }
   
   m_cmsShowMainFrame->loadEvent(*getCurrentEvent());
   m_detailViewManager->newEventCallback();
}
void FWGUIManager::eventIdChanged ( )
void FWGUIManager::evePreTerminate ( )

Definition at line 225 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and m_viewMap.

Referenced by CmsShowMain::doExit().

{
   gEve->GetWindowManager()->Disconnect("WindowSelected(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
   gEve->GetWindowManager()->Disconnect("WindowDocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");
   gEve->GetWindowManager()->Disconnect("WindowUndocked(TEveWindow*)", this, "checkSubviewAreaIconState(TEveWindow*)");

   // avoid emit signals at end
   gEve->GetSelection()->Disconnect();
   gEve->GetHighlight()->Disconnect();
   gEve->GetSelection()->RemoveElements();
   gEve->GetHighlight()->RemoveElements();
    
   m_cmsShowMainFrame->UnmapWindow();
   for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
   {
     TEveCompositeFrameInMainFrame* mainFrame = dynamic_cast<TEveCompositeFrameInMainFrame*>((*wIt).first->GetEveFrame());
     //  main frames not to watch dying
      if (mainFrame) mainFrame->UnmapWindow();
     // destroy
      (*wIt).second->destroy();
   }
}
void FWGUIManager::exportAllViews ( const std::string &  format)

Definition at line 877 of file FWGUIManager.cc.

References mergeVDriftHistosByStation::file, getCurrentEvent(), i, j, prof2calltree::l, m_viewMap, and mergeVDriftHistosByStation::name.

Referenced by exportImagesOfAllViews().

{
   // Save all GL views.
   // Expects format to have "%d %d %d %s" which are replaced with
   //   run-number, event number, lumi block and view-name.
   // Blanks in view-name are removed.
   // If several views shave the same name, they are post-fixed
   // with "_%d". They are sorted by view diagonal.

   typedef std::list<TEveViewer*>           viewer_list_t;
   typedef viewer_list_t::iterator          viewer_list_i;

   typedef std::map<TString, viewer_list_t> name_map_t;
   typedef name_map_t::iterator             name_map_i;

   name_map_t vls;

   for (ViewMap_i i = m_viewMap.begin(); i != m_viewMap.end(); ++i)
   {
      TEveViewer *ev = dynamic_cast<TEveViewer*>(i->first);
      if (ev)
      {
         TString name(ev->GetElementName());
         name.ReplaceAll(" ", "");
         viewer_list_t &l  = vls[name];
         viewer_list_i  li = l.begin();
         while (li != l.end() && (*li)->GetGLViewer()->ViewportDiagonal() < ev->GetGLViewer()->ViewportDiagonal())
            ++li;
         l.insert(li, ev);
      }
   }

   const edm::EventBase *event = getCurrentEvent();
   for (name_map_i i = vls.begin(); i != vls.end(); ++i)
   {
      bool multi_p    = (i->second.size() > 1);
      int  view_count = 1;
      for (viewer_list_i j = i->second.begin(); j != i->second.end(); ++j, ++view_count)
      {
         TString view_name(i->first);
         if (multi_p)
         {
            view_name += "_";
            view_name += view_count;
         }
         TString file;
         file.Form(format.c_str(), event->id().run(), event->id().event(),
                   event->luminosityBlock(), view_name.Data());
         (*j)->GetGLViewer()->SavePicture(file);
      }
   }
}
void FWGUIManager::exportImageOfMainView ( )

Definition at line 835 of file FWGUIManager.cc.

References m_cmsShowMainFrame, m_viewMap, and m_viewPrimPack.

Referenced by FWGUIManager().

{
   TGFrameElementPack* frameEL = (TGFrameElementPack*) m_viewPrimPack->GetPack()->GetList()->At(1);
   TEveCompositeFrame* ef = dynamic_cast<TEveCompositeFrame*>(frameEL->fFrame);
   m_viewMap[ef->GetEveWindow()]->promptForSaveImageTo(m_cmsShowMainFrame);
}
void FWGUIManager::exportImagesOfAllViews ( )

Definition at line 843 of file FWGUIManager.cc.

References gather_cfg::cout, dir, exportAllViews(), m_cmsShowMainFrame, and mergeVDriftHistosByStation::name.

Referenced by FWGUIManager().

{
   try {
      static TString dir(".");
      const char *  kImageExportTypes[] = {"PNG",                     "*.png",
                                           "GIF",                     "*.gif",
                                           "JPEG",                    "*.jpg",
                                           "PDF",                     "*.pdf",
                                           "Encapsulated PostScript", "*.eps",
                                           0, 0};

      TGFileInfo fi;
      fi.fFileTypes = kImageExportTypes;
      fi.fIniDir    = StrDup(dir);
      new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame,
                       kFDSave,&fi);
      dir = fi.fIniDir;
      if (fi.fFilename != 0) {
         std::string name = fi.fFilename;
         // fi.fFileTypeIdx points to the name of the file type
         // selected in the drop-down menu, so fi.fFileTypeIdx gives us
         // the extension
         std::string ext = kImageExportTypes[fi.fFileTypeIdx + 1] + 1;
         if (name.find(ext) == name.npos)
            name += ext;
         // now add format trailing before the extension
         name.insert(name.rfind('.'), "-%d_%d_%d_%s");
         exportAllViews(name);
      }
   }
   catch (std::runtime_error &e) { std::cout << e.what() << std::endl; }
}
void FWGUIManager::filterButtonClicked ( )

Definition at line 1356 of file FWGUIManager.cc.

References filterButtonClicked_.

void FWGUIManager::finishUpColorChange ( ) [private]
CSGAction * FWGUIManager::getAction ( const std::string  name)
const edm::EventBase * FWGUIManager::getCurrentEvent ( ) const
FWGUIManager * FWGUIManager::getGUIManager ( ) [static]
CmsShowMainFrame* FWGUIManager::getMainFrame ( ) const [inline]
TEveWindow * FWGUIManager::getSwapCandidate ( ) [private]

Definition at line 432 of file FWGUIManager.cc.

References i, m_viewPrimPack, m_viewSecPack, and createTree::pp.

Referenced by checkSubviewAreaIconState(), and subviewSwapped().

{
   TEveWindow* swapCandidate =0;

   if ( gEve->GetWindowManager()->GetCurrentWindow())
   {
      swapCandidate = gEve->GetWindowManager()->GetCurrentWindow();
   }
   else
   {
      // swap with first docked view
      TEveCompositeFrame* pef;
      TGFrameElementPack *pel;

      // check if there is view in prim pack
      TGPack* pp = m_viewPrimPack->GetPack();
      if ( pp->GetList()->GetSize() > 2)
      {
         pel = (TGFrameElementPack*) pp->GetList()->At(1);
         if (pel->fState) // is first undocked
         {
            pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
            if ( pef && pef->GetEveWindow())
               swapCandidate = pef->GetEveWindow();
         }
      }
      if (swapCandidate == 0)
      {
         // no eve window found in primary check secondary
         TGPack* sp = m_viewSecPack->GetPack();
         Int_t nf = sp->GetList()->GetSize();
         TIter frame_iterator(sp->GetList());
         for (Int_t i=0; i<nf; ++i) {
            pel = (TGFrameElementPack*)frame_iterator();
            pef = dynamic_cast<TEveCompositeFrame*>(pel->fFrame);
            if ( pef && pef->GetEveWindow())
            {
               swapCandidate =  pef->GetEveWindow() ;
               break;
            }
         }
      }
   }

   return swapCandidate;
}
CSGContinuousAction * FWGUIManager::loopAction ( )

Definition at line 363 of file FWGUIManager.cc.

References CmsShowMainFrame::loopAction(), and m_cmsShowMainFrame.

void FWGUIManager::lumiIdChanged ( )

Definition at line 1325 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and CmsShowMainFrame::m_eventEntry.

{
   m_cmsShowMainFrame->m_eventEntry->SetText("", kFALSE);
   m_cmsShowMainFrame->m_eventEntry->SetFocus();
}
TGFrame * FWGUIManager::makeGUIsubview ( TEveCompositeFrame *  cp,
TGCompositeFrame *  parent,
Int_t  height 
) [static]

Definition at line 253 of file FWGUIManager.cc.

Referenced by FWGUIManager().

{
   TGFrame* frame = new FWGUISubviewArea(cp, parent, height);
   return frame;
}
void FWGUIManager::measureWMOffsets ( ) [private]

Definition at line 1383 of file FWGUIManager.cc.

References asciidump::attr, fwLog, fwlog::kDebug, m_WMDecorH, m_WMOffsetX, m_WMOffsetY, x, and detailsBasic3DVector::y.

Referenced by FWGUIManager().

{
  const Int_t x = 100, y = 100;

  TGMainFrame *mf1 = new TGMainFrame(0, 0, 0);
  mf1->MapWindow();
  mf1->Move(x, y);

  // This seems to be the only reliable way to make sure Move() has been processed.
  {
    TGMainFrame *mf2 = new TGMainFrame(0, 0, 0);
    mf2->MapWindow();
    while (!mf2->IsMapped()) gClient->HandleInput();
    delete mf2;
  }
  {
    Int_t    xm, ym;
    Window_t childdum;
    WindowAttributes_t attr;
    gVirtualX->TranslateCoordinates(mf1->GetId(), gClient->GetDefaultRoot()->GetId(),
                                    0, 0, xm, ym, childdum);
    gVirtualX->GetWindowAttributes(mf1->GetId(), attr);
    m_WMOffsetX = x - xm;
    m_WMOffsetY = y - ym;
    m_WMDecorH  = attr.fY;
    fwLog(fwlog::kDebug) << Form("FWGUIManager::measureWMOffsets: required (%d,%d), measured(%d, %d) => dx=%d, dy=%d; decor_h=%d.\n",
                                 x, y, xm, ym, m_WMOffsetX, m_WMOffsetY, m_WMDecorH);
  }
  delete mf1;
}
void FWGUIManager::newItem ( const FWEventItem iItem) [private]

Definition at line 405 of file FWGUIManager.cc.

References FWEventItem::id(), and FWEventItem::name().

Referenced by FWGUIManager().

{
#if defined(THIS_WILL_NEVER_BE_DEFINED)
   m_selectionItemsComboBox->AddEntry(iItem->name().c_str(),iItem->id());
   if(iItem->id()==0) {
      m_selectionItemsComboBox->Select(0);
   }
#endif
}
void FWGUIManager::newViewSlot ( const std::string &  iName)

Definition at line 268 of file FWGUIManager.cc.

References createView().

Referenced by FWGUIManager().

{
   // this function have to exist, becuse CSGAction binds to void functions 
   createView(iName);
}
void FWGUIManager::openEveBrowserForDebugging ( ) const

Definition at line 1297 of file FWGUIManager.cc.

{
   gEve->GetBrowser()->MapWindow();
}
const FWGUIManager& FWGUIManager::operator= ( const FWGUIManager ) [private]
CSGContinuousAction * FWGUIManager::playEventsAction ( )
CSGContinuousAction * FWGUIManager::playEventsBackwardsAction ( )
void FWGUIManager::popupViewClosed ( )
void FWGUIManager::processGUIEvents ( )

Definition at line 399 of file FWGUIManager.cc.

{
   gSystem->ProcessEvents();
}
bool FWGUIManager::promptForConfigurationFile ( std::string &  result,
enum EFileDialogMode  mode 
) [private]

Helper method for a load / save configuration dialog.

result where the picked file is stored.

mode the mode for the dialog (i.e. Load / Save).

Returns:
true if a file was successfully picked, false otherwise.

Definition at line 783 of file FWGUIManager.cc.

References dir, m_cmsShowMainFrame, mode, and mergeVDriftHistosByStation::name.

Referenced by promptForLoadConfigurationFile(), and promptForSaveConfigurationFile().

{
   static const char* kFileTypes[] = {"Fireworks Configuration files","*.fwc",
                                       "All Files","*",
                                       0,0};

   static TString dir(".");

   TGFileInfo fi;
   fi.fFileTypes = kFileTypes;
   fi.fIniDir    = StrDup(dir);
   new TGFileDialog(gClient->GetDefaultRoot(), m_cmsShowMainFrame, mode, &fi);
   dir = fi.fIniDir;
   if (fi.fFilename == 0) // to handle "cancel" button properly
      return false;
   std::string name = fi.fFilename;
   // if the extension isn't already specified by hand, specify it now
   std::string ext = kFileTypes[fi.fFileTypeIdx + 1] + 1;
   if (ext.size() != 0 && name.find(ext) == name.npos)
      name += ext;
   result = name;
   return true;
}
void FWGUIManager::promptForLoadConfigurationFile ( ) [private]

Emits the signal which request to load the configuration file picked up in a dialog.

Definition at line 812 of file FWGUIManager.cc.

References loadFromConfigurationFile_, mergeVDriftHistosByStation::name, and promptForConfigurationFile().

Referenced by FWGUIManager().

{
   std::string name;
   if (!promptForConfigurationFile(name, kFDOpen))
      return;
  
   
   loadFromConfigurationFile_(name);
}
void FWGUIManager::promptForSaveConfigurationFile ( ) [private]

Emits the signal which requests to save the current configuration in the file picked up in the dialog.

Definition at line 826 of file FWGUIManager.cc.

References mergeVDriftHistosByStation::name, promptForConfigurationFile(), and writeToConfigurationFile_.

Referenced by FWGUIManager().

{
   std::string name;
   if (!promptForConfigurationFile(name, kFDSave))
      return;
   writeToConfigurationFile_(name);
}
void FWGUIManager::registerViewBuilder ( const std::string &  iName,
ViewBuildFunctor iBuilder 
)
void FWGUIManager::resetWMOffsets ( )

Definition at line 1415 of file FWGUIManager.cc.

References m_WMDecorH, m_WMOffsetX, and m_WMOffsetY.

Referenced by CmsShowMain::CmsShowMain().

void FWGUIManager::runIdChanged ( )

Definition at line 1319 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and CmsShowMainFrame::m_lumiEntry.

{
   m_cmsShowMainFrame->m_lumiEntry->SetText("", kFALSE);
   m_cmsShowMainFrame->m_lumiEntry->SetFocus();
}
void FWGUIManager::setDelayBetweenEvents ( Float_t  val)

Definition at line 1314 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and CmsShowMainFrame::setPlayDelayGUI().

void FWGUIManager::setFilterButtonIcon ( int  state)
void FWGUIManager::setFilterButtonText ( const char *  txt)
void FWGUIManager::setFrom ( const FWConfiguration iFrom) [virtual]

Implements FWConfigurable.

Definition at line 1171 of file FWGUIManager.cc.

References CmsShowMainFrame::bindCSGActionKeys(), FWViewType::checkNameWithViewVersion(), checkSubviewAreaIconState(), createView(), fwLog, kCollectionController(), kCommonController(), kControllers(), FWConfiguration::keyValues(), FWViewType::kGeometryTable, kMainWindow(), kObjectController(), kUndocked(), kViewArea(), kViewController(), kViews(), fwlog::kWarning, m_cmsShowMainFrame, m_commonPopup, m_ediFrame, m_modelPopup, m_viewMap, m_viewPopup, m_viewPrimPack, m_viewSecPack, mergeVDriftHistosByStation::name, FWGeometryTableView::populate3DViewsFromConfig(), CmsShowMainFrame::setSummaryViewWeight(), setViewPopup(), setWindowInfoFrom(), showCommonPopup(), showEDIFrame(), showModelPopup(), subviewDestroyAll(), FWConfiguration::value(), FWConfiguration::valueForKey(), FWConfiguration::version(), and CommonMethods::weight().

                                                  {
   // main window
   if (m_viewSecPack) subviewDestroyAll();

   const FWConfiguration* mw = iFrom.valueForKey(kMainWindow);
   assert(mw != 0);
   // Window needs to mapped before moving, otherwise move can lead
   // to wrong results on some window managers.
   m_cmsShowMainFrame->MapWindow();
   setWindowInfoFrom(*mw, m_cmsShowMainFrame);
   m_cmsShowMainFrame->MapSubwindows();
   m_cmsShowMainFrame->Layout();
   m_cmsShowMainFrame->MapRaised();

   // set from view reading area info nd view info
   float_t leftWeight =1;
   float_t rightWeight=1;
   if ( mw->version() >= 2 ) {
      leftWeight = atof(mw->valueForKey("leftWeight")->value().c_str());
      rightWeight = atof(mw->valueForKey("rightWeight")->value().c_str());
   }

   if ( mw->version() >= 3 ) {
      float summaryWeight = atof(mw->valueForKey("summaryWeight")->value().c_str());
      m_cmsShowMainFrame->setSummaryViewWeight(summaryWeight);       
   }

   TEveWindowSlot* primSlot = (leftWeight > 0) ? m_viewPrimPack->NewSlotWithWeight(leftWeight) : 0;
   m_viewSecPack = m_viewPrimPack->NewSlotWithWeight(rightWeight)->MakePack();
   m_viewSecPack->SetVertical();
   m_viewSecPack->SetShowTitleBar(kFALSE);

   // views list
   const FWConfiguration* views = iFrom.valueForKey(kViews); assert(0!=views);
   const FWConfiguration::KeyValues* keyVals = views->keyValues();
   const FWConfiguration* viewArea = iFrom.valueForKey(kViewArea);

   // area list (ignored in older version)
   if ( viewArea->version() > 1)
   {
      const FWConfiguration::KeyValues* akv = viewArea->keyValues();
      FWConfiguration::KeyValuesIt areaIt = akv->begin();

      for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
      {
         float weight = atof((areaIt->second).valueForKey("weight")->value().c_str());
         TEveWindowSlot* slot = ( m_viewMap.size() || (primSlot == 0) ) ? m_viewSecPack->NewSlotWithWeight(weight) : primSlot;
         std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());
         ViewMap_i lastViewIt = createView(name, slot);
         lastViewIt->second->setFrom(it->second);

         bool  undocked = atof((areaIt->second).valueForKey("undocked")->value().c_str());
         if (undocked)
         {
            TEveWindow* lastWindow = lastViewIt->first;
            lastWindow->UndockWindow();
            TEveCompositeFrameInMainFrame* emf = dynamic_cast<TEveCompositeFrameInMainFrame*>(lastWindow->GetEveFrame());
            const TGMainFrame* mf =  dynamic_cast<const TGMainFrame*>(emf->GetParent());
            m_cmsShowMainFrame->bindCSGActionKeys(mf);
            TGMainFrame* mfp = (TGMainFrame*)mf;
            const FWConfiguration* mwc = (areaIt->second).valueForKey("UndockedWindowPos");
            setWindowInfoFrom(*mwc, mfp);
         }
         areaIt++;
      }
   }
   else
   {  // create views with same weight in old version
      for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it) {
         std::string name = FWViewType::checkNameWithViewVersion(it->first, it->second.version());       
         createView(name, m_viewMap.size() ? m_viewSecPack->NewSlot() : primSlot);       

         ViewMap_i lastViewIt = m_viewMap.end(); lastViewIt--;
         lastViewIt->second->setFrom(it->second);
      }
      // handle undocked windows in old version
      const FWConfiguration* undocked = iFrom.valueForKey(kUndocked);
      if(0!=undocked) {
         fwLog(fwlog::kWarning) << "Restrore of undocked windows with old window management not supported." << std::endl;
      }
   }

   //handle controllers
   const FWConfiguration* controllers = iFrom.valueForKey(kControllers);
   if(0!=controllers) {
      const FWConfiguration::KeyValues* keyVals = controllers->keyValues();
      if(0!=keyVals) {
         //we have open controllers
         for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it)
         {
            const std::string& controllerName = it->first;
            // std::cout <<"found controller "<<controllerName<<std::endl;
            if(controllerName == kCollectionController) {
               showEDIFrame();
               setWindowInfoFrom(it->second,m_ediFrame);
            } else if (controllerName == kViewController) {
               setViewPopup(0);
               setWindowInfoFrom(it->second, m_viewPopup);
            } else if (controllerName == kObjectController) {
               showModelPopup();
               setWindowInfoFrom(it->second, m_modelPopup);
            } else if (controllerName == kCommonController) {
               showCommonPopup();
               setWindowInfoFrom(it->second, m_commonPopup);
            }
         }
      }
   }


   for(ViewMap_i it = m_viewMap.begin(); it != m_viewMap.end(); ++it)
   {
      if (it->second->typeId() == FWViewType::kGeometryTable)
      {
         FWGeometryTableView* gv = ( FWGeometryTableView*)it->second;
         gv->populate3DViewsFromConfig();
      }
   }

   // disable first docked view
   checkSubviewAreaIconState(0);

 
}
void FWGUIManager::setPlayMode ( bool  play)

Definition at line 381 of file FWGUIManager.cc.

References m_cmsShowMainFrame, CmsShowMainFrame::m_eventEntry, and CmsShowMainFrame::m_runEntry.

{
   m_cmsShowMainFrame->m_runEntry->SetEnabled(!play);
   m_cmsShowMainFrame->m_eventEntry->SetEnabled(!play);
}
void FWGUIManager::setViewPopup ( TEveWindow *  ew) [private]
void FWGUIManager::setWindowInfoFrom ( const FWConfiguration iFrom,
TGMainFrame *  iFrame 
)

Definition at line 1158 of file FWGUIManager.cc.

References m_WMDecorH, m_WMOffsetX, m_WMOffsetY, FWConfiguration::value(), FWConfiguration::valueForKey(), tablePrinter::width, x, and detailsBasic3DVector::y.

Referenced by setFrom().

{
   int x = atoi(iFrom.valueForKey("x")->value().c_str()) + m_WMOffsetX;
   int y = atoi(iFrom.valueForKey("y")->value().c_str()) + m_WMOffsetY;
   if (y < m_WMDecorH) y = m_WMDecorH;
   int width = atoi(iFrom.valueForKey("width")->value().c_str());
   int height = atoi(iFrom.valueForKey("height")->value().c_str());
   iFrame->MoveResize(x,y,width,height);
   iFrame->SetWMPosition(x, y);
}
void FWGUIManager::showCommonPopup ( )
void FWGUIManager::showEDIFrame ( int  iInfoToShow = -1)

Allowed values are -1 or ones from FWDataCategories enum.

Definition at line 634 of file FWGUIManager.cc.

References createEDIFrame(), m_ediFrame, and CmsShowEDI::show().

Referenced by FWModelContextMenuHandler::chosenItem(), FWGUIManager(), FWSummaryManager::requestForController(), FWSummaryManager::requestForError(), FWSummaryManager::requestForFilter(), FWSummaryManager::requestForInfo(), and setFrom().

{
   createEDIFrame();
   if(-1 != iToShow) {
      m_ediFrame->show(static_cast<FWDataCategories> (iToShow));
   }
   m_ediFrame->MapRaised();
}
void FWGUIManager::showEventFilterGUI ( )
void FWGUIManager::showInvMassDialog ( )
void FWGUIManager::showModelPopup ( )

Definition at line 663 of file FWGUIManager.cc.

References createModelPopup(), and m_modelPopup.

Referenced by FWModelContextMenuHandler::chosenItem(), FWGUIManager(), and setFrom().

{
   if (!m_modelPopup) createModelPopup();
   m_modelPopup->MapRaised();
}
void FWGUIManager::showSelectedModelContextMenu ( Int_t  iGlobalX,
Int_t  iGlobalY,
FWViewContextMenuHandlerBase iHandler 
)
void FWGUIManager::showViewPopup ( )

Definition at line 680 of file FWGUIManager.cc.

References setViewPopup().

Referenced by FWGUIManager().

                            {
   // CSG action .
   setViewPopup(0);
}
void FWGUIManager::subviewDestroy ( FWGUISubviewArea sva)

Definition at line 513 of file FWGUIManager.cc.

References FWViewBase::destroy(), FWGUISubviewArea::getEveWindow(), and m_viewMap.

Referenced by subviewDestroyAll(), and subviewIsBeingDestroyed().

{  
   TEveWindow* ew       = sva->getEveWindow();
   FWViewBase* viewBase = m_viewMap[ew];
   m_viewMap.erase(ew);
   viewBase->destroy();
}
void FWGUIManager::subviewDestroyAll ( )

Definition at line 522 of file FWGUIManager.cc.

References FWGUISubviewArea::getToolBarFromWindow(), i, m_viewMap, m_viewPrimPack, m_viewSecPack, setViewPopup(), and subviewDestroy().

Referenced by setFrom().

{
   std::vector<FWGUISubviewArea*> sd;
   for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
   {
      FWGUISubviewArea* ar = FWGUISubviewArea::getToolBarFromWindow(wIt->first);
      sd.push_back(ar);
   }

   for (std::vector<FWGUISubviewArea*>::iterator i= sd.begin(); i !=sd.end(); ++i)
   {
      if((*i)->isSelected())
         setViewPopup(0);
      subviewDestroy(*i);
   }

   gSystem->ProcessEvents();
   gSystem->Sleep(200);


   
   while (m_viewPrimPack->HasChildren())
   {
      TEveWindow* w = dynamic_cast<TEveWindow*>(m_viewPrimPack->FirstChild());
      if (w) w->DestroyWindowAndSlot();
   }

   gSystem->Sleep(200);
   m_viewSecPack = 0;
   gSystem->ProcessEvents();

}
void FWGUIManager::subviewInfoSelected ( FWGUISubviewArea sva)

Definition at line 556 of file FWGUIManager.cc.

References FWGUISubviewArea::getEveWindow(), FWGUISubviewArea::getToolBarFromWindow(), m_viewMap, FWGUISubviewArea::setInfoButton(), and setViewPopup().

Referenced by connectSubviewAreaSignals().

{
   // release button on previously selected
   TEveWindow* ew = sva->getEveWindow();
   for(ViewMap_i wIt = m_viewMap.begin(); wIt != m_viewMap.end(); ++wIt)
   {
      if (wIt->first != ew)
         FWGUISubviewArea::getToolBarFromWindow(wIt->first)->setInfoButton(kFALSE);
   }
   setViewPopup(sva->getEveWindow());
}
void FWGUIManager::subviewInfoUnselected ( FWGUISubviewArea sva)

Definition at line 569 of file FWGUIManager.cc.

References m_viewPopup, and CmsShowViewPopup::UnmapWindow().

Referenced by connectSubviewAreaSignals().

void FWGUIManager::subviewIsBeingDestroyed ( FWGUISubviewArea sva)

Definition at line 500 of file FWGUIManager.cc.

References f, FWGUISubviewArea::isSelected(), m_tasks, setViewPopup(), and subviewDestroy().

Referenced by connectSubviewAreaSignals().

{
   if(sva->isSelected()) {
      setViewPopup(0);
   }

   CmsShowTaskExecutor::TaskFunctor f;
   f = boost::bind(&FWGUIManager::subviewDestroy, this, sva);
   m_tasks->addTask(f);
   m_tasks->startDoingTasks();
}
void FWGUIManager::subviewSwapped ( FWGUISubviewArea sva)

Definition at line 575 of file FWGUIManager.cc.

References checkSubviewAreaIconState(), FWGUISubviewArea::getEveWindow(), getSwapCandidate(), and swap().

Referenced by connectSubviewAreaSignals().

{
   TEveWindow* curr = getSwapCandidate();
   TEveWindow* swap = sva->getEveWindow();
   if (curr) swap->SwapWindow(curr);

   checkSubviewAreaIconState(0);
}
void FWGUIManager::titleChanged ( const char *  title)

Definition at line 321 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and indexGen::title.

Referenced by CmsShowMain::appendData(), CmsShowMain::eventChangedImp(), and CmsShowMain::fileChangedSlot().

{
   char title[128];
   snprintf(title,127,"cmsShow: %s", subtitle);
   m_cmsShowMainFrame->SetWindowName(title);
}
void FWGUIManager::updateEventFilterEnable ( bool  btnEnabled)

Definition at line 1377 of file FWGUIManager.cc.

References m_cmsShowMainFrame, and CmsShowMainFrame::m_filterEnableBtn.

Referenced by CmsShowMain::setupDataHandling().

{
   m_cmsShowMainFrame->m_filterEnableBtn->SetEnabled(btnEnabled);
}
void FWGUIManager::updateStatus ( const char *  status)

Member Data Documentation

sigc::signal<void, Float_t> FWGUIManager::changedDelayBetweenEvents_

Definition at line 217 of file FWGUIManager.h.

Referenced by delaySliderChanged().

Definition at line 216 of file FWGUIManager.h.

Definition at line 211 of file FWGUIManager.h.

Referenced by eventIdChanged().

sigc::signal<void> FWGUIManager::changedRunEntry_

Definition at line 215 of file FWGUIManager.h.

sigc::signal<void> FWGUIManager::goingToQuit_

Definition at line 212 of file FWGUIManager.h.

sigc::signal<void, const std::string&> FWGUIManager::loadFromConfigurationFile_

Definition at line 210 of file FWGUIManager.h.

Referenced by promptForLoadConfigurationFile().

Definition at line 262 of file FWGUIManager.h.

Referenced by addTo(), finishUpColorChange(), setFrom(), and showCommonPopup().

Definition at line 251 of file FWGUIManager.h.

Referenced by FWGUIManager(), showSelectedModelContextMenu(), and ~FWGUIManager().

Definition at line 256 of file FWGUIManager.h.

Referenced by addData().

TGPopupMenu* FWGUIManager::m_fileMenu [private]

Definition at line 255 of file FWGUIManager.h.

FWGUIManager * FWGUIManager::m_guiManager = 0 [static, private]

Definition at line 241 of file FWGUIManager.h.

Referenced by createView(), FWGUIManager(), getGUIManager(), and setViewPopup().

Definition at line 268 of file FWGUIManager.h.

Referenced by createHelpGLPopup().

Definition at line 266 of file FWGUIManager.h.

Referenced by createHelpPopup().

Definition at line 263 of file FWGUIManager.h.

Referenced by showInvMassDialog(), and ~FWGUIManager().

sigc::connection FWGUIManager::m_modelChangeConn [private]

Definition at line 277 of file FWGUIManager.h.

Definition at line 260 of file FWGUIManager.h.

Referenced by addTo(), createModelPopup(), finishUpColorChange(), setFrom(), and showModelPopup().

Definition at line 272 of file FWGUIManager.h.

Referenced by createView(), and registerViewBuilder().

Definition at line 252 of file FWGUIManager.h.

Referenced by getCurrentEvent().

Definition at line 267 of file FWGUIManager.h.

Referenced by createShortcutPopup().

Definition at line 246 of file FWGUIManager.h.

Referenced by createList(), and ~FWGUIManager().

std::auto_ptr<CmsShowTaskExecutor> FWGUIManager::m_tasks [private]

Definition at line 279 of file FWGUIManager.h.

Referenced by subviewIsBeingDestroyed().

Definition at line 250 of file FWGUIManager.h.

ViewMap_t FWGUIManager::m_viewMap [mutable, private]
TEveWindowPack* FWGUIManager::m_viewPrimPack [private]
TEveWindowPack* FWGUIManager::m_viewSecPack [private]
int FWGUIManager::m_WMDecorH [private]

Definition at line 281 of file FWGUIManager.h.

Referenced by measureWMOffsets(), resetWMOffsets(), and setWindowInfoFrom().

Definition at line 281 of file FWGUIManager.h.

Referenced by measureWMOffsets(), resetWMOffsets(), and setWindowInfoFrom().

Definition at line 281 of file FWGUIManager.h.

Referenced by measureWMOffsets(), resetWMOffsets(), and setWindowInfoFrom().

sigc::signal<void, const TGWindow*> FWGUIManager::showEventFilterGUI_
sigc::signal<void, const std::string&> FWGUIManager::writeToConfigurationFile_

Definition at line 209 of file FWGUIManager.h.

Referenced by promptForSaveConfigurationFile().

Definition at line 213 of file FWGUIManager.h.

Referenced by FWGUIManager().