Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Fireworks_Core_FWEveViewManager_h
0002 #define Fireworks_Core_FWEveViewManager_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWEveViewManager
0007 //
0008 /**\class FWEveViewManager FWEveViewManager.h Fireworks/Core/interface/FWEveViewManager.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones, Alja Mrak-Tadel
0018 //         Created:  Thu Mar 18 14:12:45 CET 2010
0019 //
0020 
0021 // system include files
0022 #include <vector>
0023 #include <map>
0024 #include <set>
0025 #include <memory>
0026 
0027 // user include files
0028 #include "Fireworks/Core/interface/FWViewManagerBase.h"
0029 #include "Fireworks/Core/interface/FWViewType.h"
0030 
0031 // forward declarations
0032 class TEveCompund;
0033 class TEveScene;
0034 class TEveElement;
0035 class TEveWindowSlot;
0036 class FWViewBase;
0037 class FWEveView;
0038 class FWProxyBuilderBase;
0039 class FWGUIManager;
0040 class FWInteractionList;
0041 
0042 typedef std::set<FWModelId> FWModelIds;
0043 
0044 class FWEveViewManager : public FWViewManagerBase {
0045 public:
0046   struct BuilderInfo {
0047     std::string m_name;
0048     int m_viewBit;
0049 
0050     void classType(std::string&, bool&) const;
0051 
0052     BuilderInfo(std::string name, int viewBit) : m_name(name), m_viewBit(viewBit) {}
0053   };
0054 
0055   FWEveViewManager(FWGUIManager*);
0056   ~FWEveViewManager() override;
0057 
0058   // ---------- const member functions ---------------------
0059 
0060   // ---------- static member functions --------------------
0061 
0062   // ---------- member functions ---------------------------
0063   void newItem(const FWEventItem*) override;
0064   virtual void removeItem(const FWEventItem*);
0065   void eventBegin() override;
0066   void eventEnd() override;
0067   void setContext(const fireworks::Context*) override;
0068 
0069   void highlightAdded(TEveElement*);
0070   void selectionAdded(TEveElement*);
0071   void selectionRemoved(TEveElement*);
0072   void selectionCleared();
0073 
0074   FWTypeToRepresentations supportedTypesAndRepresentations() const override;
0075 
0076   static void syncAllViews() { s_syncAllViews = true; }
0077 
0078 protected:
0079   void modelChangesComing() override;
0080   void modelChangesDone() override;
0081   void colorsChanged() override;
0082 
0083 public:
0084   FWEveViewManager(const FWEveViewManager&) = delete;                   // stop default
0085   const FWEveViewManager& operator=(const FWEveViewManager&) = delete;  // stop default
0086 
0087 private:
0088   FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type);
0089   FWEveView* finishViewCreate(std::shared_ptr<FWEveView>);
0090 
0091   void beingDestroyed(const FWViewBase*);
0092   void modelChanges(const FWModelIds& iIds);
0093   void itemChanged(const FWEventItem*);
0094   bool haveViewForBit(int) const;
0095   void globalEnergyScaleChanged();
0096   void eventCenterChanged();
0097 
0098   // ---------- member data --------------------------------
0099 
0100   typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder;
0101   typedef std::vector<std::shared_ptr<FWProxyBuilderBase> > BuilderVec;
0102   typedef BuilderVec::iterator BuilderVec_it;
0103   typedef std::vector<std::shared_ptr<FWEveView> >::iterator EveViewVec_it;
0104 
0105   TypeToBuilder m_typeToBuilder;
0106 
0107   static bool s_syncAllViews;
0108 
0109   std::map<int, BuilderVec> m_builders;  // key is viewer bit
0110 
0111   std::vector<std::vector<std::shared_ptr<FWEveView> > > m_views;
0112 
0113   std::map<const FWEventItem*, FWInteractionList*> m_interactionLists;
0114 };
0115 
0116 #endif