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