Logo ROOT   6.16/01
Reference Guide
lineset.C File Reference

Detailed Description

Demonstrates usage of class TEveStraightLineSet.

TEveStraightLineSet* lineset(Int_t nlines = 40, Int_t nmarkers = 4)
{
TRandom r(0);
Float_t s = 100;
auto ls = new TEveStraightLineSet();
for (Int_t i = 0; i<nlines; i++) {
ls->AddLine( r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s),
r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s));
// add random number of markers
Int_t nm = Int_t(nmarkers* r.Rndm());
for (Int_t m = 0; m < nm; m++) ls->AddMarker(i, r.Rndm());
}
ls->SetMarkerSize(1.5);
ls->SetMarkerStyle(4);
return ls;
}
TEveStraightLineSet* lineset_2d(Int_t nlines = 40, Int_t nmarkers = 4)
{
TRandom r(0);
Float_t s = 100;
auto ls = new TEveStraightLineSet();
for (Int_t i = 0; i<nlines; i++) {
ls->AddLine( r.Uniform(-s,s), r.Uniform(-s,s), 0,
r.Uniform(-s,s), r.Uniform(-s,s), 0);
// add random number of markers
Int_t nm = Int_t(nmarkers* r.Rndm());
for (Int_t m = 0; m < nm; m++) ls->AddMarker(i, r.Rndm());
}
ls->SetMarkerSize(1.5);
ls->SetMarkerStyle(4);
return ls;
}
ROOT::R::TRInterface & r
Definition: Object.C:4
int Int_t
Definition: RtypesCore.h:41
float Float_t
Definition: RtypesCore.h:53
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
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)
Definition: TEveManager.h:168
Set of straight lines with optional markers along the lines.
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
static constexpr double nm
static constexpr double s
def lineset(nlines=40, nmarkers=4)
Definition: lineset.py:7
auto * m
Definition: textangle.C:8
Author
Matevz Tadel

Definition in file lineset.C.