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 366 of file VisAttributes.cxx.

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