ATLAS Offline Software
graphics
VP1
VP1Base
src
VP1String.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 VP1String //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: March 2008 //
12
// //
14
15
#include "
VP1Base/VP1String.h
"
16
#include "
VP1Base/VP1QtInventorUtils.h
"
17
#include "
VP1Base/VP1Interval.h
"
18
#include <QColor>
19
#include <Inventor/SbVec2d.h>
20
#include <Inventor/SbVec2f.h>
21
#include <Inventor/SbVec2s.h>
22
#include <Inventor/SbVec3d.h>
23
#include <Inventor/SbVec3f.h>
24
#include <Inventor/SbVec3s.h>
25
#include <Inventor/SbVec4d.h>
26
#include <Inventor/SbVec4f.h>
27
#include <sstream>
28
29
//____________________________________________________________________
30
QString
VP1String::str
(
const
QColor&
c
)
31
{
32
return
c
.isValid() ?
c
.name() :
"Invalid"
;
33
}
34
35
//____________________________________________________________________
36
QString
VP1String::str
(
const
SbColor&
c
)
37
{
38
return
str
(
VP1QtInventorUtils::sbcol2qcol
(
c
));
39
}
40
41
//____________________________________________________________________
42
QString
VP1String::str
(
const
VP1Interval
&
i
)
43
{
44
return
i
.toString();
45
}
46
47
//____________________________________________________________________
48
QString
VP1String::str
(
const
void
*
p
)
49
{
50
if
(
p
) {
51
std::ostringstream
s
;
52
s
<<
p
;
53
// Explicitly naming QString here avoids a cppcheck warning.
54
return
QString (
s
.str().c_str());
55
}
else
{
56
return
"NULL"
;
57
}
58
}
59
60
//____________________________________________________________________
61
QString
VP1String::str
(
const
SbVec2d&
v
) {
double
x
,
y
;
v
.getValue(
x
,
y
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
")"
; }
62
QString
VP1String::str
(
const
SbVec2f&
v
) {
float
x
,
y
;
v
.getValue(
x
,
y
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
")"
; }
63
QString
VP1String::str
(
const
SbVec2s&
v
) {
short
x
,
y
;
v
.getValue(
x
,
y
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
")"
; }
64
QString
VP1String::str
(
const
SbVec3d&
v
) {
double
x
,
y
,
z
;
v
.getValue(
x
,
y
,
z
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
", "
+
str
(
z
)+
")"
; }
65
QString
VP1String::str
(
const
SbVec3f&
v
) {
float
x
,
y
,
z
;
v
.getValue(
x
,
y
,
z
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
", "
+
str
(
z
)+
")"
; }
66
QString
VP1String::str
(
const
SbVec3s&
v
) {
short
x
,
y
,
z
;
v
.getValue(
x
,
y
,
z
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
", "
+
str
(
z
)+
")"
; }
67
QString
VP1String::str
(
const
SbVec4d&
v
) {
double
x
,
y
,
z
,
t
;
v
.getValue(
x
,
y
,
z
,
t
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
", "
+
str
(
z
)+
", "
+
str
(
t
)+
")"
; }
68
QString
VP1String::str
(
const
SbVec4f&
v
) {
float
x
,
y
,
z
,
t
;
v
.getValue(
x
,
y
,
z
,
t
);
return
"("
+
str
(
x
)+
", "
+
str
(
y
)+
", "
+
str
(
z
)+
", "
+
str
(
t
)+
")"
; }
69
python.SystemOfUnits.s
int s
Definition:
SystemOfUnits.py:131
VP1String.h
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
x
#define x
VP1String::str
static QString str(const QString &s)
Definition:
VP1String.h:49
VP1QtInventorUtils.h
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition:
lumiFormat.py:85
z
#define z
VP1Interval.h
VP1QtInventorUtils::sbcol2qcol
static QColor sbcol2qcol(const SbColor &)
Definition:
VP1QtInventorUtils.cxx:1142
python.PyAthena.v
v
Definition:
PyAthena.py:154
VP1Interval
Definition:
VP1Interval.h:23
y
#define y
python.compressB64.c
def c
Definition:
compressB64.py:93
Generated on Sun Dec 22 2024 21:22:37 for ATLAS Offline Software by
1.8.18