CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FWProxyBuilderBase.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWProxyBuilderBase_h
2 #define Fireworks_Core_FWProxyBuilderBase_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWProxyBuilderBase
7 //
16 //
17 // Original Author: Chris Jones, Matevz Tadel, Alja Mrak-Tadel
18 // Created: Thu Mar 18 14:12:12 CET 2010
19 //
20 
21 // system include files
22 #include "sigc++/connection.h"
23 
24 // user include files
25 
26 // user include files
33 
34 // forward declarations
35 
36 class FWEventItem;
37 class TEveElementList;
38 class TEveElement;
39 class FWModelId;
40 class FWInteractionList;
41 
42 namespace fireworks {
43  class Context;
44 }
45 
47 public:
48  struct Product {
51  TEveElementList* m_elements;
52  sigc::connection m_scaleConnection;
53 
55  ~Product();
56  };
57 
59  virtual ~FWProxyBuilderBase();
60 
61  // ---------- const member functions ---------------------
62 
63  const fireworks::Context& context() const;
64  const FWEventItem* item() const { return m_item; }
65  // ---------- static member functions --------------------
67  static std::string typeOfBuilder();
68 
72  static bool representsSubPart();
73  // ---------- member functions ---------------------------
74  virtual void setItem(const FWEventItem* iItem);
75  void setHaveWindow(bool iFlag);
76  void build();
77 
78  void modelChanges(const FWModelIds&);
79  void itemChanged(const FWEventItem*);
80  void scaleChanged(const FWViewContext*);
81 
82  virtual bool canHandle(const FWEventItem&); //note pass FWEventItem to see if type and container match
83 
84  virtual void setInteractionList(FWInteractionList*, const std::string&);
85  virtual void itemBeingDestroyed(const FWEventItem*);
86 
87  // const member functions
88  virtual bool haveSingleProduct() const { return true; }
89  virtual bool havePerViewProduct(FWViewType::EType) const { return false; }
90  virtual bool willHandleInteraction() const { return false; }
91 
92  TEveElementList* createProduct(FWViewType::EType, const FWViewContext*);
94 
95  bool getHaveWindow() const { return m_haveWindow; }
96  void setupElement(TEveElement* el, bool color = true) const;
97  void setupAddElement(TEveElement* el, TEveElement* parent, bool set_color = true) const;
98  int layer() const;
99 
100 protected:
101  // Override this if visibility changes can cause (re)-creation of proxies.
102  // Returns true if new proxies were created.
103  virtual bool visibilityModelChanges(const FWModelId&, TEveElement*, FWViewType::EType, const FWViewContext*);
104 
105  // Override this if you need special handling of selection or other changes.
106  virtual void localModelChanges(const FWModelId& iId,
107  TEveElement* iCompound,
108  FWViewType::EType viewType,
109  const FWViewContext* vc);
110 
111  virtual void modelChanges(const FWModelIds&, Product*);
112 
113  virtual void scaleProduct(TEveElementList* parent, FWViewType::EType, const FWViewContext* vc){};
114 
115  FWProxyBuilderBase(const FWProxyBuilderBase&); // stop default
116  const FWProxyBuilderBase& operator=(const FWProxyBuilderBase&); // stop default
117 
118  virtual void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*);
119  virtual void buildViewType(const FWEventItem* iItem, TEveElementList*, FWViewType::EType, const FWViewContext*);
120 
121  virtual void clean();
122  virtual void cleanLocal();
123 
124  void increaseComponentTransparency(unsigned int index,
125  TEveElement* holder,
126  const std::string& name,
127  Char_t transpOffset);
128 
129  // utility
130  TEveCompound* createCompound(bool set_color = true, bool propagate_color_to_all_children = false) const;
131 
132  // ---------- member data --------------------------------
133  typedef std::vector<Product*>::iterator Product_it;
134 
135  std::vector<Product*> m_products;
136 
137 private:
138  void cleanProduct(Product* p);
139  void setProjectionLayer(float);
140 
141  // ---------- member data --------------------------------
142 
144 
146 
150 
151  float m_layer;
152 };
153 
154 #endif
const fireworks::Context & context() const
virtual void buildViewType(const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
std::vector< Product * >::iterator Product_it
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
const edm::EventSetup & c
static std::string typeOfBuilder()
Used by the plugin system to determine how the proxy uses the data from FWEventItem.
std::vector< Product * > m_products
virtual bool willHandleInteraction() const
virtual void itemBeingDestroyed(const FWEventItem *)
virtual bool havePerViewProduct(FWViewType::EType) const
virtual bool visibilityModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
static bool representsSubPart()
const FWViewContext * m_viewContext
virtual void cleanLocal()
void scaleChanged(const FWViewContext *)
const FWEventItem * m_item
const FWEventItem * item() const
sigc::connection m_scaleConnection
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
Product(FWViewType::EType t, const FWViewContext *c)
const FWProxyBuilderBase & operator=(const FWProxyBuilderBase &)
std::set< FWModelId > FWModelIds
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
Definition: eve_macros.cc:154
virtual void setItem(const FWEventItem *iItem)
void removePerViewProduct(FWViewType::EType, const FWViewContext *vc)
void setHaveWindow(bool iFlag)
virtual bool haveSingleProduct() const
void cleanProduct(Product *p)
virtual bool canHandle(const FWEventItem &)
FWInteractionList * m_interactionList
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
bool getHaveWindow() const
TEveElementList * createProduct(FWViewType::EType, const FWViewContext *)
void setProjectionLayer(float)
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
void itemChanged(const FWEventItem *)
void modelChanges(const FWModelIds &)
virtual void setInteractionList(FWInteractionList *, const std::string &)
void setupElement(TEveElement *el, bool color=true) const