CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 <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 public:
46  struct BuilderInfo {
48  int m_viewBit;
49 
50  void classType(std::string&, bool&) const;
51 
52  BuilderInfo(std::string name, int viewBit) : m_name(name), m_viewBit(viewBit) {}
53  };
54 
56  ~FWEveViewManager() override;
57 
58  // ---------- const member functions ---------------------
59 
60  // ---------- static member functions --------------------
61 
62  // ---------- member functions ---------------------------
63  void newItem(const FWEventItem*) override;
64  virtual void removeItem(const FWEventItem*);
65  void eventBegin() override;
66  void eventEnd() override;
67  void setContext(const fireworks::Context*) override;
68 
69  void highlightAdded(TEveElement*);
70  void selectionAdded(TEveElement*);
71  void selectionRemoved(TEveElement*);
72  void selectionCleared();
73 
75 
76  static void syncAllViews() { s_syncAllViews = true; }
77 
78 protected:
79  void modelChangesComing() override;
80  void modelChangesDone() override;
81  void colorsChanged() override;
82 
83 public:
84  FWEveViewManager(const FWEveViewManager&) = delete; // stop default
85  const FWEveViewManager& operator=(const FWEveViewManager&) = delete; // stop default
86 
87 private:
88  FWViewBase* buildView(TEveWindowSlot* iParent, const std::string& type);
89  FWEveView* finishViewCreate(std::shared_ptr<FWEveView>);
90 
91  void beingDestroyed(const FWViewBase*);
92  void modelChanges(const FWModelIds& iIds);
93  void itemChanged(const FWEventItem*);
94  bool haveViewForBit(int) const;
96  void eventCenterChanged();
97 
98  // ---------- member data --------------------------------
99 
100  typedef std::map<std::string, std::vector<BuilderInfo> > TypeToBuilder;
101  typedef std::vector<std::shared_ptr<FWProxyBuilderBase> > BuilderVec;
102  typedef BuilderVec::iterator BuilderVec_it;
103  typedef std::vector<std::shared_ptr<FWEveView> >::iterator EveViewVec_it;
104 
106 
107  static bool s_syncAllViews;
108 
109  std::map<int, BuilderVec> m_builders; // key is viewer bit
110 
111  std::vector<std::vector<std::shared_ptr<FWEveView> > > m_views;
112 
113  std::map<const FWEventItem*, FWInteractionList*> m_interactionLists;
114 };
115 
116 #endif
std::vector< std::vector< std::shared_ptr< FWEveView > > > m_views
BuilderInfo(std::string name, int viewBit)
std::vector< std::shared_ptr< FWEveView > >::iterator EveViewVec_it
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
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)
void setContext(const fireworks::Context *) override
void colorsChanged() override
std::map< const FWEventItem *, FWInteractionList * > m_interactionLists
BuilderVec::iterator BuilderVec_it
std::vector< std::shared_ptr< FWProxyBuilderBase > > BuilderVec
virtual void removeItem(const FWEventItem *)
FWTypeToRepresentations supportedTypesAndRepresentations() const override
void eventEnd() override
void modelChangesDone() override
static void syncAllViews()
void classType(std::string &, bool &) const
void modelChangesComing() override