test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWEveViewManager.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWEveViewManager_h
2 #define Fireworks_Core_FWEveViewManager_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWEveViewManager
7 //
16 //
17 // Original Author: Chris Jones, Alja Mrak-Tadel
18 // Created: Thu Mar 18 14:12:45 CET 2010
19 //
20 
21 // system include files
22 #include <vector>
23 #include <map>
24 #include <set>
25 #include <boost/shared_ptr.hpp>
26 
27 // user include files
30 
31 // forward declarations
32 class TEveCompund;
33 class TEveScene;
34 class TEveWindowSlot;
35 class FWViewBase;
36 class FWEveView;
37 class FWProxyBuilderBase;
38 class FWGUIManager;
40 
41 typedef std::set<FWModelId> FWModelIds;
42 
44 {
45 public:
46  struct BuilderInfo
47  {
49  int m_viewBit;
50 
51  void classType(std::string& , bool&) const;
52 
53  BuilderInfo(std::string name, int viewBit) :
54  m_name(name),
55  m_viewBit(viewBit)
56  {}
57  };
58 
60  virtual ~FWEveViewManager();
61 
62  // ---------- const member functions ---------------------
63 
64  // ---------- static member functions --------------------
65 
66  // ---------- member functions ---------------------------
67  virtual void newItem(const FWEventItem*);
68  virtual void removeItem(const FWEventItem*);
69  virtual void eventBegin();
70  virtual void eventEnd();
71  virtual void setContext(const fireworks::Context*);
72 
73  void highlightAdded(TEveElement*);
74  void selectionAdded(TEveElement*);
75  void selectionRemoved(TEveElement*);
76  void selectionCleared();
77 
79 
80  static void syncAllViews() { s_syncAllViews = true; }
81 protected:
82  virtual void modelChangesComing();
83  virtual void modelChangesDone();
84  virtual void colorsChanged();
85 
86 private:
87  FWEveViewManager(const FWEveViewManager&); // stop default
88  const FWEveViewManager& operator=(const FWEveViewManager&); // stop default
89 
90  FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type);
91  FWEveView* finishViewCreate (boost::shared_ptr<FWEveView>);
92 
93  void beingDestroyed(const FWViewBase*);
94  void modelChanges(const FWModelIds& iIds);
95  void itemChanged(const FWEventItem*);
96  bool haveViewForBit (int) const;
98 
99  // ---------- member data --------------------------------
100 
101  typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder;
102  typedef std::vector<boost::shared_ptr<FWProxyBuilderBase> > BuilderVec;
103  typedef BuilderVec::iterator BuilderVec_it;
104  typedef std::vector<boost::shared_ptr<FWEveView > >::iterator EveViewVec_it;
105 
107 
108  static bool s_syncAllViews;
109 
110  std::map<int, BuilderVec> m_builders; // key is viewer bit
111 
112  std::vector< std::vector<boost::shared_ptr<FWEveView> > > m_views;
113 
114  std::map<const FWEventItem*,FWInteractionList*> m_interactionLists;
115 };
116 
117 
118 #endif
FWEveView * finishViewCreate(boost::shared_ptr< FWEveView >)
type
Definition: HCALResponse.h:21
virtual void modelChangesDone()
BuilderInfo(std::string name, int viewBit)
FWTypeToRepresentations supportedTypesAndRepresentations() const
std::map< std::string, std::vector< BuilderInfo > > TypeToBuilder
void selectionAdded(TEveElement *)
void itemChanged(const FWEventItem *)
virtual void colorsChanged()
TypeToBuilder m_typeToBuilder
static bool s_syncAllViews
FWEveViewManager(FWGUIManager *)
virtual void newItem(const FWEventItem *)
std::set< FWModelId > FWModelIds
std::vector< boost::shared_ptr< FWEveView > >::iterator EveViewVec_it
bool haveViewForBit(int) const
virtual void setContext(const fireworks::Context *)
void selectionRemoved(TEveElement *)
void highlightAdded(TEveElement *)
void modelChanges(const FWModelIds &iIds)
void beingDestroyed(const FWViewBase *)
std::map< int, BuilderVec > m_builders
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
std::map< const FWEventItem *, FWInteractionList * > m_interactionLists
virtual void modelChangesComing()
virtual void eventEnd()
virtual ~FWEveViewManager()
std::vector< boost::shared_ptr< FWProxyBuilderBase > > BuilderVec
BuilderVec::iterator BuilderVec_it
const FWEveViewManager & operator=(const FWEveViewManager &)
virtual void removeItem(const FWEventItem *)
virtual void eventBegin()
static void syncAllViews()
void classType(std::string &, bool &) const
std::vector< std::vector< boost::shared_ptr< FWEveView > > > m_views