test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <boost/shared_ptr.hpp>
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 {
62  ModelInfo(const FWDisplayProperties& iProps, bool iIsSelected) :
63  m_displayProperties(iProps),
64  m_isSelected(iIsSelected) {
65  }
66 
68  return m_displayProperties;
69  }
70  bool isSelected() const {
71  return m_isSelected;
72  }
73  };
74 
76  unsigned int iItemId,
77  boost::shared_ptr<FWItemAccessorBase> iAccessor,
78  const FWPhysicsObjectDesc& iDesc, const FWConfiguration* pbConf = 0);
79  virtual ~FWEventItem();
80 
81  // ---------- const member functions ---------------------
82 #if !defined(__CINT__) && !defined(__MAKECINT__)
83  template<class T>
84  void get(const T*& oData) const {
85  oData=reinterpret_cast<const T*>(data(typeid(T)));
86  }
87 #endif
88  const void* data(const std::type_info&) const;
90 
92  int layer() const;
94  bool isInFront() const;
96  bool isInBack() const;
97 
98  const std::string& filterExpression() const;
101  unsigned int id() const;
102  const std::string& name() const;
103  const TClass* type() const;
105  const std::string& purpose() const;
106 
107  const std::string& moduleLabel() const;
108  const std::string& productInstanceLabel() const;
109  const std::string& processName() const;
110 
111  const TClass* modelType() const;
112  ModelInfo modelInfo(int iIndex) const; //return copy for now since want to be able to change visibility
113  size_t size() const;
114  const void* modelData(int iIndex) const;
115  std::string modelName(int iIndex) const;
116 
119  bool haveInterestingValue() const;
120  const std::string& modelInterestingValueAsString(int iIndex) const;
121 
122  bool isCollection() const;
123 
124  //convenience methods
125 
126  const fireworks::Context& context () const {
127  return *m_context;
128  }
129 
131  return m_context->modelChangeManager();
132  }
134  return m_context->selectionManager();
135  }
136 
138  return m_context->colorManager();
139  }
140 
141  bool hasEvent() const {
142  return 0 != m_event;
143  }
144 
145  // hackery methods
146  const edm::EventBase *getEvent () const {
147  return m_event;
148  }
149 
150 
152  bool hasError() const;
154  const std::string& errorMessage() const;
155 
156  // ---------- static member functions --------------------
157 
158  static int minLayerValue();
159  static int maxLayerValue();
160 
161  // ---------- member functions ---------------------------
162  void setEvent(const edm::EventBase* iEvent);
163 
164  void setData(const edm::ObjectWithDict& ) const;
165 
166  void getPrimaryData() const;
167  const FWGeometry* getGeom() const;
169 
170  void setLabels(const std::string& iModule,
171  const std::string& iProductInstance,
172  const std::string& iProcess);
173  void setName(const std::string& iName);
176  void setFilterExpression(const std::string& );
177 
179  void selectItem();
180  void unselectItem();
181  void toggleSelectItem();
182  bool itemIsSelected() const;
183 
185  void moveToFront();
186  void moveToBack();
187  void moveToLayer(int layer);
188 
189  void proxyConfigChanged();
190 
191  void unselect(int iIndex) const;
192  void select(int iIndex) const;
193  void toggleSelect(int iIndex) const;
194  void setDisplayProperties(int iIndex, const FWDisplayProperties&) const;
195 
196  void destroy() const;
199 
202 
207 
211 
214 
218 private:
219  //FWEventItem(const FWEventItem&); // stop default
220 
221  //const FWEventItem& operator=(const FWEventItem&); // stop default
222 
223  void runFilter();
224  void handleChange();
225  // ---------- member data --------------------------------
227  unsigned int m_id;
229  const TClass* m_type;
231  boost::shared_ptr<FWItemAccessorBase> m_accessor;
233  int m_layer;
234  mutable std::vector<ModelInfo> m_itemInfos;
235 
236  //This will probably moved to a FWEventItemRetriever class
243 
247 
249 
250 
252 };
253 
254 
255 #endif
const TClass * m_type
Definition: FWEventItem.h:229
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:168
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:118
FWItemChangeSignal preItemChanged_
Definition: FWEventItem.h:206
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:130
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
void destroy() const
Definition: FWEventItem.cc:608
void moveToBack()
Definition: FWEventItem.cc:333
void moveToFront()
Definition: FWEventItem.cc:310
void moveToLayer(int layer)
Definition: FWEventItem.cc:356
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:574
void setEvent(const edm::EventBase *iEvent)
Definition: FWEventItem.cc:120
const std::string & name() const
Definition: FWEventItem.cc:500
FWColorManager * colorManager() const
Definition: FWEventItem.h:137
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:242
bool isSelected() const
Definition: FWEventItem.h:70
void proxyConfigChanged()
Definition: FWEventItem.cc:368
FWColorManager * colorManager() const
Definition: Context.h:65
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:276
const std::string & filterExpression() const
Definition: FWEventItem.cc:602
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:210
bool haveInterestingValue() const
Definition: FWEventItem.cc:587
void getPrimaryData() const
Definition: FWEventItem.cc:443
void unselect(int iIndex) const
Definition: FWEventItem.cc:239
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:217
boost::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:231
const fireworks::Context * m_context
Definition: FWEventItem.h:226
bool itemIsSelected() const
Definition: FWEventItem.cc:661
const std::string & processName() const
Definition: FWEventItem.cc:529
void setLabels(const std::string &iModule, const std::string &iProductInstance, const std::string &iProcess)
Definition: FWEventItem.cc:130
std::string m_moduleLabel
Definition: FWEventItem.h:237
static int maxLayerValue()
Definition: FWEventItem.cc:43
const void * data(const std::type_info &) const
Definition: FWEventItem.cc:392
int layer() const
Definition: FWEventItem.cc:457
unsigned int m_id
Definition: FWEventItem.h:227
FWModelFilter m_filter
Definition: FWEventItem.h:244
int iEvent
Definition: GenABIO.cc:230
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:155
const std::string & productInstanceLabel() const
Definition: FWEventItem.cc:523
std::string m_processName
Definition: FWEventItem.h:239
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:241
const TClass * type() const
Definition: FWEventItem.cc:506
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:251
const fireworks::Context & context() const
Definition: FWEventItem.h:126
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:201
unsigned int id() const
Definition: FWEventItem.cc:494
FWSelectionManager * selectionManager() const
Definition: Context.h:57
void setData(const edm::ObjectWithDict &) const
Definition: FWEventItem.cc:430
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:54
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:594
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:60
static int minLayerValue()
Definition: FWEventItem.cc:38
bool m_printedErrorThisEvent
Definition: FWEventItem.h:245
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:667
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:133
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:146
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:264
bool isInBack() const
returns true if item is behind all other items
Definition: FWEventItem.cc:478
size_t size() const
Definition: FWEventItem.cc:548
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:232
void selectItem()
Definition: FWEventItem.cc:632
void handleChange()
Definition: FWEventItem.cc:378
virtual ~FWEventItem()
Definition: FWEventItem.cc:99
bool hasEvent() const
Definition: FWEventItem.h:141
bool isInFront() const
returns true if item is in front of all other items
Definition: FWEventItem.cc:463
void setFilterExpression(const std::string &)
Definition: FWEventItem.cc:199
void unselectItem()
Definition: FWEventItem.cc:641
FWEventItem(fireworks::Context *iContext, unsigned int iItemId, boost::shared_ptr< FWItemAccessorBase > iAccessor, const FWPhysicsObjectDesc &iDesc, const FWConfiguration *pbConf=0)
Definition: FWEventItem.cc:52
const edm::EventBase * m_event
Definition: FWEventItem.h:240
FWModelChangeSignal changed_
Definition: FWEventItem.h:198
std::string m_errorMessage
Definition: FWEventItem.h:246
bool isCollection() const
Definition: FWEventItem.cc:555
const TClass * modelType() const
Definition: FWEventItem.cc:561
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:672
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:234
void toggleSelectItem()
Definition: FWEventItem.cc:650
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:62
void select(int iIndex) const
Definition: FWEventItem.cc:250
bool m_isSelected
Definition: FWEventItem.h:248
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:567
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
const std::string & purpose() const
Definition: FWEventItem.cc:512
long double T
void setName(const std::string &iName)
Definition: FWEventItem.cc:143
void runFilter()
Definition: FWEventItem.cc:207
std::string m_purpose
Definition: FWEventItem.h:230
std::string m_productInstanceLabel
Definition: FWEventItem.h:238
std::string m_name
Definition: FWEventItem.h:228
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
const std::string & moduleLabel() const
Definition: FWEventItem.cc:518
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:213