Re: TGeo and visibility of nested volumes.

From: Andrei Gheata <Andrei.Gheata_at_cern.ch>
Date: Mon, 19 Feb 2007 10:55:25 +0100


Hi Brett,

I modified your macro adding some explanations inside.

Cheers,
Andrei

Brett Viren wrote:
> Hi,
>
> I'm having trouble getting all nested volumes in a simple TGeo
> geometry to be displayed. I think I am correctly following the
> guidance given in the relevant FAQs in the user's manual but the best I
> can get is the top level and one intermediate level volume to display.
>
> The attached is an example of what I mean. By changing the VisLevel I
> can change the node I display, but never do intermediates show up.
>
> I've tried this with a few versions, the latest being 5.14/00.
>
>
> Thanks,
> -Brett.
>
> PS: and thanks for fixing that OpenGL bug!
>
>
>
> ------------------------------------------------------------------------
>
> void db_hand() {
> const double pi = 3.14159268;
>
>
> gSystem->Load("libGeom");
> new TGeoManager("world","Nested box test");
> TGeoMaterial *air_mat = new TGeoMaterial ("Air",1,1,0.01);
> TGeoMedium *air_med = new TGeoMedium("Air",1,air_mat);
>
> TGeoMaterial *water_mat = new TGeoMaterial ("Water",18,10,1.0);
> TGeoMedium *water_med = new TGeoMedium("Water",2,air_mat);
>
> TGeoVolume* top = gGeoManager->MakeBox("Top",air_med,1000,1000,1000);
> gGeoManager->SetTopVolume(top);
>
> TGeoBBox* b1 = new TGeoBBox("b1",800,500,500);
> TGeoVolume* v1 = new TGeoVolume("b1_vol",b1,water_med);
> top->AddNode(v1, 1);
>
> TGeoBBox* b2 = new TGeoBBox("b2",750, 450, 450);
> TGeoVolume* v2 = new TGeoVolume("b2_vol",b2,air_med);
> v1->AddNode(v2, 1);
>
> TGeoBBox* b3 = new TGeoBBox("b3",700, 400, 450);
> TGeoVolume* v3 = new TGeoVolume("b3_vol",b3,water_med);
> v2->AddNode(v3, 1);
>
> TGeoBBox* b4 = new TGeoBBox("b4",650, 350, 400);
> TGeoVolume* v4 = new TGeoVolume("b4_vol",b4,air_med);
> v3->AddNode(v4, 1);
>
> TGeoVolume* vols[] = {top,v1,v2,v3,v4,0};
> for (int ind=0; vols[ind]; ++ind) {
>
> vols[ind]->SetVisibility(true);
> vols[ind]->SetVisLeaves(true);
> vols[ind]->VisibleDaughters(true);
> vols[ind]->SetLineColor(!ind ? 1 : (ind%2 ? 2 : 4));
>
> }
>
> gGeoManager->SetVisOption(0);
> gGeoManager->SetTopVisible();
> gGeoManager->SetVisLevel(4);
>
> gGeoManager->CloseGeometry();
> top->Draw();
> }

Received on Mon Feb 19 2007 - 11:01:30 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 20 2007 - 17:50:01 CET