ATLAS Offline Software
Loading...
Searching...
No Matches
MatVisAttributes Class Reference

#include <VisAttributes.h>

Inheritance diagram for MatVisAttributes:
Collaboration diagram for MatVisAttributes:

Public Member Functions

 MatVisAttributes ()
void init ()
SoMaterial * get (const std::string &name) const
std::optional< SbColor > outlineColour (const std::string &name) const
void overrideTransparencies (float transpfact)
QByteArray getState (bool onlyChangedMaterials=true)
void applyState (QByteArray)

Protected Member Functions

void add (const std::string &name, SoMaterial *)
void setOutlineColour (const std::string &name, const SbColor &)
void setColorFromRGB (SoMaterial *mat, const std::string &type, const int r, const int g, const int b)

Private Member Functions

float getValFromRGB (const int rgb)

Private Attributes

Imp * m_d

Detailed Description

Definition at line 71 of file VisAttributes.h.

Constructor & Destructor Documentation

◆ MatVisAttributes()

MatVisAttributes::MatVisAttributes ( )

Definition at line 388 of file VisAttributes.cxx.

388 {
389 {
390 //NB: Must be here!!
391 SoMaterial *m = new SoMaterial;
392 add("DEFAULT",m);
393 }
394
395
396
397 /*
398 * ETHER MATERIAL
399 * This transparent material was used to hide the "fakeVolume" added by AGDD,
400 * but there are other "standard" volumes, which use "Ether" material, for example in CSC chambers.
401 * So we do not use this workaround anymore...
402 {
403 //
404 // 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
405 // more details:
406 // - https://its.cern.ch/jira/browse/ATLASVPONE-166
407 // - https://svnweb.cern.ch/trac/atlasoff/browser/DetectorDescription/AGDD/AGDDControl/trunk/src/AGDD2GeoModelBuilder.cxx?rev=648789#L502
408 //
409 SoMaterial *m = new SoMaterial;
410 m->ambientColor.setValue(0.2, 0.2, 0.2);
411 m->diffuseColor.setValue(0.58, 0.47, 0.81);
412 m->specularColor.setValue(0.56, 0.55, 0.56);
413 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)
414 add("Ether",m);
415 }
416 */
417 // HGTD materials
418 {
419 SoMaterial *m = new SoMaterial;
420 setColorFromRGB(m, "diffuse", 70, 190, 255);
421 setColorFromRGB(m, "ambient", 0, 30, 50);
422 setColorFromRGB(m, "specular", 255, 255, 255);
423 setColorFromRGB(m, "emissive", 20, 40, 60);
424 m->shininess.setValue(0.45);
425 add("Silicon_Ma", m);
426 }
427
428 {
429 SoMaterial *m = new SoMaterial;
430 setColorFromRGB(m, "diffuse", 245, 160, 70);
431 setColorFromRGB(m, "ambient", 60, 30, 0);
432 setColorFromRGB(m, "specular", 255, 220, 180);
433 m->shininess.setValue(0.35);
434 add("CuKapton", m);
435 }
436
437 {
438 SoMaterial *m = new SoMaterial;
439 setColorFromRGB(m, "diffuse", 155, 160, 170);
440 setColorFromRGB(m, "ambient", 45, 50, 60);
441 setColorFromRGB(m, "specular", 235, 235, 235);
442 m->shininess.setValue(0.50);
443 add("Aluminium_Ma", m);
444 }
445
446 {
447 SoMaterial *m = new SoMaterial;
448 setColorFromRGB(m, "diffuse", 185, 190, 200);
449 setColorFromRGB(m, "ambient", 55, 60, 70);
450 setColorFromRGB(m, "specular", 245, 245, 245);
451 m->shininess.setValue(0.60);
452 add("Titanium_Ma", m);
453 }
454
455 {
456 SoMaterial *m = new SoMaterial;
457 setColorFromRGB(m, "diffuse", 90, 230, 255);
458 setColorFromRGB(m, "ambient", 0, 40, 55);
459 setColorFromRGB(m, "emissive", 0, 35, 45);
460 m->transparency.setValue(0.45);
461 add("CO2CoolantMix", m);
462 }
463
464 {
465 SoMaterial *m = new SoMaterial;
466 setColorFromRGB(m, "diffuse", 110, 115, 120);
467 setColorFromRGB(m, "ambient", 35, 40, 45);
468 setColorFromRGB(m, "specular", 210, 210, 210);
469 m->shininess.setValue(0.30);
470 add("CFiberSupport", m);
471 add("CFRP", m);
472 }
473
474 {
475 SoMaterial *m = new SoMaterial;
476 setColorFromRGB(m, "diffuse", 170, 210, 140);
477 setColorFromRGB(m, "ambient", 40, 55, 30);
478 add("FEBoards", m);
479 add("PowerBlock_Ma", m);
480 }
481
482 {
483 SoMaterial *m = new SoMaterial;
484 setColorFromRGB(m, "diffuse", 130, 200, 215);
485 setColorFromRGB(m, "ambient", 20, 45, 50);
486 m->transparency.setValue(0.25);
487 add("Peek", m);
488 add("AerogelAndHoneycomb", m);
489 add("BoratedPolyethelyne", m);
490 }
491
492 {
493 SoMaterial *m = new SoMaterial;
494 setColorFromRGB(m, "diffuse", 125, 130, 140);
495 setColorFromRGB(m, "ambient", 35, 40, 45);
496 setColorFromRGB(m, "specular", 200, 200, 200);
497 m->shininess.setValue(0.35);
498 add("SSteel", m);
499 }
500 {
501 // C02:
502 SoMaterial *m = new SoMaterial;
503 m->ambientColor.setValue(0.2, 0.2, 0.2);
504 m->diffuseColor.setValue(0.58, 0.47, 0.81);
505 m->specularColor.setValue(0.56, 0.55, 0.56);
506 add("CO2",m);
507 add("ArCO2",m);
508 add("trt::CO2",m);
509 }
510
511 {
512 // Silicon
513 SoMaterial *m = new SoMaterial;
514 m->ambientColor.setValue(0.98, 0.82, 0.02);
515 m->diffuseColor.setValue(0.16, 0.26, 0.36);
516 m->specularColor.setValue(0.56, 0.55, 0.56);
517 m->shininess.setValue(0.13);
518 add("Silicon",m);
519 add("std::Silicon",m);
520 }
521
522 {
523 // Kapton
524 SoMaterial *m = new SoMaterial;
525 m->ambientColor.setValue(0.2, 0.127931, 0.177402);
526 m->diffuseColor.setValue( 0.57665, 0.155139, 0.180815);
527 m->specularColor.setValue(0.441667, 0.441667, 0.441667);
528 m->shininess.setValue(0.67);
529 add("Kapton",m);
530 add("std::Kapton",m);
531 add("KaptonC",m); //used by LAr.
532 add("FCalCableHarness",m); //used by LAr.
533 }
534
535 {
536 // Aluminium
537 SoMaterial *m = new SoMaterial;
538 m->ambientColor.setValue (0.70, 0.72, 0.72);
539 m->diffuseColor.setValue (0.56, 0.57, 0.57);
540 m->specularColor.setValue(0.71, 0.48, 0.46);
541 m->shininess.setValue(0.23);
542 add("Aluminium",m);
543 add("std::Aluminium",m);
544 }
545
546 {
547 // Iron
548 SoMaterial *m = new SoMaterial;
549 m->diffuseColor.setValue (0.1, 0.1, 0.1);
550 m->specularColor.setValue(0.92, 0.92, 0.89);
551 m->shininess.setValue(0.60);
552 add("Iron",m);
553 add("std::Iron",m);
554 }
555
556 {
557 // Tungsten
558 SoMaterial *m = new SoMaterial;
559 m->diffuseColor.setValue (0.14, 0.14, 0.14);
560 m->specularColor.setValue(0.84, 0.94, 1.00);
561 m->shininess.setValue(0.20);
562 add("Tungsten",m);
563 add("Wolfram",m);
564 add("FCal23Absorber",m);
565 }
566 {
567 // Lead
568 SoMaterial *m = new SoMaterial;
569 m->ambientColor.setValue (0.05, .05, 0.7);
570 m->diffuseColor.setValue (0.39, 0.36, 0.47);
571 m->specularColor.setValue(0.33, 0.33, 0.35);
572 m->shininess.setValue(0.30);
573 add("Lead",m);
574 add("Thinabs",m);
575 add("Thickabs",m);
576 }
577
578 {
579 // G10
580 SoMaterial *m = new SoMaterial;
581 m->diffuseColor.setValue (0.308764, 0.314286, 0.142384);
582 m->specularColor.setValue(0.268276, 0.315312, 0.308455);
583 m->shininess.setValue(0.617021);
584 add("G10",m);
585
586 }
587
588 {
589 // Muon Scintillator
590 SoMaterial *m = new SoMaterial;
591 m->diffuseColor.setValue (0.381944, 0.748016, 0);
592 m->specularColor.setValue(0.963636, 0.963636, 0.963636);
593 m->shininess.setValue(0.981818);
594 add("Scintillator",m);
595 }
596
597 {
598 // Tile Glue
599 SoMaterial *m = new SoMaterial;
600 setColorFromRGB(m, "diffuse", 102, 161, 191); // a pale azure
601 setColorFromRGB(m, "ambient", 0, 40, 47); // a dark blue
602 setColorFromRGB(m, "specular", 234,234, 234); // a light grey
603 m->shininess.setValue(0.64);
604 add( "Glue",m);
605 }
606
607 {
608 // Tile Scintillator
609 SoMaterial *m = new SoMaterial;
610 setColorFromRGB(m, "diffuse", 97, 191, 0); // a bright green
611 setColorFromRGB(m, "ambient", 51, 51, 51); // a dark grey
612 setColorFromRGB(m, "specular", 246, 246, 246); // almost white
613 m->shininess.setValue(0.98);
614 add("tile::Scintillator",m);
615 }
616 {
617 // Epoxy
618 SoMaterial *m = new SoMaterial;
619 m->diffuseColor.setValue (0, 0.748016, 0.176015);
620 m->specularColor.setValue(0.981818, 0.981818, 0.981818);
621 m->shininess.setValue(0.721212);
622 add("Epoxy",m);
623 }
624
625 {
626 // Stainless steel
627 SoMaterial *m = new SoMaterial;
628 m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
629 m->specularColor.setValue(0.168, 0.168, 0.168);
630 m->shininess.setValue(0.153696);
631 add("Stainless",m);
632 }
633 {
634 // Liquid Argon
635 SoMaterial *m = new SoMaterial;
636 m->ambientColor.setValue (0.05, .05, .06);
637 m->diffuseColor.setValue (0.39, .36, .48);
638 m->specularColor.setValue(0.33, .33, .35);
639 m->emissiveColor.setValue(0.45, .60, .60);
640 m->shininess.setValue(0.3);
641 add("LiquidArgon",m);
642 add("std::LiquidArgon",m);
643 }
644 {
645 // Copper
646 SoMaterial *m = new SoMaterial;
647 m->ambientColor.setValue (0.0, 0.0, 0.0);
648 m->diffuseColor.setValue (1.0, .43, .36);
649 m->specularColor.setValue(1.0, 1.0, 1.0);
650 m->shininess.setValue(0.4);
651 add("Copper",m);
652 add("FCal1Absorber",m);
653 }
654
655 {
656 // Cables
657 SoMaterial *m = new SoMaterial;
658 m->diffuseColor.setValue (1.0, 0, 0);
659 add("Cables",m);
660 }
661
662 {
663 // MBoards
664 SoMaterial *m = new SoMaterial;
665 m->diffuseColor.setValue (0, 1, 0);
666 add("MBoards",m);
667 }
668
669 {
670 // Carbon
671 SoMaterial *m = new SoMaterial;
672 m->diffuseColor.setValue (0.2, 0.2, 0.2);
673 m->ambientColor.setValue (0.07, 0.07, 0.07);
674 m->specularColor.setValue (0.8, 0.8, 0.8);
675 m->emissiveColor.setValue (0.028, 0.028, 0.028);
676 add("Carbon",m);
677 }
678
679 {
680 //Titanium
681 SoMaterial *m = new SoMaterial;
682 m->diffuseColor.setValue (0.62, 0.62, 0.62);
683 m->specularColor.setValue (0.294, 0.294, 0.294);
684 m->shininess.setValue(.20);
685 add("Titanium",m);
686 }
687
688 {
689 //ECServices
690 SoMaterial *m = new SoMaterial;
691 m->diffuseColor.setValue (0.7, 0.7, 0.7);
692 m->specularColor.setValue (0.5, 0.5, 0.5);
693 add("ECServices",m);
694 }
695
696 {
697 //ECCables
698 SoMaterial *m = new SoMaterial;
699 m->diffuseColor.setValue (0.1, 0.1, 0.1);
700 add("ECCables",m);
701 }
702
703 {
704 //Services
705 SoMaterial *m = new SoMaterial;
706 m->diffuseColor.setValue (0.765, 0.718, 0.541);
707 m->specularColor.setValue (0.5, 0.5, 0.5);
708 add("Services",m);
709 }
710
711 {
712 //MatOmega
713 SoMaterial *m = new SoMaterial;
714 m->diffuseColor.setValue (0.22, 0.22, 0.22);
715 add("MatOmega",m);
716 add("pix::Omega_BL",m);
717 add("pix::Omega_L1",m);
718 add("pix::Omega_L2",m);
719 }
720
721 {
722 //MatConn
723 SoMaterial *m = new SoMaterial;
724 m->diffuseColor.setValue (0, 0, 0);
725 m->specularColor.setValue (0.8, 0.8, 0.8);
726 add("MatConn",m);
727 add("pix::Connector_BL",m);
728 add("pix::Connector_L1",m);
729 add("pix::Connector_L2",m);
730 }
731
732 {
733 //MatPigtail
734 SoMaterial *m = new SoMaterial;
735 m->diffuseColor.setValue (0.95, 0.58, 0.13);
736 m->specularColor.setValue (0.8, 0.75, 0.7);
737 m->shininess.setValue(.30);
738 add("MatPigtail",m);
739 }
740
741 {
742 // MatAlTube
743 SoMaterial *m = new SoMaterial;
744 m->ambientColor.setValue (0.70, 0.72, 0.72);
745 m->diffuseColor.setValue (0.56, 0.57, 0.57);
746 m->specularColor.setValue(0.71, 0.48, 0.46);
747 m->shininess.setValue(0.23);
748 add("MatAlTube",m);
749 add("pix::AlTube_BL",m);
750 add("pix::AlTube_L1",m);
751 add("pix::AlTube_L2",m);
752 add("MatAlTubeFix",m);
753 }
754
755 {
756 //MatT0 (Cable)
757 SoMaterial *m = new SoMaterial;
758 m->diffuseColor.setValue (0.06, 0.06, 0.06);
759 m->specularColor.setValue (0.8, 0.8, 0.8);
760 add("MatT0",m);
761 add("Cable",m);
762 }
763
764 {
765 //MatCap1
766 SoMaterial *m = new SoMaterial;
767 m->diffuseColor.setValue (0, 0, 0.2);
768 add("MatCap1",m);
769 }
770
771 {
772 //MatCap2
773 SoMaterial *m = new SoMaterial;
774 m->diffuseColor.setValue (0, 0, 0.27);
775 add("MatCap2",m);
776 }
777
778 {
779 //MatTMT
780 SoMaterial *m = new SoMaterial;
781 m->diffuseColor.setValue (0.42, 0.42, 0.42);
782 add("MatTMT",m);
783 add("pix::AsTMT_BL",m);
784 add("pix::AsTMT_L1",m);
785 add("pix::AsTMT_L2",m);
786 }
787
788 {
789 //MatGlue
790 SoMaterial *m = new SoMaterial;
791 m->diffuseColor.setValue (1, 1, 0.78);
792 add("MatGlue",m);
793 add("pix::GlueOmegaStave_BL0",m);
794 add("pix::GlueOmegaStave_L10",m);
795 add("pix::GlueOmegaStave_L20",m);
796 add("OmegaGlue_IBL",m);
797 }
798
799 {
800 //Glue
801 SoMaterial *m = new SoMaterial;
802 m->diffuseColor.setValue (1, 1, 0.75);
803 add("pix::GlueOmegaStave_BL1",m);
804 add("pix::GlueOmegaStave_L11",m);
805 add("pix::GlueOmegaStave_L21",m);
806 }
807
808 {
809 //MatPP11
810 SoMaterial *m = new SoMaterial;
811 m->diffuseColor.setValue (0.08, 0.03, 0.03);
812 add("MatPP11",m);
813 }
814
815 {
816 //MatPP12
817 SoMaterial *m = new SoMaterial;
818 m->diffuseColor.setValue (0.325, 0.292, 0.257);
819 add("MatPP12",m);
820 }
821
822 {
823 //MatPP13
824 SoMaterial *m = new SoMaterial;
825 m->diffuseColor.setValue (0.42, 0.38, 0.30);
826 m->emissiveColor.setValue (0.028, 0.028, 0.028);
827 add("MatPP13",m);
828 }
829
830 {
831 //MatPP14
832 SoMaterial *m = new SoMaterial;
833 m->diffuseColor.setValue (0.3, 0.3, 0.3);
834 m->emissiveColor.setValue (0.028, 0.028, 0.028);
835 add("MatPP14",m);
836 }
837
838 {
839 //MatPP15
840 SoMaterial *m = new SoMaterial;
841 m->diffuseColor.setValue (0.2, 0.2, 0.23);
842 m->emissiveColor.setValue (0.028, 0.028, 0.028);
843 add("MatPP15",m);
844 }
845
846 {
847 //MatPP16
848 SoMaterial *m = new SoMaterial;
849 m->diffuseColor.setValue (0.4, 0.4, 0.4);
850 m->emissiveColor.setValue (0.028, 0.028, 0.028);
851 add("MatPP16",m);
852 }
853
854 {
855 //MatPP17
856 SoMaterial *m = new SoMaterial;
857 m->diffuseColor.setValue (0.17, 0.19, 0.16);
858 m->emissiveColor.setValue (0.028, 0.028, 0.028);
859 add("MatPP17",m);
860 }
861
862 {
863 //Disk
864 SoMaterial *m = new SoMaterial;
865 m->diffuseColor.setValue (0.5, 0.5, 0.5);
866 m->specularColor.setValue (0.5, 0.5, 0.5);
867 m->emissiveColor.setValue (0.028, 0.028, 0.028);
868 add("Disk",m);
869 }
870
871 {
872 //Hybrid
873 SoMaterial *m = new SoMaterial;
874 m->diffuseColor.setValue (0.15, 0.33, 0);
875 m->specularColor.setValue (0.39, 0.39, 0.39);
876 m->emissiveColor.setValue (0.028, 0.028, 0.028);
877 m->shininess.setValue(.60);
878 add("Hybrid",m);
879 add("pix::Hybrid",m);
880 }
881
882 {
883 //Chip
884 SoMaterial *m = new SoMaterial;
885 m->diffuseColor.setValue (0.8, 0.51, 0.105);
886 m->specularColor.setValue (0.39, 0.39, 0.39);
887 m->emissiveColor.setValue (0.028, 0.028, 0.028);
888 m->shininess.setValue(.60);
889 add("Chip",m);
890 add("pix::Chip",m);
891 }
892
893
894 {
895 SoMaterial *m = new SoMaterial;
896 m->diffuseColor.setValue (0.42, 0.42, 0.42);
897 add("pix:AsTMT_BL",m);
898 }
899
900 {
901 SoMaterial *m = new SoMaterial;
902 m->diffuseColor.setValue (0.95, 0.52, 0.12);
903 m->specularColor.setValue (0.8, 0.75, 0.7);
904 m->shininess.setValue(.30);
905 add("pix::PigtailCyl",m);
906 add("pix::PigtailFlat",m);
907 }
908
909 {
910 // Rings and Service Support
911 SoMaterial *m = new SoMaterial;
912 m->ambientColor.setValue (0.50, 0.49, 0.12);
913 m->diffuseColor.setValue (0.665, 0.618, 0.441);
914 m->specularColor.setValue(0.51, 0.48, 0.16);
915 m->shininess.setValue(0.37);
916 //Rings
917 add("pix::AsRingCen_BL",m);
918 add("pix::AsRingInt_BL",m);
919 add("pix::AsRingOut_BL",m);
920 add("pix::AsRing_L1",m);
921 add("pix::AsRingOut_L1",m);
922 add("pix::AsRing_L2",m);
923 add("pix::AsRingOut_L2",m);
924 //ServiceSupport
925 add("pix::ServiceSupport_BL",m);
926 add("pix::ServiceSupport_L1",m);
927 add("pix::ServiceSupport_L2",m);
928 }
929 {
930 // Halfshell
931 SoMaterial *m = new SoMaterial;
932 m->ambientColor.setValue (0.21, 0.23, 0.23);
933 m->diffuseColor.setValue (0.1, 0.11, 0.11);
934 m->specularColor.setValue(0.31, 0.28, 0.06);
935 m->shininess.setValue(0.43);
936 add("pix::Halfshell_BL",m);
937 add("pix::Halfshell_L1",m);
938 add("pix::Halfshell_L2",m);
939 }
940
941 {
942 SoMaterial *m = new SoMaterial;
943 m->ambientColor.setValue (0.40, 0.42, 0.42);
944 m->diffuseColor.setValue (0.36, 0.37, 0.37);
945 m->specularColor.setValue(0.51, 0.28, 0.26);
946 m->shininess.setValue(0.38);
947 add("Prepreg",m);
948 }
949
950 {
951 SoMaterial *m = new SoMaterial;
952 m->ambientColor.setValue (0.10, 0.12, 0.12);
953 m->diffuseColor.setValue (0.09, 0.10, 0.17);
954 add("pix::CablesAxial_BL",m);
955 add("pix::CoolingAxial_BL",m);
956 add("pix::CabCoolAxial_L1",m);
957 add("pix::CabCoolAxial_L2",m);
958 add("pix::CabCoolRadial_L1",m);
959 add("pix::OuterCable_BL",m);
960 add("pix::OuterCabCool_L1",m);
961 add("pix::OuterCabCool_L2",m);
962 }
963 {
964 SoMaterial *m = new SoMaterial;
965 m->ambientColor.setValue (0.12, 0.14, 0.14);
966 m->diffuseColor.setValue (0.10, 0.11, 0.19);
967 add("pix::CablesRadial_BL",m);
968 add("pix::CoolingRadial_BL",m);
969 add("pix::CabCoolRadial_L2",m);
970 add("pix::OuterCooling_BL",m);
971 }
972
973 {
974 SoMaterial *m = new SoMaterial;
975 m->ambientColor.setValue (0.20, 0.25, 0.25);
976 m->diffuseColor.setValue (0.22, 0.22, 0.22);
977 add("pix::Ulink_BL_A",m);
978 add("pix::AsUlink_BL_C",m);
979 add("pix::AsUlink_L1",m);
980 add("pix::AsUlink_L2",m);
981 }
982
983 {
984 SoMaterial *m = new SoMaterial;
985 m->ambientColor.setValue (0.40, 0.42, 0.42);
986 m->diffuseColor.setValue (0.36, 0.37, 0.37);
987 m->specularColor.setValue(0.51, 0.28, 0.26);
988 m->shininess.setValue(0.38);
989 add("pix::SSR_BL_A",m);
990 add("pix::SSR_BL_C",m);
991 add("pix::SSR_L1_A",m);
992 add("pix::SSR_L1_C",m);
993 add("pix::SSR_L2",m);
994 }
995
996 {
997 SoMaterial *m = new SoMaterial;
998 m->ambientColor.setValue (0.35, 0.37, 0.37);
999 m->diffuseColor.setValue (0.31, 0.32, 0.32);
1000 m->specularColor.setValue(0.51, 0.28, 0.26);
1001 m->shininess.setValue(0.38);
1002 add("pix::InnerSkin_BL",m);
1003 add("pix::InnerSkin_L1",m);
1004 add("pix::InnerSkin_L2",m);
1005 }
1006
1007 {
1008 SoMaterial *m = new SoMaterial;
1009 m->ambientColor.setValue (0.55, 0.57, 0.57);
1010 m->diffuseColor.setValue (0.51, 0.52, 0.52);
1011 m->specularColor.setValue(0.51, 0.28, 0.26);
1012 m->shininess.setValue(0.33);
1013 add("pix::Fingers1",m);
1014 add("pix::Fingers2",m);
1015 add("pix::Fingers3",m);
1016 add("pix::Fingers4",m);
1017 }
1018
1019 {
1020 //Glass
1021 SoMaterial *m = new SoMaterial;
1022 m->diffuseColor.setValue (0.8, 0.9, 1.0);
1023 m->specularColor.setValue (0.39, 0.39, 0.39);
1024 m->emissiveColor.setValue (0.028, 0.028, 0.028);
1025 m->shininess.setValue(.60);
1026 add("Glass",m);
1027 }
1028
1029 {
1030 SoMaterial *material = new SoMaterial;
1031 material->diffuseColor.setValue(0.9,0.7,0.5);
1032 material->ambientColor.setValue(0.57,0.57,0.57);
1033 material->specularColor.setValue(0.27,0.27,0.27);
1034 material->shininess.setValue(.80);
1035 add("AlNitride",material);
1036 add("Dogleg",material);
1037 add("BrlBaseBoard",material);
1038 add("BrlHybrid",material);
1039 add("BrlBracket",material);
1040 add("PigTail",material);
1041 }
1042
1043 {
1044 SoMaterial *material = new SoMaterial;
1045 material->diffuseColor.setValue(0.40,0.60,0.40);
1046 material->ambientColor.setValue(0.57,0.57,0.57);
1047 material->specularColor.setValue(0.27,0.27,0.27);
1048 material->shininess.setValue(.80);
1049 add("PowerTape",material);
1050 }
1051
1052 {
1053 SoMaterial *material = new SoMaterial;
1054 material->diffuseColor.setValue(0.57,0.82,0.9);
1055 material->ambientColor.setValue(0.57,0.57,0.57);
1056 material->specularColor.setValue(0.27,0.27,0.27);
1057 material->shininess.setValue(.80);
1058 add("CoolingBlock",material);
1059 add("sct::CoolBlockSecHi",material);
1060 add("sct::CoolBlockSecLo",material);
1061 add("sct::DiscCoolingInn",material);
1062 add("sct::DiscCoolingOut",material);
1063 }
1064
1065 { /* Large structures in sct */
1066 SoMaterial *material = new SoMaterial;
1067 //material->diffuseColor.setValue(0.7,0.6,0.5);
1068 material->diffuseColor.setValue(0.8,0.7,0.6);
1069 material->ambientColor.setValue(0.57,0.57,0.57);
1070 material->specularColor.setValue(0.27,0.27,0.27);
1071 material->shininess.setValue(.80);
1072 add("sct::DiscCoolingMid",material);
1073 add("sct::DiscPowerTapeMid",material);
1074 add("sct::DiscPowerTapeInn",material);
1075 add("sct::DiscPowerTapeOut",material);
1076 add("sct::EMI",material);
1077 add("sct::EMIJoint",material);
1078 add("sct::Flange0",material);
1079 add("sct::Flange1",material);
1080 add("sct::Flange2",material);
1081 add("sct::Flange3",material);
1082 add("sct::FwdFrontSupport",material);
1083 add("sct::FwdITE",material);
1084 add("sct::FwdLMT",material);
1085 add("sct::FwdLMTCooling",material);
1086 add("sct::FwdOTE",material);
1087 add("sct::FwdRearSupport",material);
1088 add("sct::FwdRail",material);
1089 add("sct::FwdSupport",material);
1090 add("sct::FwdSpineMid",material);
1091 add("sct::FwdSpineOut",material);
1092 add("sct::FwdSpineInn",material);
1093 add("sct::Harness",material);
1094 add("sct::OptoHarnessO",material);
1095 add("sct::OptoHarnessOM",material);
1096 add("sct::OptoHarnessOMI",material);
1097 add("sct::Spider",material);
1098 add("sct::SupportCyl0",material);
1099 add("sct::SupportCyl1",material);
1100 add("sct::SupportCyl2",material);
1101 add("sct::SupportCyl3",material);
1102 add("sct::TSCylinder",material);
1103 }
1104
1105 { /* Details in sct (A) */
1106 SoMaterial *material = new SoMaterial;
1107 material->diffuseColor.setValue(0.6,0.525,0.45);
1108 material->ambientColor.setValue(0.57,0.57,0.57);
1109 material->specularColor.setValue(0.27,0.27,0.27);
1110 material->shininess.setValue(.80);
1111 add("sct::FwdHybrid",material);
1112 add("sct::CoolBlockMainHi",material);
1113 add("sct::CoolBlockMainLo",material);
1114 }
1115
1116 { /* Details in sct (B) */
1117 SoMaterial *material = new SoMaterial;
1118 material->diffuseColor.setValue(0.4,0.35,0.30);
1119 material->ambientColor.setValue(0.57,0.57,0.57);
1120 material->specularColor.setValue(0.27,0.27,0.27);
1121 material->shininess.setValue(.80);
1122 add("sct::CFiberInterLink",material);
1123 add("sct::Clamp0",material);
1124 add("sct::Clamp1",material);
1125 add("sct::Clamp2",material);
1126 add("sct::Clamp3",material);
1127 add("sct::CoolingEnd0",material);
1128 add("sct::CoolingEnd1",material);
1129 add("sct::CoolingEnd2",material);
1130 add("sct::CoolingEnd3",material);
1131 add("sct::CoolingPipe",material);
1132 add("sct::DiscFixation",material);
1133 add("sct::DiscSupport0",material);
1134 add("sct::DiscSupport1",material);
1135 add("sct::ModuleConnector",material);
1136 add("sct::DiscSupport2",material);
1137 add("sct::DiscSupport3",material);
1138 add("sct::DiscSupport4",material);
1139 add("sct::DiscSupport5",material);
1140 add("sct::DiscSupport6",material);
1141 add("sct::DiscSupport7",material);
1142 add("sct::DiscSupport8",material);
1143 add("sct::FSIBL",material);
1144 add("sct::FSIBH",material);
1145 add("sct::FSIFL",material);
1146 add("sct::FSIFH",material);
1147 add("sct::FwdCoolingPipe",material);
1148 add("sct::FwdFlangeFrontInn",material);
1149 add("sct::FwdFlangeFrontOut",material);
1150 add("sct::FwdFlangeRearInn",material);
1151 add("sct::FwdFlangeRearOut",material);
1152 add("sct::FwdNPipe",material);
1153 add("sct::FwdShuntShield",material);
1154 add("sct::PPConnector",material);
1155 add("sct::PPCooling",material);
1156 add("sct::PPF0c",material);
1157 add("sct::PPF0e",material);
1158 add("sct::PPF0o",material);
1159 add("sct::TSBulkhead",material);
1160 add("sct::TSEndPanel",material);
1161 }
1162 {
1163 SoMaterial * m = new SoMaterial;
1164 m->diffuseColor.setValue(SbColor(0.33333,0.33333,0.49804));
1165 m->shininess.setValue(0);
1166 add("sct::FwdFibres",m);
1167 }
1168
1169 {
1170 // NSW - sTGC
1171 SoMaterial * m = new SoMaterial;
1172 m->ambientColor.setValue(0.2, 0.2, 0.2);
1173 setColorFromRGB(m, "diffuse", 4, 142, 167); // #048EA7 - Blue Munsell (greenish azure)
1174 m->specularColor.setValue(0,0,0);
1175 m->shininess.setValue(0.2);
1176 add("Honeycomb",m);
1177 add("muo::Honeycomb",m); // there's a typo in the Muon material, should be "muon::", not "muo::" ...
1178
1179 }
1180 {
1181 // NSW - MicroMegas (MM)
1182 SoMaterial *m = new SoMaterial;
1183 setColorFromRGB(m, "diffuse", 212, 194, 126); // #D4C27E - Ecru
1184 m->specularColor.setValue (0.5, 0.5, 0.5);
1185 m->shininess.setValue(0.2);
1186 add("PCB",m);
1187 add("sct::PCB",m);
1188 }
1189 {
1190 // NSW - Shield Steel
1191 SoMaterial *m = new SoMaterial;
1192 m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
1193 m->specularColor.setValue(0.168, 0.168, 0.168);
1194 m->shininess.setValue(0.153696);
1195 add("ShieldSteel",m);
1196 add("shield::ShieldSteel",m);
1197 }
1198
1199 /* WIP
1200 {
1201 // NSW - Special material for the Run3 Detector Pape
1202 // The aim is to colorize the JD shield plate
1203 // in contrasting color, for the NSW images
1204 SoMaterial *m = new SoMaterial;
1205 setColorFromRGB(m, "diffuse", 114, 83, 143); // 72538F - Royal Purple
1206 //m->diffuseColor.setValue (0.424238, 0.424238, 0.424238);
1207 m->specularColor.setValue(0.168, 0.168, 0.168);
1208 m->shininess.setValue(0.153696);
1209 add("shield::ShieldSteel",m);
1210 }
1211 */
1212
1213 // Adding ITk colors
1214 // PP0 material
1215 // Services and Cooling
1216 {
1217 SoMaterial *m = new SoMaterial;
1218 setColorFromRGB(m, "diffuse", 81, 163, 119);
1219 setColorFromRGB(m, "ambient", 0, 40, 48);
1220 setColorFromRGB(m, "specular", 255, 255, 255);
1221 setColorFromRGB(m, "emissive", 0, 0, 0);
1222 m->shininess.setValue(0.5);
1223 m->transparency.setValue(0.6);
1224 // inner pixel system
1225 add( "PP0BMaterial",m);
1226 add( "PP0CMaterial",m);
1227 add( "PP0DMaterial",m);
1228 add( "PP0SMaterial",m);
1229 add( "PP0QMaterial",m);
1230 // inner pixel system
1231 add( "SvcBrlPP0_30_Hor2_L2_Sec0_Material",m);
1232 add( "SvcBrlPP0_40_Hor3_L3_Sec0_Material",m);
1233 add( "SvcBrlPP0_50_Hor4_L4_Sec0_Material",m);
1234 add( "OutPixIncSec2PP0Material",m);
1235 add( "OutPixIncSec3PP0Material",m);
1236 add( "OutPixIncSec4PP0Material",m);
1237
1238 add( "Type1ServiceBMaterial",m);
1239 add( "Type1ServiceCMaterial",m);
1240 add( "Type1ServiceDMaterial",m);
1241 add( "Type1ServiceSMaterial",m);
1242 add( "Type1ServiceQMaterial",m);
1243 add( "Type1CoolingBMaterial",m);
1244 add( "Type1CoolingEMaterial",m);
1245 }
1246
1247 // PP1 material
1248 {
1249 SoMaterial *m = new SoMaterial;
1250 setColorFromRGB(m, "diffuse", 76, 76, 204);
1251 setColorFromRGB(m, "emissive", 53, 53, 141);
1252 m->transparency.setValue(0.7);
1253
1254 add( "matPixType2D",m);
1255 add( "matPixType2F",m);
1256 add( "matPixType2H",m);
1257 add( "matPixType2I",m);
1258 add( "matPixType2L",m);
1259 add( "matPixReadout1",m);
1260 add( "matPixReadout2",m);
1261 add( "matPixType2G",m);
1262 add( "matPixType2E",m);
1263 add( "PP1_T2_Power_lowr",m);
1264 add( "PP1_T2_Power",m);
1265 add( "PP1_T2_Power_midr",m);
1266 add( "PP1_T1_Inner",m);
1267 add( "PP1_T1_Outer",m);
1268 add( "PP1_T2_Power_highr",m);
1269 add( "PP1_T2_cooling_quadrant",m);
1270 add( "matPixCoolingOuter",m);
1271 add( "pixSvc_PP1_T2_R347_R420_CoolingInner",m);
1272 add( "MatB_PP1",m);
1273 add( "MatEC_PP1",m);
1274 add( "HeatExchanger",m);
1275 add( "PP1_T1_Outer_Cyl",m);
1276 add( "PP1_T1_Inner_Cyl",m);
1277 add( "matPixCoolingSum",m);
1278 add( "AlAnticorodal",m);
1279 add( "matHeatExchanger",m);
1280 add( "matPixCoolingInner",m);
1281 add( "PP1_T1_cooling_Steel",m);
1282 add( "PP1_T1_powerconnector_Al",m);
1283 add( "PP1_T1_Inner_Cone",m);
1284 add( "matPP1Type1PixInner",m);
1285 add( "matPP1InnerConnectors",m);
1286 add( "matPP1Type1PixOuter",m);
1287 add( "matPP1OuterConnectors",m);
1288 add( "PP1_T1_Outer_Cone",m);
1289
1290 }
1291
1292 // Hybrid material on ITk strip modules
1293 {
1294 SoMaterial *m = new SoMaterial;
1295 setColorFromRGB(m, "diffuse", 29, 86, 86);
1296 setColorFromRGB(m, "ambient", 0, 0, 0);
1297 setColorFromRGB(m, "specular", 0, 0, 0);
1298 setColorFromRGB(m, "emissive", 59, 117, 176);
1299 add( "matB_HybridPCB",m);
1300 add( "matEC_HybridPCB",m);
1301 add( "matEC_HybridR0H0",m);
1302 add( "matEC_HybridR0H1",m);
1303 add( "matEC_HybridR1H0",m);
1304 add( "matEC_HybridR1H1",m);
1305 add( "matEC_HybridR2H0",m);
1306 add( "matEC_HybridR3H0",m);
1307 add( "matEC_HybridR3H1",m);
1308 add( "matEC_HybridR3H2",m);
1309 add( "matEC_HybridR3H3",m);
1310 add( "matEC_HybridR4H0",m);
1311 add( "matEC_HybridR4H1",m);
1312 add( "matEC_HybridR5H0",m);
1313 add( "matEC_HybridR5H1",m);
1314 add( "matPetalBusKapton",m);
1315 add( "matDCDC_PCB",m);
1316 add( "matDCDC_Box",m);
1317 }
1318
1320 init();
1321}
void add(const std::string &name, SoMaterial *)
void setColorFromRGB(SoMaterial *mat, const std::string &type, const int r, const int g, const int b)

Member Function Documentation

◆ add()

void VisAttributes::add ( const std::string & name,
SoMaterial * material )
protectedinherited

Definition at line 135 of file VisAttributes.cxx.

135 {
136 if (m_d->_map.find(name)!=m_d->_map.end()) {
137 std::cout<<"VisAttributes::add ERROR: Material " <<name<<" already added!"<<std::endl;
138 return;
139 }
140 material->ref();
141 m_d->_map[name]=material;
142 if (material->transparency.getNum()!=1)
143 std::cout<<"VisAttributes::add Warning: Found #transparency values different from 1 in material "<<name<<std::endl;
144 // FIXME. Commented out, because Ric and I are not sure why this is an issue
145 // We may want to add this back if this turns out to indicate a real problem
146 // if (material->transparency[0]!=0.0)
147 // std::cout<<"VisAttributes::add Warning: Found transparency value different from 0 in material "<<name<<std::endl;
148}

◆ applyState()

void VisAttributes::applyState ( QByteArray ba)
inherited

Definition at line 63 of file VisAttributes.cxx.

64{
65 //Get map out:
66 QMap<QString,QByteArray> storedstates;
67 QBuffer buffer(&ba);
68 buffer.open(QIODevice::ReadOnly);
69 QDataStream state(&buffer);
70 qint32 version;
71 state >> version;
72 if (version!=0)
73 return;//ignore silently
74 state >> storedstates;
75 buffer.close();
76
77 std::map< std::string, SoMaterial *>::iterator itMat,itMatE(m_d->_map.end());
78
79 //Apply states from map:
80 QMap<QString,QByteArray>::const_iterator it, itE(storedstates.constEnd());
81 for (it = storedstates.constBegin(); it!=itE; ++it) {
82 itMat = m_d->_map.find(it.key().toStdString());
83 if (itMat!=itMatE) {
84 QByteArray b(it.value());
86 }
87 }
88
89}
static bool deserialiseSoMaterial(QByteArray &, SoMaterial *&)

◆ get()

SoMaterial * VisAttributes::get ( const std::string & name) const
inherited

Definition at line 126 of file VisAttributes.cxx.

126 {
127 std::map <std::string, SoMaterial *>::const_iterator m = m_d->_map.find(name);
128 if (m!=m_d->_map.end()) {
129 return (*m).second;
130 } else {
131 return NULL;
132 }
133}

◆ getState()

QByteArray VisAttributes::getState ( bool onlyChangedMaterials = true)
inherited

Definition at line 34 of file VisAttributes.cxx.

35{
36 //Figure out states to store
37 QMap<QString,QByteArray> storedstates, statesnow = m_d->currentState();
38 if (onlyChangedMaterials) {
39 QMap<QString,QByteArray>::const_iterator it, itE(statesnow.constEnd());
40 QMap<QString,QByteArray>::const_iterator itOrig, itOrigE(m_d->initialState.constEnd());
41 for (it = statesnow.constBegin(); it!=itE; ++it) {
42 itOrig = m_d->initialState.constFind(it.key());
43 if (itOrig==itOrigE||it.value()!=itOrig.value())
44 storedstates.insert(it.key(),it.value());
45 }
46 } else {
47 storedstates = statesnow;
48 }
49
50 //Put map in bytearray and return:
51 QByteArray byteArray;
52 QBuffer buffer(&byteArray);
53 buffer.open(QIODevice::WriteOnly);
54 QDataStream out(&buffer);
55 out << qint32(0);//version
56 out << storedstates;
57 buffer.close();
58 return byteArray;
59
60}

◆ getValFromRGB()

float VisAttributes::getValFromRGB ( const int rgb)
privateinherited

Definition at line 157 of file VisAttributes.cxx.

158{
159 return rgb/255.0;
160}

◆ init()

void VisAttributes::init ( )
inherited

Definition at line 28 of file VisAttributes.cxx.

29{
30 m_d->initialState = m_d->currentState();
31}

◆ outlineColour()

std::optional< SbColor > VisAttributes::outlineColour ( const std::string & name) const
inherited

Definition at line 115 of file VisAttributes.cxx.

116{
117 const auto it = m_d->outlineColours.find(name);
118 return it == m_d->outlineColours.end() ? std::nullopt : std::optional<SbColor>(it->second);
119}

◆ overrideTransparencies()

void VisAttributes::overrideTransparencies ( float transpfact)
inherited

Definition at line 150 of file VisAttributes.cxx.

151{
152 std::map< std::string, SoMaterial *>::iterator it, itE = m_d->_map.end();
153 for (it=m_d->_map.begin();it!=itE;++it)
154 it->second->transparency.set1Value( 0, transpfact );
155}

◆ setColorFromRGB()

void VisAttributes::setColorFromRGB ( SoMaterial * mat,
const std::string & type,
const int r,
const int g,
const int b )
protectedinherited

Definition at line 162 of file VisAttributes.cxx.

163{
164 const float fr = getValFromRGB(r);
165 const float fg = getValFromRGB(g);
166 const float fb = getValFromRGB(b);
167 if (type == "ambient")
168 mat->ambientColor.setValue(fr, fg, fb);
169 else if (type == "diffuse")
170 mat->diffuseColor.setValue(fr, fg, fb);
171 else if (type == "specular")
172 mat->specularColor.setValue(fr, fg, fb);
173 else if (type == "emissive")
174 mat->emissiveColor.setValue(fr, fg, fb);
175 else
176 std::cout << "ERROR! Color type not supported ==> " << type << std::endl;
177
178 // Debug Msg
179 //std::cout << "Set color (" << r << "," << g << "," << b << ") to (" << fr << "," << fg << "," << fb << ")" << std::endl;
180 return;
181}
float getValFromRGB(const int rgb)
int r
Definition globals.cxx:22

◆ setOutlineColour()

void VisAttributes::setOutlineColour ( const std::string & name,
const SbColor & colour )
protectedinherited

Definition at line 121 of file VisAttributes.cxx.

122{
123 m_d->outlineColours.insert_or_assign(name, colour);
124}

Member Data Documentation

◆ m_d

Imp* VisAttributes::m_d
privateinherited

Definition at line 55 of file VisAttributes.h.


The documentation for this class was generated from the following files: