Fireworks
Core
src
FWViewManagerManager.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: Core
4
// Class : FWViewManagerManager
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Tue Jan 15 10:27:12 EST 2008
11
//
12
13
// system include files
14
#include <iostream>
15
#include <functional>
16
17
// user include files
18
#include "
Fireworks/Core/interface/FWViewManagerManager.h
"
19
#include "
Fireworks/Core/interface/FWViewManagerBase.h
"
20
#include "
Fireworks/Core/interface/FWEventItem.h
"
21
#include "
Fireworks/Core/interface/fwLog.h
"
22
#include "
Fireworks/Core/interface/FWTypeToRepresentations.h
"
23
24
//
25
// constants, enums and typedefs
26
//
27
28
//
29
// static data member definitions
30
//
31
32
//
33
// constructors and destructor
34
//
35
FWViewManagerManager::FWViewManagerManager
(
FWModelChangeManager
* iCM,
FWColorManager
* iColorM)
36
: m_changeManager(iCM), m_colorManager(iColorM) {}
37
38
// FWViewManagerManager::FWViewManagerManager(const FWViewManagerManager& rhs)
39
// {
40
// // do actual copying here;
41
// }
42
43
FWViewManagerManager::~FWViewManagerManager
() {}
44
45
//
46
// assignment operators
47
//
48
// const FWViewManagerManager& FWViewManagerManager::operator=(const FWViewManagerManager& rhs)
49
// {
50
// //An exception safe implementation is
51
// FWViewManagerManager temp(rhs);
52
// swap(rhs);
53
//
54
// return *this;
55
// }
56
57
//
58
// member functions
59
//
60
void
FWViewManagerManager::add
(std::shared_ptr<FWViewManagerBase> iManager) {
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
}
71
72
void
FWViewManagerManager::registerEventItem
(
const
FWEventItem
* iItem) {
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
}
87
88
void
FWViewManagerManager::removeEventItem
(
const
FWEventItem
* iItem) {
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
}
93
94
//
95
// const member functions
96
//
97
FWTypeToRepresentations
FWViewManagerManager::supportedTypesAndRepresentations
()
const
{
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
}
107
108
void
FWViewManagerManager::eventBegin
() {
109
for
(
auto
i
=
m_viewManagers
.begin();
i
!=
m_viewManagers
.end(); ++
i
)
110
(*i)->eventBegin();
111
}
112
113
void
FWViewManagerManager::eventEnd
() {
114
for
(
auto
i
=
m_viewManagers
.begin();
i
!=
m_viewManagers
.end(); ++
i
)
115
(*i)->eventEnd();
116
}
117
118
//
119
// static member functions
120
//
FWViewManagerManager::eventEnd
void eventEnd()
Definition:
FWViewManagerManager.cc:113
fwLog
#define fwLog(_level_)
Definition:
fwLog.h:45
mps_fire.i
i
Definition:
mps_fire.py:428
FWViewManagerManager::m_colorManager
FWColorManager * m_colorManager
Definition:
FWViewManagerManager.h:62
FWEventItem::goingToBeDestroyed_
FWItemChangeSignal goingToBeDestroyed_
Definition:
FWEventItem.h:197
FWViewManagerManager::FWViewManagerManager
FWViewManagerManager(FWModelChangeManager *, FWColorManager *)
Definition:
FWViewManagerManager.cc:35
FWViewManagerManager::add
void add(std::shared_ptr< FWViewManagerBase >)
Definition:
FWViewManagerManager.cc:60
FWModelChangeManager
Definition:
FWModelChangeManager.h:33
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
FWViewManagerBase.h
FWViewManagerManager::eventBegin
void eventBegin()
Definition:
FWViewManagerManager.cc:108
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
fwlog::kWarning
Definition:
fwLog.h:35
fwLog.h
FWColorManager
Definition:
FWColorManager.h:45
FWEventItem.h
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
FWEventItem
Definition:
FWEventItem.h:56
FWViewManagerManager::m_viewManagers
std::vector< std::shared_ptr< FWViewManagerBase > > m_viewManagers
Definition:
FWViewManagerManager.h:60
FWTypeToRepresentations
Definition:
FWTypeToRepresentations.h:33
FWTypeToRepresentations.h
FWViewManagerManager::registerEventItem
void registerEventItem(const FWEventItem *iItem)
Definition:
FWViewManagerManager.cc:72
FWEventItem::name
const std::string & name() const
Definition:
FWEventItem.cc:435
FWViewManagerManager::supportedTypesAndRepresentations
FWTypeToRepresentations supportedTypesAndRepresentations() const
Definition:
FWViewManagerManager.cc:97
FWViewManagerManager::~FWViewManagerManager
virtual ~FWViewManagerManager()
Definition:
FWViewManagerManager.cc:43
FWViewManagerManager.h
Generated for CMSSW Reference Manual by
1.8.16