CMS 3D CMS Logo

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 <memory>
26 
27 // user include files
30 
31 // forward declarations
32 class TEveCompund;
33 class TEveScene;
34 class TEveElement;
35 class TEveWindowSlot;
36 class FWViewBase;
37 class FWEveView;
38 class FWProxyBuilderBase;
39 class FWGUIManager;
41 
42 typedef std::set<FWModelId> FWModelIds;
43 
45 {
46 public:
47  struct BuilderInfo
48  {
50  int m_viewBit;
51 
52  void classType(std::string& , bool&) const;
53 
54  BuilderInfo(std::string name, int viewBit) :
55  m_name(name),
56  m_viewBit(viewBit)
57  {}
58  };
59 
61  virtual ~FWEveViewManager();
62 
63  // ---------- const member functions ---------------------
64 
65  // ---------- static member functions --------------------
66 
67  // ---------- member functions ---------------------------
68  virtual void newItem(const FWEventItem*);
69  virtual void removeItem(const FWEventItem*);
70  virtual void eventBegin();
71  virtual void eventEnd();
72  virtual void setContext(const fireworks::Context*);
73 
74  void highlightAdded(TEveElement*);
75  void selectionAdded(TEveElement*);
76  void selectionRemoved(TEveElement*);
77  void selectionCleared();
78 
80 
81  static void syncAllViews() { s_syncAllViews = true; }
82 protected:
83  virtual void modelChangesComing();
84  virtual void modelChangesDone();
85  virtual void colorsChanged();
86 
87 private:
88  FWEveViewManager(const FWEveViewManager&); // stop default
89  const FWEveViewManager& operator=(const FWEveViewManager&); // stop default
90 
91  FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type);
92  FWEveView* finishViewCreate (std::shared_ptr<FWEveView>);
93 
94  void beingDestroyed(const FWViewBase*);
95  void modelChanges(const FWModelIds& iIds);
96  void itemChanged(const FWEventItem*);
97  bool haveViewForBit (int) const;
99 
100  // ---------- member data --------------------------------
101 
102  typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder;
103  typedef std::vector<std::shared_ptr<FWProxyBuilderBase> > BuilderVec;
104  typedef BuilderVec::iterator BuilderVec_it;
105  typedef std::vector<std::shared_ptr<FWEveView > >::iterator EveViewVec_it;
106 
107  TypeToBuilder m_typeToBuilder;
108 
109  static bool s_syncAllViews;
110 
111  std::map<int, BuilderVec> m_builders; // key is viewer bit
112 
113  std::vector< std::vector<std::shared_ptr<FWEveView> > > m_views;
114 
115  std::map<const FWEventItem*,FWInteractionList*> m_interactionLists;
116 };
117 
118 
119 #endif
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 *)
FWEveView * finishViewCreate(std::shared_ptr< FWEveView >)
virtual void newItem(const FWEventItem *)
std::set< FWModelId > FWModelIds
bool haveViewForBit(int) const
virtual void setContext(const fireworks::Context *)
std::vector< std::vector< std::shared_ptr< FWEveView > > > m_views
void selectionRemoved(TEveElement *)
void highlightAdded(TEveElement *)
void modelChanges(const FWModelIds &iIds)
void beingDestroyed(const FWViewBase *)
std::map< int, BuilderVec > m_builders
std::vector< std::shared_ptr< FWEveView > >::iterator EveViewVec_it
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
std::map< const FWEventItem *, FWInteractionList * > m_interactionLists
virtual void modelChangesComing()
virtual void eventEnd()
virtual ~FWEveViewManager()
BuilderVec::iterator BuilderVec_it
const FWEveViewManager & operator=(const FWEveViewManager &)
std::vector< std::shared_ptr< FWProxyBuilderBase > > BuilderVec
virtual void removeItem(const FWEventItem *)
virtual void eventBegin()
static void syncAllViews()
void classType(std::string &, bool &) const