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  ~FWGUIManager() override;
111  void evePreTerminate();
112 
113  //configuration management interface
114  void addTo(FWConfiguration&) const override;
115  void setFrom(const FWConfiguration&) override;
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  fireworks::Context* getContext() { return m_context; }
156  static TGFrame* makeGUIsubview(TEveCompositeFrame* cp, TGCompositeFrame* parent, Int_t height);
157 
158  // ---------- member functions ---------------------------
159  //have to use the portable syntax else the reflex code will not build
160  void registerViewBuilder(const std::string& iName,
161  ViewBuildFunctor& iBuilder);
162 
163 
164  ViewMap_i createView(const std::string& iName, TEveWindowSlot* slot = nullptr);
165  void newViewSlot(const std::string& iName);
166 
167  void connectSubviewAreaSignals(FWGUISubviewArea*);
168  void enableActions(bool enable = true);
169  void disablePrevious();
170  void disableNext();
171  void setPlayMode(bool);
172  void updateStatus(const char* status);
173  void clearStatus();
174  void eventChangedCallback();
175 
176  CSGAction* getAction(const std::string name);
177 
178  void addData();
179  void titleChanged(const char *title);
180 
181  void openEveBrowserForDebugging() const;
182  void setDelayBetweenEvents(Float_t);
183 
184  void showEventFilterGUI();
185  void filterButtonClicked();
186  void setFilterButtonText(const char* txt);
187  void setFilterButtonIcon(int);
188  void updateEventFilterEnable(bool);
189 
190  void runIdChanged();
191  void lumiIdChanged();
192  void eventIdChanged();
193  void checkSubviewAreaIconState(TEveWindow*);
194  void subviewIsBeingDestroyed(FWGUISubviewArea*);
195  void subviewDestroy(FWGUISubviewArea*); // timeout funct
196  void subviewDestroyAll();
197  void subviewInfoSelected(FWGUISubviewArea*);
198  void subviewInfoUnselected(FWGUISubviewArea*);
199  void subviewSwapped(FWGUISubviewArea*);
200 
201  CmsShowMainFrame* getMainFrame() const { return m_cmsShowMainFrame; }
202  const edm::EventBase* getCurrentEvent() const;
203 
204  void resetWMOffsets();
205 
206  // signals
207  sigc::signal<void> filterButtonClicked_;
208  sigc::signal<void, const TGWindow*> showEventFilterGUI_;
209  sigc::signal<void, const std::string&> writeToConfigurationFile_;
210  sigc::signal<void, const std::string&> writePartialToConfigurationFile_;
211  sigc::signal<void, const std::string&> loadFromConfigurationFile_;
212  sigc::signal<void, const std::string&> loadPartialFromConfigurationFile_;
213  sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
214  sigc::signal<void> goingToQuit_;
216 
217  sigc::signal<void> changedRunEntry_;
218  sigc::signal<void> changedEventEntry_;
219  sigc::signal<void, Float_t> changedDelayBetweenEvents_;
220 
221 private:
222  FWGUIManager(const FWGUIManager&) = delete; // stop default
223  const FWGUIManager& operator=(const FWGUIManager&) = delete; // stop default
224 
225  TEveWindow* getSwapCandidate();
226 
227  void newItem(const FWEventItem*);
228 
229  bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode);
230  void promptForSaveConfigurationFile();
231  void promptForPartialSaveConfigurationFile();
232  void promptForLoadConfigurationFile();
233  void promptForPartialLoadConfigurationFile();
234  void savePartialToConfigurationFile();
235 
236  void delaySliderChanged(Int_t);
237 
238  void finishUpColorChange();
239 
240  void setViewPopup(TEveWindow*);
241 
242  void measureWMOffsets();
243 
244  // ---------- static member data --------------------------------
245 
247 
248  // ---------- member data --------------------------------
250 
252 
253  //views are owned by their individual view managers
259 
260  TGPopupMenu* m_fileMenu;
262 
263  // event data inspector
269 
270  // help
274 
275  // subview memebers
276  mutable ViewMap_t m_viewMap;
277  NameToViewBuilder m_nameToViewBuilder;
278 
279  TEveWindowPack *m_viewPrimPack;
280  TEveWindowPack *m_viewSecPack;
281 
282  sigc::connection m_modelChangeConn;
283 
284  std::auto_ptr<CmsShowTaskExecutor> m_tasks;
285  std::vector<FWViewBase*> m_regionViews;
286  int m_WMOffsetX, m_WMOffsetY, m_WMDecorH;
287 };
288 
289 
290 #endif
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:215
fireworks::Context * getContext()
Definition: FWGUIManager.h:155
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:207
ViewMap_t m_viewMap
Definition: FWGUIManager.h:276
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:210
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:277
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:264
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:251
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:212
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:268
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:282
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:246
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:260
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:254
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:279
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:98
std::auto_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:284
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:280
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:266
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:219
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:257
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:208
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:258
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:261
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:265
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:217
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:267
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:273
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:285
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:255
sigc::signal< void > changedEventEntry_
Definition: FWGUIManager.h:218
fireworks::Context * m_context
Definition: FWGUIManager.h:249
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:209
HLT enums.
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:101
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:211
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:256
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:213
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:214
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:271
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:272