CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWGUIManager.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef Fireworks_Core_FWGUIManager_h
3 #define Fireworks_Core_FWGUIManager_h
4 //
5 // Package: Core
6 // Class : FWGUIManager
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Feb 11 10:52:24 EST 2008
19 //
20 
21 // system include files
22 #include <map>
23 #include <boost/function.hpp>
24 #include <boost/shared_ptr.hpp>
25 #include <sigc++/sigc++.h>
26 #include "Rtypes.h"
27 #include "GuiTypes.h"
28 #include "TGFileDialog.h"
29 #include <memory>
30 
31 // user include files
34 
35 // forward declarations
36 class TGPictureButton;
37 class TGComboBox;
38 class TGTextButton;
39 class TGTextEntry;
40 class TGFrame;
41 class TGSplitFrame;
42 class TGVerticalFrame;
43 class TGMainFrame;
44 class TGPack;
45 class TGCompositeFrame;
46 class TGCheckButton;
47 class TGPopupMenu;
48 
49 class TGListTreeItem;
50 class TGListTree;
51 class TEveElementList;
52 class TEveElement;
53 class TEveWindowPack;
54 class TEveWindowSlot;
55 class TEveCompositeFrame;
56 class TEveWindow;
57 
58 class CmsShowMainFrame;
59 class FWEventItem;
60 class FWViewBase;
61 class FWGUISubviewArea;
62 
63 class FWSelectionManager;
64 class FWSummaryManager;
66 class FWInvMassDialog;
67 class CSGAction;
69 
71 
73 
74 class FWNavigatorBase;
75 
78 class TGWindow;
79 
80 namespace edm {
81  class EventBase;
82 }
83 
84 class CmsShowEDI;
85 class CmsShowModelPopup;
86 class CmsShowViewPopup;
88 class CmsShowCommonPopup;
89 class CmsShowHelpPopup;
90 
91 namespace fireworks {
92  class Context;
93 }
94 
96 {
97  // typedefs
98 public:
99  typedef boost::function2<FWViewBase*,TEveWindowSlot*, const std::string& > ViewBuildFunctor;
100  typedef std::map<std::string, ViewBuildFunctor > NameToViewBuilder;
101 private:
102  typedef std::map<TEveWindow*, FWViewBase*> ViewMap_t;
103  typedef ViewMap_t::iterator ViewMap_i;
104 
105 
106 public:
108  const FWViewManagerManager* iVMMgr,
110 
111  virtual ~FWGUIManager();
112  void evePreTerminate();
113 
114  //configuration management interface
115  void addTo(FWConfiguration&) const;
116  void setFrom(const FWConfiguration&);
117  void setWindowInfoFrom(const FWConfiguration& iFrom, TGMainFrame* iFrame);
118 
119  TGVerticalFrame* createList(TGCompositeFrame *p);
120  void createViews(TEveWindowSlot *slot);
121  void exportImageOfMainView();
122  void exportImagesOfAllViews();
123  void exportAllViews(const std::string& format, int height);
124 
125  void createEDIFrame();
127  void showEDIFrame(int iInfoToShow=-1);
128 
129  void showCommonPopup();
130 
131  void createModelPopup();
132  void showModelPopup();
133  void showViewPopup();
134  void popupViewClosed();
135 
136  void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase* iHandler);
137 
138  void showInvMassDialog();
139  // void showGeometryBrowser();
140 
141  // help
142  void createHelpPopup ();
143  void createShortcutPopup ();
144  void createHelpGLPopup ();
145 
146  // ---------- const member functions ---------------------
147  // bool waitingForUserAction() const;
151 
152  // ---------- static member functions --------------------
153  static FWGUIManager* getGUIManager();
154  static TGFrame* makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height);
155 
156  // ---------- member functions ---------------------------
157  //have to use the portable syntax else the reflex code will not build
158  void registerViewBuilder(const std::string& iName,
159  ViewBuildFunctor& iBuilder);
160 
161 
162  ViewMap_i createView(const std::string& iName, TEveWindowSlot* slot = 0);
163  void newViewSlot(const std::string& iName);
164 
166  void enableActions(bool enable = true);
167  void disablePrevious();
168  void disableNext();
169  void setPlayMode(bool);
170  void updateStatus(const char* status);
171  void clearStatus();
172  void eventChangedCallback();
173 
175 
176  void addData();
177  void titleChanged(const char *title);
178 
179  void openEveBrowserForDebugging() const;
180  void setDelayBetweenEvents(Float_t);
181 
182  void showEventFilterGUI();
183  void filterButtonClicked();
184  void setFilterButtonText(const char* txt);
185  void setFilterButtonIcon(int);
186  void updateEventFilterEnable(bool);
187 
188  void runIdChanged();
189  void lumiIdChanged();
190  void eventIdChanged();
191  void checkSubviewAreaIconState(TEveWindow*);
193  void subviewDestroy(FWGUISubviewArea*); // timeout funct
194  void subviewDestroyAll();
198 
200  const edm::EventBase* getCurrentEvent() const;
201 
202  void resetWMOffsets();
203 
204  // signals
205  sigc::signal<void> filterButtonClicked_;
206  sigc::signal<void, const TGWindow*> showEventFilterGUI_;
207  sigc::signal<void, const std::string&> writeToConfigurationFile_;
208  sigc::signal<void, const std::string&> writePartialToConfigurationFile_;
209  sigc::signal<void, const std::string&> loadFromConfigurationFile_;
210  sigc::signal<void, const std::string&> loadPartialFromConfigurationFile_;
211  sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
212  sigc::signal<void> goingToQuit_;
214 
215  sigc::signal<void> changedRunEntry_;
216  sigc::signal<void> changedEventEntry_;
217  sigc::signal<void, Float_t> changedDelayBetweenEvents_;
218 
219 private:
220  FWGUIManager(const FWGUIManager&); // stop default
221  const FWGUIManager& operator=(const FWGUIManager&); // stop default
222 
223  TEveWindow* getSwapCandidate();
224 
225  void newItem(const FWEventItem*);
226 
227  bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode);
233 
234  void delaySliderChanged(Int_t);
235 
236  void finishUpColorChange();
237 
238  void setViewPopup(TEveWindow*);
239 
240  void measureWMOffsets();
241 
242  // ---------- static member data --------------------------------
243 
245 
246  // ---------- member data --------------------------------
248 
250 
251  //views are owned by their individual view managers
257 
258  TGPopupMenu* m_fileMenu;
260 
261  // event data inspector
267 
268  // help
272 
273  // subview memebers
276 
277  TEveWindowPack *m_viewPrimPack;
278  TEveWindowPack *m_viewSecPack;
279 
280  sigc::connection m_modelChangeConn;
281 
282  std::auto_ptr<CmsShowTaskExecutor> m_tasks;
283 
285 };
286 
287 
288 #endif
TGVerticalFrame * createList(TGCompositeFrame *p)
void promptForPartialSaveConfigurationFile()
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:213
void popupViewClosed()
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:103
std::map< std::string, ViewBuildFunctor > NameToViewBuilder
Definition: FWGUIManager.h:100
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:205
ViewMap_t m_viewMap
Definition: FWGUIManager.h:274
void showModelPopup()
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:208
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:275
list parent
Definition: dbtoconf.py:74
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:262
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:249
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:210
void setFilterButtonIcon(int)
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:266
void setViewPopup(TEveWindow *)
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:280
void newViewSlot(const std::string &iName)
void addTo(FWConfiguration &) const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:244
void delaySliderChanged(Int_t)
void updateStatus(const char *status)
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:258
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:252
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:277
void showEDIFrame(int iInfoToShow=-1)
Allowed values are -1 or ones from FWDataCategories enum.
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:99
void enableActions(bool enable=true)
std::auto_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:282
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:278
void setWindowInfoFrom(const FWConfiguration &iFrom, TGMainFrame *iFrame)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
void checkSubviewAreaIconState(TEveWindow *)
void connectSubviewAreaSignals(FWGUISubviewArea *)
const FWGUIManager & operator=(const FWGUIManager &)
void createShortcutPopup()
void setPlayMode(bool)
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:264
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:217
TEveWindow * getSwapCandidate()
void resetWMOffsets()
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:255
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:206
void setDelayBetweenEvents(Float_t)
void exportImagesOfAllViews()
void subviewDestroy(FWGUISubviewArea *)
tuple result
Definition: query.py:137
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:256
void newItem(const FWEventItem *)
void filterButtonClicked()
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:259
void exportImageOfMainView()
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:199
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:263
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:215
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:265
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:271
void setFrom(const FWConfiguration &)
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:253
void eventChangedCallback()
void savePartialToConfigurationFile()
void clearStatus()
const edm::EventBase * getCurrentEvent() const
ViewMap_i createView(const std::string &iName, TEveWindowSlot *slot=0)
CSGAction * getAction(const std::string name)
sigc::signal< void > changedEventEntry_
Definition: FWGUIManager.h:216
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:247
bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode)
CSGContinuousAction * playEventsBackwardsAction()
void finishUpColorChange()
void exportAllViews(const std::string &format, int height)
void setFilterButtonText(const char *txt)
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:207
virtual ~FWGUIManager()
CSGContinuousAction * playEventsAction()
void subviewSwapped(FWGUISubviewArea *)
FWGUIManager(fireworks::Context *ctx, const FWViewManagerManager *iVMMgr, FWNavigatorBase *navigator)
void showEventFilterGUI()
void evePreTerminate()
void promptForPartialLoadConfigurationFile()
void subviewInfoUnselected(FWGUISubviewArea *)
void promptForSaveConfigurationFile()
void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
void createEDIFrame()
tuple status
Definition: ntuplemaker.py:245
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:102
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:209
void titleChanged(const char *title)
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:254
void disableNext()
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:211
void measureWMOffsets()
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:212
void showCommonPopup()
void runIdChanged()
void showViewPopup()
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:269
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:270