ATLAS Offline Software
Loading...
Searching...
No Matches
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
17#include <cassert>
18
27
28//____________________________________________________________________
38
39//____________________________________________________________________
40IVP12DDetViewsSystem::IVP12DDetViewsSystem(const QString & name, const QString & information, const QString & contact_info)
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//____________________________________________________________________
62
63//____________________________________________________________________
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
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//____________________________________________________________________
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
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//____________________________________________________________________
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//____________________________________________________________________
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
151 m_d->itemcollectionPermanent_xy->clear();
152 m_d->itemcollectionPermanent_rz->clear();
153 m_d->wascreated=false;
154}
155
156//____________________________________________________________________
157QSet<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//____________________________________________________________________
166QSet<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}
VP1GraphicsItemCollection * itemcollectionPermanent_xy
VP1GraphicsItemCollection * itemcollectionEvent_xy
VP1GraphicsItemCollection * itemcollectionEvent_rz
VP1GraphicsItemCollection * itemcollectionPermanent_rz
void refresh(StoreGateSvc *storegate)
virtual void systemcreate(StoreGateSvc *detstore)
virtual void buildPermanentItemCollections(StoreGateSvc *detstore, VP1GraphicsItemCollection *ic_xy, VP1GraphicsItemCollection *ic_rz)
virtual QWidget * buildController()
QSet< VP1GraphicsItemCollection * > getItemCollections_RZ() const
QSet< VP1GraphicsItemCollection * > getItemCollections_XY() const
void create(StoreGateSvc *detstore)
virtual void buildEventItemCollections(StoreGateSvc *sg, VP1GraphicsItemCollection *ic_xy, VP1GraphicsItemCollection *ic_rz)
IVP12DDetViewsSystem(const QString &name, const QString &information, const QString &contact_info)
IVP12DSystem(const QString &name, const QString &information, const QString &contact_info)
void registerItemCollection(VP1GraphicsItemCollection *)
void messageDebug(const QString &) const
const QString & name() const
void updateGUI()
void registerController(QWidget *)
const QString & information() const
const QString & contact_info() const
The Athena Transient Store API.