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