Loading [MathJax]/extensions/tex2jax.js
ROOT
6.08/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
2
3
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
2
3
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
v
x
+
Enumerations
a
d
e
f
g
h
m
p
t
v
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
u
v
w
+
All Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
v
w
x
y
z
+
Macros
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tutorials
eve
boxset_cones.C File Reference
Tutorials
»
Event display tutorials
Detailed Description
Demonstrates usage of 'cone' mode in
TEveBoxSet
class.
TEveBoxSet
* boxset_cones(
Float_t
x=0,
Float_t
y=0,
Float_t
z=0,
Int_t
num=100,
Bool_t
register
=
kTRUE
)
{
TEveManager::Create
();
using namespace
TMath
;
TEveStraightLineSet
* lines =
new
TEveStraightLineSet
(
"StraightLines"
);
lines->
SetLineColor
(
kYellow
);
lines->
SetLineWidth
(2);
TRandom
r
(0);
TEveRGBAPalette
* pal =
new
TEveRGBAPalette
(0, 500);
TEveBoxSet
* cones =
new
TEveBoxSet
(
"ConeSet"
);
cones->
SetPalette
(pal);
cones->
Reset
(
TEveBoxSet::kBT_Cone
,
kFALSE
, 64);
Float_t
a = 40;
// max distance between cones
TEveVector
dir, pos;
Float_t
theta, phi, height, rad;
for
(
Int_t
i=0; i<num; ++i)
{
theta = r.
Uniform
(0,
TMath::Pi
());
phi = r.
Uniform
(-
TMath::Pi
(),
TMath::Pi
());
height = r.
Uniform
(5, 15);
rad = r.
Uniform
(3, 5);
dir.
Set
(
Cos
(phi)*
Cos
(theta),
Sin
(phi)*
Cos
(theta),
Sin
(theta));
dir *= height;
pos.
Set
(r.
Uniform
(-a,a), r.
Uniform
(-a, a), r.
Uniform
(-a, a));
cones->
AddCone
(pos, dir, rad);
cones->
DigitValue
(r.
Uniform
(0, 500));
// draw axis line 30% longer than cone height
TEveVector
end = pos + dir*1.3f;
lines->
AddLine
(pos.
fX
, pos.
fY
, pos.
fZ
, end.
fX
, end.
fY
, end.
fZ
);
}
// by default cone cap not drawn
if
(r.
Integer
(2)>0) cones->
SetDrawConeCap
(
kTRUE
);
cones->
RefitPlex
();
TEveTrans
& t = cones->
RefMainTrans
();
t.
SetPos
(x, y, z);
gEve
->
AddElement
(cones);
gEve
->
AddElement
(lines);
gEve
->
Redraw3D
(
kTRUE
);
return
cones;
}
TEveBoxSet
*
elliptic_boxset_cones(
Float_t
x=0,
Float_t
y=0,
Float_t
z=0,
Int_t
num=100,
Bool_t
register
=
kTRUE
)
{
TEveManager::Create
();
using namespace
TMath
;
TEveManager::Create
();
TEveStraightLineSet
* lines =
new
TEveStraightLineSet
(
"StraightLines"
);
lines->
SetLineColor
(
kYellow
);
lines->
SetLineWidth
(2);
TRandom
r
(0);
TEveBoxSet
* cones =
new
TEveBoxSet
(
"EllipticConeSet"
);
cones->
Reset
(
TEveBoxSet::kBT_EllipticCone
,
kTRUE
, 64);
cones->
SetPickable
(
kTRUE
);
Float_t
a = 40;
// max distance between cones
TEveVector
dir, pos;
Float_t
theta, phi, height, rad;
for
(
Int_t
i=0; i<num; ++i)
{
theta = r.
Uniform
(0,
TMath::Pi
());
phi = r.
Uniform
(-
TMath::Pi
(),
TMath::Pi
());
height = r.
Uniform
(5, 15);
rad = r.
Uniform
(3, 5);
dir.
Set
(
Cos
(phi)*
Cos
(theta),
Sin
(phi)*
Cos
(theta),
Sin
(theta));
dir *= height;
pos.
Set
(r.
Uniform
(-a,a), r.
Uniform
(-a, a), r.
Uniform
(-a, a));
cones->
AddEllipticCone
(pos, dir, rad, 0.5*rad, r.
Uniform
(0,360));
cones->
DigitColor
(r.
Uniform
(20, 255), r.
Uniform
(20, 255),
r.
Uniform
(20, 255), r.
Uniform
(20, 255));
// draw axis line 30% longer than cone height
TEveVector
end = pos + dir*1.3f;
lines->
AddLine
(pos.
fX
, pos.
fY
, pos.
fZ
, end.
fX
, end.
fY
, end.
fZ
);
}
// by default cone cap not drawn
if
(r.
Integer
(2)>0) cones->
SetDrawConeCap
(
kTRUE
);
cones->
RefitPlex
();
TEveTrans
& t = cones->
RefMainTrans
();
t.
SetPos
(x, y, z);
gEve
->
AddElement
(cones);
gEve
->
AddElement
(lines);
gEve
->
Redraw3D
(
kTRUE
);
return
cones;
}
Author
Alja Mrak-Tadel
Definition in file
boxset_cones.C
.