CMS 3D CMS Logo

CmsShowMainBase.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_CmsShowMainBase_h
2 #define Fireworks_Core_CmsShowMainBase_h
3 
6 
8 
9 #include <memory>
10 #include <string>
11 #include <cassert>
12 #include "sigc++/signal.h"
13 
14 #include "TTimer.h"
15 
17 class FWGUIManager;
19 class FWNavigatorBase;
20 
21 // replace forfard declaration with include to avoid compilation warnigs
22 /*
23 class FWModelChangeManager;
24 class FWSelectionManager;
25 class FWViewManagerManager;
26 class CmsShowTaskExecutor;
27 class FWChangeManager;
28 class FWColorManager;
29 class FWConfigurationManager;
30 */
38 
39 namespace fireworks {
40  class Context;
41 }
42 
50 public:
52  virtual ~CmsShowMainBase() noexcept(false);
53 
62  assert(m_guiManager.get() && "Call CmsShowMainBase::setup first!");
63  return m_guiManager.get();
64  }
65 
67 
69 
70  void setupActions();
71  void setupViewManagers();
72 
73  // Configuration handling.
75  const char *configFilename() const { return m_configFileName.c_str(); };
76 
83  void setupConfiguration();
84 
85  void registerPhysicsObject(const FWPhysicsObjectDesc &iItem);
86  void draw();
87 
88  // Geometry handling
89  void loadGeometry();
92  FWGeometry &getGeom() { return m_geom; }
93 
94  void setSimGeometryFilename(const std::string &filename, const std::string &geoname) {
96  m_TGeoName = geoname;
97  }
98 
99  // Event navigation.
100  void doFirstEvent();
101  void doPreviousEvent();
102  void doNextEvent();
103  void doLastEvent();
105  virtual void checkPosition() = 0;
106  bool forward() const { return m_forward; }
107  bool loop() const { return m_loop; }
108  virtual void quit() = 0;
109 
110  void setupAutoLoad(float x);
111  void startAutoLoadTimer();
112  void stopAutoLoadTimer();
113  void setupDebugSupport();
114 
115  void setPlayDelay(Float_t val);
116  void playForward();
117  void playBackward();
118  bool isPlaying() const { return m_isPlaying; }
119 
121  virtual void stopPlaying();
122  virtual void autoLoadNewEvent() = 0;
123 
124  void setPlayLoop();
125  void unsetPlayLoop();
126 
129 
130  class SignalTimer : public TTimer {
131  public:
132  Bool_t Notify() override {
133  timeout_();
134  return true;
135  }
136  sigc::signal<void> timeout_;
137  };
138 
139 protected:
140  void eventChangedSlot();
141  virtual void eventChangedImp();
142  void sendVersionInfo();
144 
145 private:
146  // The base class is responsible for the destruction of fwlite / FF
147  // agnostic managers.
148  std::unique_ptr<FWModelChangeManager> m_changeManager;
149  std::unique_ptr<FWColorManager> m_colorManager;
150  std::unique_ptr<FWConfigurationManager> m_configurationManager;
151  std::unique_ptr<FWEventItemsManager> m_eiManager;
152  std::unique_ptr<FWGUIManager> m_guiManager;
153  std::unique_ptr<FWSelectionManager> m_selectionManager;
154  std::unique_ptr<CmsShowTaskExecutor> m_startupTasks;
155  std::unique_ptr<FWViewManagerManager> m_viewManager;
156 
157  std::unique_ptr<SignalTimer> m_autoLoadTimer;
158 
159  // These are actually set by the concrete implementation via the setup
160  // method.
164 
165  void setPlayLoopImp();
166  void unsetPlayLoopImp();
167 
171  bool m_forward;
173  bool m_loop;
174  Float_t m_playDelay;
180 };
181 
182 #endif
CmsShowMainBase::configFilename
const char * configFilename() const
Definition: CmsShowMainBase.h:75
CmsShowMainBase::m_autoLoadTimer
std::unique_ptr< SignalTimer > m_autoLoadTimer
Definition: CmsShowMainBase.h:157
CmsShowMainBase::quit
virtual void quit()=0
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
CmsShowMainBase::m_metadataManagerPtr
FWJobMetadataManager * m_metadataManagerPtr
Definition: CmsShowMainBase.h:162
FWModelChangeManager.h
CmsShowMainBase::configurationManager
FWConfigurationManager * configurationManager()
Definition: CmsShowMainBase.h:56
CmsShowMainBase::m_configFileName
std::string m_configFileName
Definition: CmsShowMainBase.h:175
FWNavigatorBase
Definition: FWNavigatorBase.h:27
CmsShowMainBase::checkPosition
virtual void checkPosition()=0
fireworks::Context
Definition: Context.h:41
FWGUIManager
Definition: FWGUIManager.h:95
CmsShowMainBase::changeManager
FWModelChangeManager * changeManager()
Definition: CmsShowMainBase.h:54
FWGeometry
Definition: FWGeometry.h:27
CmsShowMainBase::unsetPlayLoop
void unsetPlayLoop()
Definition: CmsShowMainBase.cc:361
CmsShowMainBase::setupConfiguration
void setupConfiguration()
Definition: CmsShowMainBase.cc:322
CmsShowMainBase::eventChangedImp
virtual void eventChangedImp()
Definition: CmsShowMainBase.cc:145
CmsShowMainBase::writeToConfigFile
void writeToConfigFile(const std::string &config)
Definition: CmsShowMainBase.cc:246
CmsShowMainBase::loadGeometry
void loadGeometry()
Definition: CmsShowMainBase.cc:395
CmsShowMainBase::reloadConfiguration
void reloadConfiguration(const std::string &config)
Definition: CmsShowMainBase.cc:258
CmsShowMainBase::goToRunEvent
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
Definition: CmsShowMainBase.cc:170
CmsShowMainBase::guiManager
FWGUIManager * guiManager()
Definition: CmsShowMainBase.h:61
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HLT_FULL_cff.navigator
navigator
Definition: HLT_FULL_cff.py:13126
CmsShowMainBase::loop
bool loop() const
Definition: CmsShowMainBase.h:107
FWEventItemsManager
Definition: FWEventItemsManager.h:44
CmsShowMainBase::m_isPlaying
bool m_isPlaying
Definition: CmsShowMainBase.h:172
CmsShowMainBase::unsetPlayLoopImp
void unsetPlayLoopImp()
Definition: CmsShowMainBase.cc:370
cms::cuda::assert
assert(be >=bs)
CmsShowMainBase::setSimGeometryFilename
void setSimGeometryFilename(const std::string &filename, const std::string &geoname)
Definition: CmsShowMainBase.h:94
CmsShowMainBase::m_viewManager
std::unique_ptr< FWViewManagerManager > m_viewManager
Definition: CmsShowMainBase.h:155
CmsShowMainBase::doFirstEvent
void doFirstEvent()
Definition: CmsShowMainBase.cc:147
CmsShowMainBase::setup
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
Definition: CmsShowMainBase.cc:199
Context
DDAxes::x
FWModelChangeManager
Definition: FWModelChangeManager.h:33
CmsShowMainBase::setAutoSaveAllViewsHeight
void setAutoSaveAllViewsHeight(int x)
Definition: CmsShowMainBase.h:128
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
CmsShowMainBase::doLastEvent
void doLastEvent()
Definition: CmsShowMainBase.cc:164
CmsShowMainBase::setConfigFilename
void setConfigFilename(const std::string &f)
Definition: CmsShowMainBase.h:74
CmsShowMainBase::m_autoLoadTimerRunning
bool m_autoLoadTimerRunning
Definition: CmsShowMainBase.h:170
CmsShowMainBase::SignalTimer
Definition: CmsShowMainBase.h:130
CmsShowMainBase::SignalTimer::timeout_
sigc::signal< void > timeout_
Definition: CmsShowMainBase.h:136
CmsShowMainBase::playBackward
void playBackward()
Definition: CmsShowMainBase.cc:387
CmsShowMainBase::partialWriteToConfigFile
void partialWriteToConfigFile(const std::string &config)
Definition: CmsShowMainBase.cc:253
config
Definition: config.py:1
FWSelectionManager.h
CmsShowMainBase::doNextEvent
void doNextEvent()
Definition: CmsShowMainBase.cc:153
FWConfigurationManager
Definition: FWConfigurationManager.h:32
CmsShowMainBase::setupActions
void setupActions()
Definition: CmsShowMainBase.cc:74
FWJobMetadataManager
Definition: FWJobMetadataManager.h:18
FWColorManager.h
CmsShowMainBase::setAutoSaveAllViewsFormat
void setAutoSaveAllViewsFormat(const std::string &fmt)
Definition: CmsShowMainBase.h:127
CmsShowMainBase::CmsShowMainBase
CmsShowMainBase()
Definition: CmsShowMainBase.cc:50
CmsShowMainBase::SignalTimer::Notify
Bool_t Notify() override
Definition: CmsShowMainBase.h:132
CmsShowMainBase
Definition: CmsShowMainBase.h:49
CmsShowMainBase::m_changeManager
std::unique_ptr< FWModelChangeManager > m_changeManager
Definition: CmsShowMainBase.h:148
CmsShowMainBase::doPreviousEvent
void doPreviousEvent()
Definition: CmsShowMainBase.cc:159
EventID.h
CmsShowMainBase::writePartialToConfigFile
void writePartialToConfigFile()
CmsShowMainBase::autoLoadNewEvent
virtual void autoLoadNewEvent()=0
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
CmsShowMainBase::m_geometryFilename
std::string m_geometryFilename
Definition: CmsShowMainBase.h:176
CmsShowMainBase::m_guiManager
std::unique_ptr< FWGUIManager > m_guiManager
Definition: CmsShowMainBase.h:152
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
CmsShowMainBase::colorManager
FWColorManager * colorManager()
Definition: CmsShowMainBase.h:55
CmsShowMainBase::m_forward
bool m_forward
Definition: CmsShowMainBase.h:171
CmsShowMainBase::m_eiManager
std::unique_ptr< FWEventItemsManager > m_eiManager
Definition: CmsShowMainBase.h:151
CmsShowMainBase::setupAutoLoad
void setupAutoLoad(float x)
Definition: CmsShowMainBase.cc:301
CmsShowMainBase::m_colorManager
std::unique_ptr< FWColorManager > m_colorManager
Definition: CmsShowMainBase.h:149
CmsShowMainBase::isPlaying
bool isPlaying() const
Definition: CmsShowMainBase.h:118
CmsShowMainBase::draw
void draw()
Definition: CmsShowMainBase.cc:176
CmsShowTaskExecutor.h
CmsShowMainBase::startupTasks
CmsShowTaskExecutor * startupTasks()
Definition: CmsShowMainBase.h:66
CmsShowTaskExecutor
Definition: CmsShowTaskExecutor.h:30
CmsShowMainBase::m_contextPtr
fireworks::Context * m_contextPtr
Definition: CmsShowMainBase.h:163
CmsShowMainBase::stopPlaying
virtual void stopPlaying()
Definition: CmsShowMainBase.cc:374
CmsShowMainBase::modelChangeManager
FWModelChangeManager * modelChangeManager()
Definition: CmsShowMainBase.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CmsShowMainBase::setupDebugSupport
void setupDebugSupport()
Definition: CmsShowMainBase.cc:349
FWViewManagerManager
Definition: FWViewManagerManager.h:37
CmsShowMainBase::m_configurationManager
std::unique_ptr< FWConfigurationManager > m_configurationManager
Definition: CmsShowMainBase.h:150
FWGeometry.h
CmsShowMainBase::startAutoLoadTimer
void startAutoLoadTimer()
Definition: CmsShowMainBase.cc:310
CmsShowMainBase::m_loop
bool m_loop
Definition: CmsShowMainBase.h:173
CmsShowMainBase::setPlayLoopImp
void setPlayLoopImp()
Definition: CmsShowMainBase.cc:368
FWSelectionManager
Definition: FWSelectionManager.h:34
CmsShowMainBase::geometryFilename
const std::string & geometryFilename(void)
Definition: CmsShowMainBase.h:91
CmsShowMainBase::viewManager
FWViewManagerManager * viewManager()
Definition: CmsShowMainBase.h:60
CmsShowMainBase::setPlayDelay
void setPlayDelay(Float_t val)
Definition: CmsShowMainBase.cc:347
FWPhysicsObjectDesc
Definition: FWPhysicsObjectDesc.h:30
CmsShowMainBase::setupViewManagers
void setupViewManagers()
Definition: CmsShowMainBase.cc:110
CmsShowMainBase::m_autoSaveAllViewsFormat
std::string m_autoSaveAllViewsFormat
Definition: CmsShowMainBase.h:168
CmsShowMainBase::m_TGeoName
std::string m_TGeoName
Definition: CmsShowMainBase.h:179
CmsShowMainBase::setGeometryFilename
void setGeometryFilename(const std::string &filename)
Definition: CmsShowMainBase.h:90
CmsShowMainBase::stopAutoLoadTimer
void stopAutoLoadTimer()
Definition: CmsShowMainBase.cc:317
CmsShowMainBase::playForward
void playForward()
Definition: CmsShowMainBase.cc:379
CmsShowMainBase::selectionManager
FWSelectionManager * selectionManager()
Definition: CmsShowMainBase.h:59
CmsShowMainBase::forward
bool forward() const
Definition: CmsShowMainBase.h:106
FWColorManager
Definition: FWColorManager.h:45
FWPhysicsObjectDesc.h
CmsShowMainBase::eventChangedSlot
void eventChangedSlot()
Definition: CmsShowMainBase.cc:143
CmsShowMainBase::m_navigatorPtr
FWNavigatorBase * m_navigatorPtr
Definition: CmsShowMainBase.h:161
CmsShowMainBase::partialLoadConfiguration
void partialLoadConfiguration(const std::string &config)
Definition: CmsShowMainBase.cc:297
heppy_batch.val
val
Definition: heppy_batch.py:351
CmsShowMainBase::~CmsShowMainBase
virtual ~CmsShowMainBase() noexcept(false)
Definition: CmsShowMainBase.cc:72
CmsShowMainBase::sendVersionInfo
void sendVersionInfo()
Definition: CmsShowMainBase.cc:407
CmsShowMainBase::m_geom
FWGeometry m_geom
Definition: CmsShowMainBase.h:177
CmsShowMainBase::m_playDelay
Float_t m_playDelay
Definition: CmsShowMainBase.h:174
CmsShowMainBase::m_startupTasks
std::unique_ptr< CmsShowTaskExecutor > m_startupTasks
Definition: CmsShowMainBase.h:154
FWEventItemsManager.h
CmsShowMainBase::context
fireworks::Context * context()
Definition: CmsShowMainBase.h:143
CmsShowMainBase::setPlayLoop
void setPlayLoop()
Definition: CmsShowMainBase.cc:354
CmsShowMainBase::m_selectionManager
std::unique_ptr< FWSelectionManager > m_selectionManager
Definition: CmsShowMainBase.h:153
CmsShowMainBase::registerPhysicsObject
void registerPhysicsObject(const FWPhysicsObjectDesc &iItem)
Definition: CmsShowMainBase.cc:372
fireworks
Definition: FWTauProxyBuilderBase.h:35
CmsShowMainBase::eiManager
FWEventItemsManager * eiManager()
Definition: CmsShowMainBase.h:57
CmsShowMainBase::checkKeyBindingsOnPLayEventsStateChanged
virtual void checkKeyBindingsOnPLayEventsStateChanged()
Definition: CmsShowMainBase.h:120
FWConfigurationManager.h
CmsShowMainBase::getGeom
FWGeometry & getGeom()
Definition: CmsShowMainBase.h:92
CmsShowMainBase::m_autoSaveAllViewsHeight
int m_autoSaveAllViewsHeight
Definition: CmsShowMainBase.h:169
CmsShowMainBase::writeToCurrentConfigFile
void writeToCurrentConfigFile()
Definition: CmsShowMainBase.cc:251
CmsShowMainBase::m_simGeometryFilename
std::string m_simGeometryFilename
Definition: CmsShowMainBase.h:178
FWViewManagerManager.h