#include <Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h>
Public Member Functions | |
FWCaloDataProxyBuilderBase () | |
virtual bool | willHandleInteraction () const |
virtual | ~FWCaloDataProxyBuilderBase () |
Protected Member Functions | |
virtual bool | assertCaloDataSlice ()=0 |
virtual void | build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) |
virtual void | fillCaloData ()=0 |
virtual void | itemBeingDestroyed (const FWEventItem *) |
virtual void | setCaloData (const fireworks::Context &)=0 |
Protected Attributes | |
TEveCaloData * | m_caloData |
Int_t | m_sliceIndex |
Private Member Functions | |
void | clearCaloDataSelection () |
FWCaloDataProxyBuilderBase (const FWCaloDataProxyBuilderBase &) | |
virtual void | modelChanges (const FWModelIds &, Product *) |
const FWCaloDataProxyBuilderBase & | operator= (const FWCaloDataProxyBuilderBase &) |
Description: [one line class summary]
Usage: <usage>
Definition at line 34 of file FWCaloDataProxyBuilderBase.h.
FWCaloDataProxyBuilderBase::FWCaloDataProxyBuilderBase | ( | ) |
Definition at line 45 of file FWCaloDataProxyBuilderBase.cc.
: m_caloData(0), m_sliceIndex(-1) { }
FWCaloDataProxyBuilderBase::~FWCaloDataProxyBuilderBase | ( | ) | [virtual] |
Definition at line 56 of file FWCaloDataProxyBuilderBase.cc.
{ }
FWCaloDataProxyBuilderBase::FWCaloDataProxyBuilderBase | ( | const FWCaloDataProxyBuilderBase & | ) | [private] |
virtual bool FWCaloDataProxyBuilderBase::assertCaloDataSlice | ( | ) | [protected, pure virtual] |
Implemented in FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.
Referenced by build().
void FWCaloDataProxyBuilderBase::build | ( | const FWEventItem * | iItem, |
TEveElementList * | product, | ||
const FWViewContext * | |||
) | [protected, virtual] |
Reimplemented from FWProxyBuilderBase.
Reimplemented in FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.
Definition at line 77 of file FWCaloDataProxyBuilderBase.cc.
References assertCaloDataSlice(), FWEventItem::context(), fillCaloData(), FWProxyBuilderBase::item(), m_caloData, m_sliceIndex, and setCaloData().
{ setCaloData(iItem->context()); assertCaloDataSlice(); fillCaloData(); m_caloData->SetSliceColor(m_sliceIndex,item()->defaultDisplayProperties().color()); m_caloData->SetSliceTransparency(m_sliceIndex,item()->defaultDisplayProperties().transparency()); m_caloData->DataChanged(); m_caloData->CellSelectionChanged(); }
void FWCaloDataProxyBuilderBase::clearCaloDataSelection | ( | ) | [private] |
Definition at line 136 of file FWCaloDataProxyBuilderBase.cc.
References m_caloData, m_sliceIndex, and swap().
Referenced by itemBeingDestroyed(), and modelChanges().
{ //find all selected cell ids which are not from this FWEventItem and preserve only them // do this by moving them to the end of the list and then clearing only the end of the list // this avoids needing any additional memory TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected(); TEveCaloData::vCellId_t::iterator itEnd = selected.end(); for(TEveCaloData::vCellId_t::iterator it = selected.begin(); it != itEnd; ++it) { if(it->fSlice ==m_sliceIndex) { //we have found one we want to get rid of, so we swap it with the // one closest to the end which is not of this slice do { TEveCaloData::vCellId_t::iterator itLast = itEnd-1; itEnd = itLast; } while (itEnd != it && itEnd->fSlice==m_sliceIndex); if(itEnd != it) { std::swap(*it,*itEnd); } else { //shouldn't go on since advancing 'it' will put us past itEnd break; } //std::cout <<"keeping "<<it->fTower<<" "<<it->fSlice<<std::endl; } } selected.erase(itEnd,selected.end()); // reset higlight m_caloData->GetCellsHighlighted().clear(); }
virtual void FWCaloDataProxyBuilderBase::fillCaloData | ( | ) | [protected, pure virtual] |
Implemented in FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.
Referenced by build(), and modelChanges().
void FWCaloDataProxyBuilderBase::itemBeingDestroyed | ( | const FWEventItem * | iItem | ) | [protected, virtual] |
Reimplemented from FWProxyBuilderBase.
Reimplemented in FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.
Definition at line 121 of file FWCaloDataProxyBuilderBase.cc.
References clearCaloDataSelection(), m_caloData, m_sliceIndex, FWFromTEveCaloDataSelector::resetSliceSelector(), and EgammaValidation_Wenu_cff::sel.
{ FWProxyBuilderBase::itemBeingDestroyed(iItem); if (m_caloData) { clearCaloDataSelection(); FWFromTEveCaloDataSelector* sel = reinterpret_cast<FWFromTEveCaloDataSelector*>(m_caloData->GetUserData()); sel->resetSliceSelector(m_sliceIndex); m_caloData->DataChanged(); } }
void FWCaloDataProxyBuilderBase::modelChanges | ( | const FWModelIds & | , |
Product * | p | ||
) | [private, virtual] |
Reimplemented from FWProxyBuilderBase.
Definition at line 94 of file FWCaloDataProxyBuilderBase.cc.
References clearCaloDataSelection(), fillCaloData(), FWProxyBuilderBase::item(), m_caloData, and m_sliceIndex.
{ if(m_caloData && item()) { clearCaloDataSelection(); fillCaloData(); TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected(); if(!selected.empty()) { if(0==m_caloData->GetSelectedLevel()) { gEve->GetSelection()->AddElement(m_caloData); } } else { if(1==m_caloData->GetSelectedLevel()||2==m_caloData->GetSelectedLevel()) { gEve->GetSelection()->RemoveElement(m_caloData); } } m_caloData->SetSliceColor(m_sliceIndex,item()->defaultDisplayProperties().color()); m_caloData->SetSliceTransparency(m_sliceIndex,item()->defaultDisplayProperties().transparency()); m_caloData->DataChanged(); m_caloData->CellSelectionChanged(); } }
const FWCaloDataProxyBuilderBase& FWCaloDataProxyBuilderBase::operator= | ( | const FWCaloDataProxyBuilderBase & | ) | [private] |
virtual void FWCaloDataProxyBuilderBase::setCaloData | ( | const fireworks::Context & | ) | [protected, pure virtual] |
Implemented in FWCaloTowerProxyBuilderBase, and FWHFTowerProxyBuilderBase.
Referenced by build().
virtual bool FWCaloDataProxyBuilderBase::willHandleInteraction | ( | ) | const [inline, virtual] |
Reimplemented from FWProxyBuilderBase.
Definition at line 42 of file FWCaloDataProxyBuilderBase.h.
{ return true; }
TEveCaloData* FWCaloDataProxyBuilderBase::m_caloData [protected] |
Definition at line 57 of file FWCaloDataProxyBuilderBase.h.
Referenced by FWHFTowerProxyBuilderBase::assertCaloDataSlice(), FWCaloTowerProxyBuilderBase::assertCaloDataSlice(), build(), clearCaloDataSelection(), FWCaloTowerProxyBuilderBase::fillCaloData(), itemBeingDestroyed(), modelChanges(), FWHFTowerProxyBuilderBase::setCaloData(), and FWCaloTowerProxyBuilderBase::setCaloData().
Int_t FWCaloDataProxyBuilderBase::m_sliceIndex [protected] |
Definition at line 58 of file FWCaloDataProxyBuilderBase.h.
Referenced by FWHFTowerProxyBuilderBase::assertCaloDataSlice(), FWCaloTowerProxyBuilderBase::assertCaloDataSlice(), build(), clearCaloDataSelection(), FWCaloTowerProxyBuilderBase::fillCaloData(), FWHFTowerProxyBuilderBase::fillCaloData(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), itemBeingDestroyed(), FWHFTowerProxyBuilderBase::itemBeingDestroyed(), and modelChanges().