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 
70  void setup(FWNavigatorBase *navigator,
71  fireworks::Context *context,
72  FWJobMetadataManager *metadataManager);
73 
74  void setupActions();
75  void setupViewManagers();
76 
77  // Configuration handling.
78  void setConfigFilename(const std::string &f) { m_configFileName = f; };
79  const char *configFilename() const { return m_configFileName.c_str(); };
80 
81  void writeToConfigFile(const std::string &config);
83  void reloadConfiguration(const std::string &config);
84  void setupConfiguration();
85 
87  void draw();
88 
89  // Geometry handling
90  void loadGeometry();
92  const std::string &geometryFilename(void) { return m_geometryFilename; }
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 
125 
126 protected:
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  void eventChangedSlot();
137  virtual void eventChangedImp();
138  void sendVersionInfo();
139 
140 private:
141  // The base class is responsible for the destruction of fwlite / FF
142  // agnostic managers.
143  std::auto_ptr<FWModelChangeManager> m_changeManager;
144  std::auto_ptr<FWColorManager> m_colorManager;
145  std::auto_ptr<FWConfigurationManager> m_configurationManager;
146  std::auto_ptr<FWEventItemsManager> m_eiManager;
147  std::auto_ptr<FWGUIManager> m_guiManager;
148  std::auto_ptr<FWSelectionManager> m_selectionManager;
149  std::auto_ptr<CmsShowTaskExecutor> m_startupTasks;
150  std::auto_ptr<FWViewManagerManager> m_viewManager;
151 
152 
153 
154  std::auto_ptr<SignalTimer> m_autoLoadTimer;
155 
156  // These are actually set by the concrete implementation via the setup
157  // method.
161 
162  void setPlayLoopImp();
163  void unsetPlayLoopImp();
164 
167  bool m_forward;
169  bool m_loop;
170  Float_t m_playDelay;
171  std::string m_configFileName;
172  std::string m_geometryFilename;
175 };
176 
177 #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)
unsigned int EventNumber_t
Definition: EventID.h:30
FWEventItemsManager * eiManager()
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
Definition: EventID.h:31
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
Definition: EventRange.h:32
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