ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
hierarchical_scene.C File Reference
Tutorials
»
Visualisation tutorials
»
Event display tutorials
Detailed Description
const
Int_t
Ns = 7;
void
add_blobs(
TEveElement
*p,
Float_t
rad,
Float_t
height,
Float_t
size
,
Int_t
level)
{
if
(level <= 0)
return
;
for
(
Int_t
i = 0; i < Ns; ++i) {
auto
x
=
new
TEveGeoShape
(
"SS"
);
x
->SetShape(
new
TGeoSphere
(0,
size
));
Double_t
phi =
TMath::TwoPi
() * i / Ns;
x
->RefMainTrans().SetPos(rad *
TMath::Cos
(phi), rad *
TMath::Sin
(phi), height);
x
->SetMainColor(
TColor::GetColorPalette
(
gRandom
->Integer(
TColor::GetNumberOfColors
())));
p->
AddElement
(
x
);
add_blobs(
x
, 0.8 * rad, 0.8 * height, 0.8 *
size
, level - 1);
}
}
void
hierarchical_scene()
{
TEveManager::Create
();
TColor::SetPalette
(1, 0);
gRandom
=
new
TRandom3
(0);
auto
s =
gEve
->SpawnNewScene(
"Hierarchical Scene"
,
"OoogaDooga"
);
s->SetHierarchical(
kTRUE
);
gEve
->GetDefaultViewer()->AddScene(s);
add_blobs(s, 6, 4, 0.5, 4);
gEve
->Redraw3D(
kTRUE
);
}
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Int_t
int Int_t
Signed integer 4 bytes (int).
Definition
RtypesCore.h:59
Double_t
double Double_t
Double 8 bytes.
Definition
RtypesCore.h:73
Float_t
float Float_t
Float 4 bytes (float).
Definition
RtypesCore.h:71
kTRUE
constexpr Bool_t kTRUE
Definition
RtypesCore.h:107
gEve
externTEveManager * gEve
Definition
TEveManager.h:243
gRandom
externTRandom * gRandom
Definition
TRandom.h:62
TColor::SetPalette
static void SetPalette(Int_t ncolors, Int_t *colors, Float_t alpha=1.)
TColor::GetNumberOfColors
static Int_t GetNumberOfColors()
TColor::GetColorPalette
static Int_t GetColorPalette(Int_t i)
TEveElement
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition
TEveElement.h:36
TEveElement::AddElement
virtual void AddElement(TEveElement *el)
Add el to the list of children.
Definition
TEveElement.cxx:1322
TEveGeoShape
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Definition
TEveGeoShape.h:24
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:886
TGeoSphere
Definition
TGeoSphere.h:17
TRandom3
Random number generator class based on M.
Definition
TRandom3.h:27
x
Double_t x[n]
Definition
legend1.C:17
TMath::Cos
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition
TMath.h:605
TMath::Sin
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition
TMath.h:599
TMath::TwoPi
constexpr Double_t TwoPi()
Definition
TMath.h:47
Author
Matevz Tadel
Definition in file
hierarchical_scene.C
.
tutorials
visualisation
eve
hierarchical_scene.C
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1