File indexing completed on 2023-10-25 09:46:19
0001 #ifndef Fireworks_Core_FWProxyBuilderBase_h
0002 #define Fireworks_Core_FWProxyBuilderBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "sigc++/connection.h"
0023
0024
0025
0026
0027 #include "Fireworks/Core/interface/FWEvePtr.h"
0028 #include "Fireworks/Core/interface/FWViewType.h"
0029 #include "Fireworks/Core/interface/FWProxyBuilderFactory.h"
0030 #include "Fireworks/Core/interface/FWModelChangeSignal.h"
0031 #include "Fireworks/Core/interface/FWModelIdFromEveSelector.h"
0032 #include "Fireworks/Core/interface/FWViewContext.h"
0033
0034
0035
0036 class FWEventItem;
0037 class TEveElementList;
0038 class TEveElement;
0039 class FWModelId;
0040 class FWInteractionList;
0041
0042 namespace fireworks {
0043 class Context;
0044 }
0045
0046 class FWProxyBuilderBase {
0047 public:
0048 struct Product {
0049 FWViewType::EType m_viewType;
0050 const FWViewContext* m_viewContext;
0051 TEveElementList* m_elements;
0052 sigc::connection m_scaleConnection;
0053
0054 Product(FWViewType::EType t, const FWViewContext* c);
0055 ~Product();
0056 };
0057
0058 FWProxyBuilderBase();
0059 virtual ~FWProxyBuilderBase();
0060
0061
0062
0063 const fireworks::Context& context() const;
0064 const FWEventItem* item() const { return m_item; }
0065
0066
0067 static std::string typeOfBuilder();
0068
0069
0070
0071
0072 static bool representsSubPart();
0073
0074 virtual void setItem(const FWEventItem* iItem);
0075 void setHaveWindow(bool iFlag);
0076 void build();
0077
0078 void modelChanges(const FWModelIds&);
0079 void itemChanged(const FWEventItem*);
0080 void scaleChanged(const FWViewContext*);
0081
0082 virtual bool canHandle(const FWEventItem&);
0083
0084 virtual void setInteractionList(FWInteractionList*, const std::string&);
0085 virtual void itemBeingDestroyed(const FWEventItem*);
0086
0087
0088 virtual bool haveSingleProduct() const { return true; }
0089 virtual bool havePerViewProduct(FWViewType::EType) const { return false; }
0090 virtual bool willHandleInteraction() const { return false; }
0091
0092 TEveElementList* createProduct(FWViewType::EType, const FWViewContext*);
0093 void removePerViewProduct(FWViewType::EType, const FWViewContext* vc);
0094
0095 bool getHaveWindow() const { return m_haveWindow; }
0096 void setupElement(TEveElement* el, bool color = true) const;
0097 void setupAddElement(TEveElement* el, TEveElement* parent, bool set_color = true) const;
0098 int layer() const;
0099
0100 protected:
0101
0102
0103 virtual bool visibilityModelChanges(const FWModelId&, TEveElement*, FWViewType::EType, const FWViewContext*);
0104
0105
0106 virtual void localModelChanges(const FWModelId& iId,
0107 TEveElement* iCompound,
0108 FWViewType::EType viewType,
0109 const FWViewContext* vc);
0110
0111 virtual void modelChanges(const FWModelIds&, Product*);
0112
0113 virtual void scaleProduct(TEveElementList* parent, FWViewType::EType, const FWViewContext* vc){};
0114
0115 FWProxyBuilderBase(const FWProxyBuilderBase&);
0116 const FWProxyBuilderBase& operator=(const FWProxyBuilderBase&);
0117
0118 virtual void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*);
0119 virtual void buildViewType(const FWEventItem* iItem, TEveElementList*, FWViewType::EType, const FWViewContext*);
0120
0121 virtual void clean();
0122 virtual void cleanLocal();
0123
0124 void increaseComponentTransparency(unsigned int index,
0125 TEveElement* holder,
0126 const std::string& name,
0127 Char_t transpOffset);
0128
0129
0130 TEveCompound* createCompound(bool set_color = true, bool propagate_color_to_all_children = false) const;
0131
0132
0133 typedef std::vector<Product*>::iterator Product_it;
0134
0135 std::vector<Product*> m_products;
0136
0137 private:
0138 void cleanProduct(Product* p);
0139 void setProjectionLayer(float);
0140
0141
0142
0143 FWInteractionList* m_interactionList;
0144
0145 const FWEventItem* m_item;
0146
0147 bool m_modelsChanged;
0148 bool m_haveWindow;
0149 bool m_mustBuild;
0150
0151 float m_layer;
0152 };
0153
0154 #endif