ROOT
v6-22
Reference Guide
compound.C File Reference
Tutorials
»
Event display tutorials
Detailed Description
Demonstrates usage of EVE compound objects - class
TEveCompound
.
TEveLine
*
random_line
(
TRandom
& rnd,
Int_t
n
,
Float_t
delta)
{
auto
line
=
new
TEveLine
;
line
->SetMainColor(
kGreen
);
Float_t
x
= 0,
y
= 0, z = 0;
for
(
Int_t
i=0; i<
n
; ++i) {
line
->SetNextPoint(
x
,
y
, z);
x
+= rnd.
Uniform
(0, delta);
y
+= rnd.
Uniform
(0, delta);
z += rnd.
Uniform
(0, delta);
}
return
line
;
}
void
compound
()
{
TEveManager::Create
();
auto
ml =
new
TEveLine
;
ml->
SetMainColor
(
kRed
);
ml->SetLineStyle(2);
ml->SetLineWidth(3);
gEve
->
InsertVizDBEntry
(
"BigLine"
, ml);
auto
cmp =
new
TEveCompound
;
cmp->
SetMainColor
(
kGreen
);
gEve
->
AddElement
(cmp);
TRandom
rnd(0);
cmp->OpenCompound();
cmp->AddElement(
random_line
(rnd, 20, 10));
cmp->AddElement(
random_line
(rnd, 20, 10));
auto
line
=
random_line
(rnd, 20, 12);
line
->ApplyVizTag(
"BigLine"
);
cmp->AddElement(
line
);
cmp->CloseCompound();
// Projected view
auto
viewer =
gEve
->
SpawnNewViewer
(
"Projected"
);
auto
scene =
gEve
->
SpawnNewScene
(
"Projected Event"
);
viewer->AddScene(scene);
{
auto
v
= viewer->GetGLViewer();
v
->SetCurrentCamera(
TGLViewer::kCameraOrthoXOY
);
}
// projections
auto
mng =
new
TEveProjectionManager
(
TEveProjection::kPT_RPhi
);
scene->AddElement(mng);
auto
axes =
new
TEveProjectionAxes
(mng);
scene->AddElement(axes);
gEve
->
AddToListTree
(axes,
kTRUE
);
gEve
->
AddToListTree
(mng,
kTRUE
);
mng->ImportElements(cmp);
gEve
->
Redraw3D
(
kTRUE
);
}
Int_t
int Int_t
Definition:
RtypesCore.h:43
Float_t
float Float_t
Definition:
RtypesCore.h:55
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:89
kRed
@ kRed
Definition:
Rtypes.h:64
kGreen
@ kGreen
Definition:
Rtypes.h:64
gEve
R__EXTERN TEveManager * gEve
Definition:
TEveManager.h:243
TEveCompound
Description of TEveCompound.
Definition:
TEveCompound.h:24
TEveCompound::SetMainColor
virtual void SetMainColor(Color_t color)
SetMainColor for the compound.
Definition:
TEveCompound.cxx:40
TEveElement::SetMainColor
virtual void SetMainColor(Color_t color)
Set main color of the element.
Definition:
TEveElement.cxx:1158
TEveLine
An arbitrary polyline with fixed line and marker attributes.
Definition:
TEveLine.h:26
TEveManager::AddElement
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
Definition:
TEveManager.cxx:528
TEveManager::AddToListTree
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=0)
Definition:
TEveManager.cxx:486
TEveManager::InsertVizDBEntry
Bool_t InsertVizDBEntry(const TString &tag, TEveElement *model, Bool_t replace, Bool_t update)
Insert a new visualization-parameter database entry.
Definition:
TEveManager.cxx:621
TEveManager::SpawnNewViewer
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
Definition:
TEveManager.cxx:303
TEveManager::Create
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
Definition:
TEveManager.cxx:893
TEveManager::Redraw3D
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Definition:
TEveManager.h:168
TEveManager::SpawnNewScene
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
Definition:
TEveManager.cxx:337
TEveProjectionAxes
Axes for non-linear projections.
Definition:
TEveProjectionAxes.h:29
TEveProjectionManager
Manager class for steering of projections and managing projected objects.
Definition:
TEveProjectionManager.h:22
TEveProjection::kPT_RPhi
@ kPT_RPhi
Definition:
TEveProjections.h:29
TGLViewer::kCameraOrthoXOY
@ kCameraOrthoXOY
Definition:
TGLViewer.h:64
TRandom
This is the base class for the ROOT Random number generators.
Definition:
TRandom.h:27
TRandom::Uniform
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Definition:
TRandom.cxx:635
line
TLine * line
Definition:
entrylistblock_figure1.C:235
compound
void compound()
Definition:
compound.C:25
random_line
REX::REveLine * random_line(TRandom &rnd, Int_t n, Float_t delta)
Definition:
compound.C:9
y
Double_t y[n]
Definition:
legend1.C:17
x
Double_t x[n]
Definition:
legend1.C:17
n
const Int_t n
Definition:
legend1.C:16
v
@ v
Definition:
rootcling_impl.cxx:3624
Author
Matevz Tadel
Definition in file
compound.C
.
tutorials
eve
compound.C
ROOT v6-22 - Reference Guide Generated on Fri Apr 1 2022 11:54:07 (GVA Time) using Doxygen 1.9.4