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 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
FWProxyBuilderBase::Product::Product
Product(FWViewType::EType t, const FWViewContext *c)
Definition: FWProxyBuilderBase.cc:43
FWProxyBuilderBase::createProduct
TEveElementList * createProduct(FWViewType::EType, const FWViewContext *)
Definition: FWProxyBuilderBase.cc:239
FWProxyBuilderBase::havePerViewProduct
virtual bool havePerViewProduct(FWViewType::EType) const
Definition: FWProxyBuilderBase.h:89
FWProxyBuilderBase::~FWProxyBuilderBase
virtual ~FWProxyBuilderBase()
Definition: FWProxyBuilderBase.cc:77
fireworks::Context
Definition: Context.h:41
FWProxyBuilderBase::setHaveWindow
void setHaveWindow(bool iFlag)
Definition: FWProxyBuilderBase.cc:85
FWViewType::EType
EType
Definition: FWViewType.h:31
set_color
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
Definition: eve_macros.cc:154
FWProxyBuilderBase::setupElement
void setupElement(TEveElement *el, bool color=true) const
Definition: FWProxyBuilderBase.cc:358
FWProxyBuilderBase::m_item
const FWEventItem * m_item
Definition: FWProxyBuilderBase.h:145
FWProxyBuilderBase::removePerViewProduct
void removePerViewProduct(FWViewType::EType, const FWViewContext *vc)
Definition: FWProxyBuilderBase.cc:269
FWProxyBuilderBase::itemChanged
void itemChanged(const FWEventItem *)
Definition: FWProxyBuilderBase.cc:217
FWModelId
Definition: FWModelId.h:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FWProxyBuilderBase::setProjectionLayer
void setProjectionLayer(float)
Definition: FWProxyBuilderBase.cc:339
FWProxyBuilderBase::Product::m_viewContext
const FWViewContext * m_viewContext
Definition: FWProxyBuilderBase.h:50
FWProxyBuilderBase::m_layer
float m_layer
Definition: FWProxyBuilderBase.h:151
FWProxyBuilderBase::willHandleInteraction
virtual bool willHandleInteraction() const
Definition: FWProxyBuilderBase.h:90
FWInteractionList
Definition: FWInteractionList.h:33
Context
FWProxyBuilderBase::Product::m_viewType
FWViewType::EType m_viewType
Definition: FWProxyBuilderBase.h:49
FWProxyBuilderBase::createCompound
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
Definition: FWProxyBuilderBase.cc:374
FWProxyBuilderBase::canHandle
virtual bool canHandle(const FWEventItem &)
Definition: FWProxyBuilderBase.cc:230
FWProxyBuilderBase::itemBeingDestroyed
virtual void itemBeingDestroyed(const FWEventItem *)
Definition: FWProxyBuilderBase.cc:97
FWModelChangeSignal.h
FWViewContext.h
FWProxyBuilderBase::layer
int layer() const
Definition: FWProxyBuilderBase.cc:414
FWProxyBuilderBase::m_mustBuild
bool m_mustBuild
Definition: FWProxyBuilderBase.h:149
FWViewType.h
FWProxyBuilderBase::setInteractionList
virtual void setInteractionList(FWInteractionList *, const std::string &)
Definition: FWProxyBuilderBase.cc:287
FWProxyBuilderBase::increaseComponentTransparency
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
Definition: FWProxyBuilderBase.cc:393
FWProxyBuilderBase::buildViewType
virtual void buildViewType(const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
Definition: FWProxyBuilderBase.cc:333
FWProxyBuilderBase::scaleChanged
void scaleChanged(const FWViewContext *)
Definition: FWProxyBuilderBase.cc:305
FWProxyBuilderBase::scaleProduct
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
Definition: FWProxyBuilderBase.h:113
OrderedSet.t
t
Definition: OrderedSet.py:90
FWProxyBuilderBase::clean
virtual void clean()
Definition: FWProxyBuilderBase.cc:314
FWProxyBuilderBase::typeOfBuilder
static std::string typeOfBuilder()
Used by the plugin system to determine how the proxy uses the data from FWEventItem.
Definition: FWProxyBuilderBase.cc:420
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWProxyBuilderBase::cleanProduct
void cleanProduct(Product *p)
FWProxyBuilderBase::localModelChanges
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
Definition: FWProxyBuilderBase.cc:300
FWProxyBuilderBase::visibilityModelChanges
virtual bool visibilityModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
Definition: FWProxyBuilderBase.cc:293
FWProxyBuilderBase::operator=
const FWProxyBuilderBase & operator=(const FWProxyBuilderBase &)
FWProxyBuilderBase::Product_it
std::vector< Product * >::iterator Product_it
Definition: FWProxyBuilderBase.h:133
FWProxyBuilderBase::representsSubPart
static bool representsSubPart()
Definition: FWProxyBuilderBase.cc:422
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWProxyBuilderBase::m_interactionList
FWInteractionList * m_interactionList
Definition: FWProxyBuilderBase.h:143
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWProxyBuilderBase::Product::m_scaleConnection
sigc::connection m_scaleConnection
Definition: FWProxyBuilderBase.h:52
FWViewContext
Definition: FWViewContext.h:32
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWProxyBuilderBase::cleanLocal
virtual void cleanLocal()
Definition: FWProxyBuilderBase.cc:324
FWProxyBuilderBase::Product::m_elements
TEveElementList * m_elements
Definition: FWProxyBuilderBase.h:51
FWEventItem
Definition: FWEventItem.h:56
FWModelIdFromEveSelector.h
FWProxyBuilderBase::Product::~Product
~Product()
Definition: FWProxyBuilderBase.cc:49
FWProxyBuilderBase::modelChanges
void modelChanges(const FWModelIds &)
Definition: FWProxyBuilderBase.cc:205
FWProxyBuilderBase
Definition: FWProxyBuilderBase.h:46
FWProxyBuilderBase::m_haveWindow
bool m_haveWindow
Definition: FWProxyBuilderBase.h:148
FWProxyBuilderBase::m_modelsChanged
bool m_modelsChanged
Definition: FWProxyBuilderBase.h:147
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
FWProxyBuilderBase::FWProxyBuilderBase
FWProxyBuilderBase()
Definition: FWProxyBuilderBase.cc:69
FWProxyBuilderBase::Product
Definition: FWProxyBuilderBase.h:48
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FWProxyBuilderBase::haveSingleProduct
virtual bool haveSingleProduct() const
Definition: FWProxyBuilderBase.h:88
FWEvePtr.h
fireworks
Definition: FWTauProxyBuilderBase.h:35
FWProxyBuilderBase::getHaveWindow
bool getHaveWindow() const
Definition: FWProxyBuilderBase.h:95
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
FWModelIds
std::set< FWModelId > FWModelIds
Definition: FWEveViewManager.h:40
FWProxyBuilderFactory.h
FWProxyBuilderBase::m_products
std::vector< Product * > m_products
Definition: FWProxyBuilderBase.h:135
class-composition.parent
parent
Definition: class-composition.py:88