CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWViewManagerManager Class Reference

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

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 37 of file FWViewManagerManager.h.

Constructor & Destructor Documentation

FWViewManagerManager::FWViewManagerManager ( FWModelChangeManager iCM,
FWColorManager iColorM 
)

Definition at line 35 of file FWViewManagerManager.cc.

36  :
37  m_changeManager(iCM),
38  m_colorManager(iColorM)
39 {
40 }
FWModelChangeManager * m_changeManager
FWColorManager * m_colorManager
FWViewManagerManager::~FWViewManagerManager ( )
virtual

Definition at line 47 of file FWViewManagerManager.cc.

48 {
49 }
FWViewManagerManager::FWViewManagerManager ( const FWViewManagerManager )
private

Member Function Documentation

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

Definition at line 67 of file FWViewManagerManager.cc.

References m_changeManager, m_colorManager, m_typeToItems, and m_viewManagers.

Referenced by counter.Counter::register(), and CmsShowMainBase::setupViewManagers().

68 {
69  m_viewManagers.push_back(iManager);
70  iManager->setChangeManager(m_changeManager);
71  iManager->setColorManager(m_colorManager);
72 
73  for(std::map<std::string,const FWEventItem*>::iterator it=m_typeToItems.begin(), itEnd=m_typeToItems.end();
74  it != itEnd;
75  ++it) {
76  iManager->newItem(it->second);
77  }
78 }
FWModelChangeManager * m_changeManager
std::map< std::string, const FWEventItem * > m_typeToItems
FWColorManager * m_colorManager
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers
void FWViewManagerManager::eventBegin ( )

Definition at line 124 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

125 {
126  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
127  (*i)->eventBegin();
128 }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers
void FWViewManagerManager::eventEnd ( )

Definition at line 131 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

132 {
133  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
134  (*i)->eventEnd();
135 }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers
const FWViewManagerManager& FWViewManagerManager::operator= ( const FWViewManagerManager )
private
void FWViewManagerManager::registerEventItem ( const FWEventItem iItem)

Definition at line 81 of file FWViewManagerManager.cc.

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

Referenced by CmsShowMainBase::setup().

82 {
83  if ( m_typeToItems.find(iItem->name()) != m_typeToItems.end() ) {
84  fwLog(fwlog::kWarning) << "WARNING: item "<< iItem->name() <<" was already registered. Request ignored.\n";
85  return;
86  }
87  m_typeToItems[iItem->name()]=iItem;
88  iItem->goingToBeDestroyed_.connect(boost::bind(&FWViewManagerManager::removeEventItem,this,_1));
89 
90  //std::map<std::string, std::vector<std::string> >::iterator itFind = m_typeToBuilders.find(iItem->name());
91  for(std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator itVM = m_viewManagers.begin();
92  itVM != m_viewManagers.end();
93  ++itVM) {
94  (*itVM)->newItem(iItem);
95  }
96 }
void removeEventItem(const FWEventItem *iItem)
const std::string & name() const
Definition: FWEventItem.cc:513
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:219
std::map< std::string, const FWEventItem * > m_typeToItems
#define fwLog(_level_)
Definition: fwLog.h:50
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers
void FWViewManagerManager::removeEventItem ( const FWEventItem iItem)

Definition at line 99 of file FWViewManagerManager.cc.

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

100 {
101  std::map<std::string, const FWEventItem*>::iterator itr =
102  m_typeToItems.find(iItem->name());
103  if ( itr != m_typeToItems.end() ) m_typeToItems.erase( itr );
104 }
const std::string & name() const
Definition: FWEventItem.cc:513
std::map< std::string, const FWEventItem * > m_typeToItems
FWTypeToRepresentations FWViewManagerManager::supportedTypesAndRepresentations ( ) const

Definition at line 111 of file FWViewManagerManager.cc.

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

112 {
113  FWTypeToRepresentations returnValue;
114  for(std::vector<boost::shared_ptr<FWViewManagerBase> >::const_iterator itVM = m_viewManagers.begin();
115  itVM != m_viewManagers.end();
116  ++itVM) {
117  FWTypeToRepresentations v = (*itVM)->supportedTypesAndRepresentations();
118  returnValue.insert(v);
119  }
120  return returnValue;
121 }
void insert(const FWTypeToRepresentations &)
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers

Member Data Documentation

FWModelChangeManager* FWViewManagerManager::m_changeManager
private

Definition at line 63 of file FWViewManagerManager.h.

Referenced by add().

FWColorManager* FWViewManagerManager::m_colorManager
private

Definition at line 64 of file FWViewManagerManager.h.

Referenced by add().

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

Definition at line 65 of file FWViewManagerManager.h.

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

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