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
const TClass * m_type
Definition: FWEventItem.h:210
bool isCollection() const
Definition: FWEventItem.cc:462
FWSelectionManager * selectionManager() const
Definition: Context.h:54
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:330
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:112
size_t size() const
Definition: FWEventItem.cc:457
FWItemChangeSignal preItemChanged_
Definition: FWEventItem.h:186
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
void moveToBack()
Definition: FWEventItem.cc:299
Color_t m_origColor
Definition: FWEventItem.h:230
void moveToFront()
Definition: FWEventItem.cc:278
void setData(const edm::ObjectWithDict &) const
Definition: FWEventItem.cc:385
void moveToLayer(int layer)
Definition: FWEventItem.cc:320
void setEvent(const edm::EventBase *iEvent)
Definition: FWEventItem.cc:111
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
bool hasEvent() const
Definition: FWEventItem.h:128
bool itemIsSelected() const
Definition: FWEventItem.cc:537
FWItemValueGetter m_interestingValueGetter
Definition: FWEventItem.h:223
unsigned int id() const
Definition: FWEventItem.cc:433
FWItemChangeSignal defaultDisplayPropertiesChanged_
Definition: FWEventItem.h:190
bool isInBack() const
returns true if item is behind all other items
Definition: FWEventItem.cc:420
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:197
FWModelChangeManager * changeManager() const
Definition: FWEventItem.h:123
const std::string & processName() const
Definition: FWEventItem.cc:444
const std::string & errorMessage() const
returns error string if there was a problem this event
Definition: FWEventItem.cc:541
const fireworks::Context * m_context
Definition: FWEventItem.h:207
bool isInFront() const
returns true if item is in front of all other items
Definition: FWEventItem.cc:407
const std::string & moduleLabel() const
Definition: FWEventItem.cc:441
void setLabels(const std::string &iModule, const std::string &iProductInstance, const std::string &iProcess)
Definition: FWEventItem.cc:119
std::string m_moduleLabel
Definition: FWEventItem.h:218
std::shared_ptr< FWItemAccessorBase > m_accessor
Definition: FWEventItem.h:212
const void * data(const std::type_info &) const
Definition: FWEventItem.cc:353
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
static int maxLayerValue()
Definition: FWEventItem.cc:40
const std::string & modelInterestingValueAsString(int iIndex) const
Definition: FWEventItem.cc:486
void select(int iIndex) const
Definition: FWEventItem.cc:224
const fireworks::Context & context() const
Definition: FWEventItem.h:121
unsigned int m_id
Definition: FWEventItem.h:208
FWSelectionManager * selectionManager() const
Definition: FWEventItem.h:124
const TClass * modelType() const
Definition: FWEventItem.cc:464
bool isSelected() const
Definition: FWEventItem.h:65
FWModelFilter m_filter
Definition: FWEventItem.h:225
void unselect(int iIndex) const
Definition: FWEventItem.cc:215
int iEvent
Definition: GenABIO.cc:224
void setDefaultDisplayProperties(const FWDisplayProperties &)
Definition: FWEventItem.cc:138
void resetColor()
Definition: FWEventItem.cc:550
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
std::string m_processName
Definition: FWEventItem.h:220
edm::TypeWithDict m_wrapperType
Definition: FWEventItem.h:222
void getPrimaryData() const
Definition: FWEventItem.cc:396
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
FWProxyBuilderConfiguration * m_proxyBuilderConfig
Definition: FWEventItem.h:232
bool hasError() const
returns true if failed to get data for this event
Definition: FWEventItem.cc:539
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
const std::string & filterExpression() const
Definition: FWEventItem.cc:491
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:59
static int minLayerValue()
Definition: FWEventItem.cc:38
bool m_printedErrorThisEvent
Definition: FWEventItem.h:226
FWModelChangeManager * modelChangeManager() const
Definition: Context.h:53
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
int layer() const
Definition: FWEventItem.cc:405
FWDisplayProperties m_displayProperties
Definition: FWEventItem.h:213
void selectItem()
Definition: FWEventItem.cc:514
void handleChange()
Definition: FWEventItem.cc:341
const TClass * type() const
Definition: FWEventItem.cc:437
virtual ~FWEventItem()
Definition: FWEventItem.cc:94
const std::string & name() const
Definition: FWEventItem.cc:435
void setFilterExpression(const std::string &)
Definition: FWEventItem.cc:180
void unselectItem()
Definition: FWEventItem.cc:521
const edm::EventBase * m_event
Definition: FWEventItem.h:221
FWEventItem(fireworks::Context *iContext, unsigned int iItemId, std::shared_ptr< FWItemAccessorBase > iAccessor, const FWPhysicsObjectDesc &iDesc, const FWConfiguration *pbConf=nullptr)
Definition: FWEventItem.cc:45
FWModelChangeSignal changed_
Definition: FWEventItem.h:178
std::string m_errorMessage
Definition: FWEventItem.h:227
HLT enums.
std::vector< ModelInfo > m_itemInfos
Definition: FWEventItem.h:215
void toggleSelectItem()
Definition: FWEventItem.cc:528
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:247
ModelInfo(const FWDisplayProperties &iProps, bool iIsSelected)
Definition: FWEventItem.h:61
bool haveInterestingValue() const
Definition: FWEventItem.cc:482
const std::string & purpose() const
Definition: FWEventItem.cc:439
bool m_isSelected
Definition: FWEventItem.h:229
FWColorManager * colorManager() const
Definition: FWEventItem.h:126
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void destroy() const
Definition: FWEventItem.cc:493
long double T
const std::string & productInstanceLabel() const
Definition: FWEventItem.cc:442
void setName(const std::string &iName)
Definition: FWEventItem.cc:130
void runFilter()
Definition: FWEventItem.cc:186
std::string m_purpose
Definition: FWEventItem.h:211
std::string m_productInstanceLabel
Definition: FWEventItem.h:219
std::string m_name
Definition: FWEventItem.h:209
FWColorManager * colorManager() const
Definition: Context.h:58
void toggleSelect(int iIndex) const
Definition: FWEventItem.cc:236
FWItemChangeSignal filterChanged_
Definition: FWEventItem.h:193