98 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance();
99 G4LogicalVolume* pLV = 0;
101 for (G4int i = 0; i < G4int(pLVStore->size()); i++) {
102 pLV = (*pLVStore)[i];
106 if (!
Contains(lvList, pLV)) lvList.push_back(pLV);
110 if (lvList.size() > 0)
return lvList;
112 G4PhysicalVolumeStore* pPVStore = G4PhysicalVolumeStore::GetInstance();
113 G4VPhysicalVolume* pPV = 0;
115 for (G4int i = 0; i < G4int(pPVStore->size()); i++) {
116 pPV = (*pPVStore)[i];
118 pLV = pPV->GetLogicalVolume();
119 if (!
Contains(lvList, pLV)) lvList.push_back(pLV);
202 G4LogicalVolume*
const lv,
const TG4G3Attribute att,
const G4int val)
210 const G4VisAttributes* visAttributes = lv->GetVisAttributes();
211 G4VisAttributes* newVisAttributes;
213 newVisAttributes =
new G4VisAttributes(
false);
215 G4bool visibility = visAttributes->IsVisible();
216 G4Colour colour = visAttributes->GetColour();
217 newVisAttributes =
new G4VisAttributes(visibility, colour);
220 const G4int kAbsVal = abs(val);
223 G4double red(0), green(0), blue(0);
224 G4bool isVisible(
false);
225 G4bool isDaughtersInvisible(
false);
226 G4VisAttributes::LineStyle lineStyle = G4VisAttributes::unbroken;
227 G4double lineWidth = 1.0;
228 G4bool isForceDrawingStyle(
false);
229 G4VisAttributes::ForcedDrawingStyle drawingStyle = G4VisAttributes::wireframe;
234 isVisible = visAttributes->IsVisible();
235 isDaughtersInvisible = visAttributes->IsDaughtersInvisible();
236 red = visAttributes->GetColour().GetRed();
237 green = visAttributes->GetColour().GetGreen();
238 blue = visAttributes->GetColour().GetBlue();
239 lineStyle = visAttributes->GetLineStyle();
240 lineWidth = visAttributes->GetLineWidth();
241 isForceDrawingStyle = visAttributes->IsForceDrawingStyle();
242 if (isForceDrawingStyle)
243 drawingStyle = visAttributes->GetForcedDrawingStyle();
245 G4double luminosityBin(0.04),
274 lineStyle = G4VisAttributes::unbroken;
277 lineStyle = G4VisAttributes::dashed;
280 lineStyle = G4VisAttributes::dotted;
284 G4cout <<
"TG4VisManager::Gsatt() Usage of LSTY :" << G4endl
285 <<
"ATT = 1,2,3 means line unbroken, dashed or dotted"
287 <<
"any other value resets to the default : unbroken"
289 lineStyle = G4VisAttributes::unbroken;
294 if (lineWidth > 7) lineWidth = 7;
296 G4cout <<
"TG4VisManager::Gsatt() Usage for LWID :" << G4endl
297 <<
" The VAL you supply means the width of lines in pixels "
298 <<
"for the screen and in 0.1*mm for paper." << G4endl
299 <<
" Negative values means the same, but for all daughters"
343 if (kAbsVal >= 8 && kAbsVal <= 16) {
347 luminosity = (kAbsVal - 7) * luminosityBin;
349 if (kAbsVal >= 17 && kAbsVal <= 41) {
353 luminosity = (kAbsVal - 16) * luminosityBin;
355 if (kAbsVal >= 67 && kAbsVal <= 91) {
359 luminosity = (kAbsVal - 66) * luminosityBin;
361 if (kAbsVal >= 117 && kAbsVal <= 141) {
365 luminosity = (kAbsVal - 116) * luminosityBin;
367 if (kAbsVal >= 42 && kAbsVal <= 66) {
371 luminosity = (kAbsVal - 41) * luminosityBin;
373 if (kAbsVal >= 142 && kAbsVal <= 166) {
377 luminosity = (kAbsVal - 141) * luminosityBin;
379 if (kAbsVal >= 92 && kAbsVal <= 116) {
383 luminosity = (kAbsVal - 91) * luminosityBin;
385 if (red < luminosityBin) red += luminosity;
386 if (green < luminosityBin) green += luminosity;
387 if (blue < luminosityBin) blue += luminosity;
390 isForceDrawingStyle =
true;
393 drawingStyle = G4VisAttributes::wireframe;
396 drawingStyle = G4VisAttributes::solid;
400 G4cout <<
"TG4VisManager::Gsatt() FILL usage :" << G4endl
401 <<
" The FILL values you can supply are only :" << G4endl
402 <<
"+/- 1 : forces wireframe drawing (default)" << G4endl
403 <<
"+/- 2 : forces solid drawing" << G4endl
404 <<
"other values sets the drawing style to solid" << G4endl;
405 drawingStyle = G4VisAttributes::solid;
411 newVisAttributes->SetVisibility(isVisible);
412 newVisAttributes->SetDaughtersInvisible(isDaughtersInvisible);
413 newVisAttributes->SetColour(red, green, blue);
414 newVisAttributes->SetLineStyle(lineStyle);
415 newVisAttributes->SetLineWidth(lineWidth);
416 if (drawingStyle == G4VisAttributes::wireframe)
417 newVisAttributes->SetForceWireframe(isForceDrawingStyle);
418 if (drawingStyle == G4VisAttributes::solid)
419 newVisAttributes->SetForceSolid(isForceDrawingStyle);
421 lv->SetVisAttributes(newVisAttributes);
442 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance();
443 const G4LogicalVolume* pLV = 0;
445 for (G4int i = 0; i < G4int(pLVStore->size()); i++) {
446 pLV = (*pLVStore)[i];
448 const G4Material* pMaterial = pLV->GetMaterial();
449 const G4State kState = pMaterial->GetState();
450 G4double density = (pMaterial->GetDensity()) * cm3 / g;
451 G4String nState =
"Undefined";
453 G4double luminosity = 0.;
454 if (kState == kStateUndefined) {
455 nState =
"Undefined";
457 if (kState == kStateSolid) {
461 luminosity = 25 - 25 * density / 2;
463 else if (density < 3) {
465 luminosity = 25 - 25 * (density - 2);
467 else if (density < 10) {
469 luminosity = 25 - 25 * (density - 5) / 5;
471 else if (density < 15) {
473 luminosity = 25 - 25 * (density - 10) / 5;
475 else if (density < 20) {
477 luminosity = 9 - 9 * (density - 15) / 5;
480 if (kState == kStateLiquid) {
483 luminosity = 25 - 25 * density / 2;
485 if (kState == kStateGas) {
487 if (density < 0.001) {
490 else if (density < 0.002) {
493 else if (density < 0.003) {
501 if (luminosity < 0) luminosity = 0;
502 colour += (G4int)luminosity;
504 Gsatt(pLV->GetName(),
"COLO", colour);