ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1CaloClusterSystems
src
VP1CaloClusterSystem.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
7
// //
8
// Implementation of class VP1CaloClusterSystem //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: June 2008 //
12
// //
14
15
#include "
VP1CaloClusterSystems/VP1CaloClusterSystem.h
"
16
#include "
VP1CaloClusterSystems/CaloClusterSysController.h
"
17
#include "
VP1CaloClusterSystems/VP1CaloClusterCollection.h
"
18
19
#include "
VP1Base/VP1Serialise.h
"
20
#include "
VP1Base/VP1Deserialise.h
"
21
#include "
VP1Base/VP1CollectionWidget.h
"
22
#include <Inventor/nodes/SoSeparator.h>
23
#include <Inventor/nodes/SoSwitch.h>
24
#include <Inventor/SoPath.h>
25
26
//____________________________________________________________________
27
class
VP1CaloClusterSystem::Imp
{
28
public
:
29
Imp
(
VP1CaloClusterSystem
*
tc
) :
theclass
(
tc
),
controller
(0) {}
30
VP1CaloClusterSystem
*
theclass
;
31
CaloClusterSysController
*
controller
;
32
};
33
34
//_____________________________________________________________________________________
35
VP1CaloClusterSystem::VP1CaloClusterSystem
()
36
:
IVP13DSystemSimple
(
"Clusters"
,
37
"System showing Calorimeter Clusters"
,
38
"Thomas.Kittelmann@cern.ch"
),
39
m_d
(new
Imp
(this))
40
{
41
}
42
43
//____________________________________________________________________
44
VP1CaloClusterSystem::~VP1CaloClusterSystem
()
45
{
46
delete
m_d
;
47
}
48
49
//_____________________________________________________________________________________
50
void
VP1CaloClusterSystem::systemerase
()
51
{
52
//Save present states and then clear all event data and related gui elements.
53
m_d
->controller->collWidget()->clear();
54
}
55
56
//_____________________________________________________________________________________
57
void
VP1CaloClusterSystem::buildEventSceneGraph
(
StoreGateSvc
*, SoSeparator *root)
58
{
59
root->addChild(
m_d
->controller->drawOptions());
60
61
//Create collection list based on contents of event store, populate
62
//gui and apply states:
63
m_d
->controller->collWidget()->setCollections(
VP1CaloClusterCollection::createCollections
(
this
,
m_d
->controller));
64
65
//Add collections to event scenegraph:
66
for
(
VP1StdCollection
* col :
m_d
->controller->collWidget()->collections<
VP1StdCollection
>())
67
root->addChild(col->collSwitch());
68
}
69
70
//_____________________________________________________________________________________
71
QWidget *
VP1CaloClusterSystem::buildController
()
72
{
73
m_d
->controller =
new
CaloClusterSysController
(
this
);
74
return
m_d
->controller;
75
}
76
77
//_____________________________________________________________________________________
78
void
VP1CaloClusterSystem::userPickedNode
(SoNode*, SoPath * pickedPath) {
79
80
for
(
VP1CaloClusterCollection
* col :
m_d
->controller->collWidget()->collections<
VP1CaloClusterCollection
>()) {
81
if
(col->visible()&&pickedPath->containsNode(col->collSep())) {
82
message
(col->infoOnClicked(pickedPath));
83
return
;
84
}
85
}
86
message
(
"Error: Does not have cluster information for picked node"
);
87
}
88
89
//_____________________________________________________________________________________
90
QByteArray
VP1CaloClusterSystem::saveState
()
91
{
92
VP1Serialise
serialise(1
/*version*/
,
this
);
93
ensureBuildController
();
94
95
serialise.save(
IVP13DSystemSimple::saveState
());
96
97
serialise.save(
m_d
->controller->collWidget());
98
serialise.save(
m_d
->controller->saveSettings());
//1+
99
100
serialise.disableUnsavedChecks();
//We do the testing in the controller
101
102
return
serialise.result();
103
}
104
105
//_____________________________________________________________________________________
106
void
VP1CaloClusterSystem::restoreFromState
(QByteArray ba)
107
{
108
VP1Deserialise
state
(ba,
this
);
109
if
(
state
.version()<0||
state
.version()>1) {
110
message
(
"Warning: State data in .vp1 file is in wrong format - ignoring!"
);
111
return
;
112
}
113
ensureBuildController
();
114
IVP13DSystemSimple::restoreFromState
(
state
.restoreByteArray());
115
116
state
.restore(
m_d
->controller->collWidget());
117
if
(
state
.version()>=1)
118
m_d
->controller->restoreSettings(
state
.restoreByteArray());
119
120
state
.disableUnrestoredChecks();
//We do the testing in the controller
121
}
CaloClusterSysController.h
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
VP1CaloClusterCollection.h
VP1CaloClusterSystem.h
VP1CollectionWidget.h
VP1Deserialise.h
VP1Serialise.h
CaloClusterSysController
Definition
CaloClusterSysController.h:23
IVP13DSystemSimple::IVP13DSystemSimple
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
Definition
IVP13DSystemSimple.cxx:50
IVP13DSystemSimple::ensureBuildController
void ensureBuildController()
Definition
IVP13DSystemSimple.cxx:90
IVP1System::restoreFromState
virtual void restoreFromState(QByteArray)
Definition
IVP1System.cxx:302
IVP1System::state
State state() const
Definition
IVP1System.cxx:129
IVP1System::message
void message(const QString &) const
Definition
IVP1System.cxx:336
IVP1System::saveState
virtual QByteArray saveState()
Definition
IVP1System.cxx:294
StoreGateSvc
The Athena Transient Store API.
Definition
StoreGateSvc.h:120
VP1CaloClusterCollection
Definition
VP1CaloClusterCollection.h:28
VP1CaloClusterCollection::createCollections
static QList< VP1CaloClusterCollection * > createCollections(IVP1System *, CaloClusterSysController *)
Definition
VP1CaloClusterCollection.cxx:34
VP1CaloClusterSystem::Imp
Definition
VP1CaloClusterSystem.cxx:27
VP1CaloClusterSystem::Imp::controller
CaloClusterSysController * controller
Definition
VP1CaloClusterSystem.cxx:31
VP1CaloClusterSystem::Imp::theclass
VP1CaloClusterSystem * theclass
Definition
VP1CaloClusterSystem.cxx:30
VP1CaloClusterSystem::Imp::Imp
Imp(VP1CaloClusterSystem *tc)
Definition
VP1CaloClusterSystem.cxx:29
VP1CaloClusterSystem::restoreFromState
void restoreFromState(QByteArray)
Definition
VP1CaloClusterSystem.cxx:106
VP1CaloClusterSystem::VP1CaloClusterSystem
VP1CaloClusterSystem()
Definition
VP1CaloClusterSystem.cxx:35
VP1CaloClusterSystem::saveState
QByteArray saveState()
Definition
VP1CaloClusterSystem.cxx:90
VP1CaloClusterSystem::buildController
virtual QWidget * buildController()
Definition
VP1CaloClusterSystem.cxx:71
VP1CaloClusterSystem::systemerase
void systemerase()
Definition
VP1CaloClusterSystem.cxx:50
VP1CaloClusterSystem::userPickedNode
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
Definition
VP1CaloClusterSystem.cxx:78
VP1CaloClusterSystem::buildEventSceneGraph
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
Definition
VP1CaloClusterSystem.cxx:57
VP1CaloClusterSystem::m_d
Imp * m_d
Definition
VP1CaloClusterSystem.h:38
VP1CaloClusterSystem::~VP1CaloClusterSystem
virtual ~VP1CaloClusterSystem()
Definition
VP1CaloClusterSystem.cxx:44
VP1Deserialise
Definition
VP1Deserialise.h:44
VP1Serialise
Definition
VP1Serialise.h:45
VP1StdCollection
Definition
VP1StdCollection.h:31
Generated on
for ATLAS Offline Software by
1.17.0