ATLAS Offline Software
Loading...
Searching...
No Matches
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>
25class 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):
29class VisibleObjectToMaterialHelper_Base : public QObject {
30 Q_OBJECT
31public:
32 VisibleObjectToMaterialHelper_Base(QObject * p) : QObject(p) {}
34signals:
36private Q_SLOTS:
37 virtual void emitSignal() = 0;
38};
39
40
41template <class objectT>
43public:
44
45 inline VisibleObjectToMaterialHelper(QObject * parent = 0, IVP1System*sys=0);
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
53private:
54 inline void emitSignal();
55 inline void scheduleUpdate();
56 std::map<const objectT*,SoMaterial*> m_visobjects;
58};
59
61
62#endif
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
void setState(const objectT *, SoMaterial *mat)
const std::map< const objectT *, SoMaterial * > & visibleObjects()
std::map< const objectT *, SoMaterial * > m_visobjects
VisibleObjectToMaterialHelper(QObject *parent=0, IVP1System *sys=0)