Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:30

0001 #ifndef Fireworks_Core_CmsShowViewPopup_h
0002 #define Fireworks_Core_CmsShowViewPopup_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     CmsShowViewPopup
0007 //
0008 /**\class CmsShowViewPopup CmsShowViewPopup.h Fireworks/Core/interface/CmsShowViewPopup.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:
0018 //         Created:  Wed Jun 25 15:15:12 EDT 2008
0019 //
0020 
0021 // system include files
0022 #include <vector>
0023 #ifndef __CINT__
0024 #include <memory>
0025 #include <sigc++/sigc++.h>
0026 #endif
0027 #include "TGFrame.h"
0028 
0029 // user include files
0030 #include "Fireworks/Core/interface/FWParameterSetterEditorBase.h"
0031 
0032 // forward declarations
0033 class TGLabel;
0034 class TGTextButton;
0035 class TGButton;
0036 class TGFrame;
0037 class TGTab;
0038 class TGCompositeFrame;
0039 class TEveWindow;
0040 
0041 class FWParameterBase;
0042 class FWParameterSetterBase;
0043 class FWViewBase;
0044 class FWColorManager;
0045 class FWDialogBuilder;
0046 
0047 /* Helper class to organise parameters in view controller */
0048 
0049 class ViewerParameterGUI : public TGCompositeFrame, public FWParameterSetterEditorBase {
0050 public:
0051   ViewerParameterGUI(const TGFrame*);
0052   ~ViewerParameterGUI() override {}
0053 
0054   ViewerParameterGUI& requestTab(const char*);
0055   ViewerParameterGUI& addParam(const FWParameterBase*);
0056   ViewerParameterGUI& separator();
0057   void reset();
0058   void populateComplete();
0059 
0060   TGCompositeFrame* getTabContainer();
0061   void addFrameToContainer(TGCompositeFrame*);
0062 
0063 private:
0064   TGTab* m_tab;
0065   std::string m_selectedTabName;
0066 #ifndef __CINT__
0067   std::vector<std::shared_ptr<FWParameterSetterBase> > m_setters;
0068 #endif
0069 };
0070 
0071 //==============================================================================
0072 
0073 class CmsShowViewPopup : public TGTransientFrame {
0074 public:
0075   CmsShowViewPopup(const TGWindow* p = nullptr,
0076                    UInt_t w = 200,
0077                    UInt_t h = 200,
0078                    FWColorManager* cm = nullptr,
0079                    FWViewBase* wb = nullptr,
0080                    TEveWindow* ew = nullptr);
0081   ~CmsShowViewPopup() override;
0082 
0083   // ---------- const member functions ---------------------
0084 
0085   // ---------- static member functions --------------------
0086 
0087   // ---------- member functions ---------------------------
0088 
0089   void CloseWindow() override;
0090   void MapWindow() override;
0091   void UnmapWindow() override;
0092 
0093   bool mapped() { return m_mapped; }
0094 
0095   void reset(FWViewBase*, TEveWindow* ew);
0096 
0097   void saveImage();
0098   void changeBackground();
0099   void backgroundColorWasChanged();
0100   TEveWindow* getEveWindow() const { return m_eveWindow; }
0101 #ifndef __CINT__
0102   sigc::signal<void()> closed_;
0103 #endif
0104 
0105   ClassDefOverride(CmsShowViewPopup, 0);
0106 
0107 private:
0108   CmsShowViewPopup(const CmsShowViewPopup&);                   // stop default
0109   const CmsShowViewPopup& operator=(const CmsShowViewPopup&);  // stop default
0110 
0111   // ---------- member data --------------------------------
0112 
0113   bool m_mapped;
0114 
0115   TGLabel* m_viewLabel;
0116   ViewerParameterGUI* m_paramGUI;
0117   TGTextButton* m_saveImageButton;
0118   TGTextButton* m_changeBackground;
0119 
0120   FWColorManager* m_colorManager;
0121   FWViewBase* m_viewBase;
0122   TEveWindow* m_eveWindow;
0123 };
0124 
0125 #endif