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  void initEmpty();
119 
120  TGVerticalFrame* createList(TGCompositeFrame *p);
121  void createViews(TEveWindowSlot *slot);
122  void exportImageOfMainView();
123  void exportImagesOfAllViews();
124  void exportAllViews(const std::string& format, int height);
125 
126  void createEDIFrame();
128  void showEDIFrame(int iInfoToShow=-1);
129 
130  void open3DRegion();
131  void showCommonPopup();
132 
133  void createModelPopup();
134  void showModelPopup();
135  void showViewPopup();
136  void popupViewClosed();
137 
138  void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase* iHandler);
139 
140  void showInvMassDialog();
141  // void showGeometryBrowser();
142 
143  // help
144  void createHelpPopup ();
145  void createShortcutPopup ();
146  void createHelpGLPopup ();
147 
148  // ---------- const member functions ---------------------
149  // bool waitingForUserAction() const;
153 
154  // ---------- static member functions --------------------
155  static FWGUIManager* getGUIManager();
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 = 0);
165  void newViewSlot(const std::string& iName);
166 
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 
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*);
195  void subviewDestroy(FWGUISubviewArea*); // timeout funct
196  void subviewDestroyAll();
200 
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&); // stop default
223  const FWGUIManager& operator=(const FWGUIManager&); // stop default
224 
225  TEveWindow* getSwapCandidate();
226 
227  void newItem(const FWEventItem*);
228 
229  bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode);
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
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;
287 };
288 
289 
290 #endif
TGVerticalFrame * createList(TGCompositeFrame *p)
void promptForPartialSaveConfigurationFile()
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:215
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:207
ViewMap_t m_viewMap
Definition: FWGUIManager.h:276
void showModelPopup()
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
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:251
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:212
void setFilterButtonIcon(int)
void open3DRegion()
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:268
void setViewPopup(TEveWindow *)
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:282
void newViewSlot(const std::string &iName)
void addTo(FWConfiguration &) const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:246
void delaySliderChanged(Int_t)
void updateStatus(const char *status)
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:260
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:254
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:279
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:284
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:280
tuple result
Definition: mps_fire.py:95
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:266
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:219
TEveWindow * getSwapCandidate()
void resetWMOffsets()
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:257
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:208
void setDelayBetweenEvents(Float_t)
void exportImagesOfAllViews()
void subviewDestroy(FWGUISubviewArea *)
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:258
void newItem(const FWEventItem *)
void filterButtonClicked()
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:261
void exportImageOfMainView()
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:265
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:217
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:267
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:273
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:285
void setFrom(const FWConfiguration &)
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:255
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:218
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:249
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:209
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()
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:102
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:211
void titleChanged(const char *title)
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:256
void disableNext()
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:213
void measureWMOffsets()
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:214
void showCommonPopup()
void runIdChanged()
void showViewPopup()
void createHelpGLPopup()
tuple status
Definition: mps_update.py:57
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:271
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:272