i’m a ROOT-newbie, and i’ve written a script, which simulates a tube-detector with several tubes. they are displayed in the openGL-viewer via top.Draw(“ogl”).
in my script, i open a datafile and set the color of each tube according to the value of the tube in the datafile. everything workes fine so far.
what i’ve tried to do now, is to display several datasamples, one after the other.
i think i have to use the “update”-funktion, but i didn’t succeed, yet.
the last lines of my script are the following:
(they’re inside a while loop, where “ii” is the number of the sample)
i thought those few lines would be wrong enough
here’s the script (i don’t want to post the whole thing, but i think, these are the essential parts). since i’m running the interpreter mode, there are no functions in it (afaik there mustn’t be any functions in scripts which are to be run in the interpreter mode?).
i’m a ROOT-newbie, and i’ve written a script, which simulates a tube-detector with several tubes. they are displayed in the openGL-viewer via top.Draw(“ogl”).
in my script, i open a datafile and set the color of each tube according to the value of the tube in the datafile. everything workes fine so far.
what i’ve tried to do now, is to display several datasamples, one after the other.
i think i have to use the “update”-funktion, but i didn’t succeed, yet.
[/quote]
Hello.
from your macros it’s not easy to understand, what you want. Do you want to make an animation?
If you want an animation, what shoud be the time interval between frames?
I’ve modified your script and reused sample code from my answer somewhere in this forum eventm.C (3.05 KB) TGLViewer.cxx (72.8 KB) TGLViewer.h (15.6 KB)
thanks for your answers.
My intention was to display ONE event (datalines 1-10 in the datafile);
if the user presses a key (for example “space”), the next event (datalines 11-20) should be displayed.
But i have an Error: Can’t call TGeoVolume::DefineSection(0,-200/2,12,12) in current scope
Possible candidates are…
(in TGeoVolume)
(in TGeoAtt)
*** Interpreter error recovered ***
Is it possible to make this kind of loop with Pgon and Pcon ?
But i have an Error: Can’t call TGeoVolume::DefineSection(0,-200/2,12,12) in current scope
*** Interpreter error recovered ***[/quote]
Your question is not about OpenGL viewer, it’s about TGeo classes.
TGeoVolume does not have member DefineSection (and it can not have such a member).
TGeoPgon has, but TGeoVolume is not a TGeoPgon. Probably, Andrei or somebody, who knows
geom module of ROOT will correct me, if I’m wrong, but you can do:
arr[idx] = geom->MakePgon(.....
//Now, you can ask your volume to give you a shape:
//arr[idx]->GetShape() - this will give you TGeoShape, indirect base class for TGeoPgon, you need a cast:
TGeoPgon *pgonShape = (TGeoPgon *)arr[idx]->GetShape();
pgonShape->DefineSection(.....
I think it can be good to read docs about ROOT’s geometry.