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 = 0);
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 0 != m_event;
145  }
146 
147  // hackery methods
148  const edm::EventBase *getEvent () const {
149  return m_event;
150  }
151 
152 
154  bool hasError() const;
156  const std::string& errorMessage() const;
157 
158  // ---------- static member functions --------------------
159 
160  static int minLayerValue();
161  static int maxLayerValue();
162 
163  // ---------- member functions ---------------------------
164  void setEvent(const edm::EventBase* iEvent);
165 
166  void setData(const edm::ObjectWithDict& ) const;
167 
168  void getPrimaryData() const;
169  const FWGeometry* getGeom() const;
170  FWProxyBuilderConfiguration* getConfig() const { return m_proxyBuilderConfig; }
171 
172  void setLabels(const std::string& iModule,
173  const std::string& iProductInstance,
174  const std::string& iProcess);
175  void setName(const std::string& iName);
176  void setDefaultDisplayProperties(const FWDisplayProperties&);
178  void setFilterExpression(const std::string& );
179 
181  void selectItem();
182  void unselectItem();
183  void toggleSelectItem();
184  bool itemIsSelected() const;
185 
187  void moveToFront();
188  void moveToBack();
189  void moveToLayer(int layer);
190 
191  void proxyConfigChanged();
192 
193  void unselect(int iIndex) const;
194  void select(int iIndex) const;
195  void toggleSelect(int iIndex) const;
196  void setDisplayProperties(int iIndex, const FWDisplayProperties&) const;
197 
198  void destroy() const;
201 
204 
209 
213 
216 
220 
221 private:
222  //FWEventItem(const FWEventItem&); // stop default
223 
224  //const FWEventItem& operator=(const FWEventItem&); // stop default
225 
226  void runFilter();
227  void handleChange();
228  // ---------- member data --------------------------------
230  unsigned int m_id;
232  const TClass* m_type;
234  std::shared_ptr<FWItemAccessorBase> m_accessor;
236  int m_layer;
237  mutable std::vector<ModelInfo> m_itemInfos;
238 
239  //This will probably moved to a FWEventItemRetriever class
246 
250 
252  Color_t m_origColor;
253 
255 };
256 
257 
258 #endif
const TClass * m_type
Definition: FWEventItem.h:232
size
Write out results.
type
Definition: HCALResponse.h:21
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:170
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:208
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:132
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
Color_t m_origColor
Definition: FWEventItem.h:252
def destroy(e)
Definition: pyrootRender.py:13
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:245
bool isSelected() const
Definition: FWEventItem.h:71
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:212
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:219
const fireworks::Context * m_context
Definition: FWEventItem.h:229
std::string m_moduleLabel
Definition: FWEventItem.h:240
std::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:234
unsigned int m_id
Definition: FWEventItem.h:230
FWModelFilter m_filter
Definition: FWEventItem.h:247
int iEvent
Definition: GenABIO.cc:230
std::string m_processName
Definition: FWEventItem.h:242
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:244
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:254
const fireworks::Context & context() const
Definition: FWEventItem.h:128
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:203
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:61
bool m_printedErrorThisEvent
Definition: FWEventItem.h:248
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:148
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:235
bool hasEvent() const
Definition: FWEventItem.h:143
const edm::EventBase * m_event
Definition: FWEventItem.h:243
FWModelChangeSignal changed_
Definition: FWEventItem.h:200
std::string m_errorMessage
Definition: FWEventItem.h:249
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:237
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:63
bool m_isSelected
Definition: FWEventItem.h:251
long double T
std::string m_purpose
Definition: FWEventItem.h:233
std::string m_productInstanceLabel
Definition: FWEventItem.h:241
std::string m_name
Definition: FWEventItem.h:231
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:215