ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Base
src
IVP12DDetViewsSystem.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// //
7
// Implementation of class IVP12DDetViewsSystem //
8
// //
9
// Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10
// //
11
// Initial version: July 2007 //
12
// //
14
15
#include "
VP1Base/IVP12DDetViewsSystem.h
"
16
#include "
VP1Base/VP1GraphicsItemCollection.h
"
17
#include <cassert>
18
19
void
IVP12DDetViewsSystem::systemcreate
(
StoreGateSvc
*) {}
20
QWidget *
IVP12DDetViewsSystem::buildController
() {
return
0; }
21
void
IVP12DDetViewsSystem::buildPermanentItemCollections
(
StoreGateSvc
*,
VP1GraphicsItemCollection
*,
22
VP1GraphicsItemCollection
*){}
23
void
IVP12DDetViewsSystem::buildEventItemCollections
(
StoreGateSvc
*,
VP1GraphicsItemCollection
*,
24
VP1GraphicsItemCollection
*){}
25
void
IVP12DDetViewsSystem::systemuncreate
() {}
26
void
IVP12DDetViewsSystem::systemerase
() {}
27
28
//____________________________________________________________________
29
class
IVP12DDetViewsSystem::Imp
{
30
public
:
31
VP1GraphicsItemCollection
*
itemcollectionPermanent_xy
;
32
VP1GraphicsItemCollection
*
itemcollectionPermanent_rz
;
33
VP1GraphicsItemCollection
*
itemcollectionEvent_xy
;
34
VP1GraphicsItemCollection
*
itemcollectionEvent_rz
;
35
bool
wasrefreshed
;
36
bool
wascreated
;
37
};
38
39
//____________________________________________________________________
40
IVP12DDetViewsSystem::IVP12DDetViewsSystem
(
const
QString &
name
,
const
QString &
information
,
const
QString &
contact_info
)
41
:
IVP12DSystem
(
name
,
information
,
contact_info
),
m_d
(new
Imp
)
42
{
43
m_d
->itemcollectionPermanent_xy =
new
VP1GraphicsItemCollection
(
this
);
44
m_d
->itemcollectionPermanent_rz =
new
VP1GraphicsItemCollection
(
this
);
45
m_d
->itemcollectionEvent_xy =
new
VP1GraphicsItemCollection
(
this
);
46
m_d
->itemcollectionEvent_rz =
new
VP1GraphicsItemCollection
(
this
);
47
48
registerItemCollection
(
m_d
->itemcollectionPermanent_xy);
49
registerItemCollection
(
m_d
->itemcollectionPermanent_rz);
50
registerItemCollection
(
m_d
->itemcollectionEvent_xy);
51
registerItemCollection
(
m_d
->itemcollectionEvent_rz);
52
53
m_d
->wasrefreshed=
false
;
54
m_d
->wascreated=
false
;
55
}
56
57
//____________________________________________________________________
58
IVP12DDetViewsSystem::~IVP12DDetViewsSystem
()
59
{
60
delete
m_d
;
m_d
=0;
61
}
62
63
//____________________________________________________________________
64
void
IVP12DDetViewsSystem::create
(
StoreGateSvc
* detstore)
65
{
66
assert(!
m_d
->wascreated);
67
systemcreate
(detstore);
68
69
QWidget * controller =
buildController
();
70
if
(controller)
71
registerController
(controller);
72
73
bool
hasview_xy =
m_d
->itemcollectionPermanent_xy->isAttachedToView();
74
if
(hasview_xy)
75
m_d
->itemcollectionPermanent_xy->detachFromView();
76
bool
hasview_rz =
m_d
->itemcollectionPermanent_rz->isAttachedToView();
77
if
(hasview_rz)
78
m_d
->itemcollectionPermanent_rz->detachFromView();
79
80
buildPermanentItemCollections
(detstore,
81
m_d
->itemcollectionPermanent_xy,
82
m_d
->itemcollectionPermanent_rz );
83
84
if
(hasview_xy)
85
m_d
->itemcollectionPermanent_xy->reattachToView();
86
if
(hasview_rz)
87
m_d
->itemcollectionPermanent_rz->reattachToView();
88
89
m_d
->wascreated=
true
;
90
}
91
92
//____________________________________________________________________
93
void
IVP12DDetViewsSystem::refresh
(
StoreGateSvc
* sg)
94
{
95
assert(
m_d
->wascreated);
96
assert(!
m_d
->wasrefreshed);
97
98
bool
hasview_xy =
m_d
->itemcollectionEvent_xy->isAttachedToView();
99
if
(hasview_xy)
100
m_d
->itemcollectionEvent_xy->detachFromView();
101
updateGUI
();
102
bool
hasview_rz =
m_d
->itemcollectionEvent_rz->isAttachedToView();
103
if
(hasview_rz)
104
m_d
->itemcollectionEvent_rz->detachFromView();
105
updateGUI
();
106
107
buildEventItemCollections
( sg,
108
m_d
->itemcollectionEvent_xy,
109
m_d
->itemcollectionEvent_rz );
110
111
updateGUI
();
112
if
(hasview_xy)
113
m_d
->itemcollectionEvent_xy->reattachToView();
114
updateGUI
();
115
if
(hasview_rz)
116
m_d
->itemcollectionEvent_rz->reattachToView();
117
118
m_d
->wasrefreshed=
true
;
119
}
120
121
//____________________________________________________________________
122
void
IVP12DDetViewsSystem::erase
()
123
{
124
assert(
m_d
->wascreated);
125
assert(
m_d
->wasrefreshed);
126
systemerase
();
127
m_d
->itemcollectionEvent_xy->clear();
128
m_d
->itemcollectionEvent_rz->clear();
129
m_d
->wasrefreshed=
false
;
130
}
131
132
//____________________________________________________________________
133
void
IVP12DDetViewsSystem::uncreate
()
134
{
135
messageDebug
(
"uncreate()..."
);
136
137
assert(
m_d
->wascreated);
138
assert(!
m_d
->wasrefreshed);
139
140
if
(
m_d
->itemcollectionEvent_xy->isAttachedToView())
141
m_d
->itemcollectionEvent_xy->detachFromView();
142
if
(
m_d
->itemcollectionEvent_rz->isAttachedToView())
143
m_d
->itemcollectionEvent_rz->detachFromView();
144
145
if
(
m_d
->itemcollectionPermanent_xy->isAttachedToView())
146
m_d
->itemcollectionPermanent_xy->detachFromView();
147
if
(
m_d
->itemcollectionPermanent_rz->isAttachedToView())
148
m_d
->itemcollectionPermanent_rz->detachFromView();
149
150
systemuncreate
();
151
m_d
->itemcollectionPermanent_xy->clear();
152
m_d
->itemcollectionPermanent_rz->clear();
153
m_d
->wascreated=
false
;
154
}
155
156
//____________________________________________________________________
157
QSet<VP1GraphicsItemCollection*>
IVP12DDetViewsSystem::getItemCollections_XY
()
const
158
{
159
QSet<VP1GraphicsItemCollection*> l;
160
l <<
m_d
->itemcollectionPermanent_xy;
161
l <<
m_d
->itemcollectionEvent_xy;
162
return
l;
163
}
164
165
//____________________________________________________________________
166
QSet<VP1GraphicsItemCollection*>
IVP12DDetViewsSystem::getItemCollections_RZ
()
const
167
{
168
QSet<VP1GraphicsItemCollection*> l;
169
l <<
m_d
->itemcollectionPermanent_rz;
170
l <<
m_d
->itemcollectionEvent_rz;
171
return
l;
172
}
IVP12DDetViewsSystem.h
VP1GraphicsItemCollection.h
IVP12DDetViewsSystem::Imp
Definition
IVP12DDetViewsSystem.cxx:29
IVP12DDetViewsSystem::Imp::itemcollectionPermanent_xy
VP1GraphicsItemCollection * itemcollectionPermanent_xy
Definition
IVP12DDetViewsSystem.cxx:31
IVP12DDetViewsSystem::Imp::wascreated
bool wascreated
Definition
IVP12DDetViewsSystem.cxx:36
IVP12DDetViewsSystem::Imp::itemcollectionEvent_xy
VP1GraphicsItemCollection * itemcollectionEvent_xy
Definition
IVP12DDetViewsSystem.cxx:33
IVP12DDetViewsSystem::Imp::itemcollectionEvent_rz
VP1GraphicsItemCollection * itemcollectionEvent_rz
Definition
IVP12DDetViewsSystem.cxx:34
IVP12DDetViewsSystem::Imp::itemcollectionPermanent_rz
VP1GraphicsItemCollection * itemcollectionPermanent_rz
Definition
IVP12DDetViewsSystem.cxx:32
IVP12DDetViewsSystem::Imp::wasrefreshed
bool wasrefreshed
Definition
IVP12DDetViewsSystem.cxx:35
IVP12DDetViewsSystem::systemerase
virtual void systemerase()
Definition
IVP12DDetViewsSystem.cxx:26
IVP12DDetViewsSystem::uncreate
void uncreate()
Definition
IVP12DDetViewsSystem.cxx:133
IVP12DDetViewsSystem::~IVP12DDetViewsSystem
virtual ~IVP12DDetViewsSystem()
Definition
IVP12DDetViewsSystem.cxx:58
IVP12DDetViewsSystem::refresh
void refresh(StoreGateSvc *storegate)
Definition
IVP12DDetViewsSystem.cxx:93
IVP12DDetViewsSystem::m_d
Imp * m_d
Definition
IVP12DDetViewsSystem.h:69
IVP12DDetViewsSystem::systemcreate
virtual void systemcreate(StoreGateSvc *detstore)
Definition
IVP12DDetViewsSystem.cxx:19
IVP12DDetViewsSystem::systemuncreate
virtual void systemuncreate()
Definition
IVP12DDetViewsSystem.cxx:25
IVP12DDetViewsSystem::buildPermanentItemCollections
virtual void buildPermanentItemCollections(StoreGateSvc *detstore, VP1GraphicsItemCollection *ic_xy, VP1GraphicsItemCollection *ic_rz)
Definition
IVP12DDetViewsSystem.cxx:21
IVP12DDetViewsSystem::buildController
virtual QWidget * buildController()
Definition
IVP12DDetViewsSystem.cxx:20
IVP12DDetViewsSystem::getItemCollections_RZ
QSet< VP1GraphicsItemCollection * > getItemCollections_RZ() const
Definition
IVP12DDetViewsSystem.cxx:166
IVP12DDetViewsSystem::getItemCollections_XY
QSet< VP1GraphicsItemCollection * > getItemCollections_XY() const
Definition
IVP12DDetViewsSystem.cxx:157
IVP12DDetViewsSystem::erase
void erase()
Definition
IVP12DDetViewsSystem.cxx:122
IVP12DDetViewsSystem::create
void create(StoreGateSvc *detstore)
Definition
IVP12DDetViewsSystem.cxx:64
IVP12DDetViewsSystem::buildEventItemCollections
virtual void buildEventItemCollections(StoreGateSvc *sg, VP1GraphicsItemCollection *ic_xy, VP1GraphicsItemCollection *ic_rz)
Definition
IVP12DDetViewsSystem.cxx:23
IVP12DDetViewsSystem::IVP12DDetViewsSystem
IVP12DDetViewsSystem(const QString &name, const QString &information, const QString &contact_info)
Definition
IVP12DDetViewsSystem.cxx:40
IVP12DSystem::IVP12DSystem
IVP12DSystem(const QString &name, const QString &information, const QString &contact_info)
Definition
IVP12DSystem.cxx:32
IVP12DSystem::registerItemCollection
void registerItemCollection(VP1GraphicsItemCollection *)
Definition
IVP12DSystem.cxx:44
IVP1System::messageDebug
void messageDebug(const QString &) const
Definition
IVP1System.cxx:347
IVP1System::name
const QString & name() const
Definition
IVP1System.cxx:50
IVP1System::updateGUI
void updateGUI()
Definition
IVP1System.cxx:262
IVP1System::registerController
void registerController(QWidget *)
Definition
IVP1System.cxx:224
IVP1System::information
const QString & information() const
Definition
IVP1System.cxx:56
IVP1System::contact_info
const QString & contact_info() const
Definition
IVP1System.cxx:62
StoreGateSvc
The Athena Transient Store API.
Definition
StoreGateSvc.h:120
VP1GraphicsItemCollection
Definition
VP1GraphicsItemCollection.h:53
Generated on
for ATLAS Offline Software by
1.17.0