The Geometry shapes

{
   //
   // To see the output of this macro, click  here 
   //
   gROOT->Reset();
   c1 = new TCanvas("c1","Geometry Shapes",200,10,700,500);

   //  Define some volumes
   brik = new TBRIK("BRIK","BRIK","void",200,150,150);
   trd1 = new TTRD1("TRD1","TRD1","void",200,50,100,100);
   trd2 = new TTRD2("TRD2","TRD2","void",200,50,200,50,100);
   trap = new TTRAP("TRAP","TRAP","void",190,0,0,60,40,90,15,120,80,180,15);
   para = new TPARA("PARA","PARA","void",100,200,200,15,30,30);
   gtra = new TGTRA("GTRA","GTRA","void",390,0,0,20,60,40,90,15,120,80,180,15);
   tube = new TTUBE("TUBE","TUBE","void",150,200,400);
   tubs = new TTUBS("TUBS","TUBS","void",80,100,100,90,235);
   cone = new TCONE("CONE","CONE","void",50,70,120,150,100);
   cons = new TCONS("CONS","CONS","void",50,100,100,200,300,90,270);

   pcon = new TPCON("PCON","PCON","void",180,270,4);
   pcon->DefineSection(0,50,100,-200);
   pcon->DefineSection(1,50,80,-50);
   pcon->DefineSection(2,50,80,50);
   pcon->DefineSection(3,50,100,200);

   pgon = new TPGON("PGON","PGON","void",180,270,8,4);
   pgon->DefineSection(0,50,100,-200);
   pgon->DefineSection(1,50,80,-50);
   pgon->DefineSection(2,50,80,50);
   pgon->DefineSection(3,50,100,200);

   //  Set shapes attributes
   brik->SetLineColor(1);
   trd1->SetLineColor(2);
   trd2->SetLineColor(3);
   trap->SetLineColor(4);
   para->SetLineColor(5);
   gtra->SetLineColor(7);
   tube->SetLineColor(6);
   tubs->SetLineColor(7);
   cone->SetLineColor(2);
   cons->SetLineColor(3);
   pcon->SetLineColor(6);
   pgon->SetLineColor(2);

   //  Build the geometry hierarchy
   node1 = new TNode("NODE1","NODE1","BRIK");
   node1->cd();

   node2  = new TNode("NODE2","NODE2","TRD1",0,0,-1000);
   node3  = new TNode("NODE3","NODE3","TRD2",0,0,1000);
   node4  = new TNode("NODE4","NODE4","TRAP",0,-1000,0);
   node5  = new TNode("NODE5","NODE5","PARA",0,1000,0);
   node6  = new TNode("NODE6","NODE6","TUBE",-1000,0,0);
   node7  = new TNode("NODE7","NODE7","TUBS",1000,0,0);
   node8  = new TNode("NODE8","NODE8","CONE",-300,-300,0);
   node9  = new TNode("NODE9","NODE9","CONS",300,300,0);
   node10 = new TNode("NODE10","NODE10","PCON",0,-1000,-1000);
   node11 = new TNode("NODE11","NODE11","PGON",0,1000,1000);
   node12 = new TNode("NODE12","NODE12","GTRA",0,-400,700);

   // Draw this geometry in the current canvas
   node1->cd();
   node1->Draw();
   c1->Update();
   //
   //  Draw the geometry using the x3d viewver.
   //  Note that this viewver may also be invoked from the "View" menu in
   //  the canvas tool bar
   c1->x3d();
   //
   // once in x3d viewer, type m to see the menu.
   // For example typing r will show a solid model of this geometry.
}



ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.