97 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance();
98 G4LogicalVolume* pLV = 0;
100 for (G4int i = 0; i < G4int(pLVStore->size()); i++) {
101 pLV = (*pLVStore)[i];
103 if (!
Contains(lvList, pLV)) lvList.push_back(pLV);
107 if (lvList.size() > 0)
return lvList;
109 G4PhysicalVolumeStore* pPVStore = G4PhysicalVolumeStore::GetInstance();
110 G4VPhysicalVolume* pPV = 0;
112 for (G4int i = 0; i < G4int(pPVStore->size()); i++) {
113 pPV = (*pPVStore)[i];
115 pLV = pPV->GetLogicalVolume();
116 if (!
Contains(lvList, pLV)) lvList.push_back(pLV);
199 G4LogicalVolume*
const lv,
const TG4G3Attribute att,
const G4int val)
207 const G4VisAttributes* visAttributes = lv->GetVisAttributes();
208 G4VisAttributes* newVisAttributes;
210 newVisAttributes =
new G4VisAttributes(
false);
212 G4bool visibility = visAttributes->IsVisible();
213 G4Colour colour = visAttributes->GetColour();
214 newVisAttributes =
new G4VisAttributes(visibility, colour);
217 const G4int kAbsVal = abs(val);
220 G4double red(0), green(0), blue(0);
221 G4bool isVisible(
false);
222 G4bool isDaughtersInvisible(
false);
223 G4VisAttributes::LineStyle lineStyle = G4VisAttributes::unbroken;
224 G4double lineWidth = 1.0;
225 G4bool isForceDrawingStyle(
false);
226 G4VisAttributes::ForcedDrawingStyle drawingStyle = G4VisAttributes::wireframe;
231 isVisible = visAttributes->IsVisible();
232 isDaughtersInvisible = visAttributes->IsDaughtersInvisible();
233 red = visAttributes->GetColour().GetRed();
234 green = visAttributes->GetColour().GetGreen();
235 blue = visAttributes->GetColour().GetBlue();
236 lineStyle = visAttributes->GetLineStyle();
237 lineWidth = visAttributes->GetLineWidth();
238 isForceDrawingStyle = visAttributes->IsForceDrawingStyle();
239 if (isForceDrawingStyle)
240 drawingStyle = visAttributes->GetForcedDrawingStyle();
242 G4double luminosityBin(0.04),
271 lineStyle = G4VisAttributes::unbroken;
274 lineStyle = G4VisAttributes::dashed;
277 lineStyle = G4VisAttributes::dotted;
281 G4cout <<
"TG4VisManager::Gsatt() Usage of LSTY :" << G4endl
282 <<
"ATT = 1,2,3 means line unbroken, dashed or dotted"
284 <<
"any other value resets to the default : unbroken"
286 lineStyle = G4VisAttributes::unbroken;
291 if (lineWidth > 7) lineWidth = 7;
293 G4cout <<
"TG4VisManager::Gsatt() Usage for LWID :" << G4endl
294 <<
" The VAL you supply means the width of lines in pixels "
295 <<
"for the screen and in 0.1*mm for paper." << G4endl
296 <<
" Negative values means the same, but for all daughters"
340 if (kAbsVal >= 8 && kAbsVal <= 16) {
344 luminosity = (kAbsVal - 7) * luminosityBin;
346 if (kAbsVal >= 17 && kAbsVal <= 41) {
350 luminosity = (kAbsVal - 16) * luminosityBin;
352 if (kAbsVal >= 67 && kAbsVal <= 91) {
356 luminosity = (kAbsVal - 66) * luminosityBin;
358 if (kAbsVal >= 117 && kAbsVal <= 141) {
362 luminosity = (kAbsVal - 116) * luminosityBin;
364 if (kAbsVal >= 42 && kAbsVal <= 66) {
368 luminosity = (kAbsVal - 41) * luminosityBin;
370 if (kAbsVal >= 142 && kAbsVal <= 166) {
374 luminosity = (kAbsVal - 141) * luminosityBin;
376 if (kAbsVal >= 92 && kAbsVal <= 116) {
380 luminosity = (kAbsVal - 91) * luminosityBin;
382 if (red < luminosityBin) red += luminosity;
383 if (green < luminosityBin) green += luminosity;
384 if (blue < luminosityBin) blue += luminosity;
387 isForceDrawingStyle =
true;
390 drawingStyle = G4VisAttributes::wireframe;
393 drawingStyle = G4VisAttributes::solid;
397 G4cout <<
"TG4VisManager::Gsatt() FILL usage :" << G4endl
398 <<
" The FILL values you can supply are only :" << G4endl
399 <<
"+/- 1 : forces wireframe drawing (default)" << G4endl
400 <<
"+/- 2 : forces solid drawing" << G4endl
401 <<
"other values sets the drawing style to solid" << G4endl;
402 drawingStyle = G4VisAttributes::solid;
408 newVisAttributes->SetVisibility(isVisible);
409 newVisAttributes->SetDaughtersInvisible(isDaughtersInvisible);
410 newVisAttributes->SetColour(red, green, blue);
411 newVisAttributes->SetLineStyle(lineStyle);
412 newVisAttributes->SetLineWidth(lineWidth);
413 if (drawingStyle == G4VisAttributes::wireframe)
414 newVisAttributes->SetForceWireframe(isForceDrawingStyle);
415 if (drawingStyle == G4VisAttributes::solid)
416 newVisAttributes->SetForceSolid(isForceDrawingStyle);
418 lv->SetVisAttributes(newVisAttributes);
439 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance();
440 const G4LogicalVolume* pLV = 0;
442 for (G4int i = 0; i < G4int(pLVStore->size()); i++) {
443 pLV = (*pLVStore)[i];
445 const G4Material* pMaterial = pLV->GetMaterial();
446 const G4State kState = pMaterial->GetState();
447 G4double density = (pMaterial->GetDensity()) * cm3 / g;
448 G4String nState =
"Undefined";
450 G4double luminosity = 0.;
451 if (kState == kStateUndefined) {
452 nState =
"Undefined";
454 if (kState == kStateSolid) {
458 luminosity = 25 - 25 * density / 2;
460 else if (density < 3) {
462 luminosity = 25 - 25 * (density - 2);
464 else if (density < 10) {
466 luminosity = 25 - 25 * (density - 5) / 5;
468 else if (density < 15) {
470 luminosity = 25 - 25 * (density - 10) / 5;
472 else if (density < 20) {
474 luminosity = 9 - 9 * (density - 15) / 5;
477 if (kState == kStateLiquid) {
480 luminosity = 25 - 25 * density / 2;
482 if (kState == kStateGas) {
484 if (density < 0.001) {
487 else if (density < 0.002) {
490 else if (density < 0.003) {
498 if (luminosity < 0) luminosity = 0;
499 colour += (G4int)luminosity;
501 Gsatt(pLV->GetName(),
"COLO", colour);