CMS 3D CMS Logo

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 <sigc++/sigc++.h>
25 #include "Rtypes.h"
26 #include "GuiTypes.h"
27 #include "TGFileDialog.h"
28 #include <memory>
29 
30 // user include files
33 
34 // forward declarations
35 class TGPictureButton;
36 class TGComboBox;
37 class TGTextButton;
38 class TGTextEntry;
39 class TGFrame;
40 class TGSplitFrame;
41 class TGVerticalFrame;
42 class TGMainFrame;
43 class TGPack;
44 class TGCompositeFrame;
45 class TGCheckButton;
46 class TGPopupMenu;
47 
48 class TGListTreeItem;
49 class TGListTree;
50 class TEveElementList;
51 class TEveElement;
52 class TEveWindowPack;
53 class TEveWindowSlot;
54 class TEveCompositeFrame;
55 class TEveWindow;
56 
57 class CmsShowMainFrame;
58 class FWEventItem;
59 class FWViewBase;
60 class FWGUISubviewArea;
61 
62 class FWSelectionManager;
63 class FWSummaryManager;
65 class FWInvMassDialog;
66 class CSGAction;
68 
70 
72 
73 class FWNavigatorBase;
74 
77 class TGWindow;
78 
79 namespace edm {
80  class EventBase;
81 }
82 
83 class CmsShowEDI;
84 class CmsShowModelPopup;
85 class CmsShowViewPopup;
87 class CmsShowCommonPopup;
88 class CmsShowHelpPopup;
89 
90 namespace fireworks {
91  class Context;
92 }
93 
95 {
96  // typedefs
97 public:
98  typedef boost::function2<FWViewBase*,TEveWindowSlot*, const std::string& > ViewBuildFunctor;
99  typedef std::map<std::string, ViewBuildFunctor > NameToViewBuilder;
100 private:
101  typedef std::map<TEveWindow*, FWViewBase*> ViewMap_t;
102  typedef ViewMap_t::iterator ViewMap_i;
103 
104 
105 public:
107  const FWViewManagerManager* iVMMgr,
109 
110  virtual ~FWGUIManager();
111  void evePreTerminate();
112 
113  //configuration management interface
114  void addTo(FWConfiguration&) const;
115  void setFrom(const FWConfiguration&);
116  void setWindowInfoFrom(const FWConfiguration& iFrom, TGMainFrame* iFrame);
117  void initEmpty();
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 open3DRegion();
130  void showCommonPopup();
131 
132  void createModelPopup();
133  void showModelPopup();
134  void showViewPopup();
135  void popupViewClosed();
136 
137  void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase* iHandler);
138 
139  void showInvMassDialog();
140  // void showGeometryBrowser();
141 
142  // help
143  void createHelpPopup ();
144  void createShortcutPopup ();
145  void createHelpGLPopup ();
146 
147  // ---------- const member functions ---------------------
148  // bool waitingForUserAction() const;
149  CSGContinuousAction* playEventsAction();
150  CSGContinuousAction* playEventsBackwardsAction();
151  CSGContinuousAction* loopAction();
152 
153  // ---------- static member functions --------------------
154  static FWGUIManager* getGUIManager();
155  static TGFrame* makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height);
156 
157  // ---------- member functions ---------------------------
158  //have to use the portable syntax else the reflex code will not build
159  void registerViewBuilder(const std::string& iName,
160  ViewBuildFunctor& iBuilder);
161 
162 
163  ViewMap_i createView(const std::string& iName, TEveWindowSlot* slot = 0);
164  void newViewSlot(const std::string& iName);
165 
166  void connectSubviewAreaSignals(FWGUISubviewArea*);
167  void enableActions(bool enable = true);
168  void disablePrevious();
169  void disableNext();
170  void setPlayMode(bool);
171  void updateStatus(const char* status);
172  void clearStatus();
173  void eventChangedCallback();
174 
175  CSGAction* getAction(const std::string name);
176 
177  void addData();
178  void titleChanged(const char *title);
179 
180  void openEveBrowserForDebugging() const;
181  void setDelayBetweenEvents(Float_t);
182 
183  void showEventFilterGUI();
184  void filterButtonClicked();
185  void setFilterButtonText(const char* txt);
186  void setFilterButtonIcon(int);
187  void updateEventFilterEnable(bool);
188 
189  void runIdChanged();
190  void lumiIdChanged();
191  void eventIdChanged();
192  void checkSubviewAreaIconState(TEveWindow*);
193  void subviewIsBeingDestroyed(FWGUISubviewArea*);
194  void subviewDestroy(FWGUISubviewArea*); // timeout funct
195  void subviewDestroyAll();
196  void subviewInfoSelected(FWGUISubviewArea*);
197  void subviewInfoUnselected(FWGUISubviewArea*);
198  void subviewSwapped(FWGUISubviewArea*);
199 
200  CmsShowMainFrame* getMainFrame() const { return m_cmsShowMainFrame; }
201  const edm::EventBase* getCurrentEvent() const;
202 
203  void resetWMOffsets();
204 
205  // signals
206  sigc::signal<void> filterButtonClicked_;
207  sigc::signal<void, const TGWindow*> showEventFilterGUI_;
208  sigc::signal<void, const std::string&> writeToConfigurationFile_;
209  sigc::signal<void, const std::string&> writePartialToConfigurationFile_;
210  sigc::signal<void, const std::string&> loadFromConfigurationFile_;
211  sigc::signal<void, const std::string&> loadPartialFromConfigurationFile_;
212  sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
213  sigc::signal<void> goingToQuit_;
215 
216  sigc::signal<void> changedRunEntry_;
217  sigc::signal<void> changedEventEntry_;
218  sigc::signal<void, Float_t> changedDelayBetweenEvents_;
219 
220 private:
221  FWGUIManager(const FWGUIManager&); // stop default
222  const FWGUIManager& operator=(const FWGUIManager&); // stop default
223 
224  TEveWindow* getSwapCandidate();
225 
226  void newItem(const FWEventItem*);
227 
228  bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode);
229  void promptForSaveConfigurationFile();
230  void promptForPartialSaveConfigurationFile();
231  void promptForLoadConfigurationFile();
232  void promptForPartialLoadConfigurationFile();
233  void savePartialToConfigurationFile();
234 
235  void delaySliderChanged(Int_t);
236 
237  void finishUpColorChange();
238 
239  void setViewPopup(TEveWindow*);
240 
241  void measureWMOffsets();
242 
243  // ---------- static member data --------------------------------
244 
246 
247  // ---------- member data --------------------------------
249 
251 
252  //views are owned by their individual view managers
258 
259  TGPopupMenu* m_fileMenu;
261 
262  // event data inspector
268 
269  // help
273 
274  // subview memebers
275  mutable ViewMap_t m_viewMap;
276  NameToViewBuilder m_nameToViewBuilder;
277 
278  TEveWindowPack *m_viewPrimPack;
279  TEveWindowPack *m_viewSecPack;
280 
281  sigc::connection m_modelChangeConn;
282 
283  std::auto_ptr<CmsShowTaskExecutor> m_tasks;
284  std::vector<FWViewBase*> m_regionViews;
285  int m_WMOffsetX, m_WMOffsetY, m_WMDecorH;
286 };
287 
288 
289 #endif
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:214
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:102
std::map< std::string, ViewBuildFunctor > NameToViewBuilder
Definition: FWGUIManager.h:99
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:206
ViewMap_t m_viewMap
Definition: FWGUIManager.h:275
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:209
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:276
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:263
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:250
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:211
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:267
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:281
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:245
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:259
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:253
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:278
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:98
std::auto_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:283
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:279
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:265
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:218
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:256
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:207
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:257
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:260
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:200
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:264
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:216
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:266
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:272
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:284
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:254
sigc::signal< void > changedEventEntry_
Definition: FWGUIManager.h:217
fireworks::Context * m_context
Definition: FWGUIManager.h:248
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:208
HLT enums.
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:101
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:210
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:255
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:212
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:213
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:270
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:271