Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Fireworks_Core_FWDetailViewManager_h
0002 #define Fireworks_Core_FWDetailViewManager_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWDetailViewManager
0007 //
0008 /**\class FWDetailViewManager FWDetailViewManager.h Fireworks/Core/interface/FWDetailViewManager.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Wed Mar  5 09:13:43 EST 2008
0019 //
0020 #include <map>
0021 #include <memory>
0022 #include <string>
0023 #include <vector>
0024 
0025 class FWColorManager;
0026 class TEveCompositeFrameInMainFrame;
0027 class FWDetailViewBase;
0028 class FWModelId;
0029 class TEveWindow;
0030 
0031 namespace fireworks {
0032   class Context;
0033 }
0034 
0035 class FWDetailViewManager {
0036 public:
0037   FWDetailViewManager(fireworks::Context*);
0038   virtual ~FWDetailViewManager();
0039 
0040   std::vector<std::string> detailViewsFor(const FWModelId&) const;
0041   //  void assertMainFrame();
0042   void openDetailViewFor(const FWModelId&, const std::string&);
0043   void colorsChanged();
0044   void newEventCallback();
0045   void eveWindowDestroyed(TEveWindow*);
0046 
0047   struct ViewFrame {
0048     TEveCompositeFrameInMainFrame* m_eveFrame;
0049     std::unique_ptr<FWDetailViewBase> m_detailView;
0050     TEveWindow* m_eveWindow;
0051 
0052     ViewFrame(TEveCompositeFrameInMainFrame* f, std::unique_ptr<FWDetailViewBase> v, TEveWindow* w);
0053     ~ViewFrame();
0054     ViewFrame(const ViewFrame&) = delete;
0055     ViewFrame& operator=(const ViewFrame&) = delete;
0056     ViewFrame(ViewFrame&&) = default;
0057     ViewFrame& operator=(ViewFrame&&) = default;
0058   };
0059 
0060   FWDetailViewManager(const FWDetailViewManager&) = delete;                   // stop default
0061   const FWDetailViewManager& operator=(const FWDetailViewManager&) = delete;  // stop default
0062 
0063 protected:
0064   fireworks::Context* m_context;
0065 
0066 private:
0067   std::vector<std::string> findViewersFor(const std::string&) const;
0068 
0069   typedef std::vector<ViewFrame> vViews_t;
0070   typedef vViews_t::iterator vViews_i;
0071   vViews_t m_views;
0072 
0073   mutable std::map<std::string, std::vector<std::string> > m_typeToViewers;
0074 };
0075 
0076 #endif