robot.C

Go to the documentation of this file.
00001 #include "TGeoManager.h"
00002    
00003 void robot() 
00004 {
00005   // Drawing a famous Korean robot, TaekwonV, using ROOT geometry class.
00006   // Name: robot.C
00007   // Author: Jin Hui Hwang, Dept. of Physics, Univ. of Seoul
00008   // Reviewed by Sunman Kim (sunman98@hanmail.net)
00009   // Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
00010   // 
00011   // How to run: .x robot.C in ROOT terminal, then use OpenGL
00012   //
00013   // This macro was created for the evaluation of Computational Physics course in 2006.
00014   // We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
00015   //
00016 
00017    TGeoManager *Robot = new TGeoManager("Robot","This is Taegwon V");
00018 
00019    TGeoMaterial *vacuum=new TGeoMaterial("vacuum",0,0,0);  
00020    TGeoMaterial *Fe=new TGeoMaterial("Fe",55.845,26,7.87); 
00021 
00022    TGeoMedium *Air=new TGeoMedium("Vacuum",0,vacuum);
00023    TGeoMedium *Iron=new TGeoMedium("Iron",1,Fe);
00024 
00025    // create volume
00026 
00027    TGeoVolume *top=Robot->MakeBox("top",Air,1000,1000,1000);   
00028    Robot->SetTopVolume(top);     
00029    Robot->SetTopVisible(0); 
00030       // If you want to see the boundary, please input the number, 1 instead of 0.
00031       // Like this, geom->SetTopVisible(1); 
00032 
00033 
00034 
00035    // head
00036    TGeoVolume *Band=Robot->MakeEltu("Band",Iron,20,20,2.5);
00037      Band->SetLineColor(12);
00038      Band->SetFillColor(12);
00039    TGeoVolume *Band_b=Robot->MakeSphere("Band_b",Iron,0,2,0,180,180,360);  
00040      Band_b->SetLineColor(2);
00041      Band_b->SetFillColor(2);
00042    TGeoVolume *Head=Robot->MakeSphere("Head",Iron,0,19,0,180,180,360);  
00043      Head->SetLineColor(17);
00044      Head->SetFillColor(17);
00045    TGeoVolume *Horn=Robot->MakeSphere("Horn",Iron,0,10,60,180,240,300);
00046 
00047    // drawing head
00048    top->AddNodeOverlap(Band,1,new TGeoTranslation(0,0,90));
00049    float Phi = 3.14;
00050    int N = 10;
00051 
00052    for (int i=0; i<=N;i++){
00053       top->AddNodeOverlap(Band_b,1,new TGeoCombiTrans(sin(2*Phi/N*i)*19,-cos(2*Phi/N*i)*19,90, 
00054          new TGeoRotation("R1",-90+(360/N*i),-90,90)));
00055    }
00056    top->AddNodeOverlap(Head,1,new TGeoCombiTrans(0,0,87.5,new TGeoRotation("R2",0,-90,0)));
00057 
00058    char name[50];
00059    float pcs = 30;
00060    for (int i=1; i<pcs; i++){
00061       sprintf(name,"Horn%d",i);
00062       Horn=Robot->MakeSphere(name,Iron,
00063          10- 10/pcs*i ,10,180-(120/pcs)*i,180-((120/pcs) * (i-1)),240,300);
00064       Horn->SetLineColor(2);
00065       Horn->SetFillColor(2);
00066       top->AddNodeOverlap(Horn,1,new TGeoCombiTrans(0,8,102,new TGeoRotation("R2",0,140,0)));   
00067       top->AddNodeOverlap(Horn,1,new TGeoCombiTrans(0,-8,102,new TGeoRotation("R2",180,140,0)));
00068    }
00069 
00070    // face
00071    TGeoVolume *Migan=Robot->MakeGtra("Migan",Iron,3,0,0,0,3,2,11,0,3,3,11,0);
00072      Migan->SetLineColor(17);
00073      Migan->SetFillColor(17);
00074    TGeoVolume *Ko=Robot->MakeGtra("Ko",Iron,7,0,0,0,3,1,5,0,3,2,5,0);
00075      Ko->SetLineColor(17);
00076      Ko->SetFillColor(17);
00077    TGeoVolume *Ko_m=Robot->MakeBox("Ko_m",Iron,2,8,4);
00078      Ko_m->SetLineColor(17);
00079      Ko_m->SetFillColor(17);
00080    TGeoVolume *Bol_1=Robot->MakeBox("Bol_1",Iron,7,5.5,7);
00081      Bol_1->SetLineColor(17);
00082      Bol_1->SetFillColor(17);
00083    TGeoVolume *Bol_2=Robot->MakeGtra("Bol_2",Iron,1,0,0,0,7,0,9,0,7,0,9,0);
00084      Bol_2->SetLineColor(17);
00085      Bol_2->SetFillColor(17);
00086    TGeoVolume *Noon=Robot->MakeBox("Noon",Iron,1,10,5);
00087      Noon->SetLineColor(12);
00088      Noon->SetFillColor(12);
00089    TGeoVolume *Tuck=Robot->MakeBox("Tuck",Iron,2,10,5.5);
00090      Tuck->SetLineColor(2);
00091      Tuck->SetFillColor(2);
00092    TGeoVolume *Tuck_1=Robot->MakeBox("Tuck_1",Iron,2,9,1);
00093      Tuck_1->SetLineColor(2);
00094      Tuck_1->SetFillColor(2);
00095    TGeoVolume *Tuck_2=Robot->MakeBox("Tuck_2",Iron,3,1,14);
00096      Tuck_2->SetLineColor(2);
00097      Tuck_2->SetFillColor(2);
00098    TGeoVolume *Tuck_j=Robot->MakeSphere("Tuck_j",Iron,0,3.5,0,180,0,360);  
00099      Tuck_j->SetLineColor(5);
00100      Tuck_j->SetFillColor(5);
00101           TGeoVolume *Ear=Robot->MakeCons("Ear",Iron,1,0,3,0,3,0,360);
00102      Ear->SetLineColor(5);
00103      Ear->SetFillColor(5);
00104           TGeoVolume *Ear_2=Robot->MakeCone("Ear_2",Iron,5,0,0,0,3);
00105      Ear_2->SetLineColor(5);
00106      Ear_2->SetFillColor(5);
00107 
00108    // drawing face
00109    top->AddNodeOverlap(Migan,1,new TGeoCombiTrans(-15,0,88,new TGeoRotation("R2",-90,40,0)));
00110    top->AddNodeOverlap(Ko,1,new TGeoCombiTrans(-15,0,76.5,new TGeoRotation("R2",-90,-20,0)));
00111    top->AddNodeOverlap(Ko_m,1,new TGeoTranslation(-9,0,68));
00112    top->AddNodeOverlap(Bol_1,1,new TGeoCombiTrans(-7,2,76,new TGeoRotation("R2",-30,-10,0)));
00113    top->AddNodeOverlap(Bol_1,1,new TGeoCombiTrans(-7,-2,76,new TGeoRotation("R2",30,10,0)));
00114    top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-6.5,-10.5,76,new TGeoRotation("R2",-15,-90,-30)));
00115    top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-4,-12.5,82.5,new TGeoRotation("R2",-20,-90,-95)));
00116    top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-7.5,10.5,76,new TGeoRotation("R2",20,-90,-30)));
00117    top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-4,12.5,82.5,new TGeoRotation("R2",20,-90,-95)));
00118    top->AddNodeOverlap(Noon,1,new TGeoCombiTrans(-5,-7,86,new TGeoRotation("R2",60,0,0)));
00119    top->AddNodeOverlap(Noon,1,new TGeoCombiTrans(-5,7,86,new TGeoRotation("R2",-60,0,0)));
00120    top->AddNodeOverlap(Tuck,1,new TGeoTranslation(-12,0,62.5));
00121    for (int i=0; i<10;i++) {
00122       top->AddNodeOverlap(Tuck_1,1,new TGeoCombiTrans(-4.2,11,61+i,new TGeoRotation("R2",90,-20,20)));
00123       top->AddNodeOverlap(Tuck_1,1,new TGeoCombiTrans(-4.2,-11,61+i,new TGeoRotation("R2",90,-20,-20)));
00124    }
00125    top->AddNodeOverlap(Tuck_2,1,new TGeoTranslation(2,-15.1,76));
00126    top->AddNodeOverlap(Tuck_2,1,new TGeoTranslation(2,15.1,76));
00127    top->AddNodeOverlap(Tuck_j,1,new TGeoTranslation(-13,0,62.5));
00128    top->AddNodeOverlap(Ear,1,new TGeoCombiTrans(2,-16.5,80,new TGeoRotation("R2",0,-90,0)));
00129    top->AddNodeOverlap(Ear,1,new TGeoCombiTrans(2,16.5,80,new TGeoRotation("R2",0,90,0)));
00130    top->AddNodeOverlap(Ear_2,1,new TGeoCombiTrans(2,-20,80,new TGeoRotation("R2",0,-90,0)));
00131    top->AddNodeOverlap(Ear_2,1,new TGeoCombiTrans(2,20,80,new TGeoRotation("R2",0,90,0)));
00132 
00133 
00134    for (int i=1; i<28; i+=1) {
00135       float a=i*0.2;
00136              TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-60-a,60+a);
00137       if (i<27) {
00138         Hear->SetLineColor(12);
00139         Hear->SetFillColor(12);
00140       }
00141       else {
00142         Hear->SetLineColor(2);
00143         Hear->SetFillColor(2);
00144       }
00145       top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
00146    }
00147    for (int i=1; i<28; i+=1) {
00148       float a=i*0.2;
00149              TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-70-a,-60-a);
00150         Hear->SetLineColor(2);
00151         Hear->SetFillColor(2);
00152       top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
00153    }
00154    for (int i=1; i<28; i+=1) {
00155       float a=i*0.2;
00156              TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,60+a,70+a);
00157         Hear->SetLineColor(2);
00158         Hear->SetFillColor(2);
00159       top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
00160    }
00161 
00162    // neck 
00163    TGeoVolume *Mock=Robot->MakeTrd2("Mock",Iron,1,1,7,6.5,20);
00164      Mock->SetLineColor(17);
00165      Mock->SetFillColor(17);
00166    TGeoVolume *Mock_1=Robot->MakeTrd2("Mock_1",Iron,1,1,6,5,20);
00167      Mock_1->SetLineColor(17);
00168      Mock_1->SetFillColor(17);
00169    TGeoVolume *Mock_s=Robot->MakeTrd2("Mock_s",Iron,1,1,5,4.5,20);
00170      Mock_s->SetLineColor(17);
00171      Mock_s->SetFillColor(17);
00172 
00173    // drawing neck 
00174           top->AddNodeOverlap(Mock,1,new TGeoCombiTrans(-5,4.7,50,new TGeoRotation("R2",-30,0,-10)));
00175           top->AddNodeOverlap(Mock,1,new TGeoCombiTrans(-5,-4.7,50,new TGeoRotation("R2",30,0,10)));
00176           top->AddNodeOverlap(Mock_1,1,new TGeoCombiTrans(11,-4,50,new TGeoRotation("R2",130,-8,10)));
00177           top->AddNodeOverlap(Mock_1,1,new TGeoCombiTrans(11,4,50,new TGeoRotation("R2",-130,8,-10)));
00178           top->AddNodeOverlap(Mock_s,1,new TGeoCombiTrans(2.5,9,50,new TGeoRotation("R2",90,0,0)));
00179           top->AddNodeOverlap(Mock_s,1,new TGeoCombiTrans(2.5,-9,50,new TGeoRotation("R2",90,0,0)));
00180 
00181 
00182    // chest
00183    TGeoVolume *Gasem=Robot->MakeBox("Gasem",Iron,16,50,20);
00184      Gasem->SetLineColor(12);
00185      Gasem->SetFillColor(12);
00186    TGeoVolume *Gasem_b1=Robot->MakeSphere("Gasem_b1",Iron,0,15,0,180,0,360);  
00187      Gasem_b1->SetLineColor(12);
00188      Gasem_b1->SetFillColor(12);
00189    TGeoVolume *Gasem_b2=Robot->MakeSphere("Gasem_b2",Iron,0,13,0,180,0,360);  
00190      Gasem_b2->SetLineColor(12);
00191      Gasem_b2->SetFillColor(12);
00192    TGeoVolume *Gasem_1=Robot->MakeEltu("Gasem_1",Iron,13,13,20);
00193      Gasem_1->SetLineColor(12);
00194      Gasem_1->SetFillColor(12);
00195    TGeoVolume *Gasem_2=Robot->MakeEltu("Gasem_2",Iron,13,13,19);
00196      Gasem_2->SetLineColor(12);
00197      Gasem_2->SetFillColor(12);
00198           TGeoVolume *Gasem_3=Robot->MakeCone("Gasem_3",Iron,19,0,13,0,15);
00199      Gasem_3->SetLineColor(12);
00200      Gasem_3->SetFillColor(12);
00201    TGeoVolume *Gasem_4=Robot->MakeEltu("Gasem_4",Iron,15,15,16);
00202      Gasem_4->SetLineColor(12);
00203      Gasem_4->SetFillColor(12);
00204    TGeoVolume *Gasem_5=Robot->MakeEltu("Gasem_5",Iron,13,13,16);
00205      Gasem_5->SetLineColor(12);
00206      Gasem_5->SetFillColor(12);
00207    TGeoVolume *Gasem_m1=Robot->MakeBox("Gasem_m1",Iron,19,19,5);
00208      Gasem_m1->SetLineColor(12);
00209      Gasem_m1->SetFillColor(12);
00210    TGeoVolume *Gasem_m2=Robot->MakeTrd2("Gasem_m2",Iron,13,15,2,2,19);
00211      Gasem_m2->SetLineColor(12);
00212      Gasem_m2->SetFillColor(12);
00213    TGeoVolume *V=Robot->MakeTrd2("V",Iron,2,2,22,30,4);
00214      V->SetLineColor(2);
00215      V->SetFillColor(2);
00216    TGeoVolume *V_m=Robot->MakeBox("V_m",Iron,2,7,1);
00217      V_m->SetLineColor(2);
00218      V_m->SetFillColor(2);
00219 
00220    // drawing chest
00221    top->AddNodeOverlap(Gasem,1,new TGeoTranslation(4,0,19));
00222    top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(-12,50,35));
00223    top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(-12,-50,35));
00224    top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(20,50,35));
00225    top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(20,-50,35));
00226    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,50,-5));
00227    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-50,-5));
00228    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,50,-5));
00229    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-50,-5));
00230    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,10,-5));
00231    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-10,-5));
00232    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,10,-5));
00233    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-10,-5));
00234    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,10,35));
00235    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-10,35));
00236    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,10,35));
00237    top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-10,35));
00238    top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(20,31,-5,new TGeoRotation("R2",0,90,0)));
00239    top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(20,-31,-5,new TGeoRotation("R2",0,90,0)));
00240    top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(-12,31,-5,new TGeoRotation("R2",0,90,0)));
00241    top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(-12,-31,-5,new TGeoRotation("R2",0,90,0)));
00242    top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(20,10,13,new TGeoRotation("R2",0,0,0)));
00243    top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(20,-10,13,new TGeoRotation("R2",0,0,0)));
00244    top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(-12,10,13,new TGeoRotation("R2",0,0,0)));
00245    top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(-12,-10,13,new TGeoRotation("R2",0,0,0)));
00246    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,50,16,new TGeoRotation("R2",0,0,0)));
00247    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,-50,16,new TGeoRotation("R2",0,0,0)));
00248    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,50,16,new TGeoRotation("R2",0,0,0)));
00249    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,-50,16,new TGeoRotation("R2",0,0,0)));
00250    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,31,35,new TGeoRotation("R2",0,-90,0)));
00251    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,-31,35,new TGeoRotation("R2",0,90,0)));
00252    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,31,35,new TGeoRotation("R2",0,-90,0)));
00253    top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,-31,35,new TGeoRotation("R2",0,90,0)));
00254    top->AddNodeOverlap(Gasem_4,1,new TGeoCombiTrans(4,-50,35,new TGeoRotation("R2",90,90,0)));
00255    top->AddNodeOverlap(Gasem_4,1,new TGeoCombiTrans(4,50,35,new TGeoRotation("R2",90,90,0)));
00256    top->AddNodeOverlap(Gasem_5,1,new TGeoCombiTrans(4,-50,-5,new TGeoRotation("R2",90,90,0)));
00257    top->AddNodeOverlap(Gasem_5,1,new TGeoCombiTrans(4,50,-5,new TGeoRotation("R2",90,90,0)));
00258    top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(-22,30,16,new TGeoRotation("R2",90,88,0)));
00259    top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(-22,-30,16,new TGeoRotation("R2",90,88,0)));
00260    top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(29,30,16,new TGeoRotation("R2",90,92,0)));
00261    top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(29,-30,16,new TGeoRotation("R2",90,92,0)));
00262    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-62,16,new TGeoRotation("R2",0,3,0)));
00263    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,62,16,new TGeoRotation("R2",0,-3,0)));
00264    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-30,47.5,new TGeoRotation("R2",0,87,0)));
00265    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,30,47.5,new TGeoRotation("R2",0,-87,0)));
00266    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-30,-16,new TGeoRotation("R2",0,90,0)));
00267    top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,30,-16,new TGeoRotation("R2",0,-90,0)));
00268    top->AddNodeOverlap(V,1,new TGeoCombiTrans(-30,18.3,16,new TGeoRotation("R2",0,-135,0)));
00269    top->AddNodeOverlap(V,1,new TGeoCombiTrans(-30,-18.3,16,new TGeoRotation("R2",0,135,0)));
00270    top->AddNodeOverlap(V_m,1,new TGeoTranslation(-30,-37,35));
00271    top->AddNodeOverlap(V_m,1,new TGeoTranslation(-30,37,35));
00272    
00273    // abdomen 
00274    TGeoVolume *Bea=Robot->MakeEltu("Bea",Iron,20,37,25);
00275      Bea->SetLineColor(17);
00276      Bea->SetFillColor(17);
00277    TGeoVolume *Bea_d=Robot->MakeEltu("Bea_d",Iron,21,36,5);
00278      Bea_d->SetLineColor(12);
00279      Bea_d->SetFillColor(12);
00280    TGeoVolume *Beakop=Robot->MakeEltu("Beakop",Iron,15,25,5);
00281      Beakop->SetLineColor(10);
00282      Beakop->SetFillColor(10);
00283 
00284    // drawing abdomen 
00285    top->AddNodeOverlap(Bea,1,new TGeoTranslation(3,0,-30));
00286    top->AddNodeOverlap(Bea_d,1,new TGeoTranslation(3,0,-10));
00287    top->AddNodeOverlap(Beakop,1,new TGeoCombiTrans(-12.1,0,-50, new TGeoRotation("R2",90,90,0)));
00288    
00289    // Gungdi
00290    TGeoVolume *Gungdi=Robot->MakeEltu("Gungdi",Iron,25,50,18);
00291      Gungdi->SetLineColor(12);
00292      Gungdi->SetFillColor(12);
00293    TGeoVolume *Gungdi_d=Robot->MakeEltu("Gungdi_d",Iron,5,5,5);
00294      Gungdi_d->SetLineColor(2);
00295      Gungdi_d->SetFillColor(2);
00296 
00297    // drawing Gungdi
00298    top->AddNodeOverlap(Gungdi,1,new TGeoTranslation(3,0,-70));
00299    for (int i=0; i<30; i++) {
00300       TGeoVolume *Gungdi_j=Robot->MakeEltu("Gungdi_j",Iron,24-0.2*i,49-0.5*i,1);
00301         Gungdi_j->SetLineColor(12);
00302         Gungdi_j->SetFillColor(12);
00303       top->AddNodeOverlap(Gungdi_j,1,new TGeoTranslation(3,0,-51+0.5*i));
00304    }
00305    for (int i=0; i<40; i++) {
00306       if (i<16) {
00307         TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,24-0.1*i,49-0.3*i,1);
00308           Gungdi_h->SetLineColor(12);
00309           Gungdi_h->SetFillColor(12);
00310         top->AddNodeOverlap(Gungdi_h,1,new TGeoTranslation(3,0,-88-0.5*i));
00311       }
00312       else {
00313         TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,27-0.3*i,52-0.5*i,1);
00314           Gungdi_h->SetLineColor(12);
00315           Gungdi_h->SetFillColor(12);
00316         top->AddNodeOverlap(Gungdi_h,1,new TGeoTranslation(3,0,-89-0.5*i));
00317       }
00318    }
00319    top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,-45,-62,new TGeoRotation("R2",0,90,0)));
00320    top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,-45,-78,new TGeoRotation("R2",0,90,0)));
00321    top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,45,-62,new TGeoRotation("R2",0,90,0)));
00322    top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,45,-78,new TGeoRotation("R2",0,90,0)));
00323 
00324    // feet
00325    TGeoVolume *Jang=Robot->MakeEltu("Jang",Iron,18,18,50);
00326      Jang->SetLineColor(17);
00327      Jang->SetFillColor(17);
00328    TGeoVolume *Jong=Robot->MakeEltu("Jong",Iron,22,22,50);
00329      Jong->SetLineColor(12);
00330      Jong->SetFillColor(12);
00331    TGeoVolume *Bal=Robot->MakeSphere("Bal",Iron,0,22,0,180,180,360);  
00332      Bal->SetLineColor(12);
00333      Bal->SetFillColor(12);
00334 
00335    // drawing Dary
00336    top->AddNodeOverlap(Jang,1,new TGeoCombiTrans(3,-25,-120,new TGeoRotation("R2",0,0,0)));
00337    top->AddNodeOverlap(Jang,1,new TGeoCombiTrans(3,25,-120,new TGeoRotation("R2",0,0,0)));
00338    top->AddNodeOverlap(Jong,1,new TGeoCombiTrans(3,-25,-220,new TGeoRotation("R2",0,0,0)));
00339    top->AddNodeOverlap(Jong,1,new TGeoCombiTrans(3,25,-220,new TGeoRotation("R2",0,0,0)));
00340    for (int i=0; i<30; i++) {
00341              TGeoVolume *Mu=Robot->MakeCons("Mu",Iron,1,0,22.1,0,22.1,120+2*i,-120-2*i);
00342         Mu->SetLineColor(4);
00343         Mu->SetFillColor(4);
00344       top->AddNodeOverlap(Mu,1,new TGeoTranslation(3,-25,-171-i));
00345       top->AddNodeOverlap(Mu,1,new TGeoTranslation(3,25,-171-i));
00346       
00347    }
00348    top->AddNodeOverlap(Bal,1,new TGeoCombiTrans(-10,-25,-270,new TGeoRotation("R2",270,-90,0)));
00349    top->AddNodeOverlap(Bal,1,new TGeoCombiTrans(-10,25,-270,new TGeoRotation("R2",270,-90,0)));
00350    
00351    // arms
00352    TGeoVolume *S=Robot->MakeSphere("S",Iron,0,25,0,180,180,360);
00353      S->SetLineColor(17);
00354      S->SetFillColor(17);
00355    TGeoVolume *S_1=Robot->MakeSphere("S_1",Iron,0,15,0,180,0,360);
00356      S_1->SetLineColor(17);
00357      S_1->SetFillColor(17);
00358    TGeoVolume *Pal=Robot->MakeEltu("Pal",Iron,15,15,30);
00359      Pal->SetLineColor(17);
00360      Pal->SetFillColor(17);
00361    TGeoVolume *Fal=Robot->MakeEltu("Fal",Iron,17,17,30);
00362      Fal->SetLineColor(4);
00363      Fal->SetFillColor(4);
00364           TGeoVolume *Bbul=Robot->MakeCone("Bbul",Iron,8,0,0,0,5);
00365      Bbul->SetLineColor(17);
00366      Bbul->SetFillColor(17);
00367 
00368    // drawing arms
00369    top->AddNodeOverlap(S,1,new TGeoCombiTrans(3,73,30,new TGeoRotation("R2",0,-30,0)));
00370    top->AddNodeOverlap(S,1,new TGeoCombiTrans(3,-73,30,new TGeoRotation("R2",0,210,0)));
00371    top->AddNodeOverlap(S_1,1,new TGeoCombiTrans(3,-73,27,new TGeoRotation("R2",0,0,0)));
00372    top->AddNodeOverlap(S_1,1,new TGeoCombiTrans(3,73,27,new TGeoRotation("R2",0,0,0)));
00373    top->AddNodeOverlap(Pal,1,new TGeoCombiTrans(3,-73,-5,new TGeoRotation("R2",0,0,0)));
00374    top->AddNodeOverlap(Pal,1,new TGeoCombiTrans(3,73,-5,new TGeoRotation("R2",0,0,0)));
00375    top->AddNodeOverlap(Fal,1,new TGeoCombiTrans(3,-73,-60,new TGeoRotation("R2",0,0,0)));
00376    top->AddNodeOverlap(Fal,1,new TGeoCombiTrans(3,73,-60,new TGeoRotation("R2",0,0,0)));
00377    top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,-97,-72,new TGeoRotation("R2",0,-90,0)));
00378    top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,-97,-48,new TGeoRotation("R2",0,-90,0)));
00379    top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,97,-72,new TGeoRotation("R2",0,90,0)));
00380    top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,97,-48,new TGeoRotation("R2",0,90,0)));
00381 
00382    // hands
00383    TGeoVolume *Son_d=Robot->MakeBox("Son_d",Iron,15,15,7);
00384      Son_d->SetLineColor(4);
00385      Son_d->SetFillColor(4);
00386    TGeoVolume *Son_g=Robot->MakeBox("Son_g",Iron,4,10,4);
00387      Son_g->SetLineColor(4);
00388      Son_g->SetFillColor(4);
00389    TGeoVolume *Son_g1=Robot->MakeBox("Son_g1",Iron,6,6,6);
00390      Son_g1->SetLineColor(4);
00391      Son_g1->SetFillColor(4);
00392    TGeoVolume *Son_g2=Robot->MakeBox("Son_g2",Iron,8,3,3);
00393      Son_g2->SetLineColor(4);
00394      Son_g2->SetFillColor(4);
00395           TGeoVolume *Last_b=Robot->MakeCone("Last_b",Iron,10,0,0,0,4);
00396      Last_b->SetLineColor(17);
00397      Last_b->SetFillColor(17);
00398    TGeoVolume *Last=Robot->MakeSphere("Last",Iron,0,3,0,180,0,360);
00399      Last->SetLineColor(2);
00400      Last->SetFillColor(2);
00401 
00402    //drawing hands
00403    top->AddNodeOverlap(Son_d,1,new TGeoCombiTrans(3,-80,-105,new TGeoRotation("R2",0,90,0)));
00404    for (int i=0; i<4; i++) {   
00405       top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,-72,-118,new TGeoRotation("R2",0,-10,0)));
00406    }
00407    for (int i=0; i<4; i++) {   
00408       top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,-67,-113,new TGeoRotation("R2",0,110,0)));
00409    }
00410    top->AddNodeOverlap(Son_g1,1,new TGeoCombiTrans(-5,-70,-98,new TGeoRotation("R2",0,0,0)));
00411    top->AddNodeOverlap(Son_g2,1,new TGeoCombiTrans(-5,-65,-102,new TGeoRotation("R2",0,60,0)));
00412    top->AddNodeOverlap(Son_d,1,new TGeoCombiTrans(3,80,-105,new TGeoRotation("R2",0,90,0)));
00413    for (int i=0; i<4; i++) {   
00414       top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,72,-118,new TGeoRotation("R2",0,10,0)));
00415    }
00416    for (int i=0; i<4; i++) {   
00417       top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,67,-113,new TGeoRotation("R2",0,70,0)));
00418    }
00419    top->AddNodeOverlap(Son_g1,1,new TGeoCombiTrans(-5,70,-98,new TGeoRotation("R2",0,0,0)));
00420    top->AddNodeOverlap(Son_g2,1,new TGeoCombiTrans(-5,65,-102,new TGeoRotation("R2",0,60,0)));
00421    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(3,-88,-103,new TGeoRotation("R2",0,180,0)));
00422    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(12,-88,-103,new TGeoRotation("R2",0,180,0)));
00423    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(-7,-88,-103,new TGeoRotation("R2",0,180,0)));
00424    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(3,88,-103,new TGeoRotation("R2",0,180,0)));
00425    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(12,88,-103,new TGeoRotation("R2",0,180,0)));
00426    top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(-7,88,-103,new TGeoRotation("R2",0,180,0)));
00427    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(3,-88,-112,new TGeoRotation("R2",0,180,0)));
00428    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(12,-88,-112,new TGeoRotation("R2",0,180,0)));
00429    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(-7,-88,-112,new TGeoRotation("R2",0,180,0)));
00430    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(3,88,-112,new TGeoRotation("R2",0,180,0)));
00431    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(12,88,-112,new TGeoRotation("R2",0,180,0)));
00432    top->AddNodeOverlap(Last,1,new TGeoCombiTrans(-7,88,-112,new TGeoRotation("R2",0,180,0)));
00433 
00434 for (int i=1; i<20; i+=1) {
00435    if (i<7) {
00436      TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,3,20/sin(i),21/sin(i),20/sin(i),21/sin(i),0,70);
00437        Effect->SetLineColor(9);
00438        Effect->SetFillColor(9);
00439      top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
00440    }
00441    if (6<i<10) {
00442      TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,5,20/sin(i),21/sin(i),20/sin(i),21/sin(i),50,120);
00443        Effect->SetLineColor(38);
00444        Effect->SetFillColor(38);
00445      top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
00446    }
00447    if (9<i<20) {
00448      TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,4,20/sin(i),21/sin(i),20/sin(i),21/sin(i),200,330);
00449        Effect->SetLineColor(33);
00450        Effect->SetFillColor(33);
00451      top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
00452    }
00453 }
00454 
00455 
00456    //close geometry
00457    top->SetVisibility(0);
00458    Robot->CloseGeometry();
00459 
00460    // in GL viewer
00461    top->Draw("ogl");
00462 }

Generated on Tue Jul 5 15:44:17 2011 for ROOT_528-00b_version by  doxygen 1.5.1