How to get a TEveElement from EVE in command line

Dear rooters,

I can run tutorials/eve/assembly.C and select a single plate, say, “PLATE_1” through Scenes -> Geometry scene -> TCP_1 -> Row_6 -> CELL_6 -> TOOTPLATE_1 -> PLATE_1, and then I can change the color of “PLATE_1” in the bottom-left panel.

Is it possible to write a line of codes in CINT to do the samething?

Cheers, Jing

Hi Jing,

You have to get a pointer to the TEveElement (or whatever class) into cint.

One option is to right-click on an object, select “Export to CINT” from menu and then type variable name, say “xx”. Then you can do:

Another way is to follow the hierarchy of elements:
TEveElement* xx = gEve->GetGlobalScene()->FindChild(“TCP_1”)->FindChild(“Row_6”) …

I could in principle add a function FindChildByPath() where one could write:


Dear Matevz,

exactly what I want. Thank you!

Cheers, Jing


I’m trying to do something similar in an Eve application I’m making in compiled code. I’d like to descend through my geometry tree, which I create using TGeoManager, then import into Eve using:

TEveGeoTopNode *enode = new TEveGeoTopNode(gGeoManager,gGeoManager->GetTopNode()); gEve->AddGlobalElement(enode)

Great, my geometry is now in Eve’s list tree and drawn in its GLviewer. I can browse through my node hierarchy in the list tree. The top node happens to be named TOP_1. I can do:

TEveElement* geotop = gEve->GetGlobalScene()->FindChild("TOP_1"); cout << "geotop element name: " << geotop->GetElementName() << endl;

which works fine. In my node hierarchy, I have more geovolumes, one of them is named TOPVETO_0. If I try:

TEveElement* topveto = gEve->GetGlobalScene()->FindChild("TOP_1")->FindChild("TOPVETO_0"); cout << "topveto element name: " << topveto->GetElementName() << endl;

I receive a segmentation fault. Indeed if I ask for TOP_1’s # of children:

I’m informed that TOP_1 has no children - even though I can see them in the list tree and they are drawn properly in the gl viewer. How have I erred?

Once more I find the answer a few seconds after posting - if anyone has this error, make sure you have the line (as in the assembly.C example):

where enode is the TEveGeoTopNode you’re using to import the geometry into eve.

Thanks assembly.C author,