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 // $Id: FWGUIManager.h,v 1.121 2011/09/08 03:09:28 amraktad Exp $
20 //
21 
22 // system include files
23 #include <map>
24 #include <boost/function.hpp>
25 #include <boost/shared_ptr.hpp>
26 #include <sigc++/sigc++.h>
27 #include "Rtypes.h"
28 #include "GuiTypes.h"
29 #include "TGFileDialog.h"
30 #include <memory>
31 
32 // user include files
35 
36 // forward declarations
37 class TGPictureButton;
38 class TGComboBox;
39 class TGTextButton;
40 class TGTextEntry;
41 class TGFrame;
42 class TGSplitFrame;
43 class TGVerticalFrame;
44 class TGMainFrame;
45 class TGPack;
46 class TGCompositeFrame;
47 class TGCheckButton;
48 class TGPopupMenu;
49 
50 class TGListTreeItem;
51 class TGListTree;
52 class TEveElementList;
53 class TEveElement;
54 class TEveWindowPack;
55 class TEveWindowSlot;
56 class TEveCompositeFrame;
57 class TEveWindow;
58 
59 class CmsShowMainFrame;
60 class FWEventItem;
61 class FWViewBase;
62 class FWGUISubviewArea;
63 
64 class FWSelectionManager;
65 class FWSummaryManager;
67 class FWInvMassDialog;
68 class CSGAction;
70 
72 
74 
75 class FWNavigatorBase;
76 
79 class TGWindow;
80 
81 namespace edm {
82  class EventBase;
83 }
84 
85 class CmsShowEDI;
86 class CmsShowModelPopup;
87 class CmsShowViewPopup;
89 class CmsShowCommonPopup;
90 class CmsShowHelpPopup;
91 
92 namespace fireworks {
93  class Context;
94 }
95 
97 {
98  // typedefs
99 public:
100  typedef boost::function2<FWViewBase*,TEveWindowSlot*, const std::string& > ViewBuildFunctor;
101  typedef std::map<std::string, ViewBuildFunctor > NameToViewBuilder;
102 private:
103  typedef std::map<TEveWindow*, FWViewBase*> ViewMap_t;
104  typedef ViewMap_t::iterator ViewMap_i;
105 
106 
107 public:
109  const FWViewManagerManager* iVMMgr,
110  FWNavigatorBase* navigator);
111 
112  virtual ~FWGUIManager();
113  void evePreTerminate();
114 
115  //configuration management interface
116  void addTo(FWConfiguration&) const;
117  void setFrom(const FWConfiguration&);
118  void setWindowInfoFrom(const FWConfiguration& iFrom, TGMainFrame* iFrame);
119 
120  TGVerticalFrame* createList(TGCompositeFrame *p);
121  void createViews(TEveWindowSlot *slot);
122  void exportImageOfMainView();
123  void exportImagesOfAllViews();
124  void exportAllViews(const std::string& format);
125 
126  void createEDIFrame();
128  void showEDIFrame(int iInfoToShow=-1);
129 
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;
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 
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 
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*);
194  void subviewDestroy(FWGUISubviewArea*); // timeout funct
195  void subviewDestroyAll();
199 
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&> loadFromConfigurationFile_;
210  sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
211  sigc::signal<void> goingToQuit_;
213 
214  sigc::signal<void> changedRunEntry_;
215  sigc::signal<void> changedEventEntry_;
216  sigc::signal<void, Float_t> changedDelayBetweenEvents_;
217 
218 private:
219  FWGUIManager(const FWGUIManager&); // stop default
220  const FWGUIManager& operator=(const FWGUIManager&); // stop default
221 
222  TEveWindow* getSwapCandidate();
223 
224  void newItem(const FWEventItem*);
225 
226  bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode);
229 
230  void delaySliderChanged(Int_t);
231 
232  void finishUpColorChange();
233 
234  void setViewPopup(TEveWindow*);
235 
236  void measureWMOffsets();
237 
238  // ---------- static member data --------------------------------
239 
241 
242  // ---------- member data --------------------------------
244 
246 
247  //views are owned by their individual view managers
253 
254  TGPopupMenu* m_fileMenu;
256 
257  // event data inspector
263 
264  // help
268 
269  // subview memebers
272 
273  TEveWindowPack *m_viewPrimPack;
274  TEveWindowPack *m_viewSecPack;
275 
276  sigc::connection m_modelChangeConn;
277 
278  std::auto_ptr<CmsShowTaskExecutor> m_tasks;
279 
281 };
282 
283 
284 #endif
TGVerticalFrame * createList(TGCompositeFrame *p)
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:212
void popupViewClosed()
ViewMap_t::iterator ViewMap_i
Definition: FWGUIManager.h:104
std::map< std::string, ViewBuildFunctor > NameToViewBuilder
Definition: FWGUIManager.h:101
sigc::signal< void > filterButtonClicked_
Definition: FWGUIManager.h:206
ViewMap_t m_viewMap
Definition: FWGUIManager.h:270
void showModelPopup()
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:271
list parent
Definition: dbtoconf.py:74
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:258
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:245
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
void setFilterButtonIcon(int)
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:262
void setViewPopup(TEveWindow *)
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:276
void newViewSlot(const std::string &iName)
void addTo(FWConfiguration &) const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:240
void delaySliderChanged(Int_t)
void updateStatus(const char *status)
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:254
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:248
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:273
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:100
void enableActions(bool enable=true)
std::auto_ptr< CmsShowTaskExecutor > m_tasks
Definition: FWGUIManager.h:278
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:274
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:260
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:216
TEveWindow * getSwapCandidate()
void resetWMOffsets()
void exportAllViews(const std::string &format)
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:251
sigc::signal< void, const TGWindow * > showEventFilterGUI_
Definition: FWGUIManager.h:207
void setDelayBetweenEvents(Float_t)
void exportImagesOfAllViews()
void subviewDestroy(FWGUISubviewArea *)
tuple result
Definition: query.py:137
void showInvMassDialog()
CmsShowMainFrame * m_cmsShowMainFrame
Definition: FWGUIManager.h:252
void newItem(const FWEventItem *)
void filterButtonClicked()
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:255
void exportImageOfMainView()
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:200
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:259
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:214
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:261
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:267
void setFrom(const FWConfiguration &)
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:249
void eventChangedCallback()
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:215
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:243
bool promptForConfigurationFile(std::string &result, enum EFileDialogMode mode)
CSGContinuousAction * playEventsBackwardsAction()
void finishUpColorChange()
void setFilterButtonText(const char *txt)
sigc::signal< void, const std::string & > writeToConfigurationFile_
Definition: FWGUIManager.h:208
virtual ~FWGUIManager()
CSGContinuousAction * playEventsAction()
void subviewSwapped(FWGUISubviewArea *)
FWGUIManager(fireworks::Context *ctx, const FWViewManagerManager *iVMMgr, FWNavigatorBase *navigator)
Definition: FWGUIManager.cc:95
void showEventFilterGUI()
void evePreTerminate()
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:103
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:209
void titleChanged(const char *title)
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:250
void disableNext()
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:210
void measureWMOffsets()
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:211
void showCommonPopup()
void runIdChanged()
void showViewPopup()
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:265
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:266