Logo ROOT  
Reference Guide
mp3player.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_geom
3/// Drawing a mp3 type music player, 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 mp3player.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_image
14/// \macro_code
15///
16/// \author Eun Young Kim, Dept. of Physics, Univ. of Seoul
17
18#include "TCanvas.h"
19#include "TPaveText.h"
20#include "TImage.h"
21#include "TLine.h"
22#include "TLatex.h"
23#include "TButton.h"
24#include "TGeoManager.h"
25
26void mp3player()
27{
28
29 TGeoManager *geom=new TGeoManager("geom","My first 3D geometry");
30
31
32
33 //materials
34 TGeoMaterial *vacuum=new TGeoMaterial("vacuum",0,0,0);
35 TGeoMaterial *Fe=new TGeoMaterial("Fe",55.845,26,7.87);
36
37 //create media
38
39 TGeoMedium *Iron=new TGeoMedium("Iron",1,Fe);
40 TGeoMedium *Air=new TGeoMedium("Vacuum",0,vacuum);
41
42
43 //create volume
44
45 TGeoVolume *top=geom->MakeBox("top",Air,800,800,800);
46 geom->SetTopVolume(top);
47 geom->SetTopVisible(0);
48 // If you want to see the boundary, please input the number, 1 instead of 0.
49 // Like this, geom->SetTopVisible(1);
50
51
52
53 TGeoVolume *b1=geom->MakeBox("b1",Iron,100,200,600);
54 b1->SetLineColor(2);
55
56
57 TGeoVolume *b2=geom->MakeTubs("b2",Iron,0,50,200,0,90);
58 b2->SetLineColor(10);
59
60
61 TGeoVolume *b3=geom->MakeTubs("b3",Iron,0,50,200,90,180);
62 b3->SetLineColor(10);
63
64
65 TGeoVolume *b4=geom->MakeTubs("b4",Iron,0,50,200,180,270);
66 b4->SetLineColor(10);
67
68 TGeoVolume *b5=geom->MakeTubs("b5",Iron,0,50,200,270,360);
69 b5->SetLineColor(10);
70
71
72 TGeoVolume *b6=geom->MakeTubs("b6",Iron,0,50,600,0,90);
73 b6->SetLineColor(10);
74
75 TGeoVolume *b7=geom->MakeTubs("b7",Iron,0,50,600,90,180);
76 b7->SetLineColor(10);
77
78 TGeoVolume *b8=geom->MakeTubs("b8",Iron,0,50,600,180,270);
79 b8->SetLineColor(10);
80
81 TGeoVolume *b9=geom->MakeTubs("b9",Iron,0,50,600,270,360);
82 b9->SetLineColor(10);
83
84
85
86 TGeoVolume *b10=geom->MakeTubs("b10",Iron,0,50,100,0,90);
87 b10->SetLineColor(10);
88
89 TGeoVolume *b11=geom->MakeTubs("b11",Iron,0,50,100,90,180);
90 b11->SetLineColor(10);
91
92 TGeoVolume *b12=geom->MakeTubs("b12",Iron,0,50,100,180,270);
93 b12->SetLineColor(10);
94
95 TGeoVolume *b13=geom->MakeTubs("b13",Iron,0,50,100,270,360);
96 b13->SetLineColor(10);
97
98
99 TGeoVolume *b14=geom->MakeBox("b14",Iron,100,50,450);
100 b14->SetLineColor(10);
101 TGeoVolume *b15=geom->MakeBox("b15",Iron,50,200,600);
102 b15->SetLineColor(10);
103
104
105
106 TGeoVolume *b16=geom->MakeSphere("b16",Iron,0,50,0,90,0,90);
107 b16->SetLineColor(10);
108
109 TGeoVolume *b17=geom->MakeSphere("b17",Iron,0,50,0,90,270,360);
110 b17->SetLineColor(10);
111
112 TGeoVolume *b18=geom->MakeSphere("b18",Iron,0,50,0,90,180,270);
113 b18->SetLineColor(10);
114
115 TGeoVolume *b19=geom->MakeSphere("b19",Iron,0,50,0,90,90,180);
116 b19->SetLineColor(10);
117
118
119 TGeoVolume *b20=geom->MakeTube("b20",Iron,50,150,150);
120 b20->SetLineColor(17);
121
122
123
124 TGeoVolume *b21=geom->MakeSphere("b21",Iron,0,50,90,180,0,90);
125 b21->SetLineColor(10);
126
127 TGeoVolume *b22=geom->MakeSphere("b22",Iron,0,50,90,180,270,360);
128 b22->SetLineColor(10);
129
130 TGeoVolume *b23=geom->MakeSphere("b23",Iron,0,50,90,180,180,270);
131 b23->SetLineColor(10);
132
133 TGeoVolume *b24=geom->MakeSphere("b24",Iron,0,50,90,180,90,180);
134 b24->SetLineColor(10);
135
136
137
138 TGeoVolume *b25=geom->MakeTube("b25",Iron,51,54,150);
139 b25->SetLineColor(17);
140 TGeoVolume *b26=geom->MakeTube("b26",Iron,56,59,150);
141 b26->SetLineColor(17);
142 TGeoVolume *b27=geom->MakeTube("b27",Iron,61,64,150);
143 b27->SetLineColor(17);
144 TGeoVolume *b28=geom->MakeTube("b28",Iron,66,69,150);
145 b28->SetLineColor(17);
146 TGeoVolume *b29=geom->MakeTube("b29",Iron,71,74,150);
147 b29->SetLineColor(17);
148
149 TGeoVolume *b30=geom->MakeTube("b30",Iron,76,79,150);
150 b30->SetLineColor(17);
151 TGeoVolume *b31=geom->MakeTube("b31",Iron,81,84,150);
152 b31->SetLineColor(17);
153 TGeoVolume *b32=geom->MakeTube("b32",Iron,86,89,150);
154 b32->SetLineColor(17);
155 TGeoVolume *b33=geom->MakeTube("b33",Iron,91,94,150);
156 b33->SetLineColor(17);
157 TGeoVolume *b34=geom->MakeTube("b34",Iron,96,99,150);
158 b34->SetLineColor(17);
159 TGeoVolume *b35=geom->MakeTube("b35",Iron,101,104,150);
160 b35->SetLineColor(17);
161 TGeoVolume *b36=geom->MakeTube("b36",Iron,106,109,150);
162 b36->SetLineColor(17);
163 TGeoVolume *b37=geom->MakeTube("b37",Iron,111,114,150);
164 b37->SetLineColor(17);
165 TGeoVolume *b38=geom->MakeTube("b38",Iron,116,119,150);
166 b38->SetLineColor(17);
167 TGeoVolume *b39=geom->MakeTube("b39",Iron,121,124,150);
168 b39->SetLineColor(17);
169 TGeoVolume *b40=geom->MakeTube("b40",Iron,126,129,150);
170 b40->SetLineColor(17);
171 TGeoVolume *b41=geom->MakeTube("b41",Iron,131,134,150);
172 b41->SetLineColor(17);
173 TGeoVolume *b42=geom->MakeTube("b42",Iron,136,139,150);
174 b42->SetLineColor(17);
175 TGeoVolume *b43=geom->MakeTube("b43",Iron,141,144,150);
176 b43->SetLineColor(17);
177 TGeoVolume *b44=geom->MakeTube("b44",Iron,146,149,150);
178 b44->SetLineColor(17);
179
180
181 TGeoVolume *b45=geom->MakeTube("b45",Iron,0,25,150);
182 b45->SetLineColor(10);
183
184 TGeoVolume *b46=geom->MakeTube("b46",Iron,25,30,150);
185 b46->SetLineColor(17);
186
187
188
189 TGeoVolume *b47=geom->MakeBox("b47",Iron,140,194,504);
190 b47->SetLineColor(32);
191
192
193 TGeoVolume *b48=geom->MakeBox("b48",Iron,150,176,236);
194 b48->SetLineColor(37);
195
196
197 TGeoVolume *b49=geom->MakeBox("b49",Iron,150,2,236);
198 b49->SetLineColor(20);
199 top->AddNodeOverlap(b49,49,new TGeoTranslation(-2,179,-150));
200
201 TGeoVolume *b50=geom->MakeBox("b50",Iron,150,2,236);
202 b50->SetLineColor(20);
203 top->AddNodeOverlap(b50,50,new TGeoTranslation(-2,-179,-150));
204
205 TGeoVolume *b51=geom->MakeBox("b51",Iron,150,176,2);
206 b51->SetLineColor(20);
207 top->AddNodeOverlap(b51,51,new TGeoTranslation(-2,0,89));
208
209 TGeoVolume *b52=geom->MakeBox("b52",Iron,150,176,2);
210 b52->SetLineColor(20);
211 top->AddNodeOverlap(b52,52,new TGeoTranslation(-2,0,-389));
212
213
214 TGeoVolume *b53=geom->MakeBox("b53",Iron,150,200,90);
215 b53->SetLineColor(10);
216 top->AddNodeOverlap(b53,53,new TGeoTranslation(0,0,-510));
217
218
219
220
221
222 TGeoVolume *b54=geom->MakeBox("b54",Iron,15,254,600);
223 b54->SetLineColor(37);
224 top->AddNodeOverlap(b54,54,new TGeoTranslation(25,0,0));
225
226 TGeoVolume *b55=geom->MakeTubs("b55",Iron,0,54,15,270,360);
227 b55->SetLineColor(37);
228 top->AddNodeOverlap(b55,55,new TGeoCombiTrans(25,200,-600,new TGeoRotation("r1",90,90,0)));
229
230
231 TGeoVolume *b56=geom->MakeTubs("b56",Iron,0,54,15,180,270);
232 b56->SetLineColor(37);
233 top->AddNodeOverlap(b56,56,new TGeoCombiTrans(25,-200,-600,new TGeoRotation("r1",90,90,0)));
234
235
236 TGeoVolume *b57=geom->MakeTubs("b57",Iron,0,54,15,0,90);
237 b57->SetLineColor(37);
238 top->AddNodeOverlap(b57,57,new TGeoCombiTrans(25,200,600,new TGeoRotation("r1",90,90,0)));
239
240 TGeoVolume *b58=geom->MakeTubs("b58",Iron,0,54,15,90,180);
241 b58->SetLineColor(37);
242 top->AddNodeOverlap(b58,58,new TGeoCombiTrans(25,-200,600,new TGeoRotation("r1",90,90,0)));
243
244 //TGeoVolume *b59=geom->MakePgon("b59",Iron,100,100,100,100);
245 //b59->SetLineColor(37);
246 //top->AddNodeOverlap(b59,59,new TGeoCombiTrans(200,200,100,new TGeoRotation("r1",90,90,0)));
247
248
249
250//IAudid
251
252
253
254 TGeoVolume *b61=geom->MakeBox("b61",Iron,5,19,150);
255 b61->SetLineColor(38);
256 top->AddNodeOverlap(b61,61,new TGeoCombiTrans(-4,-87,-495,new TGeoRotation("r1",90,90,30)));
257
258 TGeoVolume *b62=geom->MakeBox("b62",Iron,5,19,150);
259 b62->SetLineColor(38);
260 top->AddNodeOverlap(b62,62,new TGeoCombiTrans(-4,-65,-495,new TGeoRotation("r1",90,90,330)));
261//u
262 TGeoVolume *b63=geom->MakeBox("b63",Iron,5,15,150);
263 b63->SetLineColor(38);
264 top->AddNodeOverlap(b63,63,new TGeoCombiTrans(-4,-40,-497,new TGeoRotation("r1",90,90,0)));
265
266 TGeoVolume *b64=geom->MakeBox("b64",Iron,5,15,150);
267 b64->SetLineColor(38);
268 top->AddNodeOverlap(b64,64,new TGeoCombiTrans(-4,-10,-497,new TGeoRotation("r1",90,90,0)));
269
270 TGeoVolume *b65=geom->MakeTubs("b65",Iron,7,17,150,0,180);
271 b65->SetLineColor(38);
272 top->AddNodeOverlap(b65,65,new TGeoCombiTrans(-4,-25,-490,new TGeoRotation("r1",90,90,0)));
273
274
275//D
276
277 TGeoVolume *b66=geom->MakeBox("b66",Iron,5,19,150);
278 b66->SetLineColor(38);
279 top->AddNodeOverlap(b66,66,new TGeoCombiTrans(-4,10,-495,new TGeoRotation("r1",90,90,0)));
280
281
282 TGeoVolume *b67=geom->MakeTubs("b67",Iron,10,20,150,230,480);
283 b67->SetLineColor(38);
284 top->AddNodeOverlap(b67,67,new TGeoCombiTrans(-4,23,-495,new TGeoRotation("r1",90,90,0)));
285
286//I
287
288 TGeoVolume *b68=geom->MakeBox("b68",Iron,5,20,150);
289 b68->SetLineColor(38);
290 top->AddNodeOverlap(b68,68,new TGeoCombiTrans(-4,53,-495,new TGeoRotation("r1",90,90,0)));
291
292//O
293
294 TGeoVolume *b69=geom->MakeTubs("b69",Iron,10,22,150,0,360);
295 b69->SetLineColor(38);
296 top->AddNodeOverlap(b69,69,new TGeoCombiTrans(-4,85,-495,new TGeoRotation("r1",90,90,0)));
297
298
299// I
300 TGeoVolume *b60=geom->MakeTube("b60",Iron,0,10,150);
301 b60->SetLineColor(38);
302 top->AddNodeOverlap(b60,60,new TGeoCombiTrans(-4,-120,-550,new TGeoRotation("r1",90,90,0)));
303
304
305 TGeoVolume *b70=geom->MakeBox("b70",Iron,2,19,150);
306 b70->SetLineColor(38);
307 top->AddNodeOverlap(b70,70,new TGeoCombiTrans(-4,-114,-495,new TGeoRotation("r1",90,90,0)));
308
309 TGeoVolume *b71=geom->MakeBox("b71",Iron,2,19,150);
310 b71->SetLineColor(38);
311 top->AddNodeOverlap(b71,71,new TGeoCombiTrans(-4,-126,-495,new TGeoRotation("r1",90,90,0)));
312
313
314 TGeoVolume *b72=geom->MakeBox("b72",Iron,8,2,150);
315 b72->SetLineColor(38);
316 top->AddNodeOverlap(b72,72,new TGeoCombiTrans(-4,-120,-515,new TGeoRotation("r1",90,90,0)));
317
318
319 TGeoVolume *b73=geom->MakeBox("b73",Iron,8,2,150);
320 b73->SetLineColor(38);
321 top->AddNodeOverlap(b73,73,new TGeoCombiTrans(-4,-120,-475,new TGeoRotation("r1",90,90,0)));
322
323
324// button
325
326
327 TGeoVolume *b74=geom->MakeBox("b74",Iron,35,250,70);
328 b74->SetLineColor(38);
329 top->AddNodeOverlap(b74,74,new TGeoCombiTrans(-25,10,-60,new TGeoRotation("r1",0,0,0)));
330
331 TGeoVolume *b75=geom->MakeBox("b75",Iron,35,250,35);
332 b75->SetLineColor(38);
333 top->AddNodeOverlap(b75,75,new TGeoCombiTrans(-25,10,-175,new TGeoRotation("r1",0,0,0)));
334
335
336 TGeoVolume *b76=geom->MakeBox("b76",Iron,35,250,35);
337 b76->SetLineColor(38);
338 top->AddNodeOverlap(b76,76,new TGeoCombiTrans(-25,10,55,new TGeoRotation("r1",0,0,0)));
339
340
341 TGeoVolume *b77=geom->MakeTubs("b77",Iron,0,70,250,180,270);
342 b77->SetLineColor(38);
343 top->AddNodeOverlap(b77,77,new TGeoCombiTrans(10,10,-210,new TGeoRotation("r1",0,90,0)));
344
345
346 TGeoVolume *b78=geom->MakeTubs("b78",Iron,0,70,250,90,180);
347 b78->SetLineColor(38);
348 top->AddNodeOverlap(b78,78,new TGeoCombiTrans(10,10,90,new TGeoRotation("r1",0,90,0)));
349
350
351
352//Hold
353
354 TGeoVolume *b79=geom->MakeBox("b79",Iron,40,250,150);
355 b79->SetLineColor(10);
356 top->AddNodeOverlap(b79,79,new TGeoCombiTrans(60,0,450,new TGeoRotation("r1",0,0,0)));
357
358 TGeoVolume *b80=geom->MakeTubs("b80",Iron,50,100,250,180,270);
359 b80->SetLineColor(10);
360 top->AddNodeOverlap(b80,80,new TGeoCombiTrans(10,0,350,new TGeoRotation("r1",0,90,0)));
361
362
363 TGeoVolume *b81=geom->MakeTubs("b81",Iron,50,100,250,90,180);
364 b81->SetLineColor(10);
365 top->AddNodeOverlap(b81,81,new TGeoCombiTrans(10,0,400,new TGeoRotation("r1",0,90,0)));
366
367
368 TGeoVolume *b82=geom->MakeBox("b82",Iron,30,250,150);
369 b82->SetLineColor(10);
370 top->AddNodeOverlap(b82,82,new TGeoCombiTrans(-70,0,450,new TGeoRotation("r1",0,0,0)));
371
372
373 TGeoVolume *b83=geom->MakeBox("b83",Iron,30,250,60);
374 b83->SetLineColor(10);
375 top->AddNodeOverlap(b83,83,new TGeoCombiTrans(-20,0,540,new TGeoRotation("r1",0,0,0)));
376
377
378
379
380 TGeoVolume *b85=geom->MakeTubs("b85",Iron,0,40,240,180,270);
381 b85->SetLineColor(38);
382 top->AddNodeOverlap(b85,85,new TGeoCombiTrans(10,10,370,new TGeoRotation("r1",0,90,0)));
383
384
385
386
387 TGeoVolume *b84=geom->MakeTubs("b84",Iron,0,40,240,90,180);
388 b84->SetLineColor(38);
389 top->AddNodeOverlap(b84,84,new TGeoCombiTrans(10,10,400,new TGeoRotation("r1",0,90,0)));
390
391
392 TGeoVolume *b86=geom->MakeBox("b86",Iron,20,240,20);
393 b86->SetLineColor(38);
394 top->AddNodeOverlap(b86,86,new TGeoCombiTrans(-10,10,380,new TGeoRotation("r1",0,0,0)));
395
396
397 TGeoVolume *b87=geom->MakeBox("b87",Iron,20,250,10);
398 b87->SetLineColor(35);
399 top->AddNodeOverlap(b87,87,new TGeoCombiTrans(-10,20,385,new TGeoRotation("r1",0,0,0)));
400
401
402 TGeoVolume *b88=geom->MakeBox("b88",Iron,100,220,600);
403 b88->SetLineColor(10);
404 top->AddNodeOverlap(b88,88,new TGeoCombiTrans(0,-30,0,new TGeoRotation("r1",0,0,0)));
405
406
407 TGeoVolume *b89=geom->MakeTube("b89",Iron,25,95,650);
408 b89->SetLineColor(10);
409 top->AddNodeOverlap(b89,89,new TGeoCombiTrans(0,-60,0,new TGeoRotation("r1",0,0,0)));
410
411 TGeoVolume *b90=geom->MakeTube("b90",Iron,25,95,650);
412 b90->SetLineColor(10);
413 top->AddNodeOverlap(b90,90,new TGeoCombiTrans(0,60,0,new TGeoRotation("r1",0,0,0)));
414
415
416 TGeoVolume *b91=geom->MakeBox("b91",Iron,40,200,650);
417 b91->SetLineColor(10);
418 top->AddNodeOverlap(b91,91,new TGeoCombiTrans(70,0,0,new TGeoRotation("r1",0,0,0)));
419
420 TGeoVolume *b92=geom->MakeBox("b92",Iron,100,50,650);
421 b92->SetLineColor(10);
422 top->AddNodeOverlap(b92,92,new TGeoCombiTrans(0,150,0,new TGeoRotation("r1",0,0,0)));
423
424 TGeoVolume *b93=geom->MakeBox("b93",Iron,100,50,650);
425 b93->SetLineColor(10);
426 top->AddNodeOverlap(b93,93,new TGeoCombiTrans(0,-150,0,new TGeoRotation("r1",0,0,0)));
427
428
429 TGeoVolume *b94=geom->MakeBox("b94",Iron,40,200,650);
430 b94->SetLineColor(10);
431 top->AddNodeOverlap(b94,94,new TGeoCombiTrans(-70,0,0,new TGeoRotation("r1",0,0,0)));
432
433
434 TGeoVolume *b95=geom->MakeTube("b95",Iron,25,35,650);
435 b95->SetLineColor(1);
436 top->AddNodeOverlap(b95,95,new TGeoCombiTrans(0,-60,-10,new TGeoRotation("r1",0,0,0)));
437
438 TGeoVolume *b96=geom->MakeTube("b96",Iron,25,35,650);
439 b96->SetLineColor(1);
440 top->AddNodeOverlap(b96,96,new TGeoCombiTrans(0,60,-10,new TGeoRotation("r1",0,0,0)));
441//usb
442
443 TGeoVolume *b97=geom->MakeBox("b97",Iron,70,70,600);
444 b97->SetLineColor(17);
445 top->AddNodeOverlap(b97,97,new TGeoCombiTrans(0,0,57,new TGeoRotation("r1",0,0,0)));
446
447
448 TGeoVolume *b98=geom->MakeTubs("b98",Iron,0,50,600,0,90);
449 b98->SetLineColor(17);
450 top->AddNodeOverlap(b98,98,new TGeoCombiTrans(20,60,57,new TGeoRotation("r1",0,0,0)));
451
452 TGeoVolume *b99=geom->MakeTubs("b99",Iron,0,50,600,180,270);
453 b99->SetLineColor(17);
454 top->AddNodeOverlap(b99,99,new TGeoCombiTrans(-20,-60,57,new TGeoRotation("r1",0,0,0)));
455
456
457 TGeoVolume *b100=geom->MakeTubs("b100",Iron,0,50,600,90,180);
458 b100->SetLineColor(17);
459 top->AddNodeOverlap(b100,100,new TGeoCombiTrans(-20,60,57,new TGeoRotation("r1",0,0,0)));
460
461
462 TGeoVolume *b101=geom->MakeTubs("b101",Iron,0,50,600,270,360);
463 b101->SetLineColor(17);
464 top->AddNodeOverlap(b101,101,new TGeoCombiTrans(20,-60,57,new TGeoRotation("r1",0,0,0)));
465
466 TGeoVolume *b102=geom->MakeBox("b102",Iron,20,110,600);
467 b102->SetLineColor(17);
468 top->AddNodeOverlap(b102,102,new TGeoCombiTrans(0,0,57,new TGeoRotation("r1",0,0,0)));
469
470
471 TGeoVolume *b103=geom->MakeBox("b103",Iron,15,200,600);
472 b103->SetLineColor(37);
473 top->AddNodeOverlap(b103,103,new TGeoCombiTrans(25,0,57,new TGeoRotation("r1",0,0,0)));
474//AddNode
475 top->AddNodeOverlap(b1,1,new TGeoTranslation(0,0,0));
476 top->AddNodeOverlap(b2,2,new TGeoCombiTrans(100,0,600,new TGeoRotation("r1",0,90,0)));
477 top->AddNodeOverlap(b3,3,new TGeoCombiTrans(-100,0,600,new TGeoRotation("r1",0,90,0)));
478 top->AddNodeOverlap(b4,4,new TGeoCombiTrans(-100,0,-600,new TGeoRotation("r1",0,90,0)));
479 top->AddNodeOverlap(b5,5,new TGeoCombiTrans(100,0,-600,new TGeoRotation("r1",0,90,0)));
480 top->AddNodeOverlap(b6,6,new TGeoCombiTrans(100,200,0,new TGeoRotation("r1",0,0,0)));
481 top->AddNodeOverlap(b7,7,new TGeoCombiTrans(-100,200,0,new TGeoRotation("r1",0,0,0)));
482 top->AddNodeOverlap(b8,8,new TGeoCombiTrans(-100,-200,0,new TGeoRotation("r1",0,0,0)));
483 top->AddNodeOverlap(b9,9,new TGeoCombiTrans(100,-200,0,new TGeoRotation("r1",0,0,0)));
484
485 top->AddNodeOverlap(b10,10,new TGeoCombiTrans(0,200,600,new TGeoRotation("r2",90,90,0)));
486 top->AddNodeOverlap(b11,11,new TGeoCombiTrans(0,-200,600,new TGeoRotation("r2",90,90,0)));
487 top->AddNodeOverlap(b12,12,new TGeoCombiTrans(0,-200,-600, new TGeoRotation("r2",90,90,0)));
488 top->AddNodeOverlap(b13,13,new TGeoCombiTrans(0,200,-600,new TGeoRotation("r2",90,90,0)));
489 top->AddNodeOverlap(b14,14,new TGeoTranslation(0,200,-150));
490 top->AddNodeOverlap(b15,15,new TGeoTranslation(100,0,0));
491
492 top->AddNodeOverlap(b16,16,new TGeoCombiTrans(100,200,600,new TGeoRotation("r2",0,0,0)));
493 top->AddNodeOverlap(b17,17,new TGeoCombiTrans(100,-200,600,new TGeoRotation("r2",0,0,0)));
494 top->AddNodeOverlap(b18,18,new TGeoCombiTrans(-100,-200,600,new TGeoRotation("r2",0,0,0)));
495 top->AddNodeOverlap(b19,19,new TGeoCombiTrans(-100,200,600,new TGeoRotation("r2",0,0,0)));
496 top->AddNodeOverlap(b20,20,new TGeoCombiTrans(-3,0,350,new TGeoRotation("r2",90,90,0)));
497 top->AddNodeOverlap(b21,21,new TGeoCombiTrans(100,200,-600,new TGeoRotation("r2",0,0,0)));
498 top->AddNodeOverlap(b22,22,new TGeoCombiTrans(100,-200,-600,new TGeoRotation("r2",0,0,0)));
499 top->AddNodeOverlap(b23,23,new TGeoCombiTrans(-100,-200,-600,new TGeoRotation("r2",0,0,0)));
500 top->AddNodeOverlap(b24,24,new TGeoCombiTrans(-100,200,-600,new TGeoRotation("r2",0,0,0)));
501
502
503
504 top->AddNodeOverlap(b25,25,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
505 top->AddNodeOverlap(b26,26,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
506 top->AddNodeOverlap(b27,27,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
507 top->AddNodeOverlap(b28,28,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
508 top->AddNodeOverlap(b29,29,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
509 top->AddNodeOverlap(b30,30,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
510 top->AddNodeOverlap(b31,31,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
511 top->AddNodeOverlap(b32,32,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
512 top->AddNodeOverlap(b33,33,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
513 top->AddNodeOverlap(b34,34,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
514 top->AddNodeOverlap(b35,35,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
515 top->AddNodeOverlap(b36,36,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
516 top->AddNodeOverlap(b37,37,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
517 top->AddNodeOverlap(b38,38,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
518 top->AddNodeOverlap(b39,39,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
519 top->AddNodeOverlap(b40,40,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
520 top->AddNodeOverlap(b41,41,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
521 top->AddNodeOverlap(b42,42,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
522 top->AddNodeOverlap(b43,43,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
523 top->AddNodeOverlap(b44,44,new TGeoCombiTrans(-9,0,350,new TGeoRotation("r2",90,90,0)));
524
525
526 top->AddNodeOverlap(b45,45,new TGeoCombiTrans(-20,0,350,new TGeoRotation("r2",90,90,0)));
527 top->AddNodeOverlap(b46,46,new TGeoCombiTrans(-25,0,350,new TGeoRotation("r2",90,90,0)));
528
529 top->AddNodeOverlap(b47,47,new TGeoTranslation(5,0,85));
530 top->AddNodeOverlap(b48,48,new TGeoTranslation(-2,0,-150));
531 geom->CloseGeometry();
532
533
534
535 TCanvas *can=new TCanvas("can","My virtual laboratory",800,800);
536
537
538//Mp3
539 TPad *pad=new TPad("pad","Pad",0,0.5,0.5,1);
540 pad->SetFillColor(1);
541 pad->Draw();
542 pad->cd();
543 top->Draw();
544//Sound
545 can->cd();
546 TPad *pad2=new TPad("pad2","Pad2",0.5,0.5,1,1);
547 pad2->SetFillColor(10);
548 pad2->Draw();
549 pad2->cd();
550
551
552 TPaveText *pt = new TPaveText(0.4,0.90,0.6,0.95,"br");
553 pt->SetFillColor(30);
554 pt->AddText(0.5,0.5,"Musics");
555 pt->Draw();
556
557 TLatex Tex;
558
559 Tex.SetTextSize(0.04);
560 Tex.SetTextColor(31);
561 Tex.DrawLatex(0.3,0.81,"Mariah Carey - Shake it off");
562
563 Tex.SetTextSize(0.04);
564 Tex.SetTextColor(31);
565 Tex.DrawLatex(0.3,0.71,"Alicia keys - If I ain't got you");
566
567 Tex.SetTextSize(0.04);
568 Tex.SetTextColor(31);
569 Tex.DrawLatex(0.3,0.61,"Michael Jackson - Billie Jean");
570
571 Tex.SetTextSize(0.04);
572 Tex.SetTextColor(31);
573 Tex.DrawLatex(0.3,0.51,"Christina Milian - Am to Pm");
574
575 Tex.SetTextSize(0.04);
576 Tex.SetTextColor(31);
577 Tex.DrawLatex(0.3,0.41,"Zapp&Roger - Slow and Easy");
578
579 Tex.SetTextSize(0.04);
580 Tex.SetTextColor(31);
581 Tex.DrawLatex(0.3,0.31,"Black Eyes Peas - Let's get retarded");
582
583 Tex.SetTextSize(0.04);
584 Tex.SetTextColor(31);
585 Tex.DrawLatex(0.3,0.21,"Bosson - One in a Millin");
586
587 Tex.SetTextSize(0.04);
588 Tex.SetTextColor(15);
589 Tex.DrawLatex(0.2,0.11,"Click Button!! You Can Listen to Musics");
590 TButton *but1=new TButton("","Sound(1)",0.2,0.8,0.25,0.85);
591 but1->Draw();
592 but1->SetFillColor(29);
593 TButton *but2=new TButton("","Sound(2)",0.2,0.7,0.25,.75);
594 but2->Draw();
595 but2->SetFillColor(29);
596 TButton *but3=new TButton("","Sound(3)",0.2,0.6,0.25,0.65);
597 but3->Draw();
598 but3->SetFillColor(29);
599 TButton *but4=new TButton("","Sound(4)",0.2,0.5,0.25,0.55);
600 but4->Draw();
601 but4->SetFillColor(29);
602 TButton *but5=new TButton("","Sound(5)",0.2,0.4,0.25,0.45);
603 but5->Draw();
604 but5->SetFillColor(29);
605 TButton *but6=new TButton("","Sound(6)",0.2,0.3,0.25,0.35);
606 but6->Draw();
607 but6->SetFillColor(29);
608 TButton *but7=new TButton("","Sound(7)",0.2,0.2,0.25,0.25);
609 but7->Draw();
610 but7->SetFillColor(29);
611
612 pad->cd();
613
614//introduction
615 can->cd();
616
617 TPad *pad3=new TPad("pad3","Pad3",0,0,1,0.5);
618 pad3->SetFillColor(10);
619 pad3->Draw();
620 pad3->cd();
621
622 //TImage *image=TImage::Open("mp3.jpg");
623 //image->Draw();
624
625
626
627 TPad *pad4=new TPad("pad4","Pad4",0.6,0.1,0.9,0.9);
628 pad4->SetFillColor(1);
629 pad4->Draw();
630 pad4->cd();
631
632
633 TLine L;
634
635 Tex.SetTextSize(0.08);
636 Tex.SetTextColor(10);
637 Tex.DrawLatex(0.06,0.85,"IAudio U3 Mp3 Player");
638
639
640 L.SetLineColor(10);
641 L.SetLineWidth(3);
642 L.DrawLine(0.05, 0.83,0.90, 0.83);
643
644 Tex.SetTextSize(0.06);
645 Tex.SetTextColor(10);
646 Tex.DrawLatex(0.06,0.75,"+ Color LCD");
647
648 Tex.SetTextSize(0.06);
649 Tex.SetTextColor(10);
650 Tex.DrawLatex(0.06,0.65,"+ 60mW High Generating Power");
651
652 Tex.SetTextSize(0.06);
653 Tex.SetTextColor(10);
654 Tex.DrawLatex(0.06,0.55,"+ GUI Theme Skin");
655
656 Tex.SetTextSize(0.06);
657 Tex.SetTextColor(10);
658 Tex.DrawLatex(0.06,0.45,"+ Noble White&Black");
659
660 Tex.SetTextSize(0.06);
661 Tex.SetTextColor(10);
662 Tex.DrawLatex(0.06,0.35,"+ Text Viewer+Image Viewer");
663
664 Tex.SetTextSize(0.06);
665 Tex.SetTextColor(10);
666 Tex.DrawLatex(0.06,0.25,"+ 20 Hours Playing");
667
668 Tex.SetTextSize(0.06);
669 Tex.SetTextColor(10);
670 Tex.DrawLatex(0.06,0.15,"+ The Best Quality of Sound");
671
672
673 pad->cd();
674
675
676
677}
678
679void Sound(int i)
680{
681 char sound[128];
682 sprintf(sound,"cat sound%d.wav > /dev/audio",i);
683 gSystem->Exec(sound);
684}
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition: TAttText.h:44
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:47
A TButton object is a user interface object.
Definition: TButton.h:18
virtual void Draw(Option_t *option="")
Draw this button with its current attributes.
Definition: TButton.cxx:139
The Canvas class.
Definition: TCanvas.h:23
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Definition: TCanvas.cxx:706
Class describing rotation + translation.
Definition: TGeoMatrix.h:292
The manager class for any TGeo geometry.
Definition: TGeoManager.h:45
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
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 * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment 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 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.
To draw Mathematical Formula.
Definition: TLatex.h:18
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
Definition: TLatex.cxx:1941
Use the TLine constructor to create a simple line.
Definition: TLine.h:22
The most important graphics class in the ROOT system.
Definition: TPad.h:26
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Definition: TPad.cxx:604
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
Definition: TPad.cxx:1300
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:183
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:234
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:656
TPaveText * pt
static constexpr double L