00001 #ifndef Fireworks_Core_FWEveViewManager_h 00002 #define Fireworks_Core_FWEveViewManager_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Core 00006 // Class : FWEveViewManager 00007 // 00016 // 00017 // Original Author: Chris Jones, Alja Mrak-Tadel 00018 // Created: Thu Mar 18 14:12:45 CET 2010 00019 // $Id: FWEveViewManager.h,v 1.14 2013/01/21 20:33:28 chrjones Exp $ 00020 // 00021 00022 // system include files 00023 #include <vector> 00024 #include <map> 00025 #include <set> 00026 #include <boost/shared_ptr.hpp> 00027 00028 // user include files 00029 #include "Fireworks/Core/interface/FWViewManagerBase.h" 00030 #include "Fireworks/Core/interface/FWViewType.h" 00031 00032 // forward declarations 00033 class TEveCompund; 00034 class TEveScene; 00035 class TEveWindowSlot; 00036 class FWViewBase; 00037 class FWEveView; 00038 class FWProxyBuilderBase; 00039 class FWGUIManager; 00040 class FWInteractionList; 00041 00042 typedef std::set<FWModelId> FWModelIds; 00043 00044 class FWEveViewManager : public FWViewManagerBase 00045 { 00046 private: 00047 struct BuilderInfo 00048 { 00049 std::string m_name; 00050 int m_viewBit; 00051 00052 BuilderInfo(std::string name, int viewBit) : 00053 m_name(name), 00054 m_viewBit(viewBit) 00055 {} 00056 }; 00057 00058 public: 00059 FWEveViewManager(FWGUIManager*); 00060 virtual ~FWEveViewManager(); 00061 00062 // ---------- const member functions --------------------- 00063 00064 // ---------- static member functions -------------------- 00065 00066 // ---------- member functions --------------------------- 00067 virtual void newItem(const FWEventItem*); 00068 virtual void removeItem(const FWEventItem*); 00069 virtual void eventBegin(); 00070 virtual void eventEnd(); 00071 virtual void setContext(const fireworks::Context*); 00072 00073 void highlightAdded(TEveElement*); 00074 void selectionAdded(TEveElement*); 00075 void selectionRemoved(TEveElement*); 00076 void selectionCleared(); 00077 00078 FWTypeToRepresentations supportedTypesAndRepresentations() const; 00079 00080 protected: 00081 virtual void modelChangesComing(); 00082 virtual void modelChangesDone(); 00083 virtual void colorsChanged(); 00084 00085 private: 00086 FWEveViewManager(const FWEveViewManager&); // stop default 00087 const FWEveViewManager& operator=(const FWEveViewManager&); // stop default 00088 00089 FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type); 00090 FWEveView* finishViewCreate (boost::shared_ptr<FWEveView>); 00091 00092 void beingDestroyed(const FWViewBase*); 00093 void modelChanges(const FWModelIds& iIds); 00094 void itemChanged(const FWEventItem*); 00095 bool haveViewForBit (int) const; 00096 void globalEnergyScaleChanged(); 00097 00098 // ---------- member data -------------------------------- 00099 00100 typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder; 00101 typedef std::vector<boost::shared_ptr<FWProxyBuilderBase> > BuilderVec; 00102 typedef BuilderVec::iterator BuilderVec_it; 00103 typedef std::vector<boost::shared_ptr<FWEveView > >::iterator EveViewVec_it; 00104 00105 TypeToBuilder m_typeToBuilder; 00106 00107 std::map<int, BuilderVec> m_builders; // key is viewer bit 00108 00109 std::vector< std::vector<boost::shared_ptr<FWEveView> > > m_views; 00110 00111 std::map<const FWEventItem*,FWInteractionList*> m_interactionLists; 00112 }; 00113 00114 00115 #endif