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