CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWViewManagerManager Class Reference

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

List of all members.

Public Member Functions

void add (boost::shared_ptr< FWViewManagerBase >)
void eventBegin ()
void eventEnd ()
 FWViewManagerManager (FWModelChangeManager *, FWColorManager *)
void registerEventItem (const FWEventItem *iItem)
void removeEventItem (const FWEventItem *iItem)
FWTypeToRepresentations supportedTypesAndRepresentations () const
virtual ~FWViewManagerManager ()

Private Member Functions

 FWViewManagerManager (const FWViewManagerManager &)
const FWViewManagerManageroperator= (const FWViewManagerManager &)

Private Attributes

FWModelChangeManagerm_changeManager
FWColorManagerm_colorManager
std::map< std::string, const
FWEventItem * > 
m_typeToItems
std::vector< boost::shared_ptr
< FWViewManagerBase > > 
m_viewManagers

Detailed Description

Description: Manages all the FWViewManagerBase instances

Usage: <usage>

Definition at line 38 of file FWViewManagerManager.h.


Constructor & Destructor Documentation

FWViewManagerManager::FWViewManagerManager ( FWModelChangeManager iCM,
FWColorManager iColorM 
)

Definition at line 38 of file FWViewManagerManager.cc.

                                                                    :
   m_changeManager(iCM),
   m_colorManager(iColorM)
{
}
FWViewManagerManager::~FWViewManagerManager ( ) [virtual]

Definition at line 50 of file FWViewManagerManager.cc.

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

Member Function Documentation

void FWViewManagerManager::add ( boost::shared_ptr< FWViewManagerBase iManager)

Definition at line 70 of file FWViewManagerManager.cc.

References m_changeManager, m_colorManager, m_typeToItems, and m_viewManagers.

Referenced by CmsShowMainBase::setupViewManagers().

{
   m_viewManagers.push_back(iManager);
   iManager->setChangeManager(m_changeManager);
   iManager->setColorManager(m_colorManager);

   for(std::map<std::string,const FWEventItem*>::iterator it=m_typeToItems.begin(), itEnd=m_typeToItems.end();
       it != itEnd;
       ++it) {
      iManager->newItem(it->second);
   }
}
void FWViewManagerManager::eventBegin ( )

Definition at line 127 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

{
   gEve->DisableRedraw();
   for ( std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator i = m_viewManagers.begin();
         i != m_viewManagers.end(); ++i )
      (*i)->eventBegin();
}
void FWViewManagerManager::eventEnd ( )

Definition at line 136 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

{
   for ( std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator i = m_viewManagers.begin();
         i != m_viewManagers.end(); ++i )
      (*i)->eventEnd();
   gEve->EnableRedraw();
}
const FWViewManagerManager& FWViewManagerManager::operator= ( const FWViewManagerManager ) [private]
void FWViewManagerManager::registerEventItem ( const FWEventItem iItem)

Definition at line 84 of file FWViewManagerManager.cc.

References fwLog, FWEventItem::goingToBeDestroyed_, fwlog::kWarning, m_typeToItems, m_viewManagers, FWEventItem::name(), and removeEventItem().

Referenced by CmsShowMainBase::setup().

{
   if ( m_typeToItems.find(iItem->name()) != m_typeToItems.end() ) {
      fwLog(fwlog::kWarning) << "WARNING: item "<< iItem->name() <<" was already registered. Request ignored.\n";
      return;
   }
   m_typeToItems[iItem->name()]=iItem;
   iItem->goingToBeDestroyed_.connect(boost::bind(&FWViewManagerManager::removeEventItem,this,_1));

   //std::map<std::string, std::vector<std::string> >::iterator itFind = m_typeToBuilders.find(iItem->name());
   for(std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator itVM = m_viewManagers.begin();
       itVM != m_viewManagers.end();
       ++itVM) {
      (*itVM)->newItem(iItem);
   }
}
void FWViewManagerManager::removeEventItem ( const FWEventItem iItem)

Definition at line 102 of file FWViewManagerManager.cc.

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

{
   std::map<std::string, const FWEventItem*>::iterator itr =
      m_typeToItems.find(iItem->name());
   if ( itr != m_typeToItems.end() ) m_typeToItems.erase( itr );
}
FWTypeToRepresentations FWViewManagerManager::supportedTypesAndRepresentations ( ) const

Definition at line 114 of file FWViewManagerManager.cc.

References FWTypeToRepresentations::insert(), m_viewManagers, and v.

{
   FWTypeToRepresentations returnValue;
   for(std::vector<boost::shared_ptr<FWViewManagerBase> >::const_iterator itVM = m_viewManagers.begin();
       itVM != m_viewManagers.end();
       ++itVM) {
      FWTypeToRepresentations v = (*itVM)->supportedTypesAndRepresentations();
      returnValue.insert(v);
   }
   return returnValue;
}

Member Data Documentation

Definition at line 64 of file FWViewManagerManager.h.

Referenced by add().

Definition at line 65 of file FWViewManagerManager.h.

Referenced by add().

std::map<std::string, const FWEventItem*> FWViewManagerManager::m_typeToItems [private]

Definition at line 66 of file FWViewManagerManager.h.

Referenced by add(), registerEventItem(), and removeEventItem().

std::vector<boost::shared_ptr<FWViewManagerBase> > FWViewManagerManager::m_viewManagers [private]