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