ATLAS Offline Software
Loading...
Searching...
No Matches
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
y
#define y
x
#define x
z
#define z
VP1Interval.h
VP1QtInventorUtils.h
VP1String.h
VP1Interval
Definition
VP1Interval.h:23
VP1QtInventorUtils::sbcol2qcol
static QColor sbcol2qcol(const SbColor &)
Definition
VP1QtInventorUtils.cxx:1145
VP1String::str
static QString str(const QString &s)
Definition
VP1String.h:49
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.14.0