TEve, gEve scene set visibility of objects

Hi,

I create my detector with TGeo and add it with gEve->AddGlobalElement(…) to TEve.

In another function I’d like to turn off the visibility of the whole detector. How do I access it (the scene)?
I tried several things like for examaple:

gEve->GetEventScene()->FirstChild()->GetNode()->GetVolume()->SetVisibility(showDetectors);

… but so far I haven’t been able to find the right command.

then a comment/question:
From the detector I draw, I set some of the subdetectors (TGeoVolume) invisible right from the beginning with:

coil->SetVisibility(kFALSE);

Indeed they are invisible afterwards and I can turn their visibility on and off when running TEve, but although they are invisible at startup of TEve, their respective checkbox in the object browser on the left hand side is checked. Do I have to call another command for turning on or off the checkboxes?

cheers,
Peter

Hi Peter,

If you add it with gEve->AddGlobalElement(), than you should start with gEve->GetGlobalScene() … and then continue from there.

About the visibility … I changed the way how draw-state of TEveGeoNode is set so the list-tree should be ok now (after a call to gEve->Redraw3D()). These changes are in trunk now.

Note that visibility of a node is detemined both by the node and volume visibilities and that this can not be properly represented by a single check-box in Eve list tree. There are more controls in node-editor below.

Good luck :slight_smile:
Matevz

Hi Matevz,

I searched for the method to set the visibility of the whole detector (scene), but I didn’t find the right one.
Could you tell me the full command? Thanks!

cheers,
Peter

Hi Peter,

TEveScene is derived from TEveElement, so:
gEve->GetGlobalScene()->SetRnrSelf(kFALSE);
// To force redraw:
gEve->Redraw3D();

Cheers,
Matevz