CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 <functional>
23 #include <map>
24 #include <memory>
25 
26 #include <sigc++/sigc++.h>
27 #include "Rtypes.h"
28 #include "GuiTypes.h"
29 #include "TGFileDialog.h"
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 
95 class FWGUIManager : public FWConfigurable {
96  // typedefs
97 public:
98  typedef std::function<FWViewBase*(TEveWindowSlot*, const std::string&)> ViewBuildFunctor;
99  typedef std::map<std::string, ViewBuildFunctor> NameToViewBuilder;
100 
101 private:
102  typedef std::map<TEveWindow*, FWViewBase*> ViewMap_t;
103  typedef ViewMap_t::iterator ViewMap_i;
104 
105 public:
107 
108  ~FWGUIManager() override;
109  void evePreTerminate();
110 
111  //configuration management interface
112  void addTo(FWConfiguration&) const override;
113  void setFrom(const FWConfiguration&) override;
114  void setWindowInfoFrom(const FWConfiguration& iFrom, TGMainFrame* iFrame);
115  void initEmpty();
116 
117  TGVerticalFrame* createList(TGCompositeFrame* p);
118  void createViews(TEveWindowSlot* slot);
119  void exportImageOfMainView();
120  void exportImagesOfAllViews();
121  void exportAllViews(const std::string& format, int height);
122 
123  void createEDIFrame();
125  void showEDIFrame(int iInfoToShow = -1);
126 
127  void open3DRegion();
128  void showCommonPopup();
129 
130  void createModelPopup();
131  void showModelPopup();
132  void showViewPopup();
133  void popupViewClosed();
134 
135  void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase* iHandler);
136 
137  void showInvMassDialog();
138  // void showGeometryBrowser();
139 
140  // help
141  void createHelpPopup();
142  void createShortcutPopup();
143  void createHelpGLPopup();
144 
145  // ---------- const member functions ---------------------
146  // bool waitingForUserAction() const;
150 
151  // ---------- static member functions --------------------
152  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, ViewBuildFunctor& iBuilder);
159 
160  ViewMap_i createView(const std::string& iName, TEveWindowSlot* slot = nullptr);
161  void newViewSlot(const std::string& iName);
162 
164  void enableActions(bool enable = true);
165  void disablePrevious();
166  void disableNext();
167  void setPlayMode(bool);
168  void updateStatus(const char* status);
169  void clearStatus();
170  void eventChangedCallback();
171 
173 
174  void addData();
175  void titleChanged(const char* title);
176 
177  void openEveBrowserForDebugging() const;
178  void setDelayBetweenEvents(Float_t);
179 
180  void showEventFilterGUI();
181  void filterButtonClicked();
182  void setFilterButtonText(const char* txt);
183  void setFilterButtonIcon(int);
184  void updateEventFilterEnable(bool);
185 
186  void runIdChanged();
187  void lumiIdChanged();
188  void eventIdChanged();
189  void checkSubviewAreaIconState(TEveWindow*);
191  void subviewDestroy(FWGUISubviewArea*); // timeout funct
192  void subviewDestroyAll();
196 
198  const edm::EventBase* getCurrentEvent() const;
199 
200  void resetWMOffsets();
201 
202  // signals
203  sigc::signal<void> filterButtonClicked_;
204  sigc::signal<void, const TGWindow*> showEventFilterGUI_;
205  sigc::signal<void, const std::string&> writeToConfigurationFile_;
206  sigc::signal<void, const std::string&> writePartialToConfigurationFile_;
207  sigc::signal<void, const std::string&> loadFromConfigurationFile_;
208  sigc::signal<void, const std::string&> loadPartialFromConfigurationFile_;
209  sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
210  sigc::signal<void> goingToQuit_;
212 
213  sigc::signal<void> changedRunEntry_;
214  sigc::signal<void> changedEventEntry_;
215  sigc::signal<void, Float_t> changedDelayBetweenEvents_;
216 
217  FWGUIManager(const FWGUIManager&) = delete; // stop default
218  const FWGUIManager& operator=(const FWGUIManager&) = delete; // stop default
219 
220 private:
221  TEveWindow* getSwapCandidate();
222 
223  void newItem(const FWEventItem*);
224 
225  bool promptForConfigurationFile(std::string& result, enum EFileDialogMode mode);
231 
232  void delaySliderChanged(Int_t);
233 
234  void finishUpColorChange();
235 
236  void setViewPopup(TEveWindow*);
237 
238  void measureWMOffsets();
239 
240  // ---------- static member data --------------------------------
241 
243 
244  // ---------- member data --------------------------------
246 
248 
249  //views are owned by their individual view managers
255 
256  TGPopupMenu* m_fileMenu;
258 
259  // event data inspector
265 
266  // help
270 
271  // subview memebers
274 
275  TEveWindowPack* m_viewPrimPack;
276  TEveWindowPack* m_viewSecPack;
277 
278  sigc::connection m_modelChangeConn;
279 
280  std::unique_ptr<CmsShowTaskExecutor> m_tasks;
281  std::vector<FWViewBase*> m_regionViews;
283 };
284 
285 #endif
TGVerticalFrame * createList(TGCompositeFrame *p)
void promptForPartialSaveConfigurationFile()
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:211
void popupViewClosed()
fireworks::Context * getContext()
Definition: FWGUIManager.h:153
void setFrom(const FWConfiguration &) override
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:103
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:203
ViewMap_t m_viewMap
Definition: FWGUIManager.h:272
void showModelPopup()
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:206
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:273
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:260
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:247
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:208
void setFilterButtonIcon(int)
void open3DRegion()
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:264
void setViewPopup(TEveWindow *)
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:278
list status
Definition: mps_update.py:107
void newViewSlot(const std::string &iName)
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:242
void delaySliderChanged(Int_t)
void updateStatus(const char *status)
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:256
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:250
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:275
void showEDIFrame(int iInfoToShow=-1)
Allowed values are -1 or ones from FWDataCategories enum.
void enableActions(bool enable=true)
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:276
tuple result
Definition: mps_fire.py:311
void setWindowInfoFrom(const FWConfiguration &iFrom, TGMainFrame *iFrame)
ViewMap_i createView(const std::string &iName, TEveWindowSlot *slot=nullptr)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
void checkSubviewAreaIconState(TEveWindow *)
void connectSubviewAreaSignals(FWGUISubviewArea *)
void createShortcutPopup()
~FWGUIManager() override
void setPlayMode(bool)
CmsShowViewPopup * m_viewPopup
Definition: FWGUIManager.h:262
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:215
TEveWindow * getSwapCandidate()
void resetWMOffsets()
const FWGUIManager & operator=(const FWGUIManager &)=delete
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:253
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:204
void setDelayBetweenEvents(Float_t)
void exportImagesOfAllViews()
std::map< std::string, ViewBuildFunctor > NameToViewBuilder
Definition: FWGUIManager.h:99
void subviewDestroy(FWGUISubviewArea *)
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:254
void newItem(const FWEventItem *)
void filterButtonClicked()
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:257
void exportImageOfMainView()
void addTo(FWConfiguration &) const override
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:197
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:261
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:213
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:263
std::function< FWViewBase *(TEveWindowSlot *, const std::string &)> ViewBuildFunctor
Definition: FWGUIManager.h:98
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:269
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:281
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:251
void eventChangedCallback()
void savePartialToConfigurationFile()
void clearStatus()
const edm::EventBase * getCurrentEvent() const
CSGAction * getAction(const std::string name)
sigc::signal< void > changedEventEntry_
Definition: FWGUIManager.h:214
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:245
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)
std::unique_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:280
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:205
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()
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:102
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:207
void titleChanged(const char *title)
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:252
void disableNext()
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:209
void measureWMOffsets()
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:210
void showCommonPopup()
void runIdChanged()
void showViewPopup()
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:267
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:268