27namespace GLTutorials {
29Double_t r1, r2, r3, r4, r5, r6, r7, r8, r9;
33void generate_random(
Int_t i)
40 r2 = (2 * dr *
r.Rndm(i)) - dr;
41 r3 = (2 * dr *
r.Rndm(i)) - dr;
42 r5 = (2 * dr *
r.Rndm(i)) - dr;
43 r6 = (2 * dr *
r.Rndm(i)) - dr;
44 r8 = (2 * dr *
r.Rndm(i)) - dr;
50void parallelcoordtrans(
bool gl =
true)
55 using namespace ROOT::GLTutorials;
57 Double_t s1x = 0., s1y = 0., s1z = 0.;
58 Double_t s2x = 0., s2y = 0., s2z = 0.;
59 Double_t s3x = 0., s3y = 0., s3z = 0.;
62 TCanvas *
c1 =
new TCanvas(
"parallel coors",
"parallel coords", 0, 0, 900, 1000);
64 if (!
c1->UseGL() && !
c1->IsWeb() && !
gVirtualX->InheritsFrom(
"TGCocoa"))
66 "To have real transparency in a canvas graphics, you need either OpenGL or Mac/Cocoa or Web rendering enabled");
68 TNtuple *
const nt =
new TNtuple(
"nt",
"Demo ntuple",
"x:y:z:u:v:w:a:b:c");
70 for (
Int_t i = 0; i < 1500; ++i) {
71 r.Sphere(s1x, s1y, s1z, 0.1);
72 r.Sphere(s2x, s2y, s2z, 0.2);
73 r.Sphere(s3x, s3y, s3z, 0.05);
76 nt->
Fill(r1, r2, r3, r4, r5, r6, r7, r8, r9);
79 nt->
Fill(s1x, s1y, s1z, s2x, s2y, s2z, r7, r8, r9);
82 nt->
Fill(r1, r2, r3, r4, r5, r6, r7, s3y, r9);
85 nt->
Fill(s2x - 1, s2y - 1, s2z, s1x + .5, s1y + .5, s1z + .5, r7, r8, r9);
88 nt->
Fill(r1, r2, r3, r4, r5, r6, r7, r8, r9);
91 nt->
Fill(s1x + 1, s1y + 1, s1z + 1, s3x - 2, s3y - 2, s3z - 2, r7, r8, r9);
94 nt->
Fill(r1, r2, r3, r4, r5, r6, s3x, r8, s3z);
101 nt->
Draw(
"x:y:z:u:v:w:a:b:c",
"",
"para");
103 assert(para1 !=
nullptr &&
"parallelcoordtrans, 'ParaCoord' is null");
137 assert(col26 !=
nullptr &&
"parallelcoordtrans, color with index 26 not found");
142 nt->
Draw(
"x:y:z:u:v:w:a:b:c",
"",
"para");
144 assert(para2 !=
nullptr &&
"parallelcoordtrans, 'ParaCoord' is null");
int Int_t
Signed integer 4 bytes (int)
double Double_t
Double 8 bytes.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
R__EXTERN TStyle * gStyle
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual void SetAlpha(Float_t a)
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
A simple TTree restricted to a list of float variables only.
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetHistogramHeight(Double_t h=0)
Set the height of the bar histogram.
Parallel Coordinates class.
void SetLineColor(Color_t col)
This is the base class for the ROOT Random number generators.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
void Draw(Option_t *opt) override
Default Draw method for all objects.