CMS 3D CMS Logo

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 {
48 public:
49 
50  struct Product
51  {
54  TEveElementList* m_elements;
55  sigc::connection m_scaleConnection;
56 
58  ~Product();
59  };
60 
62  virtual ~FWProxyBuilderBase();
63 
64  // ---------- const member functions ---------------------
65 
66  const fireworks::Context& context() const;
67  const FWEventItem* item() const {
68  return m_item;
69  }
70  // ---------- static member functions --------------------
72  static std::string typeOfBuilder();
73 
77  static bool representsSubPart();
78  // ---------- member functions ---------------------------
79  virtual void setItem(const FWEventItem* iItem);
80  void setHaveWindow(bool iFlag);
81  void build();
82 
83  void modelChanges(const FWModelIds&);
84  void itemChanged(const FWEventItem*);
85  void scaleChanged(const FWViewContext*);
86 
87  virtual bool canHandle(const FWEventItem&);//note pass FWEventItem to see if type and container match
88 
89 
90  virtual void setInteractionList(FWInteractionList*, const std::string&);
91  virtual void itemBeingDestroyed(const FWEventItem*);
92 
93  // const member functions
94  virtual bool haveSingleProduct() const { return true; }
95  virtual bool havePerViewProduct(FWViewType::EType) const { return false; }
96  virtual bool willHandleInteraction() const { return false; }
97 
98  TEveElementList* createProduct(FWViewType::EType, const FWViewContext*);
99  void removePerViewProduct(FWViewType::EType, const FWViewContext* vc);
100 
101  bool getHaveWindow() const { return m_haveWindow; }
102  void setupElement(TEveElement* el, bool color = true) const;
103  void setupAddElement(TEveElement* el, TEveElement* parent, bool set_color = true) const;
104  int layer() const;
105 
106 
107 protected:
108  // Override this if visibility changes can cause (re)-creation of proxies.
109  // Returns true if new proxies were created.
110  virtual bool visibilityModelChanges(const FWModelId&, TEveElement*, FWViewType::EType,
111  const FWViewContext*);
112 
113  // Override this if you need special handling of selection or other changes.
114  virtual void localModelChanges(const FWModelId& iId, TEveElement* iCompound,
115  FWViewType::EType viewType, const FWViewContext* vc);
116 
117  virtual void modelChanges(const FWModelIds&, Product*);
118 
119  virtual void scaleProduct(TEveElementList* parent, FWViewType::EType, const FWViewContext* vc) {};
120 
121  FWProxyBuilderBase(const FWProxyBuilderBase&); // stop default
122  const FWProxyBuilderBase& operator=(const FWProxyBuilderBase&); // stop default
123 
124  virtual void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*);
125  virtual void buildViewType(const FWEventItem* iItem, TEveElementList*, FWViewType::EType, const FWViewContext*);
126 
127  virtual void clean();
128  virtual void cleanLocal();
129 
130  void increaseComponentTransparency(unsigned int index, TEveElement* holder,
131  const std::string& name, Char_t transpOffset);
132 
133  // utility
134  TEveCompound* createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const;
135 
136  // ---------- member data --------------------------------
137  typedef std::vector<Product*>::iterator Product_it;
138 
139  std::vector<Product*> m_products;
140 
141 private:
142  void cleanProduct(Product* p);
143  void setProjectionLayer(float);
144 
145  // ---------- member data --------------------------------
146 
148 
150 
154 
155  float m_layer;
156 };
157 
158 #endif
std::vector< Product * >::iterator Product_it
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
std::vector< Product * > m_products
virtual bool willHandleInteraction() const
virtual bool havePerViewProduct(FWViewType::EType) const
const FWViewContext * m_viewContext
const FWEventItem * m_item
const FWEventItem * item() const
sigc::connection m_scaleConnection
std::set< FWModelId > FWModelIds
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
Definition: eve_macros.cc:154
std::vector< T * > clean
Definition: MVATrainer.cc:156
virtual bool haveSingleProduct() const
FWInteractionList * m_interactionList
bool getHaveWindow() const
void setupAddElement(TEveElement *el, TEveElement *parent, const FWEventItem *item, bool master, bool color)
Definition: TrackUtils.cc:313