CMS 3D CMS Logo

CSGActionSupervisor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : CSGActionSupervisor
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Aug 2009
11 //
12 #include <sigc++/sigc++.h>
13 
17 
18 // constructors and destructor
19 //
21 
23  for (std::vector<CSGAction*>::iterator it = m_actionList.begin(), itEnd = m_actionList.end(); it != itEnd; ++it) {
24  delete *it;
25  }
26 }
27 
29  std::vector<CSGAction*>::iterator it_act;
30  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
31  if ((*it_act)->getName() == name)
32  return *it_act;
33  }
34  fwLog(fwlog::kWarning) << "No action is found with name " << name.c_str() << std::endl;
35  return nullptr;
36 }
37 
39 
40 const std::vector<CSGAction*>& CSGActionSupervisor::getListOfActions() const { return m_actionList; }
41 
42 void CSGActionSupervisor::defaultAction() { fwLog(fwlog::kInfo) << "Default action.\n"; }
43 
45  std::vector<CSGAction*>::iterator it_act;
46  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
47  if (enable)
48  (*it_act)->globalEnable();
49  else
50  (*it_act)->globalDisable();
51  }
52 }
53 
55  std::vector<CSGAction*>::iterator it_act;
56  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
57  if (entry == (*it_act)->getMenuEntry()) {
58  (*it_act)->activated.emit();
59  return kTRUE;
60  }
61  }
62  return kFALSE;
63 }
64 
66  std::vector<CSGAction*>::iterator it_act;
67  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
68  if ((*it_act)->getToolBarData() && (*it_act)->getToolBarData()->fId == entry) {
69  (*it_act)->activated.emit();
70  return kTRUE;
71  }
72  }
73  return kFALSE;
74 }
75 
77 
79  std::vector<CSGAction*>::iterator it_act;
80  for (it_act = m_actionList.begin(); it_act != m_actionList.end(); ++it_act) {
81  if ((*it_act)->getMenu() == menu && (*it_act)->getKeycode() != 0) {
82  (*it_act)->resizeMenuEntry();
83  }
84  }
85 }
86 
CSGActionSupervisor::CSGActionSupervisor
CSGActionSupervisor()
Definition: CSGActionSupervisor.cc:20
CSGActionSupervisor::enableActions
virtual void enableActions(bool enable=true)
Definition: CSGActionSupervisor.cc:44
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
remoteMonitoring_LED_IterMethod_cfg.enable
enable
Definition: remoteMonitoring_LED_IterMethod_cfg.py:423
CSGActionSupervisor::getToolTipDelay
Long_t getToolTipDelay() const
Definition: CSGActionSupervisor.cc:87
mps_splice.entry
entry
Definition: mps_splice.py:68
CSGAction
Definition: CSGAction.h:38
CSGActionSupervisor.h
CSGActionSupervisor::~CSGActionSupervisor
virtual ~CSGActionSupervisor()
Definition: CSGActionSupervisor.cc:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSGActionSupervisor::getAction
CSGAction * getAction(const std::string &name)
Definition: CSGActionSupervisor.cc:28
CSGActionSupervisor::activateToolBarEntry
Bool_t activateToolBarEntry(int entry)
Definition: CSGActionSupervisor.cc:65
optionsL1T.menu
menu
Definition: optionsL1T.py:29
CSGAction.h
writedatasetfile.action
action
Definition: writedatasetfile.py:8
fwlog::kWarning
Definition: fwLog.h:35
fwLog.h
CSGActionSupervisor::getListOfActions
const std::vector< CSGAction * > & getListOfActions() const
Definition: CSGActionSupervisor.cc:40
CSGActionSupervisor::defaultAction
virtual void defaultAction()
Definition: CSGActionSupervisor.cc:42
fwlog::kInfo
Definition: fwLog.h:35
CSGActionSupervisor::HandleMenu
virtual void HandleMenu(Int_t id)
Definition: CSGActionSupervisor.cc:76
CSGActionSupervisor::resizeMenu
void resizeMenu(TGPopupMenu *menu)
Definition: CSGActionSupervisor.cc:78
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CSGActionSupervisor::addToActionMap
void addToActionMap(CSGAction *action)
Definition: CSGActionSupervisor.cc:38
CSGActionSupervisor::activateMenuEntry
Bool_t activateMenuEntry(int entry)
Definition: CSGActionSupervisor.cc:54
CSGActionSupervisor::m_actionList
std::vector< CSGAction * > m_actionList
Definition: CSGActionSupervisor.h:49
CSGActionSupervisor::m_tooltipDelay
Long_t m_tooltipDelay
Definition: CSGActionSupervisor.h:57