CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
51 public:
53  virtual ~CmsShowMainBase();
54 
63  {
64  assert(m_guiManager.get() && "Call CmsShowMainBase::setup first!");
65  return m_guiManager.get();
66  }
67 
69 
72  FWJobMetadataManager *metadataManager);
73 
74  void setupActions();
75  void setupViewManagers();
76 
77  // Configuration handling.
79  const char *configFilename() const { return m_configFileName.c_str(); };
80 
87  void setupConfiguration();
88 
90  void draw();
91 
92  // Geometry handling
93  void loadGeometry();
96  FWGeometry& getGeom() { return m_geom; }
97 
99 
100  // Event navigation.
101  void doFirstEvent();
102  void doPreviousEvent();
103  void doNextEvent();
104  void doLastEvent();
106  virtual void checkPosition() = 0;
107  bool forward() const { return m_forward; }
108  bool loop() const { return m_loop; }
109  virtual void quit() = 0;
110 
111  void setupAutoLoad(float x);
112  void startAutoLoadTimer();
113  void stopAutoLoadTimer();
114  void setupDebugSupport();
115 
116  void setPlayDelay(Float_t val);
117  void playForward();
118  void playBackward();
119  bool isPlaying() const { return m_isPlaying; }
120 
122  virtual void stopPlaying();
123  virtual void autoLoadNewEvent() = 0;
124 
125  void setPlayLoop();
126  void unsetPlayLoop();
127 
130 
131  class SignalTimer : public TTimer {
132  public:
133  virtual Bool_t Notify() {
134  timeout_();
135  return true;
136  }
137  sigc::signal<void> timeout_;
138  };
139 
140 protected:
141  void eventChangedSlot();
142  virtual void eventChangedImp();
143  void sendVersionInfo();
145 
146 private:
147  // The base class is responsible for the destruction of fwlite / FF
148  // agnostic managers.
149  std::auto_ptr<FWModelChangeManager> m_changeManager;
150  std::auto_ptr<FWColorManager> m_colorManager;
151  std::auto_ptr<FWConfigurationManager> m_configurationManager;
152  std::auto_ptr<FWEventItemsManager> m_eiManager;
153  std::auto_ptr<FWGUIManager> m_guiManager;
154  std::auto_ptr<FWSelectionManager> m_selectionManager;
155  std::auto_ptr<CmsShowTaskExecutor> m_startupTasks;
156  std::auto_ptr<FWViewManagerManager> m_viewManager;
157 
158 
159 
160  std::auto_ptr<SignalTimer> m_autoLoadTimer;
161 
162  // These are actually set by the concrete implementation via the setup
163  // method.
167 
168  void setPlayLoopImp();
169  void unsetPlayLoopImp();
170 
174  bool m_forward;
176  bool m_loop;
177  Float_t m_playDelay;
182 };
183 
184 #endif
sigc::signal< void > timeout_
void partialWriteToConfigFile(const std::string &config)
FWSelectionManager * selectionManager()
FWModelChangeManager * modelChangeManager()
std::auto_ptr< FWConfigurationManager > m_configurationManager
std::string m_geometryFilename
FWGUIManager * guiManager()
FWColorManager * colorManager()
void writeToConfigFile(const std::string &config)
void setAutoSaveAllViewsHeight(int x)
FWEventItemsManager * eiManager()
assert(m_qm.get())
unsigned long long EventNumber_t
void partialLoadConfiguration(const std::string &config)
const char * configFilename() const
std::auto_ptr< FWSelectionManager > m_selectionManager
std::auto_ptr< FWEventItemsManager > m_eiManager
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
unsigned int LuminosityBlockNumber_t
void writePartialToConfigFile()
virtual void checkPosition()=0
FWModelChangeManager * changeManager()
static const char * fmt
Definition: Version.cc:9
virtual ~CmsShowMainBase()
void setupAutoLoad(float x)
FWNavigatorBase * m_navigatorPtr
void setGeometryFilename(const std::string &filename)
void reloadConfiguration(const std::string &config)
virtual void stopPlaying()
bool loop() const
CmsShowTaskExecutor * startupTasks()
std::auto_ptr< SignalTimer > m_autoLoadTimer
void setPlayDelay(Float_t val)
virtual void eventChangedImp()
virtual void quit()=0
virtual void checkKeyBindingsOnPLayEventsStateChanged()
FWJobMetadataManager * m_metadataManagerPtr
fireworks::Context * context()
double f[11][100]
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
void setSimGeometryFilename(const std::string &filename)
FWViewManagerManager * viewManager()
virtual void autoLoadNewEvent()=0
std::string m_simGeometryFilename
void setAutoSaveAllViewsFormat(const std::string &fmt)
fireworks::Context * m_contextPtr
bool isPlaying() const
FWGeometry & getGeom()
FWConfigurationManager * configurationManager()
void writeToCurrentConfigFile()
std::string m_autoSaveAllViewsFormat
tuple filename
Definition: lut2db_cfg.py:20
std::auto_ptr< FWModelChangeManager > m_changeManager
void registerPhysicsObject(const FWPhysicsObjectDesc &iItem)
unsigned int RunNumber_t
bool forward() const
const std::string & geometryFilename(void)
void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
std::auto_ptr< FWViewManagerManager > m_viewManager
std::auto_ptr< FWColorManager > m_colorManager
std::auto_ptr< FWGUIManager > m_guiManager
void setConfigFilename(const std::string &f)
std::string m_configFileName