ATLAS Offline Software
VisibleObjectToMaterialHelper.h
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 // Header file for class VisibleObjectToMaterialHelper //
9 // //
10 // Description: Helper class for those systems that must //
11 // emit signals with lists of physics objects //
12 // pointers and associated materials //
13 // //
14 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
15 // Initial version: February 2008 //
16 // //
18 
19 #ifndef VISIBLEOBJECTTOMATERIALHELPER_H
20 #define VISIBLEOBJECTTOMATERIALHELPER_H
21 
23 #include <QObject>
24 #include <map>
25 class SoMaterial;
26 
27 //We use a _Base class since we can't have templates and signals in
28 //the same class (limitation of Qt's moc):
29 class VisibleObjectToMaterialHelper_Base : public QObject {
30  Q_OBJECT
31 public:
32  VisibleObjectToMaterialHelper_Base(QObject * p) : QObject(p) {}
34 signals:
36 private Q_SLOTS:
37  virtual void emitSignal() = 0;
38 };
39 
40 
41 template <class objectT>
43 public:
44 
47 
48  inline void setState( const objectT*, SoMaterial *mat );//Call with null material if the object is not visible.
49  inline void setNoVisibleObjects();//call from systemerase()
50 
51  inline const std::map<const objectT*,SoMaterial*>& visibleObjects() { return m_visobjects; }
52 
53 private:
54  inline void emitSignal();
55  inline void scheduleUpdate();
56  std::map<const objectT*,SoMaterial*> m_visobjects;
58 };
59 
61 
62 #endif
VisibleObjectToMaterialHelper_Base::emitSignal
virtual void emitSignal()=0
VisibleObjectToMaterialHelper_Base::VisibleObjectToMaterialHelper_Base
VisibleObjectToMaterialHelper_Base(QObject *p)
Definition: VisibleObjectToMaterialHelper.h:32
VisibleObjectToMaterialHelper::emitSignal
void emitSignal()
VisibleObjectToMaterialHelper::setNoVisibleObjects
void setNoVisibleObjects()
VisibleObjectToMaterialHelper::VisibleObjectToMaterialHelper
VisibleObjectToMaterialHelper(QObject *parent=0, IVP1System *sys=0)
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
VisibleObjectToMaterialHelper
Definition: VisibleObjectToMaterialHelper.h:42
VisibleObjectToMaterialHelper_Base::~VisibleObjectToMaterialHelper_Base
virtual ~VisibleObjectToMaterialHelper_Base()
Definition: VisibleObjectToMaterialHelper.h:33
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
VisibleObjectToMaterialHelper::m_visobjects
std::map< const objectT *, SoMaterial * > m_visobjects
Definition: VisibleObjectToMaterialHelper.h:56
VisibleObjectToMaterialHelper::~VisibleObjectToMaterialHelper
virtual ~VisibleObjectToMaterialHelper()
VisibleObjectToMaterialHelper.icc
IVP1System
Definition: IVP1System.h:36
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
VisibleObjectToMaterialHelper::scheduleUpdate
void scheduleUpdate()
VisibleObjectToMaterialHelper_Base
Definition: VisibleObjectToMaterialHelper.h:29
VisibleObjectToMaterialHelper::visibleObjects
const std::map< const objectT *, SoMaterial * > & visibleObjects()
Definition: VisibleObjectToMaterialHelper.h:51
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VisibleObjectToMaterialHelper::m_hasscheduledupdate
bool m_hasscheduledupdate
Definition: VisibleObjectToMaterialHelper.h:57
python.L1.Config.LegacyTopoMergerMap.signals
signals
Definition: LegacyTopoMergerMap.py:13
VP1HelperClassBase
Definition: VP1HelperClassBase.h:28
VisibleObjectToMaterialHelper::setState
void setState(const objectT *, SoMaterial *mat)
VP1HelperClassBase.h
VisibleObjectToMaterialHelper_Base::visibleObjectsChanged
void visibleObjectsChanged()