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 
71  fireworks::Context *context,
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 
84  void setupConfiguration();
85 
87  void draw();
88 
89  // Geometry handling
90  void loadGeometry();
93  FWGeometry& getGeom() { return m_geom; }
94 
96 
97  // Event navigation.
98  void doFirstEvent();
99  void doPreviousEvent();
100  void doNextEvent();
101  void doLastEvent();
103  virtual void checkPosition() = 0;
104  bool forward() const { return m_forward; }
105  bool loop() const { return m_loop; }
106  virtual void quit() = 0;
107 
108  void setupAutoLoad(float x);
109  void startAutoLoadTimer();
110  void stopAutoLoadTimer();
111  void setupDebugSupport();
112 
113  void setPlayDelay(Float_t val);
114  void playForward();
115  void playBackward();
116  bool isPlaying() const { return m_isPlaying; }
118  virtual void stopPlaying() = 0;
119  virtual void autoLoadNewEvent() = 0;
120 
121  void setPlayLoop();
122  void unsetPlayLoop();
123 
126 
127  class SignalTimer : public TTimer {
128  public:
129  virtual Bool_t Notify() {
130  timeout_();
131  return true;
132  }
133  sigc::signal<void> timeout_;
134  };
135 
136 protected:
137  void eventChangedSlot();
138  virtual void eventChangedImp();
139  void sendVersionInfo();
140 
141 private:
142  // The base class is responsible for the destruction of fwlite / FF
143  // agnostic managers.
144  std::auto_ptr<FWModelChangeManager> m_changeManager;
145  std::auto_ptr<FWColorManager> m_colorManager;
146  std::auto_ptr<FWConfigurationManager> m_configurationManager;
147  std::auto_ptr<FWEventItemsManager> m_eiManager;
148  std::auto_ptr<FWGUIManager> m_guiManager;
149  std::auto_ptr<FWSelectionManager> m_selectionManager;
150  std::auto_ptr<CmsShowTaskExecutor> m_startupTasks;
151  std::auto_ptr<FWViewManagerManager> m_viewManager;
152 
153 
154 
155  std::auto_ptr<SignalTimer> m_autoLoadTimer;
156 
157  // These are actually set by the concrete implementation via the setup
158  // method.
162 
163  void setPlayLoopImp();
164  void unsetPlayLoopImp();
165 
169  bool m_forward;
171  bool m_loop;
172  Float_t m_playDelay;
177 };
178 
179 #endif
sigc::signal< void > timeout_
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
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
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)
bool loop() const
CmsShowTaskExecutor * startupTasks()
std::auto_ptr< SignalTimer > m_autoLoadTimer
void setPlayDelay(Float_t val)
virtual void eventChangedImp()
virtual void quit()=0
FWJobMetadataManager * m_metadataManagerPtr
double f[11][100]
std::auto_ptr< CmsShowTaskExecutor > m_startupTasks
void setIsPlaying(bool value)
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
virtual void stopPlaying()=0
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
Definition: DDAxes.h:10
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