CMS 3D CMS Logo

List of all members | Public 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 *)
 
 FWViewManagerManager (const FWViewManagerManager &)=delete
 
const FWViewManagerManageroperator= (const FWViewManagerManager &)=delete
 
void registerEventItem (const FWEventItem *iItem)
 
void removeEventItem (const FWEventItem *iItem)
 
FWTypeToRepresentations supportedTypesAndRepresentations () const
 
virtual ~FWViewManagerManager ()
 

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) {}
FWModelChangeManager * m_changeManager
FWColorManager * m_colorManager

◆ ~FWViewManagerManager()

FWViewManagerManager::~FWViewManagerManager ( )
virtual

Definition at line 43 of file FWViewManagerManager.cc.

43 {}

◆ FWViewManagerManager() [2/2]

FWViewManagerManager::FWViewManagerManager ( const FWViewManagerManager )
delete

Member Function Documentation

◆ add()

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

Definition at line 60 of file FWViewManagerManager.cc.

References m_changeManager, m_colorManager, m_typeToItems, and m_viewManagers.

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

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 }
FWModelChangeManager * m_changeManager
std::map< std::string, const FWEventItem * > m_typeToItems
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers
FWColorManager * m_colorManager

◆ eventBegin()

void FWViewManagerManager::eventBegin ( )

Definition at line 108 of file FWViewManagerManager.cc.

References mps_fire::i, and m_viewManagers.

108  {
109  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
110  (*i)->eventBegin();
111 }
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers

◆ eventEnd()

void FWViewManagerManager::eventEnd ( )

Definition at line 113 of file FWViewManagerManager.cc.

References mps_fire::i, and m_viewManagers.

113  {
114  for (auto i = m_viewManagers.begin(); i != m_viewManagers.end(); ++i)
115  (*i)->eventEnd();
116 }
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers

◆ operator=()

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

◆ registerEventItem()

void FWViewManagerManager::registerEventItem ( const FWEventItem iItem)

Definition at line 72 of file FWViewManagerManager.cc.

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

Referenced by CmsShowMainBase::setup().

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(std::bind(&FWViewManagerManager::removeEventItem, this, std::placeholders::_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 }
void removeEventItem(const FWEventItem *iItem)
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:197
std::map< std::string, const FWEventItem * > m_typeToItems
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers
#define fwLog(_level_)
Definition: fwLog.h:45
const std::string & name() const
Definition: FWEventItem.cc:435

◆ removeEventItem()

void FWViewManagerManager::removeEventItem ( const FWEventItem iItem)

Definition at line 88 of file FWViewManagerManager.cc.

References m_typeToItems, and FWEventItem::name().

Referenced by registerEventItem().

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 }
std::map< std::string, const FWEventItem * > m_typeToItems
const std::string & name() const
Definition: FWEventItem.cc:435

◆ supportedTypesAndRepresentations()

FWTypeToRepresentations FWViewManagerManager::supportedTypesAndRepresentations ( ) const

Definition at line 97 of file FWViewManagerManager.cc.

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

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 }
void insert(const FWTypeToRepresentations &)
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers

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