CMS 3D CMS Logo

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 (std::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 &)=delete
 
const FWViewManagerManageroperator= (const FWViewManagerManager &)=delete
 

Private Attributes

FWModelChangeManagerm_changeManager
 
FWColorManagerm_colorManager
 
std::map< std::string, const FWEventItem * > m_typeToItems
 
std::vector< std::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() [1/2]

FWViewManagerManager::FWViewManagerManager ( FWModelChangeManager iCM,
FWColorManager iColorM 
)

Definition at line 35 of file FWViewManagerManager.cc.

36  : m_changeManager(iCM), m_colorManager(iColorM) {}

◆ ~FWViewManagerManager()

FWViewManagerManager::~FWViewManagerManager ( )
virtual

Definition at line 43 of file FWViewManagerManager.cc.

43 {}

◆ FWViewManagerManager() [2/2]

FWViewManagerManager::FWViewManagerManager ( const FWViewManagerManager )
privatedelete

Member Function Documentation

◆ add()

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

Definition at line 60 of file FWViewManagerManager.cc.

60  {
61  m_viewManagers.push_back(iManager);
62  iManager->setChangeManager(m_changeManager);
63  iManager->setColorManager(m_colorManager);
64 
65  for (std::map<std::string, const FWEventItem*>::iterator it = m_typeToItems.begin(), itEnd = m_typeToItems.end();
66  it != itEnd;
67  ++it) {
68  iManager->newItem(it->second);
69  }
70 }

References m_changeManager, m_colorManager, m_typeToItems, and m_viewManagers.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), SequenceTypes.Task::replace(), and CmsShowMainBase::setupViewManagers().

◆ eventBegin()

void FWViewManagerManager::eventBegin ( )

Definition at line 108 of file FWViewManagerManager.cc.

108  {
109  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
110  (*i)->eventBegin();
111 }

References mps_fire::i, and m_viewManagers.

◆ eventEnd()

void FWViewManagerManager::eventEnd ( )

Definition at line 113 of file FWViewManagerManager.cc.

113  {
114  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
115  (*i)->eventEnd();
116 }

References mps_fire::i, and m_viewManagers.

◆ operator=()

const FWViewManagerManager& FWViewManagerManager::operator= ( const FWViewManagerManager )
privatedelete

◆ registerEventItem()

void FWViewManagerManager::registerEventItem ( const FWEventItem iItem)

Definition at line 72 of file FWViewManagerManager.cc.

72  {
73  if (m_typeToItems.find(iItem->name()) != m_typeToItems.end()) {
74  fwLog(fwlog::kWarning) << "WARNING: item " << iItem->name() << " was already registered. Request ignored.\n";
75  return;
76  }
77  m_typeToItems[iItem->name()] = iItem;
78  iItem->goingToBeDestroyed_.connect(boost::bind(&FWViewManagerManager::removeEventItem, this, _1));
79 
80  //std::map<std::string, std::vector<std::string> >::iterator itFind = m_typeToBuilders.find(iItem->name());
81  for (std::vector<std::shared_ptr<FWViewManagerBase> >::iterator itVM = m_viewManagers.begin();
82  itVM != m_viewManagers.end();
83  ++itVM) {
84  (*itVM)->newItem(iItem);
85  }
86 }

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

Referenced by CmsShowMainBase::setup().

◆ removeEventItem()

void FWViewManagerManager::removeEventItem ( const FWEventItem iItem)

Definition at line 88 of file FWViewManagerManager.cc.

88  {
89  std::map<std::string, const FWEventItem*>::iterator itr = m_typeToItems.find(iItem->name());
90  if (itr != m_typeToItems.end())
91  m_typeToItems.erase(itr);
92 }

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

◆ supportedTypesAndRepresentations()

FWTypeToRepresentations FWViewManagerManager::supportedTypesAndRepresentations ( ) const

Definition at line 97 of file FWViewManagerManager.cc.

97  {
98  FWTypeToRepresentations returnValue;
99  for (std::vector<std::shared_ptr<FWViewManagerBase> >::const_iterator itVM = m_viewManagers.begin();
100  itVM != m_viewManagers.end();
101  ++itVM) {
102  FWTypeToRepresentations v = (*itVM)->supportedTypesAndRepresentations();
103  returnValue.insert(v);
104  }
105  return returnValue;
106 }

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

Member Data Documentation

◆ m_changeManager

FWModelChangeManager* FWViewManagerManager::m_changeManager
private

Definition at line 61 of file FWViewManagerManager.h.

Referenced by add().

◆ m_colorManager

FWColorManager* FWViewManagerManager::m_colorManager
private

Definition at line 62 of file FWViewManagerManager.h.

Referenced by add().

◆ m_typeToItems

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

Definition at line 63 of file FWViewManagerManager.h.

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

◆ m_viewManagers

std::vector<std::shared_ptr<FWViewManagerBase> > FWViewManagerManager::m_viewManagers
private
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
mps_fire.i
i
Definition: mps_fire.py:355
FWViewManagerManager::m_colorManager
FWColorManager * m_colorManager
Definition: FWViewManagerManager.h:62
FWEventItem::goingToBeDestroyed_
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:197
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FWTypeToRepresentations::insert
void insert(const FWTypeToRepresentations &)
Definition: FWTypeToRepresentations.cc:68
FWViewManagerManager::m_changeManager
FWModelChangeManager * m_changeManager
Definition: FWViewManagerManager.h:61
fwlog::kWarning
Definition: fwLog.h:35
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
FWViewManagerManager::m_typeToItems
std::map< std::string, const FWEventItem * > m_typeToItems
Definition: FWViewManagerManager.h:63
FWViewManagerManager::removeEventItem
void removeEventItem(const FWEventItem *iItem)
Definition: FWViewManagerManager.cc:88
FWViewManagerManager::m_viewManagers
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers
Definition: FWViewManagerManager.h:60
FWTypeToRepresentations
Definition: FWTypeToRepresentations.h:33
FWEventItem::name
const std::string & name() const
Definition: FWEventItem.cc:435