The Geometry shapes

The Geometry shapes

//
// To see the output of this macro, click  here 
// Here we create a Canvas named "c1" with all default parameters
//
gROOT.Reset(c1)
TCanvas c1(c1)

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

TPCON pcon("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)

TPGON pgon("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
TNode node1("NODE1","NODE1","BRIK")
node1.cd

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

// Draw this geometry in the current canvas
node1.cd
node1.Draw
//
//  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.




[Home 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.