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

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

Definition at line 49 of file FWViewManagerManager.cc.

50 {
51 }
FWViewManagerManager::FWViewManagerManager ( const FWViewManagerManager )
private

Member Function Documentation

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

Definition at line 69 of file FWViewManagerManager.cc.

References m_changeManager, m_colorManager, m_typeToItems, and m_viewManagers.

Referenced by CmsShowMainBase::setupViewManagers().

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

References i, and m_viewManagers.

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

Definition at line 135 of file FWViewManagerManager.cc.

References i, and m_viewManagers.

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

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

Referenced by CmsShowMainBase::setup().

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

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

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

Definition at line 113 of file FWViewManagerManager.cc.

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

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