15 #include <boost/bind.hpp> 83 "FWEventItemsManager::add(const FWPhysicsObjectDesc& iItem), color index not valid. Set Color idex to %d\n",
145 assert(
nullptr != cm);
146 for (std::vector<FWEventItem*>::const_iterator it =
m_items.begin(); it !=
m_items.end(); ++it) {
159 std::ostringstream os;
160 os << (*it)->defaultDisplayProperties().color();
165 std::ostringstream os;
166 os << (*it)->layer();
171 std::ostringstream os;
172 os << static_cast<int>((*it)->defaultDisplayProperties().transparency());
177 (*it)->getConfig()->addTo(pbTmp);
188 assert(
nullptr != cm);
193 if (keyValues ==
nullptr)
196 std::vector<FWEventItem*> newItems;
197 newItems.reserve(keyValues->size());
199 for (FWConfiguration::KeyValues::const_iterator it = keyValues->begin(); it != keyValues->end(); ++it) {
203 assert(
nullptr != keyValues);
206 const std::string& productInstanceLabel = (*keyValues)[2].second.value();
208 const std::string& filterExpression = (*keyValues)[4].second.value();
209 const std::string& sColor = (*keyValues)[5].second.value();
210 const bool isVisible = (*keyValues)[6].second.value() ==
kTrue;
212 unsigned int colorIndex;
214 std::istringstream is(sColor);
223 std::istringstream is(sColor);
227 int transparency = 0;
232 transparency = strtol((*keyValues)[9].second.value().c_str(),
nullptr, 10);
236 unsigned int layer = strtol((*keyValues)[7].
second.value().c_str(),
nullptr, 10);
241 purpose = (*keyValues)[8].second.value();
248 assert(proxyConfig ==
nullptr);
249 if (purpose ==
"VerticesWithTracks") {
250 purpose =
"Vertices";
259 TClass::GetClass(type.c_str()),
263 productInstanceLabel,
268 newItems.push_back(
add(desc, proxyConfig,
false));
273 for (
auto ip : newItems)
307 if (item && item->
name() == iName)
FWModelChangeManager * m_changeManager
const KeyValues * keyValues() const
void removeItem(const FWEventItem *)
const FWDisplayProperties & displayProperties() const
static const std::string kModuleLabel("moduleLabel")
void setEvent(const edm::EventBase *iEvent)
const std::string & name() const
FWColorManager * colorManager() const
static const std::string kTrue("t")
void setFrom(const FWConfiguration &) override
static Color_t getDefaultStartColorIndex()
unsigned int version() const
Color_t oldColorToIndex(Color_t, int version) const
static const std::string kType("type")
void setContext(fireworks::Context *)
const TClass * type() const
sigc::signal< void, const FWEventItem * > removingItem_
bool colorHasIndex(Color_t) const
static const std::string kColor("color")
static const std::string kProductInstanceLabel("productInstanceLabel")
U second(std::pair< T, U > const &p)
static const std::string kFilterExpression("filterExpression")
static const std::string kProcessName("processName")
static const std::string kFalse("f")
~FWEventItemsManager() override
void setDisplayProperties(const FWDisplayProperties &)
sigc::signal< void, FWEventItem * > newItem_
FWEventItem * add(const FWPhysicsObjectDesc &iItem, const FWConfiguration *pbConf=nullptr, bool doSetEvent=true)
const FWEventItem * find(const std::string &iName) const
static const std::string kLayer("layer")
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
const edm::EventBase * m_event
std::shared_ptr< FWItemAccessorFactory > m_accessorFactory
const_iterator begin() const
NOTE: iterator is allowed to return a null object for items that have been removed.
static const std::string kTransparency("transparency")
void newEvent(const edm::EventBase *iEvent)
void addTo(FWConfiguration &) const override
static const std::string kIsVisible("isVisible")
static const std::string kPurpose("purpose")
fireworks::Context * m_context
const FWConfiguration * valueForKey(const std::string &iKey) const
std::vector< FWEventItem * > m_items
std::vector< FWEventItem * >::const_iterator const_iterator
sigc::signal< void > goingToClearItems_
FWEventItemsManager(FWModelChangeManager *)
const_iterator end() const