CMS 3D CMS Logo

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

FWEventItem Class Reference

#include <Fireworks/Core/interface/FWEventItem.h>

List of all members.

Classes

struct  ModelInfo

Public Member Functions

FWModelChangeManagerchangeManager () const
FWColorManagercolorManager () const
const fireworks::Contextcontext () const
const void * data (const std::type_info &) const
const FWDisplayPropertiesdefaultDisplayProperties () const
void destroy () const
const std::string & errorMessage () const
 returns error string if there was a problem this event
const std::string & filterExpression () const
 FWEventItem (fireworks::Context *iContext, unsigned int iItemId, boost::shared_ptr< FWItemAccessorBase > iAccessor, const FWPhysicsObjectDesc &iDesc, const FWConfiguration *pbConf=0)
template<class T >
void get (const T *&oData) const
FWProxyBuilderConfigurationgetConfig () const
const edm::EventBasegetEvent () const
const FWGeometrygetGeom () const
bool hasError () const
 returns true if failed to get data for this event
bool hasEvent () const
bool haveInterestingValue () const
unsigned int id () const
bool isCollection () const
bool isInBack () const
 returns true if item is behind all other items
bool isInFront () const
 returns true if item is in front of all other items
bool itemIsSelected () const
int layer () const
const void * modelData (int iIndex) const
ModelInfo modelInfo (int iIndex) const
const std::string & modelInterestingValueAsString (int iIndex) const
std::string modelName (int iIndex) const
const TClass * modelType () const
const std::string & moduleLabel () const
void moveToBack ()
void moveToFront ()
void moveToLayer (int layer)
const std::string & name () const
const std::string & processName () const
const std::string & productInstanceLabel () const
void proxyConfigChanged ()
const std::string & purpose () const
void select (int iIndex) const
FWSelectionManagerselectionManager () const
void selectItem ()
void setDefaultDisplayProperties (const FWDisplayProperties &)
void setDisplayProperties (int iIndex, const FWDisplayProperties &) const
void setEvent (const edm::EventBase *iEvent)
void setFilterExpression (const std::string &)
void setLabels (const std::string &iModule, const std::string &iProductInstance, const std::string &iProcess)
void setName (const std::string &iName)
size_t size () const
void toggleSelect (int iIndex) const
void toggleSelectItem ()
const TClass * type () const
void unselect (int iIndex) const
void unselectItem ()
const FWItemValueGettervalueGetter () const
 one value from the model which is normally used for the popup
virtual ~FWEventItem ()

Static Public Member Functions

static int maxLayerValue ()
static int minLayerValue ()

Public Attributes

FWModelChangeSignal changed_
FWItemChangeSignal defaultDisplayPropertiesChanged_
FWItemChangeSignal filterChanged_
FWItemChangeSignal goingToBeDestroyed_
FWItemChangeSignal itemChanged_
FWItemChangeSignal preItemChanged_

Private Member Functions

void getPrimaryData () const
void handleChange ()
void runFilter ()
void setData (const Reflex::Object &) const

Private Attributes

boost::shared_ptr
< FWItemAccessorBase
m_accessor
const fireworks::Contextm_context
FWDisplayProperties m_displayProperties
std::string m_errorMessage
const edm::EventBasem_event
FWModelFilter m_filter
unsigned int m_id
FWItemValueGetter m_interestingValueGetter
bool m_isSelected
std::vector< ModelInfom_itemInfos
int m_layer
std::string m_moduleLabel
std::string m_name
bool m_printedErrorThisEvent
std::string m_processName
std::string m_productInstanceLabel
FWProxyBuilderConfigurationm_proxyBuilderConfig
std::string m_purpose
const TClass * m_type
ROOT::Reflex::Type m_wrapperType

Detailed Description

Description: Stand in for a top level item in an Event

Usage: <usage>

Definition at line 57 of file FWEventItem.h.


Constructor & Destructor Documentation

FWEventItem::FWEventItem ( fireworks::Context iContext,
unsigned int  iItemId,
boost::shared_ptr< FWItemAccessorBase iAccessor,
const FWPhysicsObjectDesc iDesc,
const FWConfiguration pbConf = 0 
)

Definition at line 53 of file FWEventItem.cc.

References m_accessor, m_filter, m_itemInfos, m_proxyBuilderConfig, modelType(), and FWModelFilter::setClassName().

                                                                                        :
   m_context(iContext),
   m_id(iId),
   m_name(iDesc.name()),
   m_type(iDesc.type()),
   m_purpose(iDesc.purpose()),
   m_accessor(iAccessor),
   m_displayProperties(iDesc.displayProperties()),
   m_layer(iDesc.layer()),
   m_moduleLabel(iDesc.moduleLabel()),
   m_productInstanceLabel(iDesc.productInstanceLabel()),
   m_processName(iDesc.processName()),
   m_event(0),
   m_interestingValueGetter(ROOT::Reflex::Type::ByTypeInfo(*(m_accessor->modelType()->GetTypeInfo())), m_purpose),
   m_filter(iDesc.filterExpression(),""),
   m_printedErrorThisEvent(false),
   m_isSelected(false),
   m_proxyBuilderConfig(0)
{
   //assert(m_type->GetTypeInfo());
   //ROOT::Reflex::Type dataType( ROOT::Reflex::Type::ByTypeInfo(*(m_type->GetTypeInfo())));
   //assert(dataType != ROOT::Reflex::Type() );
   //
   //std::string dataTypeName = dataType.Name(ROOT::Reflex::SCOPED);
   //if (dataTypeName[dataTypeName.size() -1] == '>')
   //   dataTypeName += " ";
   //std::string wrapperName = "edm::Wrapper<" + dataTypeName + ">";
   //
   //fwLog(fwlog::kDebug) << "Looking for the wrapper name" 
   //                    << wrapperName << std::endl;
   //m_wrapperType = ROOT::Reflex::Type::ByName(wrapperName);
   //
   //assert(m_wrapperType != ROOT::Reflex::Type());
   if(!m_accessor->isCollection()) {
      m_itemInfos.reserve(1);
   }
   m_filter.setClassName(modelType()->GetName());
   m_proxyBuilderConfig = new FWProxyBuilderConfiguration(pbc, this);
}
FWEventItem::~FWEventItem ( ) [virtual]

Definition at line 100 of file FWEventItem.cc.

References m_proxyBuilderConfig.


Member Function Documentation

FWModelChangeManager* FWEventItem::changeManager ( ) const [inline]
FWColorManager* FWEventItem::colorManager ( ) const [inline]
const fireworks::Context& FWEventItem::context ( ) const [inline]
const void * FWEventItem::data ( const std::type_info &  iInfo) const

Definition at line 393 of file FWEventItem.cc.

References exception, edm::EventBase::getByLabel(), patZpeak::handle, m_accessor, m_errorMessage, m_event, m_moduleLabel, m_printedErrorThisEvent, m_processName, m_productInstanceLabel, m_type, name(), alignCSCRings::s, setData(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by get(), FWHandle::getFrom(), and getPrimaryData().

{
   using namespace Reflex;
   //At the moment this is a programming error
   assert(iInfo == *(m_type->GetTypeInfo()));

   //lookup data if we don't already have it
   if (m_accessor->data())
      return m_accessor->data();

   m_errorMessage.clear();
   if (!m_event)
      return m_accessor->data();
   
   // Retrieve the data from the event.
   edm::InputTag tag(m_moduleLabel, m_productInstanceLabel, m_processName);
   edm::FWGenericHandle handle(Reflex::Type::ByTypeInfo(iInfo));
   try
   {
      m_event->getByLabel(tag, handle);
      setData(*handle);
   }
   catch (std::exception& iException)
   {
      if (!m_printedErrorThisEvent) 
      {
         std::ostringstream s;
         s << "Failed to get " << name() << " because \n" <<iException.what();
         m_errorMessage=s.str();
         m_printedErrorThisEvent = true;
      }
      return 0;
   }
   
   return m_accessor->data();
}
const FWDisplayProperties & FWEventItem::defaultDisplayProperties ( ) const
void FWEventItem::destroy ( ) const

Definition at line 609 of file FWEventItem.cc.

References FWModelChangeManager::changed(), changeManager(), goingToBeDestroyed_, id(), getHLTprescales::index, m_itemInfos, selectionManager(), size(), FWSelectionManager::unselect(), and unselectItem().

Referenced by FWEventItemsManager::clearItems(), and CmsShowEDI::removeItem().

{
   //NOTE: need to unselect first before announcing destruction
   // because some items are listening to the display change and may
   // not properly release their connection to that signal after they
   // are destroyed via a connection to goingToBeDestroyed_
   const_cast<FWEventItem*>(this)->unselectItem();
   {
      FWChangeSentry sentry(*(changeManager()));
   
      for(int index=0; index <static_cast<int>(size()); ++index) {
         if(m_itemInfos.at(index).m_isSelected) {
            FWModelId id(this,index);
            selectionManager()->unselect(id);
            changeManager()->changed(id);
         }
      }
   }
   goingToBeDestroyed_(this);
   delete this;
}
const std::string & FWEventItem::errorMessage ( ) const

returns error string if there was a problem this event

Definition at line 673 of file FWEventItem.cc.

References getPrimaryData(), and m_errorMessage.

Referenced by hasError(), and FWCollectionSummaryWidget::itemChanged().

{
   if(m_errorMessage.empty()) {
      getPrimaryData();
   }
   return m_errorMessage;
}
const std::string & FWEventItem::filterExpression ( ) const
template<class T >
void FWEventItem::get ( const T *&  oData) const [inline]
FWProxyBuilderConfiguration* FWEventItem::getConfig ( ) const [inline]
const edm::EventBase* FWEventItem::getEvent ( ) const [inline]

Definition at line 147 of file FWEventItem.h.

References m_event.

Referenced by FWSimTrackProxyBuilder::build().

                                         {
      return m_event;
   }
const FWGeometry * FWEventItem::getGeom ( ) const

Definition at line 682 of file FWEventItem.cc.

References fireworks::Context::getGeom(), and m_context.

Referenced by FWConvTrackHitsDetailView::addModules(), FWTrackHitsDetailView::addModules(), fireworks::addSiStripClusters(), FWCastorRecHitProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWSiStripDigiProxyBuilder::build(), FWCSCRecHitProxyBuilder::build(), FWPFEcalRecHitLegoProxyBuilder::build(), FWSiPixelClusterProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), FWTracksModulesProxyBuilder::build(), FWSiPixelClusterDetProxyBuilder::build(), FWPCaloHitProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWZDCRecHitProxyBuilder::build(), FWPSimHitProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), FWTrackingParticleProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWTrackTrackingRecHitProxyBuilder::build(), FWDTSegmentProxyBuilder::build(), FWHORecHitProxyBuilder::build(), FWEcalRecHitProxyBuilder::build(), FWPhotonProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), FWRPCRecHitProxyBuilder::buildViewType(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), FWHFTowerSliceSelector::findBinFromId(), fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), FWEcalRecHitProxyBuilder::scaleProduct(), and FWHBHERecHitProxyBuilder::scaleProduct().

                           {
   return m_context->getGeom();
}
void FWEventItem::getPrimaryData ( ) const [private]

Definition at line 444 of file FWEventItem.cc.

References data(), m_accessor, and m_type.

Referenced by errorMessage(), handleChange(), modelData(), modelInfo(), modelInterestingValueAsString(), FWFileEntry::runFilter(), and size().

{
   //if(0!=m_data) return;
   if(0!=m_accessor->data()) return;
   this->data(*(m_type->GetTypeInfo()));
}
void FWEventItem::handleChange ( ) [private]

Definition at line 379 of file FWEventItem.cc.

References FWModelChangeManager::changed(), changeManager(), getPrimaryData(), preItemChanged_, and runFilter().

Referenced by moveToBack(), moveToFront(), moveToLayer(), proxyConfigChanged(), setEvent(), and setLabels().

{
   preItemChanged_(this);
   FWChangeSentry sentry(*(this->changeManager()));
   //want filter to rerun after all changes have been made
   changeManager()->changed(this);
   getPrimaryData();
   runFilter();
}
bool FWEventItem::hasError ( void  ) const

returns true if failed to get data for this event

Definition at line 668 of file FWEventItem.cc.

References errorMessage().

Referenced by FWCollectionSummaryWidget::itemChanged().

                            {
   return !errorMessage().empty();
}
bool FWEventItem::hasEvent ( ) const [inline]

Definition at line 142 of file FWEventItem.h.

References m_event.

                         {
      return 0 != m_event;
   }
bool FWEventItem::haveInterestingValue ( ) const

Definition at line 588 of file FWEventItem.cc.

Referenced by FWInteractionList::added(), and FWInteractionList::itemChanged().

{
   return true; //m_interestingValueGetter.isValid();
}
unsigned int FWEventItem::id ( void  ) const
bool FWEventItem::isCollection ( ) const

Definition at line 556 of file FWEventItem.cc.

References m_accessor.

{
   return m_accessor->isCollection();
}
bool FWEventItem::isInBack ( ) const

returns true if item is behind all other items

Definition at line 479 of file FWEventItem.cc.

References FWEventItemsManager::begin(), FWEventItemsManager::end(), fireworks::Context::eventItemsManager(), layer(), and m_context.

Referenced by CmsShowEDI::updateLayerControls().

{
   assert(0!=m_context->eventItemsManager());
   for(FWEventItemsManager::const_iterator it = m_context->eventItemsManager()->begin(),
                                           itEnd = m_context->eventItemsManager()->end();
       it != itEnd;
       ++it) {
      if((*it) && (*it != this) && (*it)->layer() <= layer()) {
         return false;
      }
   }
   return true;
}
bool FWEventItem::isInFront ( ) const

returns true if item is in front of all other items

Definition at line 464 of file FWEventItem.cc.

References FWEventItemsManager::begin(), FWEventItemsManager::end(), fireworks::Context::eventItemsManager(), layer(), and m_context.

Referenced by CmsShowEDI::updateLayerControls().

{
   assert(0!=m_context->eventItemsManager());
   for(FWEventItemsManager::const_iterator it = m_context->eventItemsManager()->begin(),
                                           itEnd = m_context->eventItemsManager()->end();
       it != itEnd;
       ++it) {
      if((*it) && (*it != this) && (*it)->layer() >= layer()) {
         return false;
      }
   }
   return true;
}
bool FWEventItem::itemIsSelected ( ) const
int FWEventItem::layer ( ) const

objects with a larger layer number are drawn on top of objects with a lower number

Definition at line 458 of file FWEventItem.cc.

References m_layer.

Referenced by addElements(), isInBack(), isInFront(), FWProxyBuilderBase::itemChanged(), FWProxyBuilderBase::layer(), moveToBack(), moveToFront(), and CmsShowEDI::updateLayerControls().

{
   return m_layer;
}
int FWEventItem::maxLayerValue ( ) [static]

Definition at line 44 of file FWEventItem.cc.

Referenced by CmsShowEDI::CmsShowEDI(), moveToFront(), and moveToLayer().

{
   return 100;
}
int FWEventItem::minLayerValue ( ) [static]

Definition at line 39 of file FWEventItem.cc.

Referenced by CmsShowEDI::CmsShowEDI(), moveToBack(), and moveToLayer().

{
   return -100;
}
const void * FWEventItem::modelData ( int  iIndex) const
FWEventItem::ModelInfo FWEventItem::modelInfo ( int  iIndex) const

Definition at line 536 of file FWEventItem.cc.

References getPrimaryData(), FWDisplayProperties::isVisible(), m_displayProperties, m_itemInfos, FWDisplayProperties::setIsVisible(), and lumiQTWidget::t.

Referenced by FWCastorRecHitProxyBuilder::build(), FWPFEcalClusterRPZProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), FWPFHcalClusterRPZProxyBuilder::build(), FWPCaloHitProxyBuilder::build(), FWZDCRecHitProxyBuilder::build(), FWHBHERecHitProxyBuilder::build(), FWHFRecHitProxyBuilder::build(), FWSimpleProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWHORecHitProxyBuilder::build(), FWEcalRecHitProxyBuilder::build(), FWSimpleProxyBuilder::buildViewType(), FWCollectionSummaryTableManager::buttonReleasedInRowHeader(), FWCollectionSummaryTableManager::cellRenderer(), FWTableViewTableManager::cellRenderer(), FWFromSliceSelector::clear(), FWCollectionSummaryWidget::colorChangeRequested(), FWTableViewTableManager::dataChanged(), FWModelIdFromEveSelector::doSelect(), FWHFTowerSliceSelector::doSelect(), FWCaloTowerSliceSelector::doSelect(), FWCaloTowerSliceSelector::doUnselect(), FWModelIdFromEveSelector::doUnselect(), FWHFTowerSliceSelector::doUnselect(), FWHFTowerProxyBuilderBase::fillCaloData(), FWCaloTowerProxyBuilderBase::fillCaloData(), CmsShowModelPopup::fillModelPopup(), FWProxyBuilderBase::increaseComponentTransparency(), FWInteractionList::itemChanged(), FWCollectionSummaryWidget::itemColorClicked(), FWPFClusterLegoProxyBuilder::localModelChanges(), FWPFCandidatesLegoProxyBuilder::localModelChanges(), FWPFEcalRecHitLegoProxyBuilder::localModelChanges(), FWPFPatJetLegoProxyBuilder< T >::localModelChanges(), FWCandidateLegoProxyBuilder::localModelChanges(), FWBeamSpotProxyBuilder::localModelChanges(), FWInteractionList::modelChanges(), FWDigitSetProxyBuilder::modelChanges(), FWTableViewTableManager::rowHeader(), FWCollectionSummaryModelCellRenderer::setData(), FWSecondarySelectableSelector::syncSelection(), and FWSimpleProxyBuilder::visibilityModelChanges().

{
   getPrimaryData();
   if(m_displayProperties.isVisible()) {
      return m_itemInfos.at(iIndex);
   }
   FWDisplayProperties dp(m_itemInfos.at(iIndex).displayProperties());
   dp.setIsVisible(false);
   ModelInfo t(dp,m_itemInfos.at(iIndex).isSelected());
   return t;
}
const std::string & FWEventItem::modelInterestingValueAsString ( int  iIndex) const
std::string FWEventItem::modelName ( int  iIndex) const

Definition at line 575 of file FWEventItem.cc.

References name(), and alignCSCRings::s.

Referenced by FWInteractionList::added(), CmsShowModelPopup::fillModelPopup(), FWInteractionList::itemChanged(), FWCollectionSummaryWidget::itemColorClicked(), and FWCollectionSummaryModelCellRenderer::setData().

{
   std::ostringstream s;
   size_t lastChar = name().size();
   //if name ends in 's' assume it is plural and remove the s for the individual object
   if(name()[lastChar-1]=='s') {
      --lastChar;
   }
   s<<name().substr(0,lastChar)<<" "<<iIndex;
   return s.str();
}
const TClass * FWEventItem::modelType ( ) const
const std::string & FWEventItem::moduleLabel ( ) const

Definition at line 519 of file FWEventItem.cc.

References m_moduleLabel.

Referenced by CmsShowEDI::fillEDIFrame(), and FWFileEntry::runFilter().

{
   return m_moduleLabel;
}
void FWEventItem::moveToBack ( )

Definition at line 334 of file FWEventItem.cc.

References FWEventItemsManager::begin(), FWEventItemsManager::end(), fireworks::Context::eventItemsManager(), handleChange(), layer(), m_accessor, m_context, m_itemInfos, m_layer, max(), and minLayerValue().

Referenced by CmsShowEDI::moveToBack().

{
   assert(0!=m_context->eventItemsManager());
   int smallest = layer();
   for(FWEventItemsManager::const_iterator it = m_context->eventItemsManager()->begin(),
                                           itEnd = m_context->eventItemsManager()->end();
       it != itEnd;
       ++it) {
      if((*it) && (*it != this) && (*it)->layer() < smallest) {
         smallest= (*it)->layer();
      }
   }

   if(smallest <= layer()) {
      m_layer = std::max(smallest-1, minLayerValue());
   }

   m_itemInfos.clear();
   m_accessor->reset();
   handleChange();
}
void FWEventItem::moveToFront ( )

change layering

Definition at line 311 of file FWEventItem.cc.

References FWEventItemsManager::begin(), FWEventItemsManager::end(), fireworks::Context::eventItemsManager(), handleChange(), layer(), m_accessor, m_context, m_itemInfos, m_layer, maxLayerValue(), and min.

Referenced by CmsShowEDI::moveToFront().

{
   assert(0!=m_context->eventItemsManager());
   int largest = layer();
   for(FWEventItemsManager::const_iterator it = m_context->eventItemsManager()->begin(),
          itEnd = m_context->eventItemsManager()->end();
       it != itEnd;
       ++it) {
      if ((*it) && (*it != this) && (*it)->layer() > largest) {
         largest= (*it)->layer();
      }
   }

   if(largest >= layer()) {
      m_layer = std::min(largest+1, maxLayerValue());
   }

   m_itemInfos.clear();
   m_accessor->reset();
   handleChange();
}
void FWEventItem::moveToLayer ( int  layer)
const std::string & FWEventItem::name ( void  ) const
const std::string & FWEventItem::processName ( ) const

Definition at line 530 of file FWEventItem.cc.

References m_processName.

Referenced by CmsShowEDI::fillEDIFrame(), and FWFileEntry::runFilter().

{
   return m_processName;
}
const std::string & FWEventItem::productInstanceLabel ( ) const

Definition at line 524 of file FWEventItem.cc.

References m_productInstanceLabel.

Referenced by CmsShowEDI::fillEDIFrame(), and FWFileEntry::runFilter().

void FWEventItem::proxyConfigChanged ( )
const std::string & FWEventItem::purpose ( ) const

Since the same C++ type can be used for multiple purposes, this string disambiguates them.

Definition at line 513 of file FWEventItem.cc.

References m_purpose.

Referenced by FWProxyBuilderBase::canHandle(), and FWEveViewManager::newItem().

{
   return m_purpose;
}
void FWEventItem::runFilter ( ) [private]

Definition at line 208 of file FWEventItem.cc.

References dtNoiseDBValidation_cfg::cerr, FWModelChangeManager::changed(), changeManager(), exception, id(), getHLTprescales::index, m_accessor, m_filter, m_itemInfos, name(), FWModelFilter::passesFilter(), and size().

Referenced by handleChange(), and setFilterExpression().

{
   if(m_accessor->isCollection() && m_accessor->data()) {
      //std::cout <<"runFilter"<<std::endl;
      FWChangeSentry sentry(*(this->changeManager()));
      int size = m_accessor->size();
      std::vector<ModelInfo>::iterator itInfo = m_itemInfos.begin();
      try {
         for(int index = 0; index != size; ++index,++itInfo) {
            bool changed = false;
            bool wasVisible = itInfo->m_displayProperties.isVisible();
            if(not m_filter.passesFilter(m_accessor->modelData(index))) {
               itInfo->m_displayProperties.setIsVisible(false);
               changed = wasVisible==true;
            } else {
               itInfo->m_displayProperties.setIsVisible(true);
               changed = wasVisible==false;
            }
            if(changed) {
               FWModelId id(this,index);
               changeManager()->changed(id);
            }
         }
      } catch( const std::exception& iException) {
         //Should log this error
         std::cerr <<"Exception occurred while running filter on "<<name()<<"\n"
         <<iException.what()<<std::endl;
      }
   }
}
void FWEventItem::select ( int  iIndex) const
FWSelectionManager* FWEventItem::selectionManager ( ) const [inline]
void FWEventItem::selectItem ( )
void FWEventItem::setData ( const Reflex::Object &  iData) const [private]

Definition at line 431 of file FWEventItem.cc.

References m_accessor, m_displayProperties, and m_itemInfos.

Referenced by data().

{
   m_accessor->setData(iData);
   //std::cout <<"size "<<m_accessor->size()<<std::endl;
   if(m_accessor->isCollection()) {
      m_itemInfos.reserve(m_accessor->size());
      m_itemInfos.resize(m_accessor->size(),ModelInfo(m_displayProperties,false));
   } else {
      m_itemInfos.push_back(ModelInfo(m_displayProperties,false));
   }
}
void FWEventItem::setDefaultDisplayProperties ( const FWDisplayProperties iProp)

This is the place where not only display properties are changed, but which is also responsible to notify the FWModelChangeManager about the change. If you've just added some property, you have a nice GUI for it and still nothing works, this is probably the place where you want to look.

Definition at line 156 of file FWEventItem.cc.

References FWModelChangeManager::changed(), changeManager(), FWDisplayProperties::color(), defaultDisplayPropertiesChanged_, id(), getHLTprescales::index, FWDisplayProperties::isVisible(), m_displayProperties, m_itemInfos, prp, FWDisplayProperties::setColor(), FWDisplayProperties::setTransparency(), size(), and FWDisplayProperties::transparency().

Referenced by CmsShowEDI::changeItemColor(), CmsShowEDI::changeItemOpacity(), FWCollectionSummaryWidget::colorChangeRequested(), CmsShowEDI::toggleItemVisible(), and FWCollectionSummaryWidget::toggleItemVisible().

{
   bool visChange = m_displayProperties.isVisible() != iProp.isVisible();
   bool colorChanged = m_displayProperties.color() != iProp.color();
   bool transparencyChanged = m_displayProperties.transparency() != iProp.transparency();

   if(!visChange && !colorChanged && !transparencyChanged) {
      return;
   }
   //If the default visibility is changed, we want to also change the the visibility of the children
   // BUT we want to remember the old visibility so if the visibility is changed again we return
   // to the previous state.
   // only the visible ones need to be marked as 'changed'
   FWChangeSentry sentry(*(changeManager()));

   for(int index=0; index <static_cast<int>(size()); ++index) {
      FWDisplayProperties prp = m_itemInfos[index].displayProperties();
      bool vis=prp.isVisible();
      bool changed = false;
      changed = visChange && vis;

      if(colorChanged) {
         if(m_displayProperties.color()==prp.color()) {
            prp.setColor(iProp.color());
            changed = true;
         }
      }
      if (transparencyChanged) {
         if(m_displayProperties.transparency() == prp.transparency()) {
            prp.setTransparency(iProp.transparency());
            changed = true;
         }
      }
      if(changed) {
         m_itemInfos[index].m_displayProperties=prp;
         FWModelId id(this,index);
         changeManager()->changed(id);
      }
   }
   m_displayProperties= iProp;
   defaultDisplayPropertiesChanged_(this);
}
void FWEventItem::setDisplayProperties ( int  iIndex,
const FWDisplayProperties iProps 
) const

Definition at line 277 of file FWEventItem.cc.

References FWModelChangeManager::changed(), changeManager(), defaultDisplayPropertiesChanged_, id(), getHLTprescales::index, FWDisplayProperties::isVisible(), m_accessor, m_displayProperties, m_itemInfos, FWDisplayProperties::setIsVisible(), and size().

Referenced by FWCollectionSummaryTableManager::buttonReleasedInRowHeader(), and FWCollectionSummaryWidget::colorChangeRequested().

{
   FWDisplayProperties& prop = m_itemInfos.at(iIndex).m_displayProperties;
   if(m_displayProperties.isVisible()) {
      if( prop
          != iProps ) {
         prop = iProps;
         FWModelId id(this,iIndex);
         //selectionManager()->select(id);
         changeManager()->changed(id);
      }
   } else {
      if(iProps.isVisible()) {
         FWChangeSentry sentry(*(this->changeManager()));
         int size = m_accessor->size();
         std::vector<ModelInfo>::iterator itInfo = m_itemInfos.begin();
         for(int index = 0; index != size; ++index,++itInfo) {
            if( itInfo->m_displayProperties.isVisible() ) {
               itInfo->m_displayProperties.setIsVisible(false);
               FWModelId id(this,index);
               changeManager()->changed(id);
            }
         }
         m_itemInfos.at(iIndex).m_displayProperties.setIsVisible(true);
         FWModelId id(this,iIndex);
         changeManager()->changed(id);
         const_cast<FWEventItem*>(this)->m_displayProperties.setIsVisible(true);
         //NOTE: need to send out a signal here
         defaultDisplayPropertiesChanged_(this);
      }
   }
}
void FWEventItem::setEvent ( const edm::EventBase iEvent)
void FWEventItem::setFilterExpression ( const std::string &  iExpression)

Throws an FWExpresionException if there is a problem with the expression

Definition at line 200 of file FWEventItem.cc.

References filterChanged_, m_filter, runFilter(), and FWModelFilter::setExpression().

Referenced by CmsShowEDI::runFilter().

{
   m_filter.setExpression(iExpression);
   filterChanged_(this);
   runFilter();
}
void FWEventItem::setLabels ( const std::string &  iModule,
const std::string &  iProductInstance,
const std::string &  iProcess 
)

Definition at line 131 of file FWEventItem.cc.

References handleChange(), m_accessor, m_itemInfos, m_moduleLabel, m_processName, and m_productInstanceLabel.

{
   m_moduleLabel = iModule;
   m_productInstanceLabel = iProductInstance;
   m_processName = iProcess;
   m_accessor->reset();
   m_itemInfos.clear();
   handleChange();
}
void FWEventItem::setName ( const std::string &  iName)

Definition at line 144 of file FWEventItem.cc.

References m_name.

{
   m_name = iName;
}
size_t FWEventItem::size ( void  ) const
void FWEventItem::toggleSelect ( int  iIndex) const
void FWEventItem::toggleSelectItem ( )
const TClass * FWEventItem::type ( ) const

Definition at line 507 of file FWEventItem.cc.

References m_type.

Referenced by CmsShowEDI::fillEDIFrame(), and FWFileEntry::runFilter().

{
   return m_type;
}
void FWEventItem::unselect ( int  iIndex) const
void FWEventItem::unselectItem ( )
const FWItemValueGetter& FWEventItem::valueGetter ( ) const [inline]

Member Data Documentation

connect to this signal if you want to know when models held by the item change

Definition at line 196 of file FWEventItem.h.

Referenced by CmsShowEDI::fillEDIFrame(), CmsShowModelPopup::fillModelPopup(), FWCollectionSummaryTableManager::FWCollectionSummaryTableManager(), FWEveViewManager::newItem(), and FWModelChangeManager::newItemSlot().

connect to this signal if you want to know that the default display properties of the item have changed. This is only useful if you are displaying these properties and not just the underlying models.

Definition at line 208 of file FWEventItem.h.

Referenced by CmsShowEDI::fillEDIFrame(), FWCollectionSummaryWidget::FWCollectionSummaryWidget(), selectItem(), setDefaultDisplayProperties(), setDisplayProperties(), toggleSelectItem(), and unselectItem().

connect to this signal if you want to know that the filter being applied to the item was changed.

Definition at line 211 of file FWEventItem.h.

Referenced by FWCollectionSummaryWidget::FWCollectionSummaryWidget(), and setFilterExpression().

connect to this signal if you need to know that this item is going to be destroyed.

Definition at line 215 of file FWEventItem.h.

Referenced by destroy(), CmsShowEDI::fillEDIFrame(), CmsShowModelPopup::fillModelPopup(), FWEveViewManager::newItem(), FWTableViewManager::newItem(), FWSummaryManager::newItem(), and FWViewManagerManager::registerEventItem().

boost::shared_ptr<FWItemAccessorBase> FWEventItem::m_accessor [private]
std::string FWEventItem::m_errorMessage [mutable, private]

Definition at line 246 of file FWEventItem.h.

Referenced by data(), and errorMessage().

Definition at line 240 of file FWEventItem.h.

Referenced by data(), getEvent(), hasEvent(), FWFileEntry::runFilter(), and setEvent().

Definition at line 244 of file FWEventItem.h.

Referenced by filterExpression(), FWEventItem(), runFilter(), and setFilterExpression().

unsigned int FWEventItem::m_id [private]

Definition at line 227 of file FWEventItem.h.

Referenced by id().

Definition at line 242 of file FWEventItem.h.

Referenced by modelInterestingValueAsString(), and valueGetter().

bool FWEventItem::m_isSelected [private]

Definition at line 248 of file FWEventItem.h.

Referenced by itemIsSelected(), selectItem(), toggleSelectItem(), and unselectItem().

std::vector<ModelInfo> FWEventItem::m_itemInfos [mutable, private]
int FWEventItem::m_layer [private]

Definition at line 233 of file FWEventItem.h.

Referenced by layer(), moveToBack(), moveToFront(), and moveToLayer().

std::string FWEventItem::m_moduleLabel [private]

Definition at line 237 of file FWEventItem.h.

Referenced by data(), moduleLabel(), and setLabels().

std::string FWEventItem::m_name [private]

Definition at line 228 of file FWEventItem.h.

Referenced by name(), and setName().

bool FWEventItem::m_printedErrorThisEvent [mutable, private]

Definition at line 245 of file FWEventItem.h.

Referenced by data(), and setEvent().

std::string FWEventItem::m_processName [private]

Definition at line 239 of file FWEventItem.h.

Referenced by data(), processName(), and setLabels().

std::string FWEventItem::m_productInstanceLabel [private]

Definition at line 238 of file FWEventItem.h.

Referenced by data(), productInstanceLabel(), and setLabels().

Definition at line 251 of file FWEventItem.h.

Referenced by FWEventItem(), getConfig(), and ~FWEventItem().

std::string FWEventItem::m_purpose [private]

Definition at line 230 of file FWEventItem.h.

Referenced by purpose().

const TClass* FWEventItem::m_type [private]

Definition at line 229 of file FWEventItem.h.

Referenced by data(), getPrimaryData(), and type().

ROOT::Reflex::Type FWEventItem::m_wrapperType [private]

Definition at line 241 of file FWEventItem.h.

connect to this signal if you want to know immediately when the data underlying the item changes only intended to be used by the FWSelectionManager

Definition at line 204 of file FWEventItem.h.

Referenced by handleChange(), and FWSelectionManager::select().