CMS 3D CMS Logo

FWEventItem.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWEventItem_h
2 #define Fireworks_Core_FWEventItem_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWEventItem
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu Jan 3 14:02:21 EST 2008
19 //
20 
21 // system include files
22 #include <string>
23 #include <vector>
25 #include <memory>
26 #include <sigc++/connection.h>
27 
28 // user include files
33 
36 
38 
39 // forward declarations
40 class TClass;
42 class FWSelectionManager;
43 class FWGeometry;
44 class TVirtualCollectionProxy;
45 class FWItemAccessorBase;
47 class FWConfiguration;
48 
49 namespace edm {
50  class EventBase;
51 }
52 namespace fireworks {
53  class Context;
54 }
55 
57 {
58 public:
59  struct ModelInfo
60  {
63  ModelInfo(const FWDisplayProperties& iProps, bool iIsSelected) :
64  m_displayProperties(iProps),
65  m_isSelected(iIsSelected) {
66  }
67 
69  return m_displayProperties;
70  }
71  bool isSelected() const {
72  return m_isSelected;
73  }
74  };
75 
77  unsigned int iItemId,
78  std::shared_ptr<FWItemAccessorBase> iAccessor,
79  const FWPhysicsObjectDesc& iDesc, const FWConfiguration* pbConf = nullptr);
80  virtual ~FWEventItem();
81 
82  // ---------- const member functions ---------------------
83 #if !defined(__CINT__) && !defined(__MAKECINT__)
84  template<class T>
85  void get(const T*& oData) const {
86  oData=reinterpret_cast<const T*>(data(typeid(T)));
87  }
88 #endif
89  const void* data(const std::type_info&) const;
90  const FWDisplayProperties& defaultDisplayProperties() const;
91 
93  int layer() const;
95  bool isInFront() const;
97  bool isInBack() const;
98 
99  const std::string& filterExpression() const;
102  unsigned int id() const;
103  const std::string& name() const;
104  const TClass* type() const;
106  const std::string& purpose() const;
107 
108  const std::string& moduleLabel() const;
109  const std::string& productInstanceLabel() const;
110  const std::string& processName() const;
111 
112  const TClass* modelType() const;
113  ModelInfo modelInfo(int iIndex) const; //return copy for now since want to be able to change visibility
114  size_t size() const;
115  const void* modelData(int iIndex) const;
116  std::string modelName(int iIndex) const;
117 
119  const FWItemValueGetter& valueGetter() const { return m_interestingValueGetter; }
120  bool haveInterestingValue() const;
121  const std::string& modelInterestingValueAsString(int iIndex) const;
122 
123  bool isCollection() const;
124 
125  void resetColor();
126  //convenience methods
127 
128  const fireworks::Context& context () const {
129  return *m_context;
130  }
131 
133  return m_context->modelChangeManager();
134  }
136  return m_context->selectionManager();
137  }
138 
140  return m_context->colorManager();
141  }
142 
143  bool hasEvent() const {
144  return nullptr != m_event;
145  }
146 
147  // hackery methods
148  const edm::EventBase *getEvent () const {
149  return m_event;
150  }
151 
153  bool hasError() const;
155  const std::string& errorMessage() const;
156 
157  // ---------- static member functions --------------------
158 
159  static int minLayerValue();
160  static int maxLayerValue();
161 
162  // ---------- member functions ---------------------------
163  void setEvent(const edm::EventBase* iEvent);
164 
165  void setData(const edm::ObjectWithDict& ) const;
166 
167  void getPrimaryData() const;
168  const FWGeometry* getGeom() const;
169  FWProxyBuilderConfiguration* getConfig() const { return m_proxyBuilderConfig; }
170 
171  void setLabels(const std::string& iModule,
172  const std::string& iProductInstance,
173  const std::string& iProcess);
174  void setName(const std::string& iName);
175  void setDefaultDisplayProperties(const FWDisplayProperties&);
177  void setFilterExpression(const std::string& );
178 
180  void selectItem();
181  void unselectItem();
182  void toggleSelectItem();
183  bool itemIsSelected() const;
184 
186  void moveToFront();
187  void moveToBack();
188  void moveToLayer(int layer);
189 
190  void proxyConfigChanged(bool k = false);
191 
192  void unselect(int iIndex) const;
193  void select(int iIndex) const;
194  void toggleSelect(int iIndex) const;
195  void setDisplayProperties(int iIndex, const FWDisplayProperties&) const;
196 
197  void destroy() const;
200 
203 
208 
212 
215 
219 
220 private:
221  //FWEventItem(const FWEventItem&); // stop default
222 
223  //const FWEventItem& operator=(const FWEventItem&); // stop default
224 
225  void runFilter();
226  void handleChange();
227  // ---------- member data --------------------------------
229  unsigned int m_id;
231  const TClass* m_type;
233  std::shared_ptr<FWItemAccessorBase> m_accessor;
235  int m_layer;
236  mutable std::vector<ModelInfo> m_itemInfos;
237 
238  //This will probably moved to a FWEventItemRetriever class
245 
249 
251  Color_t m_origColor;
252 
254 };
255 
256 
257 #endif
const TClass * m_type
Definition: FWEventItem.h:231
size
Write out results.
type
Definition: HCALResponse.h:21
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:119
FWItemChangeSignal preItemChanged_
Definition: FWEventItem.h:207
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:132
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
Color_t m_origColor
Definition: FWEventItem.h:251
def destroy(e)
Definition: pyrootRender.py:15
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:244
bool isSelected() const
Definition: FWEventItem.h:71
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:211
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:218
const fireworks::Context * m_context
Definition: FWEventItem.h:228
std::string m_moduleLabel
Definition: FWEventItem.h:239
std::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:233
unsigned int m_id
Definition: FWEventItem.h:229
FWModelFilter m_filter
Definition: FWEventItem.h:246
int iEvent
Definition: GenABIO.cc:224
std::string m_processName
Definition: FWEventItem.h:241
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:243
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:253
const fireworks::Context & context() const
Definition: FWEventItem.h:128
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:202
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:61
int k[5][pyjets_maxn]
bool m_printedErrorThisEvent
Definition: FWEventItem.h:247
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:148
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:234
bool hasEvent() const
Definition: FWEventItem.h:143
const edm::EventBase * m_event
Definition: FWEventItem.h:242
FWModelChangeSignal changed_
Definition: FWEventItem.h:199
std::string m_errorMessage
Definition: FWEventItem.h:248
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:236
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:63
bool m_isSelected
Definition: FWEventItem.h:250
long double T
std::string m_purpose
Definition: FWEventItem.h:232
std::string m_productInstanceLabel
Definition: FWEventItem.h:240
std::string m_name
Definition: FWEventItem.h:230
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:214