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.13 2010/12/01 21:40:31 amraktad Exp $ 00020 // 00021 00022 // system include files 00023 #include <vector> 00024 #include <map> 00025 #include <boost/shared_ptr.hpp> 00026 00027 // user include files 00028 #include "Fireworks/Core/interface/FWViewManagerBase.h" 00029 #include "Fireworks/Core/interface/FWViewType.h" 00030 #include "Fireworks/Core/interface/FWProxyBuilderBase.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 00041 class FWEveViewManager : public FWViewManagerBase 00042 { 00043 private: 00044 struct BuilderInfo 00045 { 00046 std::string m_name; 00047 int m_viewBit; 00048 00049 BuilderInfo(std::string name, int viewBit) : 00050 m_name(name), 00051 m_viewBit(viewBit) 00052 {} 00053 }; 00054 00055 public: 00056 FWEveViewManager(FWGUIManager*); 00057 virtual ~FWEveViewManager(); 00058 00059 // ---------- const member functions --------------------- 00060 00061 // ---------- static member functions -------------------- 00062 00063 // ---------- member functions --------------------------- 00064 virtual void newItem(const FWEventItem*); 00065 virtual void removeItem(const FWEventItem*); 00066 virtual void eventBegin(); 00067 virtual void eventEnd(); 00068 virtual void setContext(const fireworks::Context*); 00069 00070 void highlightAdded(TEveElement*); 00071 void selectionAdded(TEveElement*); 00072 void selectionRemoved(TEveElement*); 00073 void selectionCleared(); 00074 00075 FWTypeToRepresentations supportedTypesAndRepresentations() const; 00076 00077 protected: 00078 virtual void modelChangesComing(); 00079 virtual void modelChangesDone(); 00080 virtual void colorsChanged(); 00081 00082 private: 00083 FWEveViewManager(const FWEveViewManager&); // stop default 00084 const FWEveViewManager& operator=(const FWEveViewManager&); // stop default 00085 00086 FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type); 00087 FWEveView* finishViewCreate (boost::shared_ptr<FWEveView>); 00088 00089 void beingDestroyed(const FWViewBase*); 00090 void modelChanges(const FWModelIds& iIds); 00091 void itemChanged(const FWEventItem*); 00092 bool haveViewForBit (int) const; 00093 void globalEnergyScaleChanged(); 00094 00095 // ---------- member data -------------------------------- 00096 00097 typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder; 00098 typedef std::vector<boost::shared_ptr<FWProxyBuilderBase> > BuilderVec; 00099 typedef BuilderVec::iterator BuilderVec_it; 00100 typedef std::vector<boost::shared_ptr<FWEveView > >::iterator EveViewVec_it; 00101 00102 TypeToBuilder m_typeToBuilder; 00103 00104 std::map<int, BuilderVec> m_builders; // key is viewer bit 00105 00106 std::vector< std::vector<boost::shared_ptr<FWEveView> > > m_views; 00107 00108 std::map<const FWEventItem*,FWInteractionList*> m_interactionLists; 00109 }; 00110 00111 00112 #endif