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  ~FWEveViewManager() override;
62 
63  // ---------- const member functions ---------------------
64 
65  // ---------- static member functions --------------------
66 
67  // ---------- member functions ---------------------------
68  void newItem(const FWEventItem*) override;
69  virtual void removeItem(const FWEventItem*);
70  void eventBegin() override;
71  void eventEnd() override;
72  void setContext(const fireworks::Context*) override;
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  void modelChangesComing() override;
84  void modelChangesDone() override;
85  void colorsChanged() override;
86 
87 private:
88  FWEveViewManager(const FWEveViewManager&) = delete; // stop default
89  const FWEveViewManager& operator=(const FWEveViewManager&) = delete; // 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  void eventCenterChanged();
100 
101  // ---------- member data --------------------------------
102 
103  typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder;
104  typedef std::vector<std::shared_ptr<FWProxyBuilderBase> > BuilderVec;
105  typedef BuilderVec::iterator BuilderVec_it;
106  typedef std::vector<std::shared_ptr<FWEveView > >::iterator EveViewVec_it;
107 
108  TypeToBuilder m_typeToBuilder;
109 
110  static bool s_syncAllViews;
111 
112  std::map<int, BuilderVec> m_builders; // key is viewer bit
113 
114  std::vector< std::vector<std::shared_ptr<FWEveView> > > m_views;
115 
116  std::map<const FWEventItem*,FWInteractionList*> m_interactionLists;
117 };
118 
119 
120 #endif
type
Definition: HCALResponse.h:21
BuilderInfo(std::string name, int viewBit)
void eventBegin() override
std::map< std::string, std::vector< BuilderInfo > > TypeToBuilder
void selectionAdded(TEveElement *)
void itemChanged(const FWEventItem *)
void newItem(const FWEventItem *) override
TypeToBuilder m_typeToBuilder
static bool s_syncAllViews
FWEveViewManager(FWGUIManager *)
FWEveView * finishViewCreate(std::shared_ptr< FWEveView >)
~FWEveViewManager() override
std::set< FWModelId > FWModelIds
const FWEveViewManager & operator=(const FWEveViewManager &)=delete
bool haveViewForBit(int) const
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
FWTypeToRepresentations supportedTypesAndRepresentations() const override
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
void setContext(const fireworks::Context *) override
std::map< const FWEventItem *, FWInteractionList * > m_interactionLists
void colorsChanged() override
BuilderVec::iterator BuilderVec_it
std::vector< std::shared_ptr< FWProxyBuilderBase > > BuilderVec
virtual void removeItem(const FWEventItem *)
void eventEnd() override
void modelChangesDone() override
static void syncAllViews()
void classType(std::string &, bool &) const
void modelChangesComing() override