Logo ROOT   6.07/09
Reference Guide
robot.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_geom
3 /// Drawing a famous Korean robot, TaekwonV, using ROOT geometry class.
4 ///
5 /// Reviewed by Sunman Kim (sunman98@hanmail.net)
6 /// Supervisor: Prof. Inkyu Park (icpark@physics.uos.ac.kr)
7 ///
8 /// How to run: `.x robot.C` in ROOT terminal, then use OpenGL
9 ///
10 /// This macro was created for the evaluation of Computational Physics course in 2006.
11 /// We thank to Prof. Inkyu Park for his special lecture on ROOT and to all of ROOT team
12 ///
13 /// \macro_code
14 ///
15 /// \author Jin Hui Hwang, Dept. of Physics, Univ. of Seoul
16 
17 #include "TGeoManager.h"
18 
19 void robot()
20 {
21 
22 
23  TGeoManager *Robot = new TGeoManager("Robot","This is Taegwon V");
24 
25  TGeoMaterial *vacuum=new TGeoMaterial("vacuum",0,0,0);
26  TGeoMaterial *Fe=new TGeoMaterial("Fe",55.845,26,7.87);
27 
28  TGeoMedium *Air=new TGeoMedium("Vacuum",0,vacuum);
29  TGeoMedium *Iron=new TGeoMedium("Iron",1,Fe);
30 
31  // create volume
32 
33  TGeoVolume *top=Robot->MakeBox("top",Air,1000,1000,1000);
34  Robot->SetTopVolume(top);
35  Robot->SetTopVisible(0);
36  // If you want to see the boundary, please input the number, 1 instead of 0.
37  // Like this, geom->SetTopVisible(1);
38 
39 
40 
41  // head
42  TGeoVolume *Band=Robot->MakeEltu("Band",Iron,20,20,2.5);
43  Band->SetLineColor(12);
44  Band->SetFillColor(12);
45  TGeoVolume *Band_b=Robot->MakeSphere("Band_b",Iron,0,2,0,180,180,360);
46  Band_b->SetLineColor(2);
47  Band_b->SetFillColor(2);
48  TGeoVolume *Head=Robot->MakeSphere("Head",Iron,0,19,0,180,180,360);
49  Head->SetLineColor(17);
50  Head->SetFillColor(17);
51  TGeoVolume *Horn=Robot->MakeSphere("Horn",Iron,0,10,60,180,240,300);
52 
53  // drawing head
54  top->AddNodeOverlap(Band,1,new TGeoTranslation(0,0,90));
55  float Phi = 3.14;
56  int N = 10;
57 
58  for (int i=0; i<=N;i++){
59  top->AddNodeOverlap(Band_b,1,new TGeoCombiTrans(sin(2*Phi/N*i)*19,-cos(2*Phi/N*i)*19,90,
60  new TGeoRotation("R1",-90+(360/N*i),-90,90)));
61  }
62  top->AddNodeOverlap(Head,1,new TGeoCombiTrans(0,0,87.5,new TGeoRotation("R2",0,-90,0)));
63 
64  char name[50];
65  float pcs = 30;
66  for (int i=1; i<pcs; i++){
67  sprintf(name,"Horn%d",i);
68  Horn=Robot->MakeSphere(name,Iron,
69  10- 10/pcs*i ,10,180-(120/pcs)*i,180-((120/pcs) * (i-1)),240,300);
70  Horn->SetLineColor(2);
71  Horn->SetFillColor(2);
72  top->AddNodeOverlap(Horn,1,new TGeoCombiTrans(0,8,102,new TGeoRotation("R2",0,140,0)));
73  top->AddNodeOverlap(Horn,1,new TGeoCombiTrans(0,-8,102,new TGeoRotation("R2",180,140,0)));
74  }
75 
76  // face
77  TGeoVolume *Migan=Robot->MakeGtra("Migan",Iron,3,0,0,0,3,2,11,0,3,3,11,0);
78  Migan->SetLineColor(17);
79  Migan->SetFillColor(17);
80  TGeoVolume *Ko=Robot->MakeGtra("Ko",Iron,7,0,0,0,3,1,5,0,3,2,5,0);
81  Ko->SetLineColor(17);
82  Ko->SetFillColor(17);
83  TGeoVolume *Ko_m=Robot->MakeBox("Ko_m",Iron,2,8,4);
84  Ko_m->SetLineColor(17);
85  Ko_m->SetFillColor(17);
86  TGeoVolume *Bol_1=Robot->MakeBox("Bol_1",Iron,7,5.5,7);
87  Bol_1->SetLineColor(17);
88  Bol_1->SetFillColor(17);
89  TGeoVolume *Bol_2=Robot->MakeGtra("Bol_2",Iron,1,0,0,0,7,0,9,0,7,0,9,0);
90  Bol_2->SetLineColor(17);
91  Bol_2->SetFillColor(17);
92  TGeoVolume *Noon=Robot->MakeBox("Noon",Iron,1,10,5);
93  Noon->SetLineColor(12);
94  Noon->SetFillColor(12);
95  TGeoVolume *Tuck=Robot->MakeBox("Tuck",Iron,2,10,5.5);
96  Tuck->SetLineColor(2);
97  Tuck->SetFillColor(2);
98  TGeoVolume *Tuck_1=Robot->MakeBox("Tuck_1",Iron,2,9,1);
99  Tuck_1->SetLineColor(2);
100  Tuck_1->SetFillColor(2);
101  TGeoVolume *Tuck_2=Robot->MakeBox("Tuck_2",Iron,3,1,14);
102  Tuck_2->SetLineColor(2);
103  Tuck_2->SetFillColor(2);
104  TGeoVolume *Tuck_j=Robot->MakeSphere("Tuck_j",Iron,0,3.5,0,180,0,360);
105  Tuck_j->SetLineColor(5);
106  Tuck_j->SetFillColor(5);
107  TGeoVolume *Ear=Robot->MakeCons("Ear",Iron,1,0,3,0,3,0,360);
108  Ear->SetLineColor(5);
109  Ear->SetFillColor(5);
110  TGeoVolume *Ear_2=Robot->MakeCone("Ear_2",Iron,5,0,0,0,3);
111  Ear_2->SetLineColor(5);
112  Ear_2->SetFillColor(5);
113 
114  // drawing face
115  top->AddNodeOverlap(Migan,1,new TGeoCombiTrans(-15,0,88,new TGeoRotation("R2",-90,40,0)));
116  top->AddNodeOverlap(Ko,1,new TGeoCombiTrans(-15,0,76.5,new TGeoRotation("R2",-90,-20,0)));
117  top->AddNodeOverlap(Ko_m,1,new TGeoTranslation(-9,0,68));
118  top->AddNodeOverlap(Bol_1,1,new TGeoCombiTrans(-7,2,76,new TGeoRotation("R2",-30,-10,0)));
119  top->AddNodeOverlap(Bol_1,1,new TGeoCombiTrans(-7,-2,76,new TGeoRotation("R2",30,10,0)));
120  top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-6.5,-10.5,76,new TGeoRotation("R2",-15,-90,-30)));
121  top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-4,-12.5,82.5,new TGeoRotation("R2",-20,-90,-95)));
122  top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-7.5,10.5,76,new TGeoRotation("R2",20,-90,-30)));
123  top->AddNodeOverlap(Bol_2,1,new TGeoCombiTrans(-4,12.5,82.5,new TGeoRotation("R2",20,-90,-95)));
124  top->AddNodeOverlap(Noon,1,new TGeoCombiTrans(-5,-7,86,new TGeoRotation("R2",60,0,0)));
125  top->AddNodeOverlap(Noon,1,new TGeoCombiTrans(-5,7,86,new TGeoRotation("R2",-60,0,0)));
126  top->AddNodeOverlap(Tuck,1,new TGeoTranslation(-12,0,62.5));
127  for (int i=0; i<10;i++) {
128  top->AddNodeOverlap(Tuck_1,1,new TGeoCombiTrans(-4.2,11,61+i,new TGeoRotation("R2",90,-20,20)));
129  top->AddNodeOverlap(Tuck_1,1,new TGeoCombiTrans(-4.2,-11,61+i,new TGeoRotation("R2",90,-20,-20)));
130  }
131  top->AddNodeOverlap(Tuck_2,1,new TGeoTranslation(2,-15.1,76));
132  top->AddNodeOverlap(Tuck_2,1,new TGeoTranslation(2,15.1,76));
133  top->AddNodeOverlap(Tuck_j,1,new TGeoTranslation(-13,0,62.5));
134  top->AddNodeOverlap(Ear,1,new TGeoCombiTrans(2,-16.5,80,new TGeoRotation("R2",0,-90,0)));
135  top->AddNodeOverlap(Ear,1,new TGeoCombiTrans(2,16.5,80,new TGeoRotation("R2",0,90,0)));
136  top->AddNodeOverlap(Ear_2,1,new TGeoCombiTrans(2,-20,80,new TGeoRotation("R2",0,-90,0)));
137  top->AddNodeOverlap(Ear_2,1,new TGeoCombiTrans(2,20,80,new TGeoRotation("R2",0,90,0)));
138 
139 
140  for (int i=1; i<28; i+=1) {
141  float a=i*0.2;
142  TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-60-a,60+a);
143  if (i<27) {
144  Hear->SetLineColor(12);
145  Hear->SetFillColor(12);
146  }
147  else {
148  Hear->SetLineColor(2);
149  Hear->SetFillColor(2);
150  }
151  top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
152  }
153  for (int i=1; i<28; i+=1) {
154  float a=i*0.2;
155  TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,-70-a,-60-a);
156  Hear->SetLineColor(2);
157  Hear->SetFillColor(2);
158  top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
159  }
160  for (int i=1; i<28; i+=1) {
161  float a=i*0.2;
162  TGeoVolume *Hear=Robot->MakeCons("Hear",Iron,3,13+a,16+a,13+a,16+a,60+a,70+a);
163  Hear->SetLineColor(2);
164  Hear->SetFillColor(2);
165  top->AddNodeOverlap(Hear,1,new TGeoTranslation(0,0,89-i));
166  }
167 
168  // neck
169  TGeoVolume *Mock=Robot->MakeTrd2("Mock",Iron,1,1,7,6.5,20);
170  Mock->SetLineColor(17);
171  Mock->SetFillColor(17);
172  TGeoVolume *Mock_1=Robot->MakeTrd2("Mock_1",Iron,1,1,6,5,20);
173  Mock_1->SetLineColor(17);
174  Mock_1->SetFillColor(17);
175  TGeoVolume *Mock_s=Robot->MakeTrd2("Mock_s",Iron,1,1,5,4.5,20);
176  Mock_s->SetLineColor(17);
177  Mock_s->SetFillColor(17);
178 
179  // drawing neck
180  top->AddNodeOverlap(Mock,1,new TGeoCombiTrans(-5,4.7,50,new TGeoRotation("R2",-30,0,-10)));
181  top->AddNodeOverlap(Mock,1,new TGeoCombiTrans(-5,-4.7,50,new TGeoRotation("R2",30,0,10)));
182  top->AddNodeOverlap(Mock_1,1,new TGeoCombiTrans(11,-4,50,new TGeoRotation("R2",130,-8,10)));
183  top->AddNodeOverlap(Mock_1,1,new TGeoCombiTrans(11,4,50,new TGeoRotation("R2",-130,8,-10)));
184  top->AddNodeOverlap(Mock_s,1,new TGeoCombiTrans(2.5,9,50,new TGeoRotation("R2",90,0,0)));
185  top->AddNodeOverlap(Mock_s,1,new TGeoCombiTrans(2.5,-9,50,new TGeoRotation("R2",90,0,0)));
186 
187 
188  // chest
189  TGeoVolume *Gasem=Robot->MakeBox("Gasem",Iron,16,50,20);
190  Gasem->SetLineColor(12);
191  Gasem->SetFillColor(12);
192  TGeoVolume *Gasem_b1=Robot->MakeSphere("Gasem_b1",Iron,0,15,0,180,0,360);
193  Gasem_b1->SetLineColor(12);
194  Gasem_b1->SetFillColor(12);
195  TGeoVolume *Gasem_b2=Robot->MakeSphere("Gasem_b2",Iron,0,13,0,180,0,360);
196  Gasem_b2->SetLineColor(12);
197  Gasem_b2->SetFillColor(12);
198  TGeoVolume *Gasem_1=Robot->MakeEltu("Gasem_1",Iron,13,13,20);
199  Gasem_1->SetLineColor(12);
200  Gasem_1->SetFillColor(12);
201  TGeoVolume *Gasem_2=Robot->MakeEltu("Gasem_2",Iron,13,13,19);
202  Gasem_2->SetLineColor(12);
203  Gasem_2->SetFillColor(12);
204  TGeoVolume *Gasem_3=Robot->MakeCone("Gasem_3",Iron,19,0,13,0,15);
205  Gasem_3->SetLineColor(12);
206  Gasem_3->SetFillColor(12);
207  TGeoVolume *Gasem_4=Robot->MakeEltu("Gasem_4",Iron,15,15,16);
208  Gasem_4->SetLineColor(12);
209  Gasem_4->SetFillColor(12);
210  TGeoVolume *Gasem_5=Robot->MakeEltu("Gasem_5",Iron,13,13,16);
211  Gasem_5->SetLineColor(12);
212  Gasem_5->SetFillColor(12);
213  TGeoVolume *Gasem_m1=Robot->MakeBox("Gasem_m1",Iron,19,19,5);
214  Gasem_m1->SetLineColor(12);
215  Gasem_m1->SetFillColor(12);
216  TGeoVolume *Gasem_m2=Robot->MakeTrd2("Gasem_m2",Iron,13,15,2,2,19);
217  Gasem_m2->SetLineColor(12);
218  Gasem_m2->SetFillColor(12);
219  TGeoVolume *V=Robot->MakeTrd2("V",Iron,2,2,22,30,4);
220  V->SetLineColor(2);
221  V->SetFillColor(2);
222  TGeoVolume *V_m=Robot->MakeBox("V_m",Iron,2,7,1);
223  V_m->SetLineColor(2);
224  V_m->SetFillColor(2);
225 
226  // drawing chest
227  top->AddNodeOverlap(Gasem,1,new TGeoTranslation(4,0,19));
228  top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(-12,50,35));
229  top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(-12,-50,35));
230  top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(20,50,35));
231  top->AddNodeOverlap(Gasem_b1,1,new TGeoTranslation(20,-50,35));
232  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,50,-5));
233  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-50,-5));
234  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,50,-5));
235  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-50,-5));
236  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,10,-5));
237  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-10,-5));
238  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,10,-5));
239  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-10,-5));
240  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,10,35));
241  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(20,-10,35));
242  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,10,35));
243  top->AddNodeOverlap(Gasem_b2,1,new TGeoTranslation(-12,-10,35));
244  top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(20,31,-5,new TGeoRotation("R2",0,90,0)));
245  top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(20,-31,-5,new TGeoRotation("R2",0,90,0)));
246  top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(-12,31,-5,new TGeoRotation("R2",0,90,0)));
247  top->AddNodeOverlap(Gasem_1,1,new TGeoCombiTrans(-12,-31,-5,new TGeoRotation("R2",0,90,0)));
248  top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(20,10,13,new TGeoRotation("R2",0,0,0)));
249  top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(20,-10,13,new TGeoRotation("R2",0,0,0)));
250  top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(-12,10,13,new TGeoRotation("R2",0,0,0)));
251  top->AddNodeOverlap(Gasem_2,1,new TGeoCombiTrans(-12,-10,13,new TGeoRotation("R2",0,0,0)));
252  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,50,16,new TGeoRotation("R2",0,0,0)));
253  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,-50,16,new TGeoRotation("R2",0,0,0)));
254  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,50,16,new TGeoRotation("R2",0,0,0)));
255  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,-50,16,new TGeoRotation("R2",0,0,0)));
256  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,31,35,new TGeoRotation("R2",0,-90,0)));
257  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(-12,-31,35,new TGeoRotation("R2",0,90,0)));
258  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,31,35,new TGeoRotation("R2",0,-90,0)));
259  top->AddNodeOverlap(Gasem_3,1,new TGeoCombiTrans(20,-31,35,new TGeoRotation("R2",0,90,0)));
260  top->AddNodeOverlap(Gasem_4,1,new TGeoCombiTrans(4,-50,35,new TGeoRotation("R2",90,90,0)));
261  top->AddNodeOverlap(Gasem_4,1,new TGeoCombiTrans(4,50,35,new TGeoRotation("R2",90,90,0)));
262  top->AddNodeOverlap(Gasem_5,1,new TGeoCombiTrans(4,-50,-5,new TGeoRotation("R2",90,90,0)));
263  top->AddNodeOverlap(Gasem_5,1,new TGeoCombiTrans(4,50,-5,new TGeoRotation("R2",90,90,0)));
264  top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(-22,30,16,new TGeoRotation("R2",90,88,0)));
265  top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(-22,-30,16,new TGeoRotation("R2",90,88,0)));
266  top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(29,30,16,new TGeoRotation("R2",90,92,0)));
267  top->AddNodeOverlap(Gasem_m1,1,new TGeoCombiTrans(29,-30,16,new TGeoRotation("R2",90,92,0)));
268  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-62,16,new TGeoRotation("R2",0,3,0)));
269  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,62,16,new TGeoRotation("R2",0,-3,0)));
270  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-30,47.5,new TGeoRotation("R2",0,87,0)));
271  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,30,47.5,new TGeoRotation("R2",0,-87,0)));
272  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,-30,-16,new TGeoRotation("R2",0,90,0)));
273  top->AddNodeOverlap(Gasem_m2,1,new TGeoCombiTrans(2,30,-16,new TGeoRotation("R2",0,-90,0)));
274  top->AddNodeOverlap(V,1,new TGeoCombiTrans(-30,18.3,16,new TGeoRotation("R2",0,-135,0)));
275  top->AddNodeOverlap(V,1,new TGeoCombiTrans(-30,-18.3,16,new TGeoRotation("R2",0,135,0)));
276  top->AddNodeOverlap(V_m,1,new TGeoTranslation(-30,-37,35));
277  top->AddNodeOverlap(V_m,1,new TGeoTranslation(-30,37,35));
278 
279  // abdomen
280  TGeoVolume *Bea=Robot->MakeEltu("Bea",Iron,20,37,25);
281  Bea->SetLineColor(17);
282  Bea->SetFillColor(17);
283  TGeoVolume *Bea_d=Robot->MakeEltu("Bea_d",Iron,21,36,5);
284  Bea_d->SetLineColor(12);
285  Bea_d->SetFillColor(12);
286  TGeoVolume *Beakop=Robot->MakeEltu("Beakop",Iron,15,25,5);
287  Beakop->SetLineColor(10);
288  Beakop->SetFillColor(10);
289 
290  // drawing abdomen
291  top->AddNodeOverlap(Bea,1,new TGeoTranslation(3,0,-30));
292  top->AddNodeOverlap(Bea_d,1,new TGeoTranslation(3,0,-10));
293  top->AddNodeOverlap(Beakop,1,new TGeoCombiTrans(-12.1,0,-50, new TGeoRotation("R2",90,90,0)));
294 
295  // Gungdi
296  TGeoVolume *Gungdi=Robot->MakeEltu("Gungdi",Iron,25,50,18);
297  Gungdi->SetLineColor(12);
298  Gungdi->SetFillColor(12);
299  TGeoVolume *Gungdi_d=Robot->MakeEltu("Gungdi_d",Iron,5,5,5);
300  Gungdi_d->SetLineColor(2);
301  Gungdi_d->SetFillColor(2);
302 
303  // drawing Gungdi
304  top->AddNodeOverlap(Gungdi,1,new TGeoTranslation(3,0,-70));
305  for (int i=0; i<30; i++) {
306  TGeoVolume *Gungdi_j=Robot->MakeEltu("Gungdi_j",Iron,24-0.2*i,49-0.5*i,1);
307  Gungdi_j->SetLineColor(12);
308  Gungdi_j->SetFillColor(12);
309  top->AddNodeOverlap(Gungdi_j,1,new TGeoTranslation(3,0,-51+0.5*i));
310  }
311  for (int i=0; i<40; i++) {
312  if (i<16) {
313  TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,24-0.1*i,49-0.3*i,1);
314  Gungdi_h->SetLineColor(12);
315  Gungdi_h->SetFillColor(12);
316  top->AddNodeOverlap(Gungdi_h,1,new TGeoTranslation(3,0,-88-0.5*i));
317  }
318  else {
319  TGeoVolume *Gungdi_h=Robot->MakeEltu("Gungdi_h",Iron,27-0.3*i,52-0.5*i,1);
320  Gungdi_h->SetLineColor(12);
321  Gungdi_h->SetFillColor(12);
322  top->AddNodeOverlap(Gungdi_h,1,new TGeoTranslation(3,0,-89-0.5*i));
323  }
324  }
325  top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,-45,-62,new TGeoRotation("R2",0,90,0)));
326  top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,-45,-78,new TGeoRotation("R2",0,90,0)));
327  top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,45,-62,new TGeoRotation("R2",0,90,0)));
328  top->AddNodeOverlap(Gungdi_d,1,new TGeoCombiTrans(3,45,-78,new TGeoRotation("R2",0,90,0)));
329 
330  // feet
331  TGeoVolume *Jang=Robot->MakeEltu("Jang",Iron,18,18,50);
332  Jang->SetLineColor(17);
333  Jang->SetFillColor(17);
334  TGeoVolume *Jong=Robot->MakeEltu("Jong",Iron,22,22,50);
335  Jong->SetLineColor(12);
336  Jong->SetFillColor(12);
337  TGeoVolume *Bal=Robot->MakeSphere("Bal",Iron,0,22,0,180,180,360);
338  Bal->SetLineColor(12);
339  Bal->SetFillColor(12);
340 
341  // drawing Dary
342  top->AddNodeOverlap(Jang,1,new TGeoCombiTrans(3,-25,-120,new TGeoRotation("R2",0,0,0)));
343  top->AddNodeOverlap(Jang,1,new TGeoCombiTrans(3,25,-120,new TGeoRotation("R2",0,0,0)));
344  top->AddNodeOverlap(Jong,1,new TGeoCombiTrans(3,-25,-220,new TGeoRotation("R2",0,0,0)));
345  top->AddNodeOverlap(Jong,1,new TGeoCombiTrans(3,25,-220,new TGeoRotation("R2",0,0,0)));
346  for (int i=0; i<30; i++) {
347  TGeoVolume *Mu=Robot->MakeCons("Mu",Iron,1,0,22.1,0,22.1,120+2*i,-120-2*i);
348  Mu->SetLineColor(4);
349  Mu->SetFillColor(4);
350  top->AddNodeOverlap(Mu,1,new TGeoTranslation(3,-25,-171-i));
351  top->AddNodeOverlap(Mu,1,new TGeoTranslation(3,25,-171-i));
352 
353  }
354  top->AddNodeOverlap(Bal,1,new TGeoCombiTrans(-10,-25,-270,new TGeoRotation("R2",270,-90,0)));
355  top->AddNodeOverlap(Bal,1,new TGeoCombiTrans(-10,25,-270,new TGeoRotation("R2",270,-90,0)));
356 
357  // arms
358  TGeoVolume *S=Robot->MakeSphere("S",Iron,0,25,0,180,180,360);
359  S->SetLineColor(17);
360  S->SetFillColor(17);
361  TGeoVolume *S_1=Robot->MakeSphere("S_1",Iron,0,15,0,180,0,360);
362  S_1->SetLineColor(17);
363  S_1->SetFillColor(17);
364  TGeoVolume *Pal=Robot->MakeEltu("Pal",Iron,15,15,30);
365  Pal->SetLineColor(17);
366  Pal->SetFillColor(17);
367  TGeoVolume *Fal=Robot->MakeEltu("Fal",Iron,17,17,30);
368  Fal->SetLineColor(4);
369  Fal->SetFillColor(4);
370  TGeoVolume *Bbul=Robot->MakeCone("Bbul",Iron,8,0,0,0,5);
371  Bbul->SetLineColor(17);
372  Bbul->SetFillColor(17);
373 
374  // drawing arms
375  top->AddNodeOverlap(S,1,new TGeoCombiTrans(3,73,30,new TGeoRotation("R2",0,-30,0)));
376  top->AddNodeOverlap(S,1,new TGeoCombiTrans(3,-73,30,new TGeoRotation("R2",0,210,0)));
377  top->AddNodeOverlap(S_1,1,new TGeoCombiTrans(3,-73,27,new TGeoRotation("R2",0,0,0)));
378  top->AddNodeOverlap(S_1,1,new TGeoCombiTrans(3,73,27,new TGeoRotation("R2",0,0,0)));
379  top->AddNodeOverlap(Pal,1,new TGeoCombiTrans(3,-73,-5,new TGeoRotation("R2",0,0,0)));
380  top->AddNodeOverlap(Pal,1,new TGeoCombiTrans(3,73,-5,new TGeoRotation("R2",0,0,0)));
381  top->AddNodeOverlap(Fal,1,new TGeoCombiTrans(3,-73,-60,new TGeoRotation("R2",0,0,0)));
382  top->AddNodeOverlap(Fal,1,new TGeoCombiTrans(3,73,-60,new TGeoRotation("R2",0,0,0)));
383  top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,-97,-72,new TGeoRotation("R2",0,-90,0)));
384  top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,-97,-48,new TGeoRotation("R2",0,-90,0)));
385  top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,97,-72,new TGeoRotation("R2",0,90,0)));
386  top->AddNodeOverlap(Bbul,1,new TGeoCombiTrans(3,97,-48,new TGeoRotation("R2",0,90,0)));
387 
388  // hands
389  TGeoVolume *Son_d=Robot->MakeBox("Son_d",Iron,15,15,7);
390  Son_d->SetLineColor(4);
391  Son_d->SetFillColor(4);
392  TGeoVolume *Son_g=Robot->MakeBox("Son_g",Iron,4,10,4);
393  Son_g->SetLineColor(4);
394  Son_g->SetFillColor(4);
395  TGeoVolume *Son_g1=Robot->MakeBox("Son_g1",Iron,6,6,6);
396  Son_g1->SetLineColor(4);
397  Son_g1->SetFillColor(4);
398  TGeoVolume *Son_g2=Robot->MakeBox("Son_g2",Iron,8,3,3);
399  Son_g2->SetLineColor(4);
400  Son_g2->SetFillColor(4);
401  TGeoVolume *Last_b=Robot->MakeCone("Last_b",Iron,10,0,0,0,4);
402  Last_b->SetLineColor(17);
403  Last_b->SetFillColor(17);
404  TGeoVolume *Last=Robot->MakeSphere("Last",Iron,0,3,0,180,0,360);
405  Last->SetLineColor(2);
406  Last->SetFillColor(2);
407 
408  //drawing hands
409  top->AddNodeOverlap(Son_d,1,new TGeoCombiTrans(3,-80,-105,new TGeoRotation("R2",0,90,0)));
410  for (int i=0; i<4; i++) {
411  top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,-72,-118,new TGeoRotation("R2",0,-10,0)));
412  }
413  for (int i=0; i<4; i++) {
414  top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,-67,-113,new TGeoRotation("R2",0,110,0)));
415  }
416  top->AddNodeOverlap(Son_g1,1,new TGeoCombiTrans(-5,-70,-98,new TGeoRotation("R2",0,0,0)));
417  top->AddNodeOverlap(Son_g2,1,new TGeoCombiTrans(-5,-65,-102,new TGeoRotation("R2",0,60,0)));
418  top->AddNodeOverlap(Son_d,1,new TGeoCombiTrans(3,80,-105,new TGeoRotation("R2",0,90,0)));
419  for (int i=0; i<4; i++) {
420  top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,72,-118,new TGeoRotation("R2",0,10,0)));
421  }
422  for (int i=0; i<4; i++) {
423  top->AddNodeOverlap(Son_g,1,new TGeoCombiTrans(-6+6*i,67,-113,new TGeoRotation("R2",0,70,0)));
424  }
425  top->AddNodeOverlap(Son_g1,1,new TGeoCombiTrans(-5,70,-98,new TGeoRotation("R2",0,0,0)));
426  top->AddNodeOverlap(Son_g2,1,new TGeoCombiTrans(-5,65,-102,new TGeoRotation("R2",0,60,0)));
427  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(3,-88,-103,new TGeoRotation("R2",0,180,0)));
428  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(12,-88,-103,new TGeoRotation("R2",0,180,0)));
429  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(-7,-88,-103,new TGeoRotation("R2",0,180,0)));
430  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(3,88,-103,new TGeoRotation("R2",0,180,0)));
431  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(12,88,-103,new TGeoRotation("R2",0,180,0)));
432  top->AddNodeOverlap(Last_b,1,new TGeoCombiTrans(-7,88,-103,new TGeoRotation("R2",0,180,0)));
433  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(3,-88,-112,new TGeoRotation("R2",0,180,0)));
434  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(12,-88,-112,new TGeoRotation("R2",0,180,0)));
435  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(-7,-88,-112,new TGeoRotation("R2",0,180,0)));
436  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(3,88,-112,new TGeoRotation("R2",0,180,0)));
437  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(12,88,-112,new TGeoRotation("R2",0,180,0)));
438  top->AddNodeOverlap(Last,1,new TGeoCombiTrans(-7,88,-112,new TGeoRotation("R2",0,180,0)));
439 
440 for (int i=1; i<20; i+=1) {
441  if (i<7) {
442  TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,3,20/sin(i),21/sin(i),20/sin(i),21/sin(i),0,70);
443  Effect->SetLineColor(9);
444  Effect->SetFillColor(9);
445  top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
446  }
447  if (6<i && i<10) {
448  TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,5,20/sin(i),21/sin(i),20/sin(i),21/sin(i),50,120);
449  Effect->SetLineColor(38);
450  Effect->SetFillColor(38);
451  top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
452  }
453  if (9<i && i<20) {
454  TGeoVolume *Effect=Robot->MakeCons("Effect",Iron,4,20/sin(i),21/sin(i),20/sin(i),21/sin(i),200,330);
455  Effect->SetLineColor(33);
456  Effect->SetFillColor(33);
457  top->AddNodeOverlap(Effect,1,new TGeoTranslation(3,0,-280));
458  }
459 }
460 
461 
462  //close geometry
463  top->SetVisibility(0);
464  Robot->CloseGeometry();
465 
466  // in GL viewer
467  top->Draw("ogl");
468 }
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:61
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void Draw(Option_t *option="")
draw top volume according to option
Class describing translations.
Definition: TGeoMatrix.h:131
#define N
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
Base class describing materials.
Definition: TGeoMaterial.h:35
TArc * a
Definition: textangle.C:12
double cos(double)
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
double sin(double)
RooArgSet S(const RooAbsArg &v1)
Class describing rotation + translation.
Definition: TGeoMatrix.h:285
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:42
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
Class describing rotations.
Definition: TGeoMatrix.h:180
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:25
virtual void SetLineColor(Color_t lcolor)
Set the line color.
char name[80]
Definition: TGX11.cxx:109