How to visualize complete ROOT geometry in REve

Hi (again),

I followed the suggestions from one of the experts in the forum to develop a GUI by using REve. I’m finding it cumbersome to load a full ROOT geometry into it. When using the older TEve, I could simply do the following:

auto gEve = TEveManager::Create();
auto gGeo = gEve->GetGeometry(rootFile);

auto tn = new TEveGeoTopNode(gGeo, gGeo->GetTopNode());
tn->SetVisOption(1);
tn->SetVisLevel(5);
gEve->AddGlobalElement(tn);

However, it seems that there’s no REve version for the TEveGeoTopNode.

Another approach that I tried was:

TObjArray* listOfVolumes = gGeoManager->GetListOfVolumes();
for(int i=0; i<listOfVolumes->GetEntries(); i++)
{
    TGeoVolume *volume = (TGeoVolume*)listOfVolumes->At(i);
    std::cout << volume->GetName() << std::endl;
    volume->SetVisibility(1);
    auto shape = new RE::REveGeoShape(volume->GetName());
    shape->SetShape(volume->GetShape());
    gEve->AddGlobalElement(shape);
}

But with the above approach all volumes are set to origin, and I would need to perform the full geometry reconstruction that I did before when creating the geometry.

I’m sure that there’s a simple method to upload and visualize the geometry, with the hierarchical tree and others.

I’d appreciate any help :slight_smile:

ROOT Version: 6.32
Platform: GNU/Linux (conda env)
Compiler: GCC


Maybe @matevz or @linev can give some hints

1 Like

@bellenot thanks a lot.

I’d really appreciate any help from the community :pray:

Dear @matevz and/or @linev ,

I’m really sorry to bother, but it be possible to help me with this particular topic?

Thanks in advance.

Hi,

Only @matevz or @alja can give you full answer.
I only can recommend to check tutorials/eve7/geom_cms.C macro which instantiate some geometry volumes,

Regards,
Sergey

1 Like

Dear @linev ,

Thanks for the feedback.

I see that the geom_cms.C makes usage of RGeomViewer . I’m trying to implement it, but I think my CMake cannot find that particular library. I tried adding mainly all libraries to CMake, but it still outputs errors when compiling.
I can also see that the Root7 libraries are not all shown when executing root-config --libs in the command. The output:

-lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame

Do you know if there’s any library missing for that one? Here’s all the libraries that I added to CMakeLists:

ROOT::Core ROOT::Imt ROOT::RIO
ROOT::Net ROOT::Hist ROOT::Graf ROOT::Graf3d
ROOT::Gpad ROOT::ROOTVecOps ROOT::Tree
ROOT::TreePlayer ROOT::Rint ROOT::Postscript
ROOT::Matrix ROOT::Physics ROOT::MathCore
ROOT::Thread ROOT::MultiProc ROOT::ROOTDataFrame
ROOT::ROOTEve ROOT::Geom ROOT::Eve ROOT::ROOTWebDisplay
ROOT::ROOTGpadv7 ROOT::WebGui6 ROOT::RGL ROOT::ROOTBrowserv7

Hi,

You always can check in which library class is implemented in doxygen documentation.

See in RGeomViewer in very bottom of HTML page. It is ROOT::ROOTGeomViewer.

Regards,
Sergey

1 Like

Hi Igi,

I think ROOTEve library is missing.
Here is an example of liniking REve libraries and sources in REve based application:


c++ -L `root-config --libdir`  `root-config --libs`  -lROOTEve -lROOTWebDisplay -lGeom -o $@ service.cc lego_bins.h

Let me know if this helps.
Alja

PS: Link to Makefile in my example project.

1 Like

For pure geometry viewer ROOTEve library is not necessary.

1 Like

Dear @alja,

Thanks a lot for the feedback.

I’m actually trying to load my complete root geometry in REve. The last messages in this thread were due to a suggestion to check tutorials/eve7/geom_cms.C, that uses RGeomViewer only.

What I really need is to be able to upload my complete geometry from a root file in REve. I tried a similar approach as for TEve, that I had in my previous code:

auto gGeo = gEve->GetGeometry(projFile);

auto tn = new TEveGeoTopNode(gGeo, gGeo->GetTopNode());
tn->SetVisOption(1);
tn->SetVisLevel(20);
gEve->AddGlobalElement(tn);

I however cannot seem to make it work with REve. I searched for an equivalent of TEveGeoTopNode in REve, but couldn’t find it.
The only way I tried is explained in my original post. However, in that way I would need to reconstruct my geometry again.
I’m sure that there’s an easy way of doing it, but I’m stuck.

I’d really appreciate any help :pray:

Dear Igi,

The turorials/eve7/geom_cms.C macro creates REveGeoShape objects from the TGeo geometry.
Your use case is based on REveGeoTopNode: one creates REveGeoTopNode from a TGeoNode object and sets the depth of rendering.
We (@linev, @matevz , and I) have implemented the initial version of REveGeoTopNode a year ago, but it is not in the root repository. I just started to review the code so it is ready for official root repository.

Alja

1 Like

Dear Igi,

We have created a PR to move our development into main root repository:

When the PR is merged, there will be two test macros available. One is tutorials/eve7geoTopNode.C which covers the use case you have described. The second test macro is tutorials/eve7/eveGeoBrowser.C which is similar to the first one with the difference that it has Segey’s geo hierarchical browser integrated in REve.

Please follow the PR and let me know if the new functionality works for your case.

Alja

1 Like

Dear @alja ,

Thank you very much for thefeedback! And it looks really nice :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.