ATLAS Offline Software
Loading...
Searching...
No Matches
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
18
22#include <Inventor/nodes/SoSeparator.h>
23#include <Inventor/nodes/SoSwitch.h>
24#include <Inventor/SoPath.h>
25
26//____________________________________________________________________
33
34//_____________________________________________________________________________________
36 : IVP13DSystemSimple("Clusters",
37 "System showing Calorimeter Clusters",
38 "Thomas.Kittelmann@cern.ch"),
39 m_d(new Imp(this))
40{
41}
42
43//____________________________________________________________________
48
49//_____________________________________________________________________________________
51{
52 //Save present states and then clear all event data and related gui elements.
53 m_d->controller->collWidget()->clear();
54}
55
56//_____________________________________________________________________________________
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//_____________________________________________________________________________________
72{
73 m_d->controller = new CaloClusterSysController(this);
74 return m_d->controller;
75}
76
77//_____________________________________________________________________________________
78void 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//_____________________________________________________________________________________
91{
92 VP1Serialise serialise(1/*version*/,this);
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//_____________________________________________________________________________________
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 }
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}
static Double_t tc
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
virtual void restoreFromState(QByteArray)
State state() const
void message(const QString &) const
virtual QByteArray saveState()
The Athena Transient Store API.
static QList< VP1CaloClusterCollection * > createCollections(IVP1System *, CaloClusterSysController *)
CaloClusterSysController * controller
VP1CaloClusterSystem * theclass
Imp(VP1CaloClusterSystem *tc)
void restoreFromState(QByteArray)
virtual QWidget * buildController()
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)