Hi, I am new to Eve, and I am having troubles displaying a super simplistic geometry. I generate a single box in a top volume using:
void worldMake() {
gSystem->Load("libGeom");
new TGeoManager("TPC", "TPC box");
TGeoMaterial *mat = new TGeoMaterial("Vacuum", 0, 0, 0 );
mat->SetTransparency( 50 );
TGeoMedium *med = new TGeoMedium("Vacuum", 1, mat );
TGeoVolume *top = gGeoManager->MakeBox("Top", med, 390. , 240., 1040. );
gGeoManager->SetTopVolume( top );
TGeoVolume *box = gGeoManager->MakeBox("Box", med, 257., 233., 1038. );
TGeoTranslation *tr1 = new TGeoTranslation( -130., 0., 0. );
top->AddNode( box, 1, tr1 );
gGeoManager->CloseGeometry();
gGeoManager->SetTopVisible();
TFile *tf = new TFile("worldgeom.root", "RECREATE");
gGeoManager->Write();
tf->Close();
}
then I try to read it in and try to display it with:
void world_test()
{
TEveManager::Create();
TFile::SetCacheFileDir(".");
gGeoManager = gEve->GetGeometry("worldgeom.root");
TGeoVolume* top = gGeoManager->GetTopVolume();
TEveGeoTopNode* box = new TEveGeoTopNode(gGeoManager,top->FindNode("Box"));
gEve->AddGlobalElement(box);
gEve->FullRedraw3D(kTRUE);
TGLViewer *v = gEve->GetDefaultGLViewer();
v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
v->RefreshPadEditor(v);
v->DoDraw();
}
but it crashes at the TEveGeoTopNode constructor. Note, I am able to display both the top volume and the box with TGeoVolume::Draw(), but not with with TEveManager.
Any advice on what I am doing wrong?