ATLAS Offline Software
Loading...
Searching...
No Matches
VP1MissingEtSystem.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Implementation of class VP1MissingEtSystem //
8// //
9// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10// Initial version: May 2007, rewritten July 2008 //
11// Updated By: Giorgi Gvaberidze(ggvaberi@cern.ch) July 2010 //
13
19//***
21
24#include <Inventor/nodes/SoSeparator.h>
25#include <Inventor/nodes/SoSwitch.h>
26#include <Inventor/SoPath.h>
27
28//____________________________________________________________________
37
38//_____________________________________________________________________________________
40: IVP13DSystemSimple ("EtMiss",
41 "Displaying missing ET.",
42 "Thomas.Kittelmann@cern.ch, ggvaberi@cern.ch"), m_d(new Imp(this))
43{
44}
45
46//____________________________________________________________________
51
52//_____________________________________________________________________________________
54{
55 //Save present states and then clear all event data and related gui elements.
56 m_d->collWidget->clear();
57}
58
59//_____________________________________________________________________________________
61{
62 //Create collection list based on contents of event store, populate gui and apply states:
63 QList<VP1StdCollection*> cols;
65 cols << col;
67 cols << col;
69 cols << col;
70
71 m_d->collWidget->setCollections(cols);
72
73 //Add collections to event scenegraph:
74 for (VP1StdCollection* col : m_d->collWidget->collections<VP1StdCollection>())
75 root->addChild(col->collSwitch());
76}
77
78//_____________________________________________________________________________________
80{
81 //Updated: replaced to predefined controller
82 m_d->controller = new missingEtController(this);
83 m_d->collWidget = static_cast<VP1MissingEtCollWidget*>(m_d->controller->collWidget());
84 return m_d->controller;
85
86}
87
88//_____________________________________________________________________________________
89void VP1MissingEtSystem::userPickedNode(SoNode*, SoPath * pickedPath)
90{
91 //Find in which collection an object was picked and let that deal with the pick:
92 for (VP1MissingEtHandle* handle : m_d->collWidget->collections<VP1MissingEtHandle>()) {
93 if (handle->visible()&&pickedPath->containsNode(handle->collSep())) {
94 message(handle->clicked(pickedPath));
95 return;
96 }
97 }
98 message("Error: Unknown picked node.");
99}
100
101//_____________________________________________________________________________________
103{
105 VP1Serialise serialise(1/*version*/, this);
106 serialise.save(IVP13DSystemSimple::saveState());
107 serialise.save(static_cast<VP1CollectionWidget*>(m_d->collWidget));
108 serialise.save(m_d->controller->saveSettings());
109 serialise.warnUnsaved(controllerWidget());
110 return serialise.result();
111}
112
113//_____________________________________________________________________________________
115{
116 VP1Deserialise state(ba,this);
117 if (state.version() < 0 || state.version() > 1) {
118 message("Warning: State data in .vp1 file is in wrong format - ignoring!");
119 return;
120 }
123 state.restore(static_cast<VP1CollectionWidget*>(m_d->collWidget));
124
125 if (state.version() >= 1)
126 m_d->controller->restoreSettings(state.restoreByteArray());
127 state.warnUnrestored(controllerWidget());
128}
static Double_t tc
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
virtual void restoreFromState(QByteArray)
State state() const
QWidget * controllerWidget()
void message(const QString &) const
virtual QByteArray saveState()
The Athena Transient Store API.
static QList< VP1StdCollection * > createCollections(IVP1System *sys)
static QList< VP1StdCollection * > createCollections(IVP1System *sys)
missingEtController * controller
VP1MissingEtSystem * theclass
Imp(VP1MissingEtSystem *tc)
VP1MissingEtCollWidget * collWidget
void restoreFromState(QByteArray ba)
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
static QList< VP1StdCollection * > createCollections(IVP1System *sys)