ATLAS Offline Software
Loading...
Searching...
No Matches
PRDCollHandleBase.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#ifndef PRDCOLLECTIONHANDLEBASE_H
6#define PRDCOLLECTIONHANDLEBASE_H
7
8// GeoModel
10//
11#include "GeoModelKernel/GeoVPhysVol.h"
12
15#include <vector>
16
19class PRDHandleBase;
21class SoSeparator;
22class SoMaterial;
23namespace Trk { class PrepRawData; }
24
26
27 Q_OBJECT
28
29public:
30
32 virtual void init(VP1MaterialButtonBase* mat=0);//reimplementations must start with a call to this.
33 virtual ~PRDCollHandleBase();
34
35 //Called from init(). Should set current cut values and
36 //connections with controller to monitor future changes. Reimplement
37 //the ..Specific method to setup subsystem specific settings.
39protected:
41public:
42
44 // For loading the data and resetting after each event: //
46
47 virtual bool load();
48
49 PRDSysCommonData * common() const { return m_common; }
50
51 //For use by the handles:
54 SoMaterial * highLightMaterial() const;
55
56 //If highlight outliers is set, other highlight modes (TRT HT, ...) will be ignored.
57 //Other highlight modes are indicated by the return value of highLight() in the PRDHandleBase's
58 bool highLightOutliers() const;
59 double highLightWeight() const { return m_highlightweight; }
60
61 bool drawErrors() const;
62 bool drawRDOs() const;
63
64
65 //Detail level of shown prds:
66 enum DETAIL { SIMPLE, DETAILED, AUTO };//AUTO => Use Level of detail (SoLOD nodes) to switch between simple/detailed shapes.
67 static QString toString(const DETAIL&);
68
69 void getLODSeparators(int index, VP1ExtraSepLayerHelper*& sephelper_detail,VP1ExtraSepLayerHelper*& sephelper_simple);
70
72 static QString toString(const COLOURMETHOD&);
76
77 DETAIL detailLevel() const;
78 bool simpleDetailLevel() const { return detailLevel()==SIMPLE; }
79signals:
81public Q_SLOTS:
84 void setDrawErrors(bool);
85 void setDrawRDOs(bool);
86 void setHighLightOutliers(bool);
87 void setHighLightWeight(const double&);
88 void setAllowedEta(const VP1Interval&);
89 void setAllowedPhi(const QList<VP1Interval>&);
90
91private Q_SLOTS:
93
94protected:
95 virtual PRDHandleBase* addPRD(const Trk::PrepRawData*) = 0;//Return pointer to the handle. Base class (this) will own it.
96
97 virtual DETAIL defaultDetailLevel() const { return AUTO; }
98 //Use to loop over prds in derived classes:
99 void addHandle(PRDHandleBase*);//All handles must be added here (so they can be retrieved by the next methods).
100 std::vector<PRDHandleBase*>& getPrdHandles();
101 const std::vector<PRDHandleBase*>& getPrdHandles() const;
102
103 virtual void postLoadInitialisation() {}
104 virtual bool cut(PRDHandleBase*) = 0;//Return true if should be shown (based on various cuts), false otherwise.
105 virtual void eraseEventDataSpecific() {}
106
107 //Utility (fixme: put in utility class elsewhere).
108 template <class T> void cleanupPtrContainer(T&) const;//Delete pointers and calls .clear()
109 // template <class T> void cleanupNodeContainer(T&) const;//unref's pointers and calls .clear()
110
111 virtual float lodArea() const { return 500.0f*500.0f; }//Reimplement Override to tune LOD shift for a given collection.
112
113 void recheckCutStatus(PRDHandleBase*);//Call in derived classes for handles that might be effected by a change in cuts.
114
115 //Convenience methods which can be called from derived classes (but specialised procedures might be more optimal)
119
120public:
122
123 //For use only by PRDHandleBase::setVisible(..):
126
127protected:
128 qint32 provideCollTypeID() const;
129 virtual QString provideText() const;
130 virtual void assignDefaultMaterial(SoMaterial*) const;
131 virtual QColor defaultColor() const = 0;//Will be used in assignDefaultMaterial
132 QString provideSection() const;
133 QString provideSectionToolTip() const;
134 QList<QWidget*> provideExtraWidgetsForGuiRow() const;
135 QByteArray extraWidgetsState() const;
136 void setExtraWidgetsState(const QByteArray&);
137private Q_SLOTS:
138 void collVisibilityChanged(bool);
139private:
140
141 class Imp;
143
148};
149
150//Fixme: Move elsewhere (at least to our cxx!):
151template <class T> void PRDCollHandleBase::cleanupPtrContainer(T&t) const
152{
153 typename T::iterator it(t.begin()), itE(t.end());
154 for (;it!=itE;++it)
155 delete *it;
156 t.clear();
157}
158
159#endif
virtual void postLoadInitialisation()
void setupSettingsFromController(PRDSystemController *)
void recheckCutStatusOfAllNotVisibleHandles()
double highLightWeight() const
PRDCollHandleBase(PRDDetType::Type, PRDSysCommonData *, const QString &key)
VP1ExtraSepLayerHelper * sephelperDetailedNodes() const
std::vector< PRDHandleBase * > & getPrdHandles()
virtual void assignDefaultMaterial(SoMaterial *) const
void setGeneralPRDDetailLevel(DETAIL)
qint32 provideCollTypeID() const
static QString toString(const DETAIL &)
VP1ExtraSepLayerHelper * sephelperSimpleNodes() const
void addHandle(PRDHandleBase *)
bool highLightOutliers() const
SoMaterial * highLightMaterial() const
virtual void eraseEventDataSpecific()
void setColourMethod(PRDCollHandleBase::COLOURMETHOD)
void getLODSeparators(int index, VP1ExtraSepLayerHelper *&sephelper_detail, VP1ExtraSepLayerHelper *&sephelper_simple)
virtual float lodArea() const
void setHighLightWeight(const double &)
void setExtraWidgetsState(const QByteArray &)
virtual QColor defaultColor() const =0
DETAIL detailLevel() const
QString provideSectionToolTip() const
PRDSysCommonData * m_common
virtual bool cut(PRDHandleBase *)=0
PRDSysCommonData * common() const
COLOURMETHOD colourMethod() const
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *)=0
void setAllowedPhi(const QList< VP1Interval > &)
QString provideSection() const
virtual void init(VP1MaterialButtonBase *mat=0)
void recheckCutStatus(PRDHandleBase *)
void detailLevelChanged()
void setAllowedEta(const VP1Interval &)
bool colourByTracks() const
virtual void setupSettingsFromControllerSpecific(PRDSystemController *)
virtual QString provideText() const
virtual DETAIL defaultDetailLevel() const
COLOURMETHOD m_colourmethod
void recheckCutStatusOfAllVisibleHandles()
QByteArray extraWidgetsState() const
void cleanupPtrContainer(T &) const
bool simpleDetailLevel() const
bool colourBySegments() const
QList< QWidget * > provideExtraWidgetsForGuiRow() const
VP1StdCollection(IVP1System *, const QString &helperClassName)
Ensure that the ATLAS eigen extensions are properly loaded.
Definition index.py:1