ATLAS Offline Software
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 
19 #include "VP1Base/VP1Serialise.h"
20 #include "VP1Base/VP1Deserialise.h"
22 #include <Inventor/nodes/SoSeparator.h>
23 #include <Inventor/nodes/SoSwitch.h>
24 #include <Inventor/SoPath.h>
25 
26 //____________________________________________________________________
28 public:
32 };
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 //____________________________________________________________________
45  {
46  delete m_d;
47 }
48 
49 //_____________________________________________________________________________________
51 {
52  //Save present states and then clear all event data and related gui elements.
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:
64 
65  //Add collections to event scenegraph:
67  root->addChild(col->collSwitch());
68 }
69 
70 //_____________________________________________________________________________________
72 {
74  return m_d->controller;
75 }
76 
77 //_____________________________________________________________________________________
78 void VP1CaloClusterSystem::userPickedNode(SoNode*, SoPath * pickedPath) {
79 
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 
96 
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  }
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 }
VP1Serialise.h
VP1CaloClusterSystem::buildController
virtual QWidget * buildController()
Definition: VP1CaloClusterSystem.cxx:71
VP1Deserialise.h
VP1Serialise
Definition: VP1Serialise.h:45
IVP13DSystemSimple
Definition: IVP13DSystemSimple.h:24
VP1CaloClusterSystem::Imp::theclass
VP1CaloClusterSystem * theclass
Definition: VP1CaloClusterSystem.cxx:30
RoiUtil::serialise
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
Definition: RoiSerialise.cxx:45
VP1CaloClusterSystem::saveState
QByteArray saveState()
Definition: VP1CaloClusterSystem.cxx:90
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
VP1CollectionWidget::clear
void clear(bool deleteCollections=true, bool deleteGuiElements=false)
Definition: VP1CollectionWidget.cxx:81
VP1Controller::saveSettings
QByteArray saveSettings() const
Definition: VP1Controller.cxx:405
VP1CaloClusterSystem
Definition: VP1CaloClusterSystem.h:22
VP1CollectionWidget::setCollections
void setCollections(QList< VP1Collection * >, bool applySavedStates=true)
Definition: VP1CollectionWidget.cxx:258
VP1CollectionWidget.h
IVP1System::state
State state() const
Definition: IVP1System.cxx:129
IVP1System::saveState
virtual QByteArray saveState()
Definition: IVP1System.cxx:294
CaloClusterSysController
Definition: CaloClusterSysController.h:23
CaloClusterSysController::drawOptions
SoGroup * drawOptions() const
Definition: CaloClusterSysController.cxx:210
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
VP1CaloClusterCollection.h
VP1Controller::restoreSettings
void restoreSettings(QByteArray)
Definition: VP1Controller.cxx:387
VP1CaloClusterSystem::userPickedNode
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
Definition: VP1CaloClusterSystem.cxx:78
VP1CaloClusterSystem::~VP1CaloClusterSystem
virtual ~VP1CaloClusterSystem()
Definition: VP1CaloClusterSystem.cxx:44
VP1CaloClusterCollection
Definition: VP1CaloClusterCollection.h:28
CaloClusterSysController::collWidget
VP1CollectionWidget * collWidget() const
Definition: CaloClusterSysController.cxx:184
VP1CaloClusterSystem.h
VP1CaloClusterCollection::createCollections
static QList< VP1CaloClusterCollection * > createCollections(IVP1System *, CaloClusterSysController *)
Definition: VP1CaloClusterCollection.cxx:34
IVP13DSystemSimple::ensureBuildController
void ensureBuildController()
Definition: IVP13DSystemSimple.cxx:90
VP1CollectionWidget::collections
QList< VP1Collection * > collections() const
Definition: VP1CollectionWidget.cxx:61
VP1Deserialise
Definition: VP1Deserialise.h:44
CaloClusterSysController.h
query_example.col
col
Definition: query_example.py:7
VP1CaloClusterSystem::VP1CaloClusterSystem
VP1CaloClusterSystem()
Definition: VP1CaloClusterSystem.cxx:35
VP1CaloClusterSystem::systemerase
void systemerase()
Definition: VP1CaloClusterSystem.cxx:50
VP1CaloClusterSystem::Imp::controller
CaloClusterSysController * controller
Definition: VP1CaloClusterSystem.cxx:31
VP1CaloClusterSystem::Imp
Definition: VP1CaloClusterSystem.cxx:27
VP1CaloClusterSystem::Imp::Imp
Imp(VP1CaloClusterSystem *tc)
Definition: VP1CaloClusterSystem.cxx:29
VP1CaloClusterSystem::m_d
Imp * m_d
Definition: VP1CaloClusterSystem.h:37
VP1StdCollection
Definition: VP1StdCollection.h:31
VP1CaloClusterSystem::buildEventSceneGraph
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
Definition: VP1CaloClusterSystem.cxx:57
VP1CaloClusterSystem::restoreFromState
void restoreFromState(QByteArray)
Definition: VP1CaloClusterSystem.cxx:106
IVP1System::message
void message(const QString &) const
Definition: IVP1System.cxx:336
IVP1System::restoreFromState
virtual void restoreFromState(QByteArray)
Definition: IVP1System.cxx:302