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 
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;
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&> 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);
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
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;
286 };
287 
288 
289 #endif
TGVerticalFrame * createList(TGCompositeFrame *p)
void promptForPartialSaveConfigurationFile()
sigc::signal< void > writeToPresentConfigurationFile_
Definition: FWGUIManager.h:214
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:206
ViewMap_t m_viewMap
Definition: FWGUIManager.h:275
void showModelPopup()
sigc::signal< void, const std::string & > writePartialToConfigurationFile_
Definition: FWGUIManager.h:209
NameToViewBuilder m_nameToViewBuilder
Definition: FWGUIManager.h:276
list parent
Definition: dbtoconf.py:74
CmsShowEDI * m_ediFrame
Definition: FWGUIManager.h:263
void subviewIsBeingDestroyed(FWGUISubviewArea *)
void subviewDestroyAll()
FWSummaryManager * m_summaryManager
Definition: FWGUIManager.h:250
void createHelpPopup()
void subviewInfoSelected(FWGUISubviewArea *)
sigc::signal< void, const std::string & > loadPartialFromConfigurationFile_
Definition: FWGUIManager.h:211
void setFilterButtonIcon(int)
void open3DRegion()
void createViews(TEveWindowSlot *slot)
FWInvMassDialog * m_invMassDialog
Definition: FWGUIManager.h:267
void setViewPopup(TEveWindow *)
sigc::connection m_modelChangeConn
Definition: FWGUIManager.h:281
void newViewSlot(const std::string &iName)
void addTo(FWConfiguration &) const
static FWGUIManager * m_guiManager
Definition: FWGUIManager.h:245
void delaySliderChanged(Int_t)
void updateStatus(const char *status)
TGPopupMenu * m_fileMenu
Definition: FWGUIManager.h:259
FWDetailViewManager * m_detailViewManager
Definition: FWGUIManager.h:253
TEveWindowPack * m_viewPrimPack
Definition: FWGUIManager.h:278
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:283
TEveWindowPack * m_viewSecPack
Definition: FWGUIManager.h:279
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:265
sigc::signal< void, Float_t > changedDelayBetweenEvents_
Definition: FWGUIManager.h:218
TEveWindow * getSwapCandidate()
void resetWMOffsets()
static TGFrame * makeGUIsubview(TEveCompositeFrame *cp, TGCompositeFrame *parent, Int_t height)
FWNavigatorBase * m_navigator
Definition: FWGUIManager.h:256
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:257
void newItem(const FWEventItem *)
void filterButtonClicked()
FWGUIEventDataAdder * m_dataAdder
Definition: FWGUIManager.h:260
void exportImageOfMainView()
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:200
void disablePrevious()
CmsShowModelPopup * m_modelPopup
Definition: FWGUIManager.h:264
sigc::signal< void > changedRunEntry_
Definition: FWGUIManager.h:216
CmsShowCommonPopup * m_commonPopup
Definition: FWGUIManager.h:266
void createModelPopup()
CmsShowHelpPopup * m_helpGLPopup
Definition: FWGUIManager.h:272
std::vector< FWViewBase * > m_regionViews
Definition: FWGUIManager.h:284
void setFrom(const FWConfiguration &)
const FWViewManagerManager * m_viewManagerManager
Definition: FWGUIManager.h:254
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:217
void updateEventFilterEnable(bool)
static FWGUIManager * getGUIManager()
CSGContinuousAction * loopAction()
void eventIdChanged()
fireworks::Context * m_context
Definition: FWGUIManager.h:248
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:208
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()
tuple status
Definition: ntuplemaker.py:245
std::map< TEveWindow *, FWViewBase * > ViewMap_t
Definition: FWGUIManager.h:102
sigc::signal< void, const std::string & > loadFromConfigurationFile_
Definition: FWGUIManager.h:210
void titleChanged(const char *title)
void promptForLoadConfigurationFile()
FWModelContextMenuHandler * m_contextMenuHandler
Definition: FWGUIManager.h:255
void disableNext()
sigc::signal< void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t > changedEventId_
Definition: FWGUIManager.h:212
void measureWMOffsets()
sigc::signal< void > goingToQuit_
Definition: FWGUIManager.h:213
void showCommonPopup()
void runIdChanged()
void showViewPopup()
void createHelpGLPopup()
CmsShowHelpPopup * m_helpPopup
Definition: FWGUIManager.h:270
void openEveBrowserForDebugging() const
void lumiIdChanged()
CmsShowHelpPopup * m_shortcutPopup
Definition: FWGUIManager.h:271