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