Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
hierarchical_scene.C File Reference

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),
x->SetMainColor(TColor::GetColorPalette
p->AddElement(x);
add_blobs(x, 0.8 * rad, 0.8 * height, 0.8 * size, level - 1);
}
}
void hierarchical_scene()
{
gRandom = new TRandom3(0);
auto s = gEve->SpawnNewScene("Hierarchical Scene", "OoogaDooga");
add_blobs(s, 6, 4, 0.5, 4);
}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
R__EXTERN TEveManager * gEve
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
static void SetPalette(Int_t ncolors, Int_t *colors, Float_t alpha=1.)
Static function.
Definition TColor.cxx:2804
static Int_t GetColorPalette(Int_t i)
Static function returning the color number i in current palette.
Definition TColor.cxx:1455
static Int_t GetNumberOfColors()
Static function returning number of colors in the color palette.
Definition TColor.cxx:1475
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
TEveViewer * GetDefaultViewer() const
Returns the default viewer - the first one in the fViewers list.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
void SetHierarchical(Bool_t h)
Definition TEveScene.h:54
virtual void AddScene(TEveScene *scene)
Add 'scene' to the list of scenes.
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Definition TGeoSphere.h:17
Random number generator class based on M.
Definition TRandom3.h:27
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition TRandom.cxx:361
Double_t x[n]
Definition legend1.C:17
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:594
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:588
constexpr Double_t TwoPi()
Definition TMath.h:44
Author
Matevz Tadel

Definition in file hierarchical_scene.C.