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

Constructor & Destructor Documentation

FWViewManagerManager::FWViewManagerManager ( FWModelChangeManager iCM,
FWColorManager iColorM 
)

Definition at line 38 of file FWViewManagerManager.cc.

39  :
40  m_changeManager(iCM),
41  m_colorManager(iColorM)
42 {
43 }
FWModelChangeManager * m_changeManager
FWColorManager * m_colorManager
FWViewManagerManager::~FWViewManagerManager ( )
virtual

Definition at line 50 of file FWViewManagerManager.cc.

51 {
52 }
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().

71 {
72  m_viewManagers.push_back(iManager);
73  iManager->setChangeManager(m_changeManager);
74  iManager->setColorManager(m_colorManager);
75 
76  for(std::map<std::string,const FWEventItem*>::iterator it=m_typeToItems.begin(), itEnd=m_typeToItems.end();
77  it != itEnd;
78  ++it) {
79  iManager->newItem(it->second);
80  }
81 }
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 127 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

128 {
129  gEve->DisableRedraw();
130  for ( std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator i = m_viewManagers.begin();
131  i != m_viewManagers.end(); ++i )
132  (*i)->eventBegin();
133 }
int i
Definition: DBlmapReader.cc:9
std::vector< boost::shared_ptr< FWViewManagerBase > > m_viewManagers
void FWViewManagerManager::eventEnd ( )

Definition at line 136 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

137 {
138  for ( std::vector<boost::shared_ptr<FWViewManagerBase> >::iterator i = m_viewManagers.begin();
139  i != m_viewManagers.end(); ++i )
140  (*i)->eventEnd();
141  gEve->EnableRedraw();
142 }
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 84 of file FWViewManagerManager.cc.

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

Referenced by CmsShowMainBase::setup().

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

Definition at line 102 of file FWViewManagerManager.cc.

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

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

Definition at line 114 of file FWViewManagerManager.cc.

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

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

Member Data Documentation

FWModelChangeManager* FWViewManagerManager::m_changeManager
private

Definition at line 64 of file FWViewManagerManager.h.

Referenced by add().

FWColorManager* FWViewManagerManager::m_colorManager
private

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