ATLAS Offline Software
Loading...
Searching...
No Matches
VisAttributes.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8#include <Inventor/nodes/SoMaterial.h>
9#include <iostream>
10#include <map>
11#include <QBuffer>
12
14
16public:
17 // The material map is here:
18 std::map< std::string, SoMaterial *> _map;
19
20 QMap<QString,QByteArray> currentState() const;
21 QMap<QString,QByteArray> initialState;
22
23};
24
25//____________________________________________________________________
27{
28 m_d->initialState = m_d->currentState();
29}
30
31//____________________________________________________________________
32QByteArray VisAttributes::getState(bool onlyChangedMaterials)
33{
34 //Figure out states to store
35 QMap<QString,QByteArray> storedstates, statesnow = m_d->currentState();
36 if (onlyChangedMaterials) {
37 QMap<QString,QByteArray>::const_iterator it, itE(statesnow.constEnd());
38 QMap<QString,QByteArray>::const_iterator itOrig, itOrigE(m_d->initialState.constEnd());
39 for (it = statesnow.constBegin(); it!=itE; ++it) {
40 itOrig = m_d->initialState.constFind(it.key());
41 if (itOrig==itOrigE||it.value()!=itOrig.value())
42 storedstates.insert(it.key(),it.value());
43 }
44 } else {
45 storedstates = statesnow;
46 }
47
48 //Put map in bytearray and return:
49 QByteArray byteArray;
50 QBuffer buffer(&byteArray);
51 buffer.open(QIODevice::WriteOnly);
52 QDataStream out(&buffer);
53 out << qint32(0);//version
54 out << storedstates;
55 buffer.close();
56 return byteArray;
57
58}
59
60//____________________________________________________________________
61void VisAttributes::applyState(QByteArray ba)
62{
63 //Get map out:
64 QMap<QString,QByteArray> storedstates;
65 QBuffer buffer(&ba);
66 buffer.open(QIODevice::ReadOnly);
67 QDataStream state(&buffer);
68 qint32 version;
69 state >> version;
70 if (version!=0)
71 return;//ignore silently
72 state >> storedstates;
73 buffer.close();
74
75 std::map< std::string, SoMaterial *>::iterator itMat,itMatE(m_d->_map.end());
76
77 //Apply states from map:
78 QMap<QString,QByteArray>::const_iterator it, itE(storedstates.constEnd());
79 for (it = storedstates.constBegin(); it!=itE; ++it) {
80 itMat = m_d->_map.find(it.key().toStdString());
81 if (itMat!=itMatE) {
82 QByteArray b(it.value());
84 }
85 }
86
87}
88
89//____________________________________________________________________
90QMap<QString,QByteArray> VisAttributes::Imp::currentState() const
91{
92 QMap<QString,QByteArray> outmap;
93 std::map< std::string, SoMaterial *>::const_iterator it(_map.begin()), itE(_map.end());
94 for (;it!=itE;++it)
95 outmap.insert(QString(it->first.c_str()),VP1QtInventorUtils::serialiseSoMaterial(it->second));
96 return outmap;
97}
98
99//____________________________________________________________________
102
103//____________________________________________________________________
105
106 std::map<std::string, SoMaterial *>::iterator m,e=m_d->_map.end();
107 for (m=m_d->_map.begin();m!=e;++m)
108 (*m).second->unref();
109
110 delete m_d;
111}
112
113SoMaterial *VisAttributes::get (const std::string & name) const {
114 std::map <std::string, SoMaterial *>::const_iterator m = m_d->_map.find(name);
115 if (m!=m_d->_map.end()) {
116 return (*m).second;
117 } else {
118 return NULL;
119 }
120}
121
122void VisAttributes::add(const std::string & name, SoMaterial *material) {
123 if (m_d->_map.find(name)!=m_d->_map.end()) {
124 std::cout<<"VisAttributes::add ERROR: Material " <<name<<" already added!"<<std::endl;
125 return;
126 }
127 material->ref();
128 m_d->_map[name]=material;
129 if (material->transparency.getNum()!=1)
130 std::cout<<"VisAttributes::add Warning: Found #transparency values different from 1 in material "<<name<<std::endl;
131 // FIXME. Commented out, because Ric and I are not sure why this is an issue
132 // We may want to add this back if this turns out to indicate a real problem
133 // if (material->transparency[0]!=0.0)
134 // std::cout<<"VisAttributes::add Warning: Found transparency value different from 0 in material "<<name<<std::endl;
135}
136
138{
139 std::map< std::string, SoMaterial *>::iterator it, itE = m_d->_map.end();
140 for (it=m_d->_map.begin();it!=itE;++it)
141 it->second->transparency.set1Value( 0, transpfact );
142}
143
145{
146 return rgb/255.0;
147}
148
149void VisAttributes::setColorFromRGB(SoMaterial* mat, const std::string& type, const int r, const int g, const int b)
150{
151 const float fr = getValFromRGB(r);
152 const float fg = getValFromRGB(g);
153 const float fb = getValFromRGB(b);
154 if (type == "ambient")
155 mat->ambientColor.setValue(fr, fg, fb);
156 else if (type == "diffuse")
157 mat->diffuseColor.setValue(fr, fg, fb);
158 else if (type == "specular")
159 mat->specularColor.setValue(fr, fg, fb);
160 else if (type == "emissive")
161 mat->emissiveColor.setValue(fr, fg, fb);
162 else
163 std::cout << "ERROR! Color type not supported ==> " << type << std::endl;
164
165 // Debug Msg
166 //std::cout << "Set color (" << r << "," << g << "," << b << ") to (" << fr << "," << fg << "," << fb << ")" << std::endl;
167 return;
168}
169
170
172
174 {
175 SoMaterial *material = new SoMaterial;
176 material->ambientColor.setValue(0.18, 0.08, 0.20);
177 material->diffuseColor.setValue(0.72, 0.30, 0.78);
178 material->specularColor.setValue(0.9, 0.9, 0.9);
179 material->shininess.setValue(0.4);
180 add("HGTD", material);
181 }
182 {
183 SoMaterial *material = new SoMaterial;
184 material->ambientColor.setValue(0, .157811, .187004);
185 material->diffuseColor.setValue(0, .631244, .748016);
186 material->specularColor.setValue(.915152, .915152, .915152);
187 material->shininess.setValue(0.642424);
188 add("Pixel",material);
189 }
190
191 {
192 SoMaterial *material = new SoMaterial;
193 material->ambientColor.setValue(0, .157811, .187004);
194 material->diffuseColor.setValue(0, .631244, .748016);
195 material->specularColor.setValue(.915152, .915152, .915152);
196 material->shininess.setValue(0.642424);
197 add("ITkPixel",material);
198 }
199
200 {
201 SoMaterial *material = new SoMaterial;
202 material->ambientColor.setValue(0, .157811, .187004);
203 material->diffuseColor.setValue(.40, .631244, .748016);
204 material->specularColor.setValue(.915152, .915152, .915152);
205 material->shininess.setValue(0.642424);
206 add("Tile",material);
207 }
208
209 {
210 SoMaterial *material = new SoMaterial;
211 material->ambientColor.setValue(0, .157811, .187004);
212 material->diffuseColor.setValue(1, .8, .7);
213 material->specularColor.setValue(.915152, .915152, .915152);
214 material->shininess.setValue(0.642424);
215 add("BeamPipe",material);
216 }
217
218 {
219 SoMaterial *material = new SoMaterial;
220 material->ambientColor.setValue(0, .6, .6);
221 material->diffuseColor.setValue(1, .8, .7);
222 material->specularColor.setValue(.91515, .915152, .915152);
223 material->shininess.setValue(0.642424);
224 add("CavernInfra",material);
225 }
226
227 {
228 SoMaterial *material = new SoMaterial;
229 material->ambientColor.setValue(0.2, 0.2, 0.2);
230 material->diffuseColor.setValue(0, 0.6667, 1.0);
231 material->specularColor.setValue(0,0,0);
232 // material->shininess.setValue(0.642424);
233// material->ambientColor.setValue(0, .157811, .187004);
234// material->diffuseColor.setValue(1, 0, 0);
235// material->specularColor.setValue(.915152, .915152, .915152);
236// material->shininess.setValue(0.642424);
237
238 add("Muon",material);
239
240 {
241 SoMaterial *material = new SoMaterial;
242 material->ambientColor.setValue(0, .157811, .187004);
243 material->diffuseColor.setValue(.98, .8, .21);
244 material->specularColor.setValue(.915152, .915152, .915152);
245 material->shininess.setValue(0.2);
246 add("CSC",material);
247 }
248
249 {
250 SoMaterial *material = new SoMaterial;
251 material->ambientColor.setValue(0, .157811, .187004);
252 material->diffuseColor.setValue(0, .9, .5);
253 material->specularColor.setValue(.915152, .915152, .915152);
254 material->shininess.setValue(0.2);
255 add("EndcapMdt",material);
256 }
257
258 {
259 SoMaterial *material = new SoMaterial;
260 material->ambientColor.setValue(0,0,0);
261 material->diffuseColor.setValue(0.41,0,0.26);
262 material->specularColor.setValue(0,0,0);
263 material->shininess.setValue(0.2);
264 add("TGC",material);
265 }
266
267 {
268 SoMaterial *material = new SoMaterial;
269
270 material->ambientColor.setValue(0.2, 0.2, 0.2);
271 material->diffuseColor.setValue(0, 0.6667, 1.0);
272 material->specularColor.setValue(0,0,0);
273// material->ambientColor.setValue(0, .157811, .187004);
274// material->diffuseColor.setValue(1, .2, .7);
275// material->specularColor.setValue(.915152, .915152, .915152);
276 material->shininess.setValue(0.2);
277
278
279 add("BarrelInner",material);
280 add("BarrelMiddle",material);
281 add("BarrelOuter",material);
282 }
283
284 {
285 SoMaterial *material = new SoMaterial;
286 material->ambientColor.setValue(0, .157811, .187004);
287 material->diffuseColor.setValue(1, .5, .5);
288 material->specularColor.setValue(.915152, .915152, .915152);
289 material->shininess.setValue(0.2);
290 add("BarrelToroid",material);
291 add("EndcapToroid",material);
292 }
293
294 {
295 SoMaterial *material = new SoMaterial;
296 material->ambientColor.setValue(0, .157811, .187004);
297 material->diffuseColor.setValue(.5, .5, 1.0);
298 material->specularColor.setValue(.915152, .915152, .915152);
299 material->shininess.setValue(0.2);
300 add("Feet",material);
301 }
302 }
303
304 {
305 SoMaterial *material = new SoMaterial;
306 material->ambientColor.setValue(.37, .69, 1.00);
307 material->diffuseColor.setValue(.21, .64, 1.00);
308 material->specularColor.setValue(1, 1, 1);
309 material->shininess.setValue(1.0);
310 add("SCT",material);
311 }
312
313 {
314 SoMaterial *material = new SoMaterial;
315 material->ambientColor.setValue(.37, .69, 1.00);
316 material->diffuseColor.setValue(.21, .64, 1.00);
317 material->specularColor.setValue(1, 1, 1);
318 material->shininess.setValue(1.0);
319 add("ITkStrip",material);
320 }
321
322 {
323 SoMaterial *material = new SoMaterial;
324 add("LAr",material);
325 add("LArBarrel",material);
326 add("LArEndcapPos",material);
327 add("LArEndcapNeg",material);
328 }
329
330 {
331 SoMaterial *material = new SoMaterial;
332 add("TRT",material);
333 }
334
335 {
336 SoMaterial *material = new SoMaterial;
337 add("InDetServMat",material);
338 material->diffuseColor.setValue(0.4,0.31,0);
339 material->shininess.setValue(1.0);
340 }
341
342 {
343 SoMaterial *material = new SoMaterial();
344 add("LucidSideA",material);
345 add("LucidSideC",material);
346 material->diffuseColor.setValue(0.6,0.11,0.3);
347 material->shininess.setValue(1.0);
348 }
349
350 {
351 SoMaterial *material = new SoMaterial;
352 material->ambientColor.setValue(0, .157811, .187004);
353 material->diffuseColor.setValue(0., 0., 0.56862745);
354 material->specularColor.setValue(.915152, .915152, .915152);
355 material->shininess.setValue(0.2);
356 add("Zdc",material);
357 }
358
359
360 // {
361 // SoMaterial *material = new SoMaterial();
362 // add("LcdXXX",material);
363 // add("LcdYYY",material);
364 // material->diffuseColor.setValue(0.6,0.11,0.3);
365 // material->shininess.setValue(1.0);
366 // }
367
368 init();
369}
370
372
374 {
375 //NB: Must be here!!
376 SoMaterial *m = new SoMaterial;
377 add("DEFAULT",m);
378 }
379
380
381
382 /*
383 * ETHER MATERIAL
384 * This transparent material was used to hide the "fakeVolume" added by AGDD,
385 * but there are other "standard" volumes, which use "Ether" material, for example in CSC chambers.
386 * So we do not use this workaround anymore...
387 {
388 //
389 // Ether: ---> it's a special "totally transparent" material, made to hide the "fakeVol" volume used in GeoModel to cope with the G4GeoAssembly objects in G4
390 // more details:
391 // - https://its.cern.ch/jira/browse/ATLASVPONE-166
392 // - https://svnweb.cern.ch/trac/atlasoff/browser/DetectorDescription/AGDD/AGDDControl/trunk/src/AGDD2GeoModelBuilder.cxx?rev=648789#L502
393 //
394 SoMaterial *m = new SoMaterial;
395 m->ambientColor.setValue(0.2, 0.2, 0.2);
396 m->diffuseColor.setValue(0.58, 0.47, 0.81);
397 m->specularColor.setValue(0.56, 0.55, 0.56);
398 m->transparency.setValue(1.0); // --> TOTALLY TRANSPARENT!!! (set it to < 1.0 (e.g. 0.5) if you want to see the "fakeVol" cylinder in GeoModel)
399 add("Ether",m);
400 }
401 */
402 // HGTD materials
403 {
404 SoMaterial *m = new SoMaterial;
405 setColorFromRGB(m, "diffuse", 70, 190, 255);
406 setColorFromRGB(m, "ambient", 0, 30, 50);
407 setColorFromRGB(m, "specular", 255, 255, 255);
408 setColorFromRGB(m, "emissive", 20, 40, 60);
409 m->shininess.setValue(0.45);
410 add("Silicon_Ma", m);
411 }
412
413 {
414 SoMaterial *m = new SoMaterial;
415 setColorFromRGB(m, "diffuse", 245, 160, 70);
416 setColorFromRGB(m, "ambient", 60, 30, 0);
417 setColorFromRGB(m, "specular", 255, 220, 180);
418 m->shininess.setValue(0.35);
419 add("CuKapton", m);
420 }
421
422 {
423 SoMaterial *m = new SoMaterial;
424 setColorFromRGB(m, "diffuse", 255, 220, 120);
425 setColorFromRGB(m, "ambient", 70, 60, 20);
426 m->shininess.setValue(0.20);
427 add("Epoxy", m);
428 }
429
430 {
431 SoMaterial *m = new SoMaterial;
432 setColorFromRGB(m, "diffuse", 155, 160, 170);
433 setColorFromRGB(m, "ambient", 45, 50, 60);
434 setColorFromRGB(m, "specular", 235, 235, 235);
435 m->shininess.setValue(0.50);
436 add("Aluminium_Ma", m);
437 }
438
439 {
440 SoMaterial *m = new SoMaterial;
441 setColorFromRGB(m, "diffuse", 185, 190, 200);
442 setColorFromRGB(m, "ambient", 55, 60, 70);
443 setColorFromRGB(m, "specular", 245, 245, 245);
444 m->shininess.setValue(0.60);
445 add("Titanium_Ma", m);
446 }
447
448 {
449 SoMaterial *m = new SoMaterial;
450 setColorFromRGB(m, "diffuse", 90, 230, 255);
451 setColorFromRGB(m, "ambient", 0, 40, 55);
452 setColorFromRGB(m, "emissive", 0, 35, 45);
453 m->transparency.setValue(0.45);
454 add("CO2CoolantMix", m);
455 }
456
457 {
458 SoMaterial *m = new SoMaterial;
459 setColorFromRGB(m, "diffuse", 110, 115, 120);
460 setColorFromRGB(m, "ambient", 35, 40, 45);
461 setColorFromRGB(m, "specular", 210, 210, 210);
462 m->shininess.setValue(0.30);
463 add("CFiberSupport", m);
464 add("CFRP", m);
465 }
466
467 {
468 SoMaterial *m = new SoMaterial;
469 setColorFromRGB(m, "diffuse", 170, 210, 140);
470 setColorFromRGB(m, "ambient", 40, 55, 30);
471 add("FEBoards", m);
472 add("PowerBlock_Ma", m);
473 }
474
475 {
476 SoMaterial *m = new SoMaterial;
477 setColorFromRGB(m, "diffuse", 130, 200, 215);
478 setColorFromRGB(m, "ambient", 20, 45, 50);
479 m->transparency.setValue(0.25);
480 add("Peek", m);
481 add("AerogelAndHoneycomb", m);
482 add("BoratedPolyethelyne", m);
483 }
484
485 {
486 SoMaterial *m = new SoMaterial;
487 setColorFromRGB(m, "diffuse", 125, 130, 140);
488 setColorFromRGB(m, "ambient", 35, 40, 45);
489 setColorFromRGB(m, "specular", 200, 200, 200);
490 m->shininess.setValue(0.35);
491 add("SSteel", m);
492 }
493 {
494 // C02:
495 SoMaterial *m = new SoMaterial;
496 m->ambientColor.setValue(0.2, 0.2, 0.2);
497 m->diffuseColor.setValue(0.58, 0.47, 0.81);
498 m->specularColor.setValue(0.56, 0.55, 0.56);
499 add("CO2",m);
500 add("ArCO2",m);
501 add("trt::CO2",m);
502 }
503
504 {
505 // Silicon
506 SoMaterial *m = new SoMaterial;
507 m->ambientColor.setValue(0.98, 0.82, 0.02);
508 m->diffuseColor.setValue(0.16, 0.26, 0.36);
509 m->specularColor.setValue(0.56, 0.55, 0.56);
510 m->shininess.setValue(0.13);
511 add("Silicon",m);
512 add("std::Silicon",m);
513 }
514
515 {
516 // Kapton
517 SoMaterial *m = new SoMaterial;
518 m->ambientColor.setValue(0.2, 0.127931, 0.177402);
519 m->diffuseColor.setValue( 0.57665, 0.155139, 0.180815);
520 m->specularColor.setValue(0.441667, 0.441667, 0.441667);
521 m->shininess.setValue(0.67);
522 add("Kapton",m);
523 add("std::Kapton",m);
524 add("KaptonC",m); //used by LAr.
525 add("FCalCableHarness",m); //used by LAr.
526 }
527
528 {
529 // Aluminium
530 SoMaterial *m = new SoMaterial;
531 m->ambientColor.setValue (0.70, 0.72, 0.72);
532 m->diffuseColor.setValue (0.56, 0.57, 0.57);
533 m->specularColor.setValue(0.71, 0.48, 0.46);
534 m->shininess.setValue(0.23);
535 add("Aluminium",m);
536 add("std::Aluminium",m);
537 }
538
539 {
540 // Iron
541 SoMaterial *m = new SoMaterial;
542 m->diffuseColor.setValue (0.1, 0.1, 0.1);
543 m->specularColor.setValue(0.92, 0.92, 0.89);
544 m->shininess.setValue(0.60);
545 add("Iron",m);
546 add("std::Iron",m);
547 }
548
549 {
550 // Tungsten
551 SoMaterial *m = new SoMaterial;
552 m->diffuseColor.setValue (0.14, 0.14, 0.14);
553 m->specularColor.setValue(0.84, 0.94, 1.00);
554 m->shininess.setValue(0.20);
555 add("Tungsten",m);
556 add("Wolfram",m);
557 add("FCal23Absorber",m);
558 }
559 {
560 // Lead
561 SoMaterial *m = new SoMaterial;
562 m->ambientColor.setValue (0.05, .05, 0.7);
563 m->diffuseColor.setValue (0.39, 0.36, 0.47);
564 m->specularColor.setValue(0.33, 0.33, 0.35);
565 m->shininess.setValue(0.30);
566 add("Lead",m);
567 add("Thinabs",m);
568 add("Thickabs",m);
569 }
570
571 {
572 // G10
573 SoMaterial *m = new SoMaterial;
574 m->diffuseColor.setValue (0.308764, 0.314286, 0.142384);
575 m->specularColor.setValue(0.268276, 0.315312, 0.308455);
576 m->shininess.setValue(0.617021);
577 add("G10",m);
578
579 }
580
581 {
582 // Muon Scintillator
583 SoMaterial *m = new SoMaterial;
584 m->diffuseColor.setValue (0.381944, 0.748016, 0);
585 m->specularColor.setValue(0.963636, 0.963636, 0.963636);
586 m->shininess.setValue(0.981818);
587 add("Scintillator",m);
588 }
589
590 {
591 // Tile Glue
592 SoMaterial *m = new SoMaterial;
593 setColorFromRGB(m, "diffuse", 102, 161, 191); // a pale azure
594 setColorFromRGB(m, "ambient", 0, 40, 47); // a dark blue
595 setColorFromRGB(m, "specular", 234,234, 234); // a light grey
596 m->shininess.setValue(0.64);
597 add( "Glue",m);
598 }
599
600 {
601 // Tile Scintillator
602 SoMaterial *m = new SoMaterial;
603 setColorFromRGB(m, "diffuse", 97, 191, 0); // a bright green
604 setColorFromRGB(m, "ambient", 51, 51, 51); // a dark grey
605 setColorFromRGB(m, "specular", 246, 246, 246); // almost white
606 m->shininess.setValue(0.98);
607 add("tile::Scintillator",m);
608 }
609 {
610 // Epoxy
611 SoMaterial *m = new SoMaterial;
612 m->diffuseColor.setValue (0, 0.748016, 0.176015);
613 m->specularColor.setValue(0.981818, 0.981818, 0.981818);
614 m->shininess.setValue(0.721212);
615 add("Epoxy",m);
616 }
617
618 {
619 // Stainless steel
620 SoMaterial *m = new SoMaterial;
621 m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
622 m->specularColor.setValue(0.168, 0.168, 0.168);
623 m->shininess.setValue(0.153696);
624 add("Stainless",m);
625 }
626 {
627 // Liquid Argon
628 SoMaterial *m = new SoMaterial;
629 m->ambientColor.setValue (0.05, .05, .06);
630 m->diffuseColor.setValue (0.39, .36, .48);
631 m->specularColor.setValue(0.33, .33, .35);
632 m->emissiveColor.setValue(0.45, .60, .60);
633 m->shininess.setValue(0.3);
634 add("LiquidArgon",m);
635 add("std::LiquidArgon",m);
636 }
637 {
638 // Copper
639 SoMaterial *m = new SoMaterial;
640 m->ambientColor.setValue (0.0, 0.0, 0.0);
641 m->diffuseColor.setValue (1.0, .43, .36);
642 m->specularColor.setValue(1.0, 1.0, 1.0);
643 m->shininess.setValue(0.4);
644 add("Copper",m);
645 add("FCal1Absorber",m);
646 }
647
648 {
649 // Cables
650 SoMaterial *m = new SoMaterial;
651 m->diffuseColor.setValue (1.0, 0, 0);
652 add("Cables",m);
653 }
654
655 {
656 // MBoards
657 SoMaterial *m = new SoMaterial;
658 m->diffuseColor.setValue (0, 1, 0);
659 add("MBoards",m);
660 }
661
662 {
663 // Carbon
664 SoMaterial *m = new SoMaterial;
665 m->diffuseColor.setValue (0.2, 0.2, 0.2);
666 m->ambientColor.setValue (0.07, 0.07, 0.07);
667 m->specularColor.setValue (0.8, 0.8, 0.8);
668 m->emissiveColor.setValue (0.028, 0.028, 0.028);
669 add("Carbon",m);
670 }
671
672 {
673 //Titanium
674 SoMaterial *m = new SoMaterial;
675 m->diffuseColor.setValue (0.62, 0.62, 0.62);
676 m->specularColor.setValue (0.294, 0.294, 0.294);
677 m->shininess.setValue(.20);
678 add("Titanium",m);
679 }
680
681 {
682 //ECServices
683 SoMaterial *m = new SoMaterial;
684 m->diffuseColor.setValue (0.7, 0.7, 0.7);
685 m->specularColor.setValue (0.5, 0.5, 0.5);
686 add("ECServices",m);
687 }
688
689 {
690 //ECCables
691 SoMaterial *m = new SoMaterial;
692 m->diffuseColor.setValue (0.1, 0.1, 0.1);
693 add("ECCables",m);
694 }
695
696 {
697 //Services
698 SoMaterial *m = new SoMaterial;
699 m->diffuseColor.setValue (0.765, 0.718, 0.541);
700 m->specularColor.setValue (0.5, 0.5, 0.5);
701 add("Services",m);
702 }
703
704 {
705 //MatOmega
706 SoMaterial *m = new SoMaterial;
707 m->diffuseColor.setValue (0.22, 0.22, 0.22);
708 add("MatOmega",m);
709 add("pix::Omega_BL",m);
710 add("pix::Omega_L1",m);
711 add("pix::Omega_L2",m);
712 }
713
714 {
715 //MatConn
716 SoMaterial *m = new SoMaterial;
717 m->diffuseColor.setValue (0, 0, 0);
718 m->specularColor.setValue (0.8, 0.8, 0.8);
719 add("MatConn",m);
720 add("pix::Connector_BL",m);
721 add("pix::Connector_L1",m);
722 add("pix::Connector_L2",m);
723 }
724
725 {
726 //MatPigtail
727 SoMaterial *m = new SoMaterial;
728 m->diffuseColor.setValue (0.95, 0.58, 0.13);
729 m->specularColor.setValue (0.8, 0.75, 0.7);
730 m->shininess.setValue(.30);
731 add("MatPigtail",m);
732 }
733
734 {
735 // MatAlTube
736 SoMaterial *m = new SoMaterial;
737 m->ambientColor.setValue (0.70, 0.72, 0.72);
738 m->diffuseColor.setValue (0.56, 0.57, 0.57);
739 m->specularColor.setValue(0.71, 0.48, 0.46);
740 m->shininess.setValue(0.23);
741 add("MatAlTube",m);
742 add("pix::AlTube_BL",m);
743 add("pix::AlTube_L1",m);
744 add("pix::AlTube_L2",m);
745 add("MatAlTubeFix",m);
746 }
747
748 {
749 //MatT0 (Cable)
750 SoMaterial *m = new SoMaterial;
751 m->diffuseColor.setValue (0.06, 0.06, 0.06);
752 m->specularColor.setValue (0.8, 0.8, 0.8);
753 add("MatT0",m);
754 add("Cable",m);
755 }
756
757 {
758 //MatCap1
759 SoMaterial *m = new SoMaterial;
760 m->diffuseColor.setValue (0, 0, 0.2);
761 add("MatCap1",m);
762 }
763
764 {
765 //MatCap2
766 SoMaterial *m = new SoMaterial;
767 m->diffuseColor.setValue (0, 0, 0.27);
768 add("MatCap2",m);
769 }
770
771 {
772 //MatTMT
773 SoMaterial *m = new SoMaterial;
774 m->diffuseColor.setValue (0.42, 0.42, 0.42);
775 add("MatTMT",m);
776 add("pix::AsTMT_BL",m);
777 add("pix::AsTMT_L1",m);
778 add("pix::AsTMT_L2",m);
779 }
780
781 {
782 //MatGlue
783 SoMaterial *m = new SoMaterial;
784 m->diffuseColor.setValue (1, 1, 0.78);
785 add("MatGlue",m);
786 add("pix::GlueOmegaStave_BL0",m);
787 add("pix::GlueOmegaStave_L10",m);
788 add("pix::GlueOmegaStave_L20",m);
789 add("OmegaGlue_IBL",m);
790 }
791
792 {
793 //Glue
794 SoMaterial *m = new SoMaterial;
795 m->diffuseColor.setValue (1, 1, 0.75);
796 add("pix::GlueOmegaStave_BL1",m);
797 add("pix::GlueOmegaStave_L11",m);
798 add("pix::GlueOmegaStave_L21",m);
799 }
800
801 {
802 //MatPP11
803 SoMaterial *m = new SoMaterial;
804 m->diffuseColor.setValue (0.08, 0.03, 0.03);
805 add("MatPP11",m);
806 }
807
808 {
809 //MatPP12
810 SoMaterial *m = new SoMaterial;
811 m->diffuseColor.setValue (0.325, 0.292, 0.257);
812 add("MatPP12",m);
813 }
814
815 {
816 //MatPP13
817 SoMaterial *m = new SoMaterial;
818 m->diffuseColor.setValue (0.42, 0.38, 0.30);
819 m->emissiveColor.setValue (0.028, 0.028, 0.028);
820 add("MatPP13",m);
821 }
822
823 {
824 //MatPP14
825 SoMaterial *m = new SoMaterial;
826 m->diffuseColor.setValue (0.3, 0.3, 0.3);
827 m->emissiveColor.setValue (0.028, 0.028, 0.028);
828 add("MatPP14",m);
829 }
830
831 {
832 //MatPP15
833 SoMaterial *m = new SoMaterial;
834 m->diffuseColor.setValue (0.2, 0.2, 0.23);
835 m->emissiveColor.setValue (0.028, 0.028, 0.028);
836 add("MatPP15",m);
837 }
838
839 {
840 //MatPP16
841 SoMaterial *m = new SoMaterial;
842 m->diffuseColor.setValue (0.4, 0.4, 0.4);
843 m->emissiveColor.setValue (0.028, 0.028, 0.028);
844 add("MatPP16",m);
845 }
846
847 {
848 //MatPP17
849 SoMaterial *m = new SoMaterial;
850 m->diffuseColor.setValue (0.17, 0.19, 0.16);
851 m->emissiveColor.setValue (0.028, 0.028, 0.028);
852 add("MatPP17",m);
853 }
854
855 {
856 //Disk
857 SoMaterial *m = new SoMaterial;
858 m->diffuseColor.setValue (0.5, 0.5, 0.5);
859 m->specularColor.setValue (0.5, 0.5, 0.5);
860 m->emissiveColor.setValue (0.028, 0.028, 0.028);
861 add("Disk",m);
862 }
863
864 {
865 //Hybrid
866 SoMaterial *m = new SoMaterial;
867 m->diffuseColor.setValue (0.15, 0.33, 0);
868 m->specularColor.setValue (0.39, 0.39, 0.39);
869 m->emissiveColor.setValue (0.028, 0.028, 0.028);
870 m->shininess.setValue(.60);
871 add("Hybrid",m);
872 add("pix::Hybrid",m);
873 }
874
875 {
876 //Chip
877 SoMaterial *m = new SoMaterial;
878 m->diffuseColor.setValue (0.8, 0.51, 0.105);
879 m->specularColor.setValue (0.39, 0.39, 0.39);
880 m->emissiveColor.setValue (0.028, 0.028, 0.028);
881 m->shininess.setValue(.60);
882 add("Chip",m);
883 add("pix::Chip",m);
884 }
885
886
887 {
888 SoMaterial *m = new SoMaterial;
889 m->diffuseColor.setValue (0.42, 0.42, 0.42);
890 add("pix:AsTMT_BL",m);
891 }
892
893 {
894 SoMaterial *m = new SoMaterial;
895 m->diffuseColor.setValue (0.95, 0.52, 0.12);
896 m->specularColor.setValue (0.8, 0.75, 0.7);
897 m->shininess.setValue(.30);
898 add("pix::PigtailCyl",m);
899 add("pix::PigtailFlat",m);
900 }
901
902 {
903 // Rings and Service Support
904 SoMaterial *m = new SoMaterial;
905 m->ambientColor.setValue (0.50, 0.49, 0.12);
906 m->diffuseColor.setValue (0.665, 0.618, 0.441);
907 m->specularColor.setValue(0.51, 0.48, 0.16);
908 m->shininess.setValue(0.37);
909 //Rings
910 add("pix::AsRingCen_BL",m);
911 add("pix::AsRingInt_BL",m);
912 add("pix::AsRingOut_BL",m);
913 add("pix::AsRing_L1",m);
914 add("pix::AsRingOut_L1",m);
915 add("pix::AsRing_L2",m);
916 add("pix::AsRingOut_L2",m);
917 //ServiceSupport
918 add("pix::ServiceSupport_BL",m);
919 add("pix::ServiceSupport_L1",m);
920 add("pix::ServiceSupport_L2",m);
921 }
922 {
923 // Halfshell
924 SoMaterial *m = new SoMaterial;
925 m->ambientColor.setValue (0.21, 0.23, 0.23);
926 m->diffuseColor.setValue (0.1, 0.11, 0.11);
927 m->specularColor.setValue(0.31, 0.28, 0.06);
928 m->shininess.setValue(0.43);
929 add("pix::Halfshell_BL",m);
930 add("pix::Halfshell_L1",m);
931 add("pix::Halfshell_L2",m);
932 }
933
934 {
935 SoMaterial *m = new SoMaterial;
936 m->ambientColor.setValue (0.40, 0.42, 0.42);
937 m->diffuseColor.setValue (0.36, 0.37, 0.37);
938 m->specularColor.setValue(0.51, 0.28, 0.26);
939 m->shininess.setValue(0.38);
940 add("Prepreg",m);
941 }
942
943 {
944 SoMaterial *m = new SoMaterial;
945 m->ambientColor.setValue (0.10, 0.12, 0.12);
946 m->diffuseColor.setValue (0.09, 0.10, 0.17);
947 add("pix::CablesAxial_BL",m);
948 add("pix::CoolingAxial_BL",m);
949 add("pix::CabCoolAxial_L1",m);
950 add("pix::CabCoolAxial_L2",m);
951 add("pix::CabCoolRadial_L1",m);
952 add("pix::OuterCable_BL",m);
953 add("pix::OuterCabCool_L1",m);
954 add("pix::OuterCabCool_L2",m);
955 }
956 {
957 SoMaterial *m = new SoMaterial;
958 m->ambientColor.setValue (0.12, 0.14, 0.14);
959 m->diffuseColor.setValue (0.10, 0.11, 0.19);
960 add("pix::CablesRadial_BL",m);
961 add("pix::CoolingRadial_BL",m);
962 add("pix::CabCoolRadial_L2",m);
963 add("pix::OuterCooling_BL",m);
964 }
965
966 {
967 SoMaterial *m = new SoMaterial;
968 m->ambientColor.setValue (0.20, 0.25, 0.25);
969 m->diffuseColor.setValue (0.22, 0.22, 0.22);
970 add("pix::Ulink_BL_A",m);
971 add("pix::AsUlink_BL_C",m);
972 add("pix::AsUlink_L1",m);
973 add("pix::AsUlink_L2",m);
974 }
975
976 {
977 SoMaterial *m = new SoMaterial;
978 m->ambientColor.setValue (0.40, 0.42, 0.42);
979 m->diffuseColor.setValue (0.36, 0.37, 0.37);
980 m->specularColor.setValue(0.51, 0.28, 0.26);
981 m->shininess.setValue(0.38);
982 add("pix::SSR_BL_A",m);
983 add("pix::SSR_BL_C",m);
984 add("pix::SSR_L1_A",m);
985 add("pix::SSR_L1_C",m);
986 add("pix::SSR_L2",m);
987 }
988
989 {
990 SoMaterial *m = new SoMaterial;
991 m->ambientColor.setValue (0.35, 0.37, 0.37);
992 m->diffuseColor.setValue (0.31, 0.32, 0.32);
993 m->specularColor.setValue(0.51, 0.28, 0.26);
994 m->shininess.setValue(0.38);
995 add("pix::InnerSkin_BL",m);
996 add("pix::InnerSkin_L1",m);
997 add("pix::InnerSkin_L2",m);
998 }
999
1000 {
1001 SoMaterial *m = new SoMaterial;
1002 m->ambientColor.setValue (0.55, 0.57, 0.57);
1003 m->diffuseColor.setValue (0.51, 0.52, 0.52);
1004 m->specularColor.setValue(0.51, 0.28, 0.26);
1005 m->shininess.setValue(0.33);
1006 add("pix::Fingers1",m);
1007 add("pix::Fingers2",m);
1008 add("pix::Fingers3",m);
1009 add("pix::Fingers4",m);
1010 }
1011
1012 {
1013 //Glass
1014 SoMaterial *m = new SoMaterial;
1015 m->diffuseColor.setValue (0.8, 0.9, 1.0);
1016 m->specularColor.setValue (0.39, 0.39, 0.39);
1017 m->emissiveColor.setValue (0.028, 0.028, 0.028);
1018 m->shininess.setValue(.60);
1019 add("Glass",m);
1020 }
1021
1022 {
1023 SoMaterial *material = new SoMaterial;
1024 material->diffuseColor.setValue(0.9,0.7,0.5);
1025 material->ambientColor.setValue(0.57,0.57,0.57);
1026 material->specularColor.setValue(0.27,0.27,0.27);
1027 material->shininess.setValue(.80);
1028 add("AlNitride",material);
1029 add("Dogleg",material);
1030 add("BrlBaseBoard",material);
1031 add("BrlHybrid",material);
1032 add("BrlBracket",material);
1033 add("PigTail",material);
1034 }
1035
1036 {
1037 SoMaterial *material = new SoMaterial;
1038 material->diffuseColor.setValue(0.40,0.60,0.40);
1039 material->ambientColor.setValue(0.57,0.57,0.57);
1040 material->specularColor.setValue(0.27,0.27,0.27);
1041 material->shininess.setValue(.80);
1042 add("PowerTape",material);
1043 }
1044
1045 {
1046 SoMaterial *material = new SoMaterial;
1047 material->diffuseColor.setValue(0.57,0.82,0.9);
1048 material->ambientColor.setValue(0.57,0.57,0.57);
1049 material->specularColor.setValue(0.27,0.27,0.27);
1050 material->shininess.setValue(.80);
1051 add("CoolingBlock",material);
1052 add("sct::CoolBlockSecHi",material);
1053 add("sct::CoolBlockSecLo",material);
1054 add("sct::DiscCoolingInn",material);
1055 add("sct::DiscCoolingOut",material);
1056 }
1057
1058 { /* Large structures in sct */
1059 SoMaterial *material = new SoMaterial;
1060 //material->diffuseColor.setValue(0.7,0.6,0.5);
1061 material->diffuseColor.setValue(0.8,0.7,0.6);
1062 material->ambientColor.setValue(0.57,0.57,0.57);
1063 material->specularColor.setValue(0.27,0.27,0.27);
1064 material->shininess.setValue(.80);
1065 add("sct::DiscCoolingMid",material);
1066 add("sct::DiscPowerTapeMid",material);
1067 add("sct::DiscPowerTapeInn",material);
1068 add("sct::DiscPowerTapeOut",material);
1069 add("sct::EMI",material);
1070 add("sct::EMIJoint",material);
1071 add("sct::Flange0",material);
1072 add("sct::Flange1",material);
1073 add("sct::Flange2",material);
1074 add("sct::Flange3",material);
1075 add("sct::FwdFrontSupport",material);
1076 add("sct::FwdITE",material);
1077 add("sct::FwdLMT",material);
1078 add("sct::FwdLMTCooling",material);
1079 add("sct::FwdOTE",material);
1080 add("sct::FwdRearSupport",material);
1081 add("sct::FwdRail",material);
1082 add("sct::FwdSupport",material);
1083 add("sct::FwdSpineMid",material);
1084 add("sct::FwdSpineOut",material);
1085 add("sct::FwdSpineInn",material);
1086 add("sct::Harness",material);
1087 add("sct::OptoHarnessO",material);
1088 add("sct::OptoHarnessOM",material);
1089 add("sct::OptoHarnessOMI",material);
1090 add("sct::Spider",material);
1091 add("sct::SupportCyl0",material);
1092 add("sct::SupportCyl1",material);
1093 add("sct::SupportCyl2",material);
1094 add("sct::SupportCyl3",material);
1095 add("sct::TSCylinder",material);
1096 }
1097
1098 { /* Details in sct (A) */
1099 SoMaterial *material = new SoMaterial;
1100 material->diffuseColor.setValue(0.6,0.525,0.45);
1101 material->ambientColor.setValue(0.57,0.57,0.57);
1102 material->specularColor.setValue(0.27,0.27,0.27);
1103 material->shininess.setValue(.80);
1104 add("sct::FwdHybrid",material);
1105 add("sct::CoolBlockMainHi",material);
1106 add("sct::CoolBlockMainLo",material);
1107 }
1108
1109 { /* Details in sct (B) */
1110 SoMaterial *material = new SoMaterial;
1111 material->diffuseColor.setValue(0.4,0.35,0.30);
1112 material->ambientColor.setValue(0.57,0.57,0.57);
1113 material->specularColor.setValue(0.27,0.27,0.27);
1114 material->shininess.setValue(.80);
1115 add("sct::CFiberInterLink",material);
1116 add("sct::Clamp0",material);
1117 add("sct::Clamp1",material);
1118 add("sct::Clamp2",material);
1119 add("sct::Clamp3",material);
1120 add("sct::CoolingEnd0",material);
1121 add("sct::CoolingEnd1",material);
1122 add("sct::CoolingEnd2",material);
1123 add("sct::CoolingEnd3",material);
1124 add("sct::CoolingPipe",material);
1125 add("sct::DiscFixation",material);
1126 add("sct::DiscSupport0",material);
1127 add("sct::DiscSupport1",material);
1128 add("sct::ModuleConnector",material);
1129 add("sct::DiscSupport2",material);
1130 add("sct::DiscSupport3",material);
1131 add("sct::DiscSupport4",material);
1132 add("sct::DiscSupport5",material);
1133 add("sct::DiscSupport6",material);
1134 add("sct::DiscSupport7",material);
1135 add("sct::DiscSupport8",material);
1136 add("sct::FSIBL",material);
1137 add("sct::FSIBH",material);
1138 add("sct::FSIFL",material);
1139 add("sct::FSIFH",material);
1140 add("sct::FwdCoolingPipe",material);
1141 add("sct::FwdFlangeFrontInn",material);
1142 add("sct::FwdFlangeFrontOut",material);
1143 add("sct::FwdFlangeRearInn",material);
1144 add("sct::FwdFlangeRearOut",material);
1145 add("sct::FwdNPipe",material);
1146 add("sct::FwdShuntShield",material);
1147 add("sct::PPConnector",material);
1148 add("sct::PPCooling",material);
1149 add("sct::PPF0c",material);
1150 add("sct::PPF0e",material);
1151 add("sct::PPF0o",material);
1152 add("sct::TSBulkhead",material);
1153 add("sct::TSEndPanel",material);
1154 }
1155 {
1156 SoMaterial * m = new SoMaterial;
1157 m->diffuseColor.setValue(SbColor(0.33333,0.33333,0.49804));
1158 m->shininess.setValue(0);
1159 add("sct::FwdFibres",m);
1160 }
1161
1162 {
1163 // NSW - sTGC
1164 SoMaterial * m = new SoMaterial;
1165 m->ambientColor.setValue(0.2, 0.2, 0.2);
1166 setColorFromRGB(m, "diffuse", 4, 142, 167); // #048EA7 - Blue Munsell (greenish azure)
1167 m->specularColor.setValue(0,0,0);
1168 m->shininess.setValue(0.2);
1169 add("Honeycomb",m);
1170 add("muo::Honeycomb",m); // there's a typo in the Muon material, should be "muon::", not "muo::" ...
1171
1172 }
1173 {
1174 // NSW - MicroMegas (MM)
1175 SoMaterial *m = new SoMaterial;
1176 setColorFromRGB(m, "diffuse", 212, 194, 126); // #D4C27E - Ecru
1177 m->specularColor.setValue (0.5, 0.5, 0.5);
1178 m->shininess.setValue(0.2);
1179 add("PCB",m);
1180 add("sct::PCB",m);
1181 }
1182 {
1183 // NSW - Shield Steel
1184 SoMaterial *m = new SoMaterial;
1185 m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
1186 m->specularColor.setValue(0.168, 0.168, 0.168);
1187 m->shininess.setValue(0.153696);
1188 add("ShieldSteel",m);
1189 add("shield::ShieldSteel",m);
1190 }
1191
1192 /* WIP
1193 {
1194 // NSW - Special material for the Run3 Detector Pape
1195 // The aim is to colorize the JD shield plate
1196 // in contrasting color, for the NSW images
1197 SoMaterial *m = new SoMaterial;
1198 setColorFromRGB(m, "diffuse", 114, 83, 143); // 72538F - Royal Purple
1199 //m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
1200 m->specularColor.setValue(0.168, 0.168, 0.168);
1201 m->shininess.setValue(0.153696);
1202 add("shield::ShieldSteel",m);
1203 }
1204 */
1205
1206 // Adding ITk colors
1207 // PP0 material
1208 // Services and Cooling
1209 {
1210 SoMaterial *m = new SoMaterial;
1211 setColorFromRGB(m, "diffuse", 81, 163, 119);
1212 setColorFromRGB(m, "ambient", 0, 40, 48);
1213 setColorFromRGB(m, "specular", 255, 255, 255);
1214 setColorFromRGB(m, "emissive", 0, 0, 0);
1215 m->shininess.setValue(0.5);
1216 m->transparency.setValue(0.6);
1217 // inner pixel system
1218 add( "PP0BMaterial",m);
1219 add( "PP0CMaterial",m);
1220 add( "PP0DMaterial",m);
1221 add( "PP0SMaterial",m);
1222 add( "PP0QMaterial",m);
1223 // inner pixel system
1224 add( "SvcBrlPP0_30_Hor2_L2_Sec0_Material",m);
1225 add( "SvcBrlPP0_40_Hor3_L3_Sec0_Material",m);
1226 add( "SvcBrlPP0_50_Hor4_L4_Sec0_Material",m);
1227 add( "OutPixIncSec2PP0Material",m);
1228 add( "OutPixIncSec3PP0Material",m);
1229 add( "OutPixIncSec4PP0Material",m);
1230
1231 add( "Type1ServiceBMaterial",m);
1232 add( "Type1ServiceCMaterial",m);
1233 add( "Type1ServiceDMaterial",m);
1234 add( "Type1ServiceSMaterial",m);
1235 add( "Type1ServiceQMaterial",m);
1236 add( "Type1CoolingBMaterial",m);
1237 add( "Type1CoolingEMaterial",m);
1238 }
1239
1240 // PP1 material
1241 {
1242 SoMaterial *m = new SoMaterial;
1243 setColorFromRGB(m, "diffuse", 76, 76, 204);
1244 setColorFromRGB(m, "emissive", 53, 53, 141);
1245 m->transparency.setValue(0.7);
1246
1247 add( "matPixType2D",m);
1248 add( "matPixType2F",m);
1249 add( "matPixType2H",m);
1250 add( "matPixType2I",m);
1251 add( "matPixType2L",m);
1252 add( "matPixReadout1",m);
1253 add( "matPixReadout2",m);
1254 add( "matPixType2G",m);
1255 add( "matPixType2E",m);
1256 add( "PP1_T2_Power_lowr",m);
1257 add( "PP1_T2_Power",m);
1258 add( "PP1_T2_Power_midr",m);
1259 add( "PP1_T1_Inner",m);
1260 add( "PP1_T1_Outer",m);
1261 add( "PP1_T2_Power_highr",m);
1262 add( "PP1_T2_cooling_quadrant",m);
1263 add( "matPixCoolingOuter",m);
1264 add( "pixSvc_PP1_T2_R347_R420_CoolingInner",m);
1265 add( "MatB_PP1",m);
1266 add( "MatEC_PP1",m);
1267 add( "HeatExchanger",m);
1268 add( "PP1_T1_Outer_Cyl",m);
1269 add( "PP1_T1_Inner_Cyl",m);
1270 add( "matPixCoolingSum",m);
1271 add( "AlAnticorodal",m);
1272 add( "matHeatExchanger",m);
1273 add( "matPixCoolingInner",m);
1274 add( "PP1_T1_cooling_Steel",m);
1275 add( "PP1_T1_powerconnector_Al",m);
1276 add( "PP1_T1_Inner_Cone",m);
1277 add( "matPP1Type1PixInner",m);
1278 add( "matPP1InnerConnectors",m);
1279 add( "matPP1Type1PixOuter",m);
1280 add( "matPP1OuterConnectors",m);
1281 add( "PP1_T1_Outer_Cone",m);
1282
1283 }
1284
1285 // Hybrid material on ITk strip modules
1286 {
1287 SoMaterial *m = new SoMaterial;
1288 setColorFromRGB(m, "diffuse", 29, 86, 86);
1289 setColorFromRGB(m, "ambient", 0, 0, 0);
1290 setColorFromRGB(m, "specular", 0, 0, 0);
1291 setColorFromRGB(m, "emissive", 59, 117, 176);
1292 add( "matB_HybridPCB",m);
1293 add( "matEC_HybridPCB",m);
1294 add( "matEC_HybridR0H0",m);
1295 add( "matEC_HybridR0H1",m);
1296 add( "matEC_HybridR1H0",m);
1297 add( "matEC_HybridR1H1",m);
1298 add( "matEC_HybridR2H0",m);
1299 add( "matEC_HybridR3H0",m);
1300 add( "matEC_HybridR3H1",m);
1301 add( "matEC_HybridR3H2",m);
1302 add( "matEC_HybridR3H3",m);
1303 add( "matEC_HybridR4H0",m);
1304 add( "matEC_HybridR4H1",m);
1305 add( "matEC_HybridR5H0",m);
1306 add( "matEC_HybridR5H1",m);
1307 add( "matPetalBusKapton",m);
1308 add( "matDCDC_PCB",m);
1309 add( "matDCDC_Box",m);
1310 }
1311
1313 init();
1314}
1315
1317
1319
1320 // WARM CYLINDER
1321 {
1322 SoMaterial *m = new SoMaterial;
1323 m->ambientColor.setValue(1, .4, .4);
1324 m->diffuseColor.setValue(1, .4, .4);
1325 m->specularColor.setValue(0.441667, 0.441667, 0.441667);
1326 m->shininess.setValue(0.67);
1327 add( "LAr::Barrel::Cryostat::Cylinder::#4",m);
1328 add( "LAr::Barrel::Cryostat::Cylinder::#5",m);
1329 add( "LAr::Barrel::Cryostat::Cylinder::#6",m);
1330 add( "LAr::Barrel::Cryostat::Cylinder::#7",m);
1331 add( "LAr::Barrel::Cryostat::Cylinder::#8",m);
1332 add( "LAr::Barrel::Cryostat::Cylinder::#9",m);
1333 add( "LAr::Barrel::Cryostat::InnerWall",m);
1334 add( "LAr::Barrel::Cryostat::InnerEndWall",m);
1335 add( "LAr::Barrel::Cryostat::Leg",m);
1336 }
1337
1338 {
1339 // WARM CYLINDER
1340 SoMaterial *m = new SoMaterial;
1341 m->ambientColor.setValue(.4, .4, 1);
1342 m->diffuseColor.setValue(.4, .4, 1);
1343 m->specularColor.setValue(0.441667, 0.441667, 0.441667);
1344 m->shininess.setValue(0.67);
1345 add( "LAr::Barrel::Cryostat::Cylinder::#0",m);
1346 add( "LAr::Barrel::Cryostat::Cylinder::#1",m);
1347 add( "LAr::Barrel::Cryostat::Cylinder::#2",m);
1348 add( "LAr::Barrel::Cryostat::Cylinder::#3",m);
1349 add( "LAr::Barrel::Cryostat::Ear",m);
1350 add( "LAr::Barrel::Cryostat::OuterWall",m);
1351 }
1352
1353 {
1354 SoMaterial *m = new SoMaterial;
1355 m->diffuseColor.setValue (1, 1, 0.5);
1356 m->ambientColor.setValue (0.54, 0.54, 0.27);
1357 m->emissiveColor.setValue (0.133, 0.133, 0.067);
1358 add("bcmModLog",m);
1359 add("bcmWallLog",m);
1360 }
1361
1362
1363
1364 {
1365 // Cutout - EMEC
1366 SoMaterial *m = new SoMaterial;
1367 //setColorFromRGB(m, "diffuse", 255, 190, 11); // ffbe0b - Mango (lighter)
1368 setColorFromRGB(m, "diffuse",245, 180, 0); // F5B400 - Selective Yellow (darker)
1369 m->shininess.setValue(0.67);
1370 add( "LAr::EMEC::Mother",m);
1371 }
1372 {
1373 // Cutout - HEC
1374 SoMaterial *m = new SoMaterial;
1375 setColorFromRGB(m, "diffuse", 47, 25, 95); // 2f195f - Russian Violet (darker)
1376 //setColorFromRGB(m, "diffuse",56, 30, 113); // 381E71 - Persian Indigo (lighter)
1377 m->shininess.setValue(0.67);
1378 add( "LAr::HEC::LiquidArgon",m);
1379 }
1380 {
1381 // Cutout - FCAL
1382 SoMaterial *m = new SoMaterial;
1383 setColorFromRGB(m, "diffuse", 246, 247, 64); // f6f740 - Maximum Yellow
1384 m->shininess.setValue(0.67);
1385 add( "LAr::FCAL::LiquidArgonC",m);
1386 add( "LAr::FCAL::LiquidArgonA",m);
1387 }
1388
1389 {
1390 // Cutout - TRT
1391 SoMaterial *m = new SoMaterial;
1392 setColorFromRGB(m, "diffuse", 114, 83, 143); // 72538F - Royal Purple
1393 m->shininess.setValue(0.67);
1394 add( "TRTEndcapWheelAB",m);
1395 add( "TRTBarrel",m);
1396 }
1397
1398 {
1399 // Cutout - SCT
1400 SoMaterial *m = new SoMaterial;
1401 //setColorFromRGB(m, "diffuse", 80, 255, 177); // 50FFB1 - Medium Spring Green
1402 setColorFromRGB(m, "diffuse", 170, 255, 255); // AAFFFF - Celeste
1403 m->shininess.setValue(0.67);
1404 add( "SCT_Barrel",m);
1405 add( "SCT_ForwardA",m);
1406 add( "SCT_ForwardC",m);
1407 }
1408
1409 // Detailed Muon View for Run3 Detector Paper
1410 // RPC layers
1411 {
1412 SoMaterial *m = new SoMaterial;
1413 setColorFromRGB(m, "diffuse", 61, 52, 139); // 3D348B - Dark Slate Blue
1414 m->shininess.setValue(0.67);
1415 //add( "RPC_AL_extsuppanel",m); // WIP
1416 add( "Rpclayer",m);
1417 }
1418
1419 // Adding ITk colors
1420 // ITk Pixel sensors
1421 {
1422 SoMaterial *m = new SoMaterial;
1423 setColorFromRGB(m, "diffuse", 81, 163, 119);
1424 setColorFromRGB(m, "ambient", 0, 40, 48);
1425 setColorFromRGB(m, "specular", 255, 255, 255);
1426 setColorFromRGB(m, "emissive", 0, 0, 0);
1427 m->shininess.setValue(0.5);
1428
1429 // innermost pixel barrel layer
1430 add( "InnerBarrelSingleMod_Sensor",m);
1431 add( "InnerBarrelSingleMod_DeadVolume",m);
1432 add( "InnerBarrelSingleMod_Chip",m);
1433 add( "InnerBarrelSingleMod_Bonding",m);
1434 // next-to-innermost pixel barrel layer
1435 add( "InnerBarrelQuadMod_Sensor",m);
1436 add( "InnerRingSingleMod_Chip",m);
1437 // innermost pixel endcap layer
1438 add( "InnerRingSingleMod_Sensor",m);
1439 add( "InnerRingSingleMod_Bonding",m);
1440 // next-to-innermost pixel endcap layer
1441 add( "InnerEndcapQuadMod_Sensor",m);
1442 // next-to-innermost pixel layers
1443 add( "InnerQuadMod_Chip",m);
1444 add( "InnerQuadMod_Bonding",m);
1445 // outer pixel barrel layers
1446 add( "OuterBarrelQuadMod_Sensor",m);
1447 add( "InclinedQuadMod_Sensor",m);
1448 // outer pixel endcap layers
1449 add( "OuterEndcapQuadMod_Sensor",m);
1450 // outer pixel layers
1451 add( "OuterQuadMod_Chip",m);
1452 add( "OuterQuadMod_Bonding",m);
1453
1454 }
1455
1456 // ITk Strip sensors
1457 {
1458 SoMaterial *m = new SoMaterial;
1459 setColorFromRGB(m, "diffuse", 54, 163, 255);
1460 setColorFromRGB(m, "ambient", 0, 0, 0);
1461 setColorFromRGB(m, "specular", 0, 0, 0);
1462 setColorFromRGB(m, "emissive", 37, 74, 111);
1463
1464 // strip barrel
1465 add( "BRLSensorSS",m);
1466 add( "BRLSensorMS",m);
1467
1468 // strip endcap
1469 add( "ECSensor0",m);
1470 add( "ECSensor1",m);
1471 add( "ECSensor2",m);
1472 add( "ECSensor3",m);
1473 add( "ECSensor4",m);
1474 add( "ECSensor5",m);
1475
1476 add( "ECSensorBack0",m);
1477 add( "ECSensorBack1",m);
1478 add( "ECSensorBack2",m);
1479 add( "ECSensorBack3",m);
1480 add( "ECSensorBack4",m);
1481 add( "ECSensorBack5",m);
1482
1483 }
1484
1485 // ITk Pixel services
1486 {
1487 SoMaterial *m = new SoMaterial;
1488 setColorFromRGB(m, "diffuse", 81, 163, 119);
1489 setColorFromRGB(m, "ambient", 0, 40, 48);
1490 setColorFromRGB(m, "specular", 255, 255, 255);
1491 setColorFromRGB(m, "emissive", 0, 0, 0);
1492 m->shininess.setValue(0.5);
1493
1494 m->transparency.setValue(0.6);
1495
1496 // pigtails and flexes
1497 // innermost pixel barrel layer
1498 add( "InnerBarrelSingleMod_Pigtail",m);
1499 // next-to-innermost pixel layers
1500 add( "InnerQuadMod_QuadPigtail",m);
1501 add( "InnerQuadMod_QuadFlex",m);
1502 // outer pixel layers
1503 add( "OuterQuadMod_QuadFlex",m);
1504
1505 // Services and cooling
1506 // inner pixel system
1507 add( "InnerPixelBarrel_T0",m);
1508 add( "InnerPixEndcap_L0T0Back_ring",m);
1509 add( "InnerPixEndcap_L1T0Front_ring",m);
1510 add( "InnerPixEndcap_L1T0Back_ring",m);
1511 add( "InnerPixEndcap_L2T0Front_ring",m);
1512 add( "InnerPixEndcap_L2T0Back_ring",m);
1513 // outer pixel system
1514 add( "L2HalfRingEndCapBusTapeRing",m);
1515 add( "L3HalfRingEndCapBusTapeRing",m);
1516 add( "L4endcapBusTape",m);
1517
1518 // other types and endcaps
1519 unsigned int sectors = 9;
1520 std::vector<unsigned int> layers = {2, 3, 4};
1521 for (auto& layer : layers) {
1522 for (unsigned int sector = 0; sector<sectors; sector++) {
1523 std::string volumeName = "Pixel__ModuleSvcM" + std::to_string(sectors-sector) + "_L" + std::to_string(layer) + "_S" + std::to_string(sector);
1524 add( volumeName,m);
1525 }
1526 }
1527 add( "PixelSvcBrlT1_L2",m);
1528 add( "PixelSvcBrlT1_L3",m);
1529 add( "PixelSvcBrlT1_L4in",m);
1530 add( "PixelSvcBrlT1_L4out",m);
1531 for (unsigned int sector = 0; sector<sectors; sector++) {
1532 std::string volumeName = "PixelSvcBrlT1_Radial" + std::to_string(sectors-sector);
1533 add( volumeName,m);
1534 }
1535
1536 add( "svcEcT1_r199_z103",m);
1537 add( "svcEcT1_r199_z116",m);
1538 add( "svcEcT1_r199_z127",m);
1539 add( "svcEcT1_r199_z141",m);
1540 add( "svcEcT1_r199_z1366",m);
1541 add( "svcEcT1_r198_z172",m);
1542 add( "svcEcT1_r198_z190",m);
1543 add( "svcEcT1_r198_z210",m);
1544 add( "svcEcT1_r198_z232",m);
1545 add( "svcEcT1_r198_z257",m);
1546 add( "svcEcT1_r198_z149",m);
1547
1548 add( "svcEcT1_r259_z151",m);
1549 add( "svcEcT1_r259_z176",m);
1550 add( "svcEcT1_r259_z203",m);
1551 add( "svcEcT1_r259_z234",m);
1552 add( "svcEcT1_r259_z270",m);
1553 add( "svcEcT1_r259_z311",m);
1554 add( "svcEcT1_r259_z359",m);
1555 add( "svcEcT1_r259_z149",m);
1556
1557 add( "svcEcT1_r319_z131",m);
1558 add( "svcEcT1_r319_z150",m);
1559 add( "svcEcT1_r319_z170",m);
1560 add( "svcEcT1_r319_z192",m);
1561 add( "svcEcT1_r319_z218",m);
1562 add( "svcEcT1_r319_z246",m);
1563 add( "svcEcT1_r319_z746",m);
1564 add( "svcEcT1_r318_z317",m);
1565 add( "svcEcT1_r318_z149",m);
1566
1567 add( "SvcEcT0TwdBS_r156_199_z.5",m);
1568 add( "SvcEcT0TwdBS_r156_198_z.5",m);
1569 add( "SvcEcT0TwdBS_r199_199_z.5",m);
1570 add( "SvcEcT0TwdBS_r216_259_z.5",m);
1571 add( "SvcEcT0TwdBS_r276_319_z.5",m);
1572 add( "SvcEcT0TwdBS_r276_318_z.5",m);
1573 add( "SvcEcT0TwdBS_r318_319_z.5",m);
1574
1575 add( "SvcEc_r196.7_197.1_z78.6",m);
1576 add( "SvcEc_r196.7_197.1_z97.6",m);
1577 add( "SvcEc_r196.7_197.1_z121.2",m);
1578 add( "SvcEc_r196.7_197.1_z150.3",m);
1579 add( "SvcEc_r196.7_197.1_z186.7",m);
1580 add( "SvcEc_r196.7_197.1_z23.3",m);
1581 add( "SvcEc_r337.8_338.2_z1939.2",m);
1582
1583
1584 add( "SvcEc_r264.4_264.8_z58.1",m);
1585 add( "SvcEc_r264.4_264.8_z66.6",m);
1586 add( "SvcEc_r264.4_264.8_z76.4",m);
1587 add( "SvcEc_r264.4_264.8_z87.5",m);
1588 add( "SvcEc_r264.4_264.8_z100.3",m);
1589 add( "SvcEc_r264.4_264.8_z115",m);
1590 add( "SvcEc_r264.4_264.8_z131.9",m);
1591 add( "SvcEc_r264.4_264.8_z30.9",m);
1592 add( "SvcEc_r338.8_339.2_z1937.2",m);
1593
1594 add( "SvcEc_r327.3_327.7_z52.7",m);
1595 add( "SvcEc_r327.3_327.7_z58.8",m);
1596 add( "SvcEc_r327.3_327.7_z65.6",m);
1597 add( "SvcEc_r327.3_327.7_z73.1",m);
1598 add( "SvcEc_r327.3_327.7_z81.7",m);
1599 add( "SvcEc_r327.3_327.7_z91.1",m);
1600 add( "SvcEc_r327.3_327.7_z101.6",m);
1601 add( "SvcEc_r327.3_327.7_z113.4",m);
1602 add( "SvcEc_r327.3_327.7_z34.7",m);
1603 add( "SvcEc_r339.8_340.2_z1935.2",m);
1604
1605 add( "SvcEc_r197.1_202.8_z.4",m);
1606 add( "SvcEc_r203.2_263.4_z.4",m);
1607 add( "SvcEc_r264.8_270.8_z.4",m);
1608 add( "SvcEc_r271.2_326.3_z.4",m);
1609 add( "SvcEc_r326.7_327.3_z.4",m);
1610 add( "SvcEc_r327.7_333.8_z.4",m);
1611 add( "SvcEc_r334.2_337.3_z.4",m);
1612 add( "SvcEc_r337.7_337.8_z.4",m);
1613 add( "SvcEc_r338.2_338.3_z.4",m);
1614 add( "SvcEc_r338.7_338.8_z.4",m);
1615 add( "SvcEc_r339.2_339.3_z.4",m);
1616 add( "SvcEc_r339.7_339.8_z.4",m);
1617
1618
1619 // cooling (when separated from services)
1620 // inner pixel system
1621 add( "InnerPixelBarrelCoolingL0",m);
1622 add( "InnerPixelBarrelCoolingL1",m);
1623 // outer pixel system
1624 add( "OuterQuadMod_Cell",m);
1625 add( "LongeronCoolingTube",m);
1626 add( "L2HalfRingCoolingPipe",m);
1627 add( "L3HalfRingCoolingPipe",m);
1628 add( "L4endcapcoolingpipe",m);
1629
1630 }
1631
1632 // ITk Strip services
1633 {
1634 SoMaterial *m = new SoMaterial;
1635 setColorFromRGB(m, "diffuse", 28, 55, 83);
1636 setColorFromRGB(m, "ambient", 0, 0, 0);
1637 setColorFromRGB(m, "specular", 0, 0, 0);
1638 setColorFromRGB(m, "emissive", 0, 87, 127);
1639 m->transparency.setValue(0.5);
1640
1641 add ("SV_Barrel01",m);
1642 add ("SV_Barrel12",m);
1643 add ("SV_Barrel23",m);
1644 add ("SV_Barrel3Out",m);
1645 add ("SV_BarrelPastEndcap",m);
1646 add ("SV_BarrelAtEC_lv",m);
1647 add ("SV_Barrel_lv",m);
1648 add ("SV_Endcap_lv",m);
1649 add ("SV_Endcap01",m);
1650 add ("SV_Endcap12",m);
1651 add ("SV_Endcap23",m);
1652 add ("SV_Endcap34",m);
1653 add ("SV_Endcap45",m);
1654 add ("SV_Endcap5Out",m);
1655 add( "SVatBulkhead_lv",m);
1656
1657 add( "SVatBulkhead_lv",m);
1658 add( "StaveSignalSS",m);
1659 add( "StaveGround",m);
1660
1661 }
1662
1663 // ITk Pixel support structures
1664 {
1665 SoMaterial *m = new SoMaterial;
1666 setColorFromRGB(m, "diffuse", 81, 163, 119);
1667 setColorFromRGB(m, "ambient", 0, 40, 48);
1668 setColorFromRGB(m, "specular", 255, 255, 255);
1669 setColorFromRGB(m, "emissive", 0, 0, 0);
1670 m->shininess.setValue(0.5);
1671
1672 m->transparency.setValue(0.6);
1673 // inner pixel system
1674 add( "IPTvol",m);
1675 add( "ISTvol",m);
1676 add( "InnerPixBarrelSupport_Stave",m);
1677 add( "InnerPixBarrelSupport_Stave1",m);
1678 add( "InnerPixBarrelSupport_Global",m);
1679 add( "InnerPixEndcap_CoupledRingSupport",m);
1680 add( "InnerPixEndcap_IntermediateRingSupport",m);
1681 add( "InnerPixEndcap_L1RingSupport",m);
1682 add( "QuarterShell",m);
1683 // outer pixel system
1684 add( "InclL2HalfShell",m);
1685 add( "InclL2Support",m);
1686 add( "InclL3HalfShell",m);
1687 add( "InclL3Support",m);
1688 add( "InclL4HalfShell",m);
1689 add( "InclL4Support",m);
1690 add( "LongeronCornerBase",m);
1691 add( "LongeronCornerEnd",m);
1692 add( "LongeronTrussWall",m);
1693 add( "LongeronCapBase",m);
1694 add( "LongeronTopCap",m);
1695 add( "L2HalfRingCarbonFoamInner",m);
1696 add( "L2HalfRingCarbonFoamOuter",m);
1697 add( "L2HalfRingFaceSheet",m);
1698 add( "L3HalfRingCarbonFoamInner",m);
1699 add( "L3HalfRingCarbonFoamOuter",m);
1700 add( "L3HalfRingFaceSheet",m);
1701 add( "L4endcapinnerCarbonFoam",m);
1702 add( "L4endcapouterCarbonFoam",m);
1703 add( "L4endcapFaceSheet",m);
1704 add( "L2HalfShell",m);
1705 add( "L3HalfShell",m);
1706 add( "L4HalfShell",m);
1707 add( "L2HalfRingEndCapFixingLug",m);
1708 add( "L3HalfRingEndCapFixingLug",m);
1709 add( "HalfRingEndCapFixingLug",m);
1710
1711 // other supports still in the pixel volume
1712 add( "FrontSupportFacing",m);
1713 add( "FrontSupportCore",m);
1714 add( "RearSupport",m);
1715 }
1716
1717 // ITk Strip support structures
1718 {
1719 SoMaterial *m = new SoMaterial;
1720 setColorFromRGB(m, "diffuse", 28, 55, 83);
1721 setColorFromRGB(m, "ambient", 0, 0, 0);
1722 setColorFromRGB(m, "specular", 0, 0, 0);
1723 setColorFromRGB(m, "emissive", 0, 87, 127);
1724 m->transparency.setValue(0.5);
1725
1726 add( "StripB_Cyl0",m);
1727 add( "StripB_Cyl1",m);
1728 add( "StripB_Cyl2",m);
1729 add( "StripB_Cyl3",m);
1730 add( "StripB_Cyl4",m);
1731 add( "StaveCylHat0",m);
1732 add( "StaveCylHat1",m);
1733 add( "StaveCylHat2",m);
1734 add( "StaveCylHat3",m);
1735 add( "Flange0",m);
1736 add( "Flange1",m);
1737 add( "Flange2",m);
1738 add( "Flange3",m);
1739 add( "Interlink0",m);
1740 add( "Interlink1",m);
1741 add( "Interlink2",m);
1742 add( "Interlink3",m);
1743 add( "WheelInnerT",m);
1744 add( "WheelOuterT",m);
1745 add( "OC_Shell",m);
1746 add( "ZBraceI",m);
1747 add( "ZBraceO",m);
1748 add( "ECPSTube",m);
1749 add( "EC_InnerCyl",m);
1750 add( "OCFlangeTop",m);
1751 add( "OCFlangeFoot",m);
1752 add( "OCHatTop",m);
1753 add( "OCHatWall",m);
1754 add( "OCHatFoot",m);
1755 add( "PetalCore",m);
1756 add( "BladeFace",m);
1757 add( "BladeSideRod",m);
1758 add( "BladeCore",m);
1759 add( "LockBaseL",m);
1760 add( "LockBaseH",m);
1761 add( "RailWall",m);
1762 add( "RailWedge",m);
1763 add( "RailBolt",m);
1764 add( "RailWheel",m);
1765 add( "RailShelf",m);
1766 add( "RailSquare",m);
1767 add( "RailSquareT",m);
1768 add( "RailSquare1",m);
1769 add( "OCMountPadOuter",m);
1770 add( "OCMountPadMiddle",m);
1771 add( "OCMountPadInner",m);
1772 add( "ZtubeD0D1",m);
1773 add( "ZtubeD1D2",m);
1774 add( "ZtubeD2D3",m);
1775 add( "ZtubeD3D4",m);
1776 add( "ZtubeD4D5",m);
1777 add( "StiffDiscAve",m);
1778 add( "Bulkhead",m);
1779 add( "StaveFacesheetAll",m);
1780 add( "EOS",m);
1781 add( "StaveEOS_CFoam",m);
1782 add( "StaveBusGlue",m);
1783 add( "StaveCloseoutEOS_End",m);
1784 add( "StaveCoreMS",m);
1785 add( "StaveCoreSS",m);
1786 add( "StaveMountC",m);
1787 add( "StaveMountI",m);
1788 add( "StaveMountE",m);
1789
1790 }
1791
1792 // polymoderator
1793 {
1794 SoMaterial *m = new SoMaterial;
1795 setColorFromRGB(m, "diffuse", 143, 145, 145);
1796 setColorFromRGB(m, "ambient", 178, 184, 184);
1797 setColorFromRGB(m, "specular", 181, 122, 117);
1798 setColorFromRGB(m, "emissive", 0, 0, 0);
1799 m->shininess.setValue(1);
1800 add( "PolyMod",m);
1801 add( "PolyMod_InnerLayer",m);
1802 add( "InnerPolyMod",m);
1803 add( "InnerPolyMod_InnerLayer",m);
1804 }
1805
1806
1807 // volumes that don't need colors as they are made of air
1808 {
1809 SoMaterial *m = new SoMaterial;
1810 m->transparency.setValue(1.0);
1811 add( "StaveCchannelAirEOS",m);
1812 add( "StaveCchannelAirLong",m);
1813 add( "StaveCchannelAirLongEOS",m);
1814 add( "PetalCloseoutShortSpace",m);
1815 add( "PetalCloseoutLongSpace",m);
1816 }
1817
1818 {
1819 SoMaterial *m = new SoMaterial;
1820 setColorFromRGB(m, "diffuse", 76, 76, 204);
1821 setColorFromRGB(m, "emissive", 53, 53, 141);
1822 m->transparency.setValue(0.7);
1823 add( "SealPlate",m);
1824 }
1825 // HGTD sensors
1826 {
1827 SoMaterial *m = new SoMaterial;
1828 setColorFromRGB(m, "diffuse", 70, 190, 255);
1829 setColorFromRGB(m, "ambient", 0, 30, 50);
1830 setColorFromRGB(m, "specular", 255, 255, 255);
1831 setColorFromRGB(m, "emissive", 20, 40, 60);
1832 m->shininess.setValue(0.45);
1833
1834 add("HGTDSiSensorPosL0", m);
1835 add("HGTDSiSensorPosL1", m);
1836 add("HGTDSiSensorPosL2", m);
1837 add("HGTDSiSensorPosL3", m);
1838 add("HGTDSiSensorNegL0", m);
1839 add("HGTDSiSensorNegL1", m);
1840 add("HGTDSiSensorNegL2", m);
1841 add("HGTDSiSensorNegL3", m);
1842 add("HGTDLGADInactive", m);
1843 add("HGTDASIC", m);
1844 }
1845
1846 // HGTD flex and hybrid
1847 {
1848 SoMaterial *m = new SoMaterial;
1849 setColorFromRGB(m, "diffuse", 245, 160, 70);
1850 setColorFromRGB(m, "ambient", 60, 30, 0);
1851 setColorFromRGB(m, "specular", 255, 220, 180);
1852 m->shininess.setValue(0.35);
1853
1854 add("HGTDFlexPackage", m);
1855 add("HGTDHybrid", m);
1856 for (int i = 0; i <= 7; ++i) {
1857 add("HGTDFlexTube" + std::to_string(i), m);
1858 }
1859 }
1860
1861 // HGTD glue
1862 {
1863 SoMaterial *m = new SoMaterial;
1864 setColorFromRGB(m, "diffuse", 255, 220, 120);
1865 setColorFromRGB(m, "ambient", 70, 60, 20);
1866 m->shininess.setValue(0.2);
1867
1868 add("HGTDGlueSensor", m);
1869 add("HGTDGlueAsic", m);
1870 }
1871
1872 // HGTD covers and support structures
1873 {
1874 SoMaterial *m = new SoMaterial;
1875 setColorFromRGB(m, "diffuse", 140, 145, 150);
1876 setColorFromRGB(m, "ambient", 40, 45, 50);
1877 setColorFromRGB(m, "specular", 220, 220, 220);
1878 m->transparency.setValue(0.20);
1879 m->shininess.setValue(0.30);
1880
1881 add("HGTDSupportPlate", m);
1882 add("HGTDCoolingPlate", m);
1883 add("HGTDFrontCover", m);
1884 add("HGTDBackCover", m);
1885 add("HGTDOuterRCover", m);
1886 add("HGTDInnerRCover1", m);
1887 add("HGTDInnerRCover2", m);
1888 add("HGTDInnerRCover3", m);
1889 }
1890
1891 // HGTD cooling tubes
1892 {
1893 SoMaterial *m = new SoMaterial;
1894 setColorFromRGB(m, "diffuse", 180, 185, 195);
1895 setColorFromRGB(m, "ambient", 50, 55, 65);
1896 setColorFromRGB(m, "specular", 245, 245, 245);
1897 m->shininess.setValue(0.55);
1898
1899 for (int i = 0; i <= 41; ++i) {
1900 add("HGTDCoolingTube_" + std::to_string(i), m);
1901 }
1902 }
1903
1904 // HGTD coolant
1905 {
1906 SoMaterial *m = new SoMaterial;
1907 setColorFromRGB(m, "diffuse", 90, 230, 255);
1908 setColorFromRGB(m, "ambient", 0, 40, 55);
1909 setColorFromRGB(m, "emissive", 0, 35, 45);
1910 m->transparency.setValue(0.45);
1911
1912 for (int i = 0; i <= 41; ++i) {
1913 add("HGTDCoolingTubeFluid_" + std::to_string(i), m);
1914 }
1915 }
1916
1917 // HGTD services and electronics
1918 {
1919 SoMaterial *m = new SoMaterial;
1920 setColorFromRGB(m, "diffuse", 145, 200, 120);
1921 setColorFromRGB(m, "ambient", 30, 50, 20);
1922 setColorFromRGB(m, "specular", 210, 210, 210);
1923 m->shininess.setValue(0.25);
1924
1925 add("HGTDPeripheralCoolingLines", m);
1926 add("support_F_vol", m);
1927 add("support_B_vol", m);
1928 add("PowerBlock_F1_vol", m);
1929 add("PowerBlock_F2_vol", m);
1930 add("PowerBlock_F3_vol", m);
1931 add("PowerBlock_B1_vol", m);
1932 add("PowerBlock_B2_vol", m);
1933 add("PowerBlock_B3_vol", m);
1934 add("VTRx_F1_vol", m);
1935 add("VTRx_F21_vol", m);
1936 add("VTRx_F22_vol", m);
1937 }
1938
1939 init();
1940}
static bool deserialiseSoMaterial(QByteArray &, SoMaterial *&)
static QByteArray serialiseSoMaterial(SoMaterial *)
QMap< QString, QByteArray > currentState() const
QMap< QString, QByteArray > initialState
std::map< std::string, SoMaterial * > _map
virtual ~VisAttributes()
float getValFromRGB(const int rgb)
void add(const std::string &name, SoMaterial *)
QByteArray getState(bool onlyChangedMaterials=true)
SoMaterial * get(const std::string &name) const
void setColorFromRGB(SoMaterial *mat, const std::string &type, const int r, const int g, const int b)
void applyState(QByteArray)
void overrideTransparencies(float transpfact)
int r
Definition globals.cxx:22