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
void overrideTransparencies (float transpfact)
QByteArray getState (bool onlyChangedMaterials=true)
void applyState (QByteArray)

Protected Member Functions

void add (const std::string &name, SoMaterial *)
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

Impm_d

Detailed Description

Definition at line 64 of file VisAttributes.h.

Constructor & Destructor Documentation

◆ MatVisAttributes()

MatVisAttributes::MatVisAttributes ( )

Definition at line 373 of file VisAttributes.cxx.

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

122 {
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}

◆ applyState()

void VisAttributes::applyState ( QByteArray ba)
inherited

Definition at line 61 of file VisAttributes.cxx.

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}
static bool deserialiseSoMaterial(QByteArray &, SoMaterial *&)

◆ get()

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

Definition at line 113 of file VisAttributes.cxx.

113 {
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}

◆ getState()

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

Definition at line 32 of file VisAttributes.cxx.

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}

◆ getValFromRGB()

float VisAttributes::getValFromRGB ( const int rgb)
privateinherited

Definition at line 144 of file VisAttributes.cxx.

145{
146 return rgb/255.0;
147}

◆ init()

void VisAttributes::init ( )
inherited

Definition at line 26 of file VisAttributes.cxx.

27{
28 m_d->initialState = m_d->currentState();
29}

◆ overrideTransparencies()

void VisAttributes::overrideTransparencies ( float transpfact)
inherited

Definition at line 137 of file VisAttributes.cxx.

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}

◆ setColorFromRGB()

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

Definition at line 149 of file VisAttributes.cxx.

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}
float getValFromRGB(const int rgb)
int r
Definition globals.cxx:22

Member Data Documentation

◆ m_d

Imp* VisAttributes::m_d
privateinherited

Definition at line 48 of file VisAttributes.h.


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