94{
95 G4Material* mate = G4PhantomParameterisation::ComputeMaterial(
96 copyNo, physVol, 0 );
97
98 if(G4VVisManager::GetConcreteInstance() && physVol)
99 {
100 G4String mateName = mate->GetName();
101 std::string::size_type iuu = mateName.find("__");
102 if( iuu != std::string::npos )
103 mateName = mateName.substr( 0, iuu );
104
106 physVol->GetLogicalVolume()->SetVisAttributes(
108 else
109 {
110 bool found = false;
112 {
114 auto len = mat_color.length();
115 if(mateName.find(mat_color) == 0 &&
116 mateName.length() > len && mateName[len] == '_')
117 {
118 physVol->GetLogicalVolume()->SetVisAttributes(
120 found = true;
121 }
122 if(found)
123 break;
124 }
125 if(!found)
126 {
127 G4int matIndex = G4int(GetMaterialIndex(copyNo));
128 static uintmax_t n = 0;
129 if(n++ < 100)
130 G4cout << "Unknown material name " << mateName
131 << " for index " << matIndex << G4endl;
133 physVol->GetLogicalVolume()->SetVisAttributes(
135 else
136 physVol->GetLogicalVolume()->SetVisAttributes(
138 }
139 }
140 physVol -> GetLogicalVolume()->SetMaterial(mate);
141 }
142
143 return mate;
144}
std::map< G4int, G4VisAttributes * > fColours2