I am making an application in TEveBrowser and I need to hide Geometry scene, so only Event scene is present.
There is a check box in TEveBrowser for this options shown on the picture below:
But I want to make a separate button for this, therefore I need this peace of code.
Can I somehow see the code for hiding geometry in TEveBrowser?
Or do You maybe know how can I hide the geometry without searching through code?
Thank you for your time and help!
You can do something like this to remove the scene from a viewer:
root  v = (TEveViewer*) gEve->GetViewers()->FindChild("Viewer 1")
root  si = (TEveSceneInfo*) v->FindChild("SI - Geometry scene")
root  v->RemoveElement(si)
or, you can disable drawing of the scene by calling:
si->SetRnrState(kFALSE) // si var from above
Thank you for your answer!
I have tried to run the code, but either way I get this error:
I am using the following code to load the geometry:
[code]gGeoManager = gEve->GetGeometry(“geometry.root”);
tn = new TEveGeoTopNode(gGeoManager, gGeoManager->GetTopNode());
gEve->AddGlobalElement(tn,0); // 0 is default parent[/code]
And when the previous Check Button (SI - Geometry scene) is unchecked the geometry is not visible.
I have tried to use the following command to hide the geometry, but I get the segmentation error.
Do you maybe have other suggestions?
Hmmh, the first code snippet should work in some way … what I sent you was cut’n’pasted from a ROOT session where it did work
What root are you using? I used 5.34 patches branch. I wouldn’t dare using trunk …
How did you execute this code?
I have found mistake. I haven’t included this: TEveViewer.
Now, there is no syntax error and it compiles . But when I click on the button, I get the segmentation error.
I execute the code using Visual Studio 2012 and root v. 5.26.
Hmmh … how did you get stuck with ROOT 5.26? Any chance for you to use 5.34?
What if you call the function directly, by hand? What’s the stack trace?
[quote=“AryaStark”]I execute the code using Visual Studio 2012 and root v. 5.26.[/quote]You cannot use Visual Studio 2012. You must use the same version of Visual Studio than the one which has been used to build ROOT itself (and there is no version of ROOT compatible with Visual Studio 2012).
[quote=“AryaStark”]PS: At some point, I will still have to put the code in Visual Studio, and when the project is over make a binary exe file of it. Is there maybe some tutorial or forum thread where I can see how to do so, without having segmentation errors?[/quote] If you just need to build a standalone application, you can take a look at the examples in the $ROOTSYS/test directory, using the Makefile.win32 nmake makefile. But you will still need the exact same version than the one used to build ROOT itself.