ATLAS Offline Software
VP1String.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Header file for class VP1String //
9 // //
10 // Description: Utility class for converting various types //
11 // to QStrings. Main purpose is to serve as //
12 // base for IVP1System, IVP1Channel, and //
13 // VP1HelperClassBase, thus providing str(..). //
14 // //
15 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
16 // Initial version: March 2008 //
17 // //
19 
20 #ifndef VP1STRING_H
21 #define VP1STRING_H
22 
23 
24 #include <QString>
25 
26 #include "GeoPrimitives/GeoPrimitives.h" // for the Amg (Eigen) vectors/matrices/...
27 
28 
29 
30 namespace HepGeom { template<class T> class BasicVector3D; }
31 class VP1Interval;
32 class QColor;
33 class SbVec2d;
34 class SbColor;
35 class SbVec2f;
36 class SbVec2s;
37 class SbVec3d;
38 class SbVec3f;
39 class SbVec3s;
40 class SbVec4d;
41 class SbVec4f;
42 
43 class VP1String {
44 public:
46  virtual ~VP1String(){}
47 
48  //Strings:
49  static QString str( const QString& s ) { return s; }
50  static QString str( const char * c) { return c; }
51 
52  //Boolean:
53  static QString str( const bool b ) { return b?"True":"False"; }
54 
55  //Colours:
56  static QString str( const QColor& );
57  static QString str( const SbColor& );
58 
59  //VP1 interval:
60  static QString str( const VP1Interval& );
61 
62  //COIN vectors:
63  static QString str( const SbVec2d& );
64  static QString str( const SbVec2f& );
65  static QString str( const SbVec2s& );
66  static QString str( const SbVec3d& );
67  static QString str( const SbVec3f& );
68  static QString str( const SbVec3s& );
69  static QString str( const SbVec4d& );
70  static QString str( const SbVec4f& );
71 
72  //Numbers:
73  static QString str( short int n ) { return QString::number(n); }
74  static QString str( unsigned short int n ) { return QString::number(n); }
75  static QString str( long n ) { return QString::number(n); }
76  static QString str( ulong n ) { return QString::number(n); }
77  static QString str( int n ) { return QString::number(n); }
78  static QString str( uint n ) { return QString::number(n); }
79  static QString str( qlonglong n ) { return QString::number(n); }
80  static QString str( qulonglong n ) { return QString::number(n); }
81  static QString str( const double& d ) { return QString::number(d); }
82  static QString str( const float& f) { return QString::number(f); }
83 
84  //Pointers:
85  static QString str(const void *);
86  template <class T>
87  static QString str( const T* t ) { return str(static_cast<const void* >(t)); }
88 
89  //Flags:
90  template <class T>
91  static QString str( const QFlags<T>& f ) { return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }
92 
93  //CLHEP vectors/points:
94  template <class T>
95  static QString str( const HepGeom::BasicVector3D<T>& t ) { return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }
96 
97  //Amg (Eigen) vectors:
98  static QString str( const Amg::Vector3D& t ) { return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }
99 
100  //Lists
101  template <class T>
102  static QString str( const QList<T>& t ) { return "QList of size"+QString::number(t.size()); }
103 
104 
105 };
106 
107 #endif
VP1String::str
static QString str(ulong n)
Definition: VP1String.h:76
VP1String::str
static QString str(short int n)
Definition: VP1String.h:73
VP1String::str
static QString str(const char *c)
Definition: VP1String.h:50
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1String::str
static QString str(qlonglong n)
Definition: VP1String.h:79
VP1String::~VP1String
virtual ~VP1String()
Definition: VP1String.h:46
VP1String::str
static QString str(uint n)
Definition: VP1String.h:78
VP1String
Definition: VP1String.h:43
VP1String::str
static QString str(unsigned short int n)
Definition: VP1String.h:74
HepGeom::BasicVector3D
Definition: VP1String.h:30
VP1String::str
static QString str(const float &f)
Definition: VP1String.h:82
hist_file_dump.d
d
Definition: hist_file_dump.py:137
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VP1String::str
static QString str(const HepGeom::BasicVector3D< T > &t)
Definition: VP1String.h:95
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1String::str
static QString str(qulonglong n)
Definition: VP1String.h:80
VP1String::VP1String
VP1String()
Definition: VP1String.h:45
GeoPrimitives.h
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
VP1String::str
static QString str(const QFlags< T > &f)
Definition: VP1String.h:91
VP1String::str
static QString str(const Amg::Vector3D &t)
Definition: VP1String.h:98
beamspotman.n
n
Definition: beamspotman.py:731
VP1String::str
static QString str(const QList< T > &t)
Definition: VP1String.h:102
VP1String::str
static QString str(const T *t)
Definition: VP1String.h:87
python.selection.number
number
Definition: selection.py:20
VP1String::str
static QString str(long n)
Definition: VP1String.h:75
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
HepGeom
Definition: VP1String.h:30
VP1Interval
Definition: VP1Interval.h:23
VP1String::str
static QString str(const double &d)
Definition: VP1String.h:81
VP1String::str
static QString str(int n)
Definition: VP1String.h:77
VP1String::str
static QString str(const bool b)
Definition: VP1String.h:53
python.compressB64.c
def c
Definition: compressB64.py:93
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35