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