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 
56 class FWEventItem {
57 public:
58  struct ModelInfo {
61  ModelInfo(const FWDisplayProperties& iProps, bool iIsSelected)
62  : m_displayProperties(iProps), m_isSelected(iIsSelected) {}
63 
65  bool isSelected() const { return m_isSelected; }
66  };
67 
69  unsigned int iItemId,
70  std::shared_ptr<FWItemAccessorBase> iAccessor,
71  const FWPhysicsObjectDesc& iDesc,
72  const FWConfiguration* pbConf = nullptr);
73  virtual ~FWEventItem();
74 
75  // ---------- const member functions ---------------------
76 #if !defined(__CINT__) && !defined(__MAKECINT__)
77  template <class T>
78  void get(const T*& oData) const {
79  oData = reinterpret_cast<const T*>(data(typeid(T)));
80  }
81 #endif
82  const void* data(const std::type_info&) const;
84 
86  int layer() const;
88  bool isInFront() const;
90  bool isInBack() const;
91 
92  const std::string& filterExpression() const;
95  unsigned int id() const;
96  const std::string& name() const;
97  const TClass* type() const;
99  const std::string& purpose() const;
100 
101  const std::string& moduleLabel() const;
102  const std::string& productInstanceLabel() const;
103  const std::string& processName() const;
104 
105  const TClass* modelType() const;
106  ModelInfo modelInfo(int iIndex) const; //return copy for now since want to be able to change visibility
107  size_t size() const;
108  const void* modelData(int iIndex) const;
109  std::string modelName(int iIndex) const;
110 
113  bool haveInterestingValue() const;
114  const std::string& modelInterestingValueAsString(int iIndex) const;
115 
116  bool isCollection() const;
117 
118  void resetColor();
119  //convenience methods
120 
121  const fireworks::Context& context() const { return *m_context; }
122 
125 
127 
128  bool hasEvent() const { return nullptr != m_event; }
129 
130  // hackery methods
131  const edm::EventBase* getEvent() const { return m_event; }
132 
134  bool hasError() const;
136  const std::string& errorMessage() const;
137 
138  // ---------- static member functions --------------------
139 
140  static int minLayerValue();
141  static int maxLayerValue();
142 
143  // ---------- member functions ---------------------------
144  void setEvent(const edm::EventBase* iEvent);
145 
146  void setData(const edm::ObjectWithDict&) const;
147 
148  void getPrimaryData() const;
149  const FWGeometry* getGeom() const;
151 
152  void setLabels(const std::string& iModule, const std::string& iProductInstance, const std::string& iProcess);
153  void setName(const std::string& iName);
156  void setFilterExpression(const std::string&);
157 
159  void selectItem();
160  void unselectItem();
161  void toggleSelectItem();
162  bool itemIsSelected() const;
163 
165  void moveToFront();
166  void moveToBack();
167  void moveToLayer(int layer);
168 
169  void proxyConfigChanged(bool k = false);
170 
171  void unselect(int iIndex) const;
172  void select(int iIndex) const;
173  void toggleSelect(int iIndex) const;
174  void setDisplayProperties(int iIndex, const FWDisplayProperties&) const;
175 
176  void destroy() const;
179 
182 
187 
191 
194 
198 
199 private:
200  //FWEventItem(const FWEventItem&); // stop default
201 
202  //const FWEventItem& operator=(const FWEventItem&); // stop default
203 
204  void runFilter();
205  void handleChange();
206  // ---------- member data --------------------------------
208  unsigned int m_id;
210  const TClass* m_type;
212  std::shared_ptr<FWItemAccessorBase> m_accessor;
214  int m_layer;
215  mutable std::vector<ModelInfo> m_itemInfos;
216 
217  //This will probably moved to a FWEventItemRetriever class
224 
228 
230  Color_t m_origColor;
231 
233 };
234 
235 #endif
FWEventItem::ModelInfo::m_isSelected
bool m_isSelected
Definition: FWEventItem.h:60
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
fireworks::Context
Definition: Context.h:41
FWGeometry
Definition: FWGeometry.h:27
FWEventItem::m_layer
int m_layer
Definition: FWEventItem.h:214
FWEventItem::productInstanceLabel
const std::string & productInstanceLabel() const
Definition: FWEventItem.cc:442
FWEventItem::setData
void setData(const edm::ObjectWithDict &) const
Definition: FWEventItem.cc:385
FWEventItem::valueGetter
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:112
FWEventItem::preItemChanged_
FWItemChangeSignal preItemChanged_
Definition: FWEventItem.h:186
FWEventItem::setEvent
void setEvent(const edm::EventBase *iEvent)
Definition: FWEventItem.cc:111
FWEventItem::errorMessage
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:541
FWItemValueGetter.h
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
fireworks::Context::modelChangeManager
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:53
FWEventItem::processName
const std::string & processName() const
Definition: FWEventItem.cc:444
FWEventItem::m_context
const fireworks::Context * m_context
Definition: FWEventItem.h:207
FWEventItem::hasEvent
bool hasEvent() const
Definition: FWEventItem.h:128
FWEventItem::isInFront
bool isInFront() const
returns true if item is in front of all other items
Definition: FWEventItem.cc:407
fireworks::Context::colorManager
FWColorManager * colorManager() const
Definition: Context.h:58
FWEventItem::toggleSelect
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:236
FWEventItem::m_moduleLabel
std::string m_moduleLabel
Definition: FWEventItem.h:218
edm
HLT enums.
Definition: AlignableModifier.h:19
FWEventItem::get
void get(const T *&oData) const
Definition: FWEventItem.h:78
FWEventItem::moveToBack
void moveToBack()
Definition: FWEventItem.cc:299
edm::ObjectWithDict
Definition: ObjectWithDict.h:17
FWEventItem::maxLayerValue
static int maxLayerValue()
Definition: FWEventItem.cc:40
FWEventItem::modelInterestingValueAsString
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:486
FWEventItem::goingToBeDestroyed_
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:197
FWEventItem::ModelInfo::ModelInfo
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:61
FWEventItem::proxyConfigChanged
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:330
FWEventItem::modelData
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
FWEventItem::itemIsSelected
bool itemIsSelected() const
Definition: FWEventItem.cc:537
Context
FWEventItem::m_id
unsigned int m_id
Definition: FWEventItem.h:208
FWEventItem::moduleLabel
const std::string & moduleLabel() const
Definition: FWEventItem.cc:441
TypeWithDict.h
FWEventItem::selectionManager
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
FWEventItem::id
unsigned int id() const
Definition: FWEventItem.cc:433
FWModelChangeManager
Definition: FWModelChangeManager.h:33
FWEventItem::m_accessor
std::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:212
FWEventItem::setDefaultDisplayProperties
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:138
FWEventItem::defaultDisplayPropertiesChanged_
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:190
FWEventItem::m_origColor
Color_t m_origColor
Definition: FWEventItem.h:230
FWItemChangeSignal.h
FWModelFilter.h
FWEventItem::select
void select(int iIndex) const
Definition: FWEventItem.cc:224
FWEventItem::changeManager
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:123
FWEventItem::getPrimaryData
void getPrimaryData() const
Definition: FWEventItem.cc:396
FWEventItem::defaultDisplayProperties
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
FWEventItem::m_interestingValueGetter
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:223
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
FWModelChangeSignal.h
FWEventItem::setLabels
void setLabels(const std::string &iModule, const std::string &iProductInstance, const std::string &iProcess)
Definition: FWEventItem.cc:119
FWEventItem::isInBack
bool isInBack() const
returns true if item is behind all other items
Definition: FWEventItem.cc:420
FWItemChangeSignal
FWEventItem::context
const fireworks::Context & context() const
Definition: FWEventItem.h:121
FWItemValueGetter
Definition: FWItemValueGetter.h:32
FWEventItem::modelType
const TClass * modelType() const
Definition: FWEventItem.cc:464
FWEventItem::data
const void * data(const std::type_info &) const
Definition: FWEventItem.cc:353
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FWEventItem::m_printedErrorThisEvent
bool m_printedErrorThisEvent
Definition: FWEventItem.h:226
FWModelChangeSignal
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWEventItem::getEvent
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
edm::TypeWithDict
Definition: TypeWithDict.h:38
FWEventItem::itemChanged_
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
FWEventItem::~FWEventItem
virtual ~FWEventItem()
Definition: FWEventItem.cc:94
FWEventItem::m_filter
FWModelFilter m_filter
Definition: FWEventItem.h:225
FWEventItem::filterExpression
const std::string & filterExpression() const
Definition: FWEventItem.cc:491
FWSelectionManager
Definition: FWSelectionManager.h:34
FWEventItem::unselect
void unselect(int iIndex) const
Definition: FWEventItem.cc:215
FWEventItem::resetColor
void resetColor()
Definition: FWEventItem.cc:550
FWEventItem::modelName
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
FWEventItem::m_wrapperType
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:222
FWPhysicsObjectDesc
Definition: FWPhysicsObjectDesc.h:30
FWEventItem::m_processName
std::string m_processName
Definition: FWEventItem.h:220
FWEventItem::ModelInfo::isSelected
bool isSelected() const
Definition: FWEventItem.h:65
iEvent
int iEvent
Definition: GenABIO.cc:224
FWEventItem::layer
int layer() const
Definition: FWEventItem.cc:405
FWDisplayProperties.h
FWEventItem::m_proxyBuilderConfig
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:232
FWEventItem::hasError
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:539
FWEventItem::type
const TClass * type() const
Definition: FWEventItem.cc:437
FWEventItem::toggleSelectItem
void toggleSelectItem()
Definition: FWEventItem.cc:528
FWColorManager
Definition: FWColorManager.h:45
FWPhysicsObjectDesc.h
FWEventItem::setDisplayProperties
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:247
FWEventItem::purpose
const std::string & purpose() const
Definition: FWEventItem.cc:439
FWEventItem::ModelInfo::displayProperties
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
FWDisplayProperties
Definition: FWDisplayProperties.h:28
FWEventItem::m_isSelected
bool m_isSelected
Definition: FWEventItem.h:229
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWEventItem::m_displayProperties
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:213
FWEventItem
Definition: FWEventItem.h:56
FWEventItem::handleChange
void handleChange()
Definition: FWEventItem.cc:341
FWEventItem::minLayerValue
static int minLayerValue()
Definition: FWEventItem.cc:38
FWEventItem::haveInterestingValue
bool haveInterestingValue() const
Definition: FWEventItem.cc:482
FWEventItem::runFilter
void runFilter()
Definition: FWEventItem.cc:186
T
long double T
Definition: Basic3DVectorLD.h:48
FWProxyBuilderConfiguration
Definition: FWProxyBuilderConfiguration.h:42
edm::EventBase
Definition: EventBase.h:46
FWEventItem::ModelInfo::m_displayProperties
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:59
FWItemAccessorBase
Definition: FWItemAccessorBase.h:33
EventBase
FWModelFilter
Definition: FWModelFilter.h:31
FWEventItem::filterChanged_
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:193
FWEventItem::isCollection
bool isCollection() const
Definition: FWEventItem.cc:462
FWEventItem::selectItem
void selectItem()
Definition: FWEventItem.cc:514
FWEventItem::m_itemInfos
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:215
FWEventItem::setName
void setName(const std::string &iName)
Definition: FWEventItem.cc:130
FWEventItem::name
const std::string & name() const
Definition: FWEventItem.cc:435
FWConfiguration
Definition: FWConfiguration.h:31
FWEventItem::setFilterExpression
void setFilterExpression(const std::string &)
Definition: FWEventItem.cc:180
fireworks
Definition: FWTauProxyBuilderBase.h:35
FWEventItem::m_productInstanceLabel
std::string m_productInstanceLabel
Definition: FWEventItem.h:219
FWEventItem::unselectItem
void unselectItem()
Definition: FWEventItem.cc:521
FWEventItem::m_name
std::string m_name
Definition: FWEventItem.h:209
FWEventItem::m_event
const edm::EventBase * m_event
Definition: FWEventItem.h:221
FWEventItem::colorManager
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
FWEventItem::FWEventItem
FWEventItem(fireworks::Context *iContext, unsigned int iItemId, std::shared_ptr< FWItemAccessorBase > iAccessor, const FWPhysicsObjectDesc &iDesc, const FWConfiguration *pbConf=nullptr)
Definition: FWEventItem.cc:45
FWEventItem::changed_
FWModelChangeSignal changed_
Definition: FWEventItem.h:178
FWEventItem::m_errorMessage
std::string m_errorMessage
Definition: FWEventItem.h:227
FWEventItem::m_type
const TClass * m_type
Definition: FWEventItem.h:210
FWEventItem::destroy
void destroy() const
Definition: FWEventItem.cc:493
fireworks::Context::selectionManager
FWSelectionManager * selectionManager() const
Definition: Context.h:54
FWEventItem::moveToFront
void moveToFront()
Definition: FWEventItem.cc:278
FWEventItem::moveToLayer
void moveToLayer(int layer)
Definition: FWEventItem.cc:320
FWEventItem::size
size_t size() const
Definition: FWEventItem.cc:457
Context.h
FWEventItem::m_purpose
std::string m_purpose
Definition: FWEventItem.h:211