CMS 3D CMS Logo

Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

FWEveViewManager Class Reference

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

Inheritance diagram for FWEveViewManager:
FWViewManagerBase

List of all members.

Classes

struct  BuilderInfo

Public Member Functions

virtual void eventBegin ()
virtual void eventEnd ()
 FWEveViewManager (FWGUIManager *)
void highlightAdded (TEveElement *)
virtual void newItem (const FWEventItem *)
virtual void removeItem (const FWEventItem *)
void selectionAdded (TEveElement *)
void selectionCleared ()
void selectionRemoved (TEveElement *)
virtual void setContext (const fireworks::Context *)
FWTypeToRepresentations supportedTypesAndRepresentations () const
virtual ~FWEveViewManager ()

Protected Member Functions

virtual void colorsChanged ()
virtual void modelChangesComing ()
virtual void modelChangesDone ()

Private Types

typedef std::vector
< boost::shared_ptr
< FWProxyBuilderBase > > 
BuilderVec
typedef BuilderVec::iterator BuilderVec_it
typedef std::vector
< boost::shared_ptr< FWEveView >
>::iterator 
EveViewVec_it
typedef std::map< std::string,
std::vector< BuilderInfo > > 
TypeToBuilder

Private Member Functions

void beingDestroyed (const FWViewBase *)
FWViewBasebuildView (TEveWindowSlot *iParent, const std::string &type)
FWEveViewfinishViewCreate (boost::shared_ptr< FWEveView >)
 FWEveViewManager (const FWEveViewManager &)
void globalEnergyScaleChanged ()
bool haveViewForBit (int) const
void itemChanged (const FWEventItem *)
void modelChanges (const FWModelIds &iIds)
const FWEveViewManageroperator= (const FWEveViewManager &)

Private Attributes

std::map< int, BuilderVecm_builders
std::map< const FWEventItem
*, FWInteractionList * > 
m_interactionLists
TypeToBuilder m_typeToBuilder
std::vector< std::vector
< boost::shared_ptr< FWEveView > > > 
m_views

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 41 of file FWEveViewManager.h.


Member Typedef Documentation

typedef std::vector<boost::shared_ptr<FWProxyBuilderBase> > FWEveViewManager::BuilderVec [private]

Definition at line 98 of file FWEveViewManager.h.

typedef BuilderVec::iterator FWEveViewManager::BuilderVec_it [private]

Definition at line 99 of file FWEveViewManager.h.

typedef std::vector<boost::shared_ptr<FWEveView > >::iterator FWEveViewManager::EveViewVec_it [private]

Definition at line 100 of file FWEveViewManager.h.

typedef std::map<std::string, std::vector<BuilderInfo> > FWEveViewManager::TypeToBuilder [private]

Definition at line 97 of file FWEveViewManager.h.


Constructor & Destructor Documentation

FWEveViewManager::FWEveViewManager ( FWGUIManager iGUIMgr)

Definition at line 75 of file FWEveViewManager.cc.

References buildView(), category(), f, first, newFWLiteAna::fullName, edmplugin::PluginManager::get(), reco::get(), i, FWViewType::idToName(), FWViewType::kTable, FWViewType::kTableHLT, FWViewType::kTableL1, FWViewType::kTypeSize, m_typeToBuilder, m_views, edmplugin::PluginInfo::name_, and FWGUIManager::registerViewBuilder().

                                                        :
   FWViewManagerBase()
{
     
   // builders
   std::set<std::string> builders;
   
   std::vector<edmplugin::PluginInfo> available = FWProxyBuilderFactory::get()->available();
   std::transform(available.begin(),
                  available.end(),
                  std::inserter(builders,builders.begin()),
                  boost::bind(&edmplugin::PluginInfo::name_,_1));
   
   if(edmplugin::PluginManager::get()->categoryToInfos().end()!=edmplugin::PluginManager::get()->categoryToInfos().find(FWProxyBuilderFactory::get()->category())) {
      available = edmplugin::PluginManager::get()->categoryToInfos().find(FWProxyBuilderFactory::get()->category())->second;
      std::transform(available.begin(),
                     available.end(),
                     std::inserter(builders,builders.begin()),
                     boost::bind(&edmplugin::PluginInfo::name_,_1));
   }
   
   
   for(std::set<std::string>::iterator it = builders.begin(), itEnd=builders.end();
       it!=itEnd;
       ++it) {
      std::string::size_type first = it->find_first_of('@')+1;
      std::string purpose = it->substr(first,it->find_last_of('@')-first);
      
      first = it->find_last_of('@')+1;
      std::string view_str =  it->substr(first,it->find_last_of('#')-first);
      int viewTypes = atoi(view_str.c_str());
      std::string fullName = *it;
      m_typeToBuilder[purpose].push_back(BuilderInfo(*it, viewTypes));
   }
   
   
   m_views.resize(FWViewType::kTypeSize); 
   
   
   // view construction called via GUI mng
   FWGUIManager::ViewBuildFunctor f =  boost::bind(&FWEveViewManager::buildView, this, _1, _2);
   for (int i = 0; i < FWViewType::kTypeSize; i++)
   {
      if ( i == FWViewType::kTable || i == FWViewType::kTableHLT || i == FWViewType::kTableL1)
         continue;
      iGUIMgr->registerViewBuilder(FWViewType::idToName(i), f);
   }
   
   // signal
   gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Master);
   TEveSelection* eveSelection = gEve->GetSelection();
   eveSelection->SetPickToSelect(TEveSelection::kPS_Master);  
   eveSelection->Connect("SelectionAdded(TEveElement*)","FWEveViewManager",this,"selectionAdded(TEveElement*)");
   eveSelection->Connect("SelectionRepeated(TEveElement*)","FWEveViewManager",this,"selectionAdded(TEveElement*)");
   eveSelection->Connect("SelectionRemoved(TEveElement*)","FWEveViewManager",this,"selectionRemoved(TEveElement*)");
   eveSelection->Connect("SelectionCleared()","FWEveViewManager",this,"selectionCleared()");

   gEve->GetHighlight()->Connect("SelectionAdded(TEveElement*)","FWEveViewManager",this,"highlightAdded(TEveElement*)");
   gEve->GetHighlight()->Connect("SelectionRepeated(TEveElement*)","FWEveViewManager",this,"highlightAdded(TEveElement*)");
}
FWEveViewManager::~FWEveViewManager ( ) [virtual]

Definition at line 136 of file FWEveViewManager.cc.

{
}
FWEveViewManager::FWEveViewManager ( const FWEveViewManager ) [private]

Member Function Documentation

void FWEveViewManager::beingDestroyed ( const FWViewBase vb) [private]

Definition at line 399 of file FWEveViewManager.cc.

References begin, haveViewForBit(), i, m_builders, m_views, FWViewBase::typeId(), and FWEveView::viewContext().

Referenced by finishViewCreate().

{
   FWEveView* view = (FWEveView*) vb;
   int typeId = view->typeId();
  
   int viewerBit = 1 << typeId;
   int nviews = m_views[typeId].size(); 
   for ( std::map<int, BuilderVec>::iterator i = m_builders.begin(); i!= m_builders.end(); ++i)
   {
      int builderBit = i->first;
      if (viewerBit == (builderBit & viewerBit)) // check only in case if connected
      {
         BuilderVec& bv =  i->second;

         // remove view-owned product
         if (viewerBit == (builderBit & viewerBit))
         {
            for(BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt)
               (*bIt)->removePerViewProduct(view->typeId(), view->viewContext());
         }

         // and setup proxy builders have-a-window flag
         if (nviews == 1)
         {
            if (!haveViewForBit(builderBit))
            {
               if (viewerBit == (builderBit & viewerBit))
               {
                  for(BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt)
                     (*bIt)->setHaveWindow(false);
               }
            }
         }
      }
   }
  

   for(EveViewVec_it i= m_views[typeId].begin(); i != m_views[typeId].end(); ++i) {
      if(i->get() == vb) {
         m_views[typeId].erase(i);
         break;
      }
   }
}
FWViewBase * FWEveViewManager::buildView ( TEveWindowSlot *  iParent,
const std::string &  type 
) [private]

Definition at line 271 of file FWEveViewManager.cc.

References prof2calltree::back, finishViewCreate(), i, FWViewType::idToName(), FWViewType::k3D, FWViewType::kGlimpse, FWViewType::kISpy, FWViewType::kLego, FWViewType::kLegoHF, FWViewType::kLegoPFECAL, FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, FWViewType::kTypeSize, and m_views.

Referenced by FWEveViewManager().

{
   FWViewType::EType type = FWViewType::kTypeSize;
   for (int i = 0; i < FWViewType::kTypeSize; ++i)
   {
      if (viewName == FWViewType::idToName(i))
      {
         type = FWViewType::EType(i);
         break;
      }
   }

   boost::shared_ptr<FWEveView> view;
   switch(type)
   {
      case FWViewType::k3D:
         view.reset(new FW3DView(iParent, type));
         break;
      case FWViewType::kISpy:
         view.reset(new FWISpyView(iParent, type));
         break;
      case FWViewType::kRhoPhi:
      case FWViewType::kRhoZ:
      case FWViewType::kRhoPhiPF:
         view.reset(new FWRPZView(iParent, type));
         break;
      case FWViewType::kLego:
      case FWViewType::kLegoPFECAL:
         view.reset(new FWEveLegoView(iParent, type));
         break;
      case FWViewType::kLegoHF:
         view.reset(new FWHFView(iParent, type));
         break;
      case FWViewType::kGlimpse:
         view.reset(new FWGlimpseView(iParent, type));
         break;
      default:
         break;
   }

   m_views[type].push_back(boost::shared_ptr<FWEveView> (view));
   return finishViewCreate(m_views[type].back());
}
void FWEveViewManager::colorsChanged ( ) [protected, virtual]

Implements FWViewManagerBase.

Definition at line 593 of file FWEveViewManager.cc.

References begin, FWViewManagerBase::colorManager(), i, FWViewType::kTypeSize, m_views, and matplotRender::t.

{
   for (int t = 0 ; t < FWViewType::kTypeSize; ++t)
   {
      for(EveViewVec_it i = m_views[t].begin(); i != m_views[t].end(); ++i) 
         (*i)->setBackgroundColor(colorManager().background());
   }
}
void FWEveViewManager::eventBegin ( ) [virtual]

Reimplemented from FWViewManagerBase.

Definition at line 604 of file FWEveViewManager.cc.

References begin, FWViewManagerBase::context(), i, FWViewType::kTypeSize, m_views, fireworks::Context::resetMaxEtAndEnergy(), and matplotRender::t.

{
   gEve->DisableRedraw();

   context().resetMaxEtAndEnergy();

   for (int t = 0 ; t < FWViewType::kTypeSize; ++t)
   {
      for(EveViewVec_it i = m_views[t].begin(); i != m_views[t].end(); ++i)   
         (*i)->eventBegin();
   }
}
void FWEveViewManager::eventEnd ( ) [virtual]

Reimplemented from FWViewManagerBase.

Definition at line 618 of file FWEveViewManager.cc.

References begin, i, FWViewType::kTypeSize, m_views, and matplotRender::t.

{
   for (int t = 0 ; t < FWViewType::kTypeSize; ++t)
   {
      for(EveViewVec_it i = m_views[t].begin(); i != m_views[t].end(); ++i)   
         (*i)->eventEnd();
   }
   gEve->EnableRedraw();
}
FWEveView * FWEveViewManager::finishViewCreate ( boost::shared_ptr< FWEveView view) [private]

Definition at line 316 of file FWEveViewManager.cc.

References FWColorManager::background(), beingDestroyed(), fireworks::Context::colorManager(), FWViewManagerBase::context(), FWEveView::eventScene(), i, FWRPZView::importElements(), m_builders, m_views, FWEveView::ownedProducts(), FWColorManager::setColorSetViewer(), and FWEveView::setContext().

Referenced by buildView().

{
   // printf("new view %s added \n", view->typeName().c_str());
   gEve->DisableRedraw();

   // set geometry and calo data
   view->setContext(context()); 

   FWColorManager::setColorSetViewer(view->viewerGL(),  context().colorManager()->background());

   // set proxies have a window falg
   int viewerBit = 1 << view->typeId();   
   if (m_views[view->typeId()].size() == 1)
   {
      for ( std::map<int, BuilderVec>::iterator i = m_builders.begin(); i!=  m_builders.end(); ++i)
      {
         int builderViewBit = i->first;
         BuilderVec& bv =  i->second;
         if (viewerBit == (builderViewBit & viewerBit))
         {
            for(BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt)
            {
               (*bIt)->setHaveWindow(true);
            }
         }
      }
   }
    
   FWRPZView* rpzView = dynamic_cast<FWRPZView*>(view.get());
   for ( std::map<int, BuilderVec>::iterator i = m_builders.begin(); i!=  m_builders.end(); ++i)
   {
      int builderViewBit = i->first;
      BuilderVec& bv =  i->second;
      if (viewerBit == (builderViewBit & viewerBit))
      { 
         for(BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt)
         {
            // it is ok to call create even for shared productsm since
            // builder map key garanties that
            TEveElementList* product = (*bIt)->createProduct(view->typeId(), view->viewContext());

            if ((*bIt)->havePerViewProduct((FWViewType::EType)view->typeId()))
            {
               // view owned
               (*bIt)->build();
               if (rpzView)
               {
                  rpzView->importElements(product, (*bIt)->item()->layer(), rpzView->ownedProducts());
               }
               else
               {
                  view->ownedProducts()->AddElement(product);
               }
            }
            else
            {
               // shared
               if (rpzView)
               {
                  rpzView->importElements(product, (*bIt)->item()->layer(), rpzView->eventScene());
               }
               else
               {
                  view->eventScene()->AddElement(product);
               }
                 
            }
         }
      }
   }

   view->beingDestroyed_.connect(boost::bind(&FWEveViewManager::beingDestroyed,this,_1));

   view->setupEnergyScale(); // notify PB for energy scale

   gEve->EnableRedraw();
   view->viewerGL()->UpdateScene();
   gEve->Redraw3D();   

   return view.get();
}
void FWEveViewManager::globalEnergyScaleChanged ( ) [private]

Definition at line 577 of file FWEveViewManager.cc.

References begin, i, FWViewType::kTypeSize, m_views, and matplotRender::t.

Referenced by setContext().

{
   for (int t = 0 ; t < FWViewType::kTypeSize; ++t)
   {
      for(EveViewVec_it i = m_views[t].begin(); i != m_views[t].end(); ++i) 
      {
         if ((*i)->isEnergyScaleGlobal())
         {
            (*i)->setupEnergyScale();
         }
      }

   }
}
bool FWEveViewManager::haveViewForBit ( int  bit) const [private]

Checks whether any of the views

Definition at line 712 of file FWEveViewManager.cc.

References FWViewType::kTypeSize, m_views, findQualityFiles::size, and matplotRender::t.

Referenced by beingDestroyed(), and newItem().

{
   for (int t = 0; t < FWViewType::kTypeSize; ++t)
   {
      if ((bit & (1 << t)) && m_views[t].size())
         return true;
   }
   // printf("have %d view for bit %d \n", haveView, bit);
   return false;
}
void FWEveViewManager::highlightAdded ( TEveElement *  iElement)

Definition at line 735 of file FWEveViewManager.cc.

References evf::utils::blocked, FWViewManagerBase::context(), ExpressReco_HICollisions_FallBack::etaBin, fireworks::Context::getCaloData(), estimatePileup::hist, i, and ExpressReco_HICollisions_FallBack::phiBin.

{

   bool blocked = gEve->GetHighlight()->BlockSignals(true);


   if (iElement == context().getCaloData())
   {
      TEveCaloData::vCellId_t& hlist =  context().getCaloData()->GetCellsHighlighted();
      std::set<TEveCaloData::CellId_t> hset;

      int etaBin, phiBin, w, newPhiBin, tower;
      TH2F* hist =  context().getCaloData()->GetHist(0);
      TAxis* etaAxis = hist->GetXaxis();
      int nBinsX = etaAxis->GetNbins() + 2;

      for (TEveCaloData::vCellId_i i = hlist.begin(); i != hlist.end(); ++i)
      {
         hist->GetBinXYZ((*i).fTower, etaBin, phiBin, w);
         if (TMath::Abs(etaAxis->GetBinCenter(etaBin)) > 4.71475)
         {
            newPhiBin = ((phiBin + 1) / 4) * 4 - 1;
            if (newPhiBin <= 0) newPhiBin = 71;
               
            tower = etaBin + newPhiBin*nBinsX;
            hset.insert(TEveCaloData::CellId_t( tower, (*i).fSlice, (*i).fFraction));
            tower += nBinsX;
            hset.insert(TEveCaloData::CellId_t(tower, (*i).fSlice, (*i).fFraction));
            tower += nBinsX;

            if (newPhiBin == 71)
               tower = etaBin + 1*nBinsX;

            hset.insert(TEveCaloData::CellId_t(tower, (*i).fSlice, (*i).fFraction));
            tower += nBinsX;
            hset.insert(TEveCaloData::CellId_t(tower, (*i).fSlice, (*i).fFraction));
         }
         else if (TMath::Abs(etaAxis->GetBinCenter(etaBin)) > 1.747650)
         {  
            newPhiBin =  ((phiBin + 1)/2)*2 - 1;
            tower = etaBin + newPhiBin*nBinsX;
            hset.insert(TEveCaloData::CellId_t( tower, (*i).fSlice, (*i).fFraction));
            tower += nBinsX;
            hset.insert(TEveCaloData::CellId_t(tower, (*i).fSlice, (*i).fFraction));
         }
         else
         {
            hset.insert(*i);
         }
      }
 
      // edit calo data list
      hlist.clear();
      for(std::set<TEveCaloData::CellId_t>::iterator it = hset.begin(); it != hset.end(); ++it)
      {
         hlist.push_back(*it);
      }    
      context().getCaloData()->CellSelectionChanged();

   }

   gEve->GetHighlight()->BlockSignals(blocked);
}
void FWEveViewManager::itemChanged ( const FWEventItem item) [private]

Callback of itemChanged_ signal. Iterate over all the builders for all the views and call itemChanged for any of the builders. If any of the builder also has at least one view, also update the interaction list.

Definition at line 501 of file FWEveViewManager.cc.

References FWProxyBuilderBase::getHaveWindow(), i, FWProxyBuilderBase::item(), FWProxyBuilderBase::itemChanged(), m_builders, and m_interactionLists.

Referenced by newItem().

{
   if (!item)
      return;

   bool itemHaveWindow = false;

   for (std::map<int, BuilderVec>::iterator i = m_builders.begin(); 
        i != m_builders.end(); ++i)
   {
      for(size_t bi = 0, be = i->second.size(); bi != be; ++bi)
      {
         FWProxyBuilderBase *builder = i->second[bi].get();
         
         if (builder->item() != item)
            continue;

         builder->itemChanged(item);
         itemHaveWindow |= builder->getHaveWindow();
      }
   }
   
   if (!itemHaveWindow)
      return;

   std::map<const FWEventItem*, FWInteractionList*>::iterator it = m_interactionLists.find(item);
   if (it != m_interactionLists.end())
   {
      if (!it->second->empty())
         it->second->itemChanged();
   }
}
void FWEveViewManager::modelChanges ( const FWModelIds iIds) [private]

Callback of event item changed_ signal.

Definition at line 460 of file FWEveViewManager.cc.

References FWProxyBuilderBase::getHaveWindow(), i, FWProxyBuilderBase::item(), m_builders, m_interactionLists, and FWProxyBuilderBase::modelChanges().

Referenced by newItem().

{
   FWModelId id = *(iIds.begin());
   const FWEventItem* item = id.item();

   // in standard case new elements can be build in case of change of visibility
   // and in non-standard case (e.g. calo towers) PB's modelChages handles all changes
   bool itemHaveWindow = false;
   for (std::map<int, BuilderVec>::iterator i = m_builders.begin(); 
        i != m_builders.end(); ++i)
   {
      for (size_t bi = 0, be = i->second.size(); bi != be; ++bi)
      {
         FWProxyBuilderBase *builder = i->second[bi].get();
         if (builder->getHaveWindow() && builder->item() == item)
         {
            builder->modelChanges(iIds);
            itemHaveWindow = true;
         }
      }
   }

   if (!itemHaveWindow)
      return;

   EveSelectionSentry();

   std::map<const FWEventItem*, FWInteractionList*>::iterator it = m_interactionLists.find(item);
   if (it != m_interactionLists.end())
   {
      if (!it->second->empty())
         it->second->modelChanges(iIds);
   }
}
void FWEveViewManager::modelChangesComing ( ) [protected, virtual]

called when models have changed and so the display must be updated

Implements FWViewManagerBase.

Definition at line 447 of file FWEveViewManager.cc.

{
   gEve->DisableRedraw();
}
void FWEveViewManager::modelChangesDone ( ) [protected, virtual]

Implements FWViewManagerBase.

Definition at line 453 of file FWEveViewManager.cc.

{
   gEve->EnableRedraw();
}
void FWEveViewManager::newItem ( const FWEventItem iItem) [virtual]

This is invoked when a new item is created by the FWEventItemsManager. The workflow is the following

1. First we check if we have a builder info for the given purpose of the item. We return simply if we don't. 2. We iterate over all the proxy builder registered for the given purpose and create a new one for this given item. 3. Interaction lists are set up in case the proxy builder does not handle interaction by itself. 4. We then iterate on the various supported views and add elements to them, making sure that we handle the case in which those elements are not unique among all the views.

Implements FWViewManagerBase.

Definition at line 181 of file FWEveViewManager.cc.

References addElements(), FWEventItem::changed_, FWProxyBuilderBase::createProduct(), ExpressReco_HICollisions_FallBack::e, exception, fwLog, reco::get(), FWEventItem::goingToBeDestroyed_, FWProxyBuilderBase::havePerViewProduct(), haveViewForBit(), i, info, itemChanged(), FWEventItem::itemChanged_, FWViewType::kTypeSize, fwlog::kWarning, m_builders, m_interactionLists, FWEveViewManager::BuilderInfo::m_name, m_typeToBuilder, FWEveViewManager::BuilderInfo::m_viewBit, m_views, modelChanges(), FWEventItem::purpose(), removeItem(), FWProxyBuilderBase::setHaveWindow(), FWProxyBuilderBase::setInteractionList(), FWProxyBuilderBase::setItem(), findQualityFiles::size, matplotRender::t, FWEveView::viewContext(), and FWProxyBuilderBase::willHandleInteraction().

{
   TypeToBuilder::iterator itFind = m_typeToBuilder.find(iItem->purpose());
   
   if (itFind == m_typeToBuilder.end())
      return;

   std::vector<BuilderInfo>& blist = itFind->second;

   for (size_t bii = 0, bie = blist.size(); bii != bie; ++bii)
   {
      // 1.
      BuilderInfo &info = blist[bii];
      std::string builderName = info.m_name;
      int builderViewBit =  info.m_viewBit;
      
      FWProxyBuilderBase* builder = 0;
      try
      {
         builder = FWProxyBuilderFactory::get()->create(builderName);

      }
      catch (std::exception& exc)
      {
         fwLog(fwlog::kWarning) << "FWEveViewManager::newItem ignoring the following exception (probably edmplugincache mismatch):"
                                << std::endl << exc.what();
      }
      if (!builder)
         continue;

      // 2.
      // printf("FWEveViewManager::makeProxyBuilderFor NEW builder %s \n", builderName.c_str());
      
      boost::shared_ptr<FWProxyBuilderBase> pB(builder);
      builder->setItem(iItem);
      iItem->changed_.connect(boost::bind(&FWEveViewManager::modelChanges,this,_1));
      iItem->goingToBeDestroyed_.connect(boost::bind(&FWEveViewManager::removeItem,this,_1));
      iItem->itemChanged_.connect(boost::bind(&FWEveViewManager::itemChanged,this,_1));

      // 3.
      // This calud be opaque to the user. I would pass a reference to the m_interactionLists to
      // FWProxyBuilderBase::setInteractionList and handle different case differently.
      if (builder->willHandleInteraction() == false)
      {
         typedef std::map<const FWEventItem*, FWInteractionList*>::iterator Iterator;
         std::pair<Iterator, bool> t = m_interactionLists.insert(std::make_pair(iItem,
                                                                                (FWInteractionList*)0));

         if (t.second == true)
            t.first->second = new FWInteractionList(iItem);
         //  printf(">>> builder %s add list %p \n", iItem->name().c_str(), il); fflush(stdout);
         builder->setInteractionList(t.first->second, iItem->purpose());
      }
      
      builder->setHaveWindow(haveViewForBit(builderViewBit));
      
      // 4.
      for (size_t viewType = 0; viewType < FWViewType::kTypeSize; ++viewType)
      {
         if (((1 << viewType) & builderViewBit) == 0)
            continue;
         
         FWViewType::EType type = (FWViewType::EType) viewType;
         
         // printf("%s builder %s supportsd view %s \n",  iItem->name().c_str(), builderName.c_str(), FWViewType::idToName(viewType).c_str());
         if (builder->havePerViewProduct((FWViewType::EType) viewType))
         { 
            for (size_t i = 0, e = m_views[viewType].size(); i != e; ++i)
            {
               FWEveView *view = m_views[viewType][i].get();
               TEveElementList* product = builder->createProduct(type, 
                                                                 view->viewContext());
               addElements(iItem, view, viewType, product);
            }
         }
         else 
         {
            TEveElementList* product = builder->createProduct(type, 0);
         
            for (size_t i = 0, e = m_views[viewType].size(); i != e; ++i)
               addElements(iItem, m_views[viewType][i].get(), viewType, product);
         }
      }
      
      m_builders[builderViewBit].push_back(pB);
   } // loop views
}
const FWEveViewManager& FWEveViewManager::operator= ( const FWEveViewManager ) [private]
void FWEveViewManager::removeItem ( const FWEventItem item) [virtual]

Remove an item from the given view.

Definition at line 537 of file FWEveViewManager.cc.

References i, m_builders, and m_interactionLists.

Referenced by newItem().

{
   EveSelectionSentry();

   std::map<const FWEventItem*, FWInteractionList*>::iterator it =  m_interactionLists.find(item);
   if (it != m_interactionLists.end())
   {
      delete it->second;
      m_interactionLists.erase(it);
   }
  
   for (std::map<int, BuilderVec>::iterator i = m_builders.begin();
        i != m_builders.end(); ++i)
   {
      BuilderVec_it bIt = i->second.begin();
      while( bIt != i->second.end() )
      {
         if ((*bIt)->item() == item)
         { 
            // TODO caching of proxy builders
            (*bIt)->itemBeingDestroyed(item);
            bIt = i->second.erase(bIt);
         }
         else
         {
            ++bIt;
         }
      }
   }
}
void FWEveViewManager::selectionAdded ( TEveElement *  iElement)

Definition at line 650 of file FWEveViewManager.cc.

References FWFromEveSelectorBase::doSelect(), and getSelector().

{
   FWFromEveSelectorBase* selector = getSelector(iElement);
   if (selector)
      selector->doSelect();
}
void FWEveViewManager::selectionCleared ( )
void FWEveViewManager::selectionRemoved ( TEveElement *  iElement)

Definition at line 658 of file FWEveViewManager.cc.

References FWFromEveSelectorBase::doUnselect(), and getSelector().

{
   FWFromEveSelectorBase* selector = getSelector(iElement);
   if (selector)
      selector->doUnselect();
}
void FWEveViewManager::setContext ( const fireworks::Context x) [virtual]
FWTypeToRepresentations FWEveViewManager::supportedTypesAndRepresentations ( ) const [virtual]

Implements FWViewManagerBase.

Definition at line 677 of file FWEveViewManager.cc.

References FWTypeToRepresentations::add(), info, FWEveViewManager::BuilderInfo::m_name, m_typeToBuilder, FWEveViewManager::BuilderInfo::m_viewBit, and AlCaRecoCosmics_cfg::name.

{
   // needed for add collection GUI
   FWTypeToRepresentations returnValue;
   const std::string kSimple("simple#");
   for(TypeToBuilder::const_iterator it = m_typeToBuilder.begin(), itEnd = m_typeToBuilder.end();
       it != itEnd;
       ++it) 
   {
      std::vector<BuilderInfo> blist = it->second;
      for (size_t bii = 0, bie = blist.size(); bii != bie; ++bii)
      {
         BuilderInfo &info = blist[bii];
         std::string name = info.m_name;
         unsigned int bitPackedViews = info.m_viewBit;
         bool representsSubPart = (name.substr(name.find_first_of('@')-1, 1)=="!");
     
         if(name.substr(0,kSimple.size()) == kSimple)
         {
            name = name.substr(kSimple.size(), name.find_first_of('@')-kSimple.size()-1);
            returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWSimpleRepresentationChecker(name, it->first,bitPackedViews,representsSubPart)) );
         }
         else
         {
            name = name.substr(0, name.find_first_of('@')-1);
            returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWEDProductRepresentationChecker(name, it->first,bitPackedViews,representsSubPart)) );
         }
      }
   }
   return returnValue;
}

Member Data Documentation

std::map<int, BuilderVec> FWEveViewManager::m_builders [private]

Definition at line 108 of file FWEveViewManager.h.

Referenced by itemChanged(), modelChanges(), newItem(), and removeItem().

Definition at line 102 of file FWEveViewManager.h.

Referenced by FWEveViewManager(), newItem(), and supportedTypesAndRepresentations().

std::vector< std::vector<boost::shared_ptr<FWEveView> > > FWEveViewManager::m_views [private]