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
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  boost::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;
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 
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;
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);
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  boost::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
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
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:132
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void destroy() const
Definition: FWEventItem.cc:610
void moveToBack()
Definition: FWEventItem.cc:335
Color_t m_origColor
Definition: FWEventItem.h:252
void moveToFront()
Definition: FWEventItem.cc:312
void moveToLayer(int layer)
Definition: FWEventItem.cc:358
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:576
void setEvent(const edm::EventBase *iEvent)
Definition: FWEventItem.cc:122
const std::string & name() const
Definition: FWEventItem.cc:502
FWColorManager * colorManager() const
Definition: FWEventItem.h:139
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:245
bool isSelected() const
Definition: FWEventItem.h:71
void proxyConfigChanged()
Definition: FWEventItem.cc:370
FWColorManager * colorManager() const
Definition: Context.h:65
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:278
const std::string & filterExpression() const
Definition: FWEventItem.cc:604
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:212
bool haveInterestingValue() const
Definition: FWEventItem.cc:589
void getPrimaryData() const
Definition: FWEventItem.cc:445
void unselect(int iIndex) const
Definition: FWEventItem.cc:241
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:219
boost::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:234
const fireworks::Context * m_context
Definition: FWEventItem.h:229
bool itemIsSelected() const
Definition: FWEventItem.cc:663
const std::string & processName() const
Definition: FWEventItem.cc:531
void setLabels(const std::string &iModule, const std::string &iProductInstance, const std::string &iProcess)
Definition: FWEventItem.cc:132
std::string m_moduleLabel
Definition: FWEventItem.h:240
static int maxLayerValue()
Definition: FWEventItem.cc:43
const void * data(const std::type_info &) const
Definition: FWEventItem.cc:394
int layer() const
Definition: FWEventItem.cc:459
unsigned int m_id
Definition: FWEventItem.h:230
FWModelFilter m_filter
Definition: FWEventItem.h:247
int iEvent
Definition: GenABIO.cc:230
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:157
void resetColor()
Definition: FWEventItem.cc:687
const std::string & productInstanceLabel() const
Definition: FWEventItem.cc:525
std::string m_processName
Definition: FWEventItem.h:242
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:244
const TClass * type() const
Definition: FWEventItem.cc:508
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:254
const fireworks::Context & context() const
Definition: FWEventItem.h:128
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:203
unsigned int id() const
Definition: FWEventItem.cc:496
FWSelectionManager * selectionManager() const
Definition: Context.h:57
void setData(const edm::ObjectWithDict &) const
Definition: FWEventItem.cc:432
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:54
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:596
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:61
static int minLayerValue()
Definition: FWEventItem.cc:38
bool m_printedErrorThisEvent
Definition: FWEventItem.h:248
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:669
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:135
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:148
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:266
bool isInBack() const
returns true if item is behind all other items
Definition: FWEventItem.cc:480
size_t size() const
Definition: FWEventItem.cc:550
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:235
void selectItem()
Definition: FWEventItem.cc:634
void handleChange()
Definition: FWEventItem.cc:380
virtual ~FWEventItem()
Definition: FWEventItem.cc:101
bool hasEvent() const
Definition: FWEventItem.h:143
bool isInFront() const
returns true if item is in front of all other items
Definition: FWEventItem.cc:465
void setFilterExpression(const std::string &)
Definition: FWEventItem.cc:201
void unselectItem()
Definition: FWEventItem.cc:643
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:243
FWModelChangeSignal changed_
Definition: FWEventItem.h:200
std::string m_errorMessage
Definition: FWEventItem.h:249
bool isCollection() const
Definition: FWEventItem.cc:557
const TClass * modelType() const
Definition: FWEventItem.cc:563
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:674
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:237
void toggleSelectItem()
Definition: FWEventItem.cc:652
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:63
void select(int iIndex) const
Definition: FWEventItem.cc:252
bool m_isSelected
Definition: FWEventItem.h:251
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:569
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
const std::string & purpose() const
Definition: FWEventItem.cc:514
long double T
void setName(const std::string &iName)
Definition: FWEventItem.cc:145
void runFilter()
Definition: FWEventItem.cc:209
std::string m_purpose
Definition: FWEventItem.h:233
std::string m_productInstanceLabel
Definition: FWEventItem.h:241
std::string m_name
Definition: FWEventItem.h:231
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const std::string & moduleLabel() const
Definition: FWEventItem.cc:520
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:215