diff --git a/DDCore/src/LCDDImp.cpp b/DDCore/src/LCDDImp.cpp index 0e7be990cb770caed703e2805c57a968b285b8d4..a148fad283d22dfc2e9164861d0772462c0ba526 100644 --- a/DDCore/src/LCDDImp.cpp +++ b/DDCore/src/LCDDImp.cpp @@ -247,6 +247,7 @@ void LCDDImp::endDocument() { // Set the world volume to invisible. VisAttr worldVis("WorldVis"); worldVis.setVisible(false); + worldVis.setShowDaughters(true) ; m_worldVol.setVisAttributes(worldVis); add(worldVis); diff --git a/DDExamples/ILDExDet/compact/ILDEx.xml b/DDExamples/ILDExDet/compact/ILDEx.xml index a9e3deba1a23fd4e822cf03dc5c9416a7f8c0c6c..998cfa74c39e93628eedebd06b7f532fdc7ab328 100644 --- a/DDExamples/ILDExDet/compact/ILDEx.xml +++ b/DDExamples/ILDExDet/compact/ILDEx.xml @@ -79,7 +79,7 @@ <vis name="TPCVis" alpha="1.0" r="0" g="1.0" b="0.7" showDaughters="true" visible="false"/> <vis name="TPCSupportVis" alpha="1.0" r="0" g="0.4" b="0.4" showDaughters="false" visible="true"/> <vis name="TPCGasVis" alpha="1.0" r="0.7" g="0" b="0" showDaughters="false" visible="false"/> - <vis name="VXDLayerVis" alpha="1.0" r="0.5" g=".5" b=".5" showDaughters="true" visible="true"/> + <vis name="VXDLayerVis" alpha="1.0" r="0.5" g=".5" b=".5" showDaughters="true" visible="true"/> <vis name="VXDSupportVis" alpha="1.0" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/> <vis name="SITSupportVis" alpha="1.0" r="0.0" g="0.3" b="0.7" showDaughters="true" visible="true"/> <vis name="SITLayerVis" alpha="1.0" r="0.0" g="0.7" b="0.3" showDaughters="true" visible="true"/> diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 5c4aab8af1bbd68d9f9eadbdde8877282c537f07..6d029722a31327c5043aca7b199f8e093a745d79 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -381,16 +381,16 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume } } if ( vis.isValid() ) { - vis_attr = (G4VisAttributes*)handleVis(vis.name(),vis.ptr()); - - if( std::string(vis.name()) == "WorldVis" ){ - printout(INFO,"Geant4Converter","************** vis.name() == \"WorldVis\" " ) ; - vis_attr->SetVisibility(true) ; - } + vis_attr = (G4VisAttributes*)handleVis(vis.name(),vis.ptr()); + + + printout(WARNING,"Geant4Converter","******************* Workaround for issue with visualization attributes: " + "call vis_attr->SetDaughtersInvisible(false) for all volumes !!!!" ) ; + vis_attr->SetDaughtersInvisible(false) ; - printout(INFO,"Geant4Converter","************** (G4VisAttributes*)handleVis( %s , 0x%x ) = %d ", vis.name() , - vis.ptr(), vis_attr->IsVisible() ) ; + printout(INFO,"Geant4Converter","************** (G4VisAttributes*)handleVis( %s , 0x%x ) = %d - daughters: %d ", vis.name() , + vis.ptr(), vis_attr->IsVisible() , !vis_attr->IsDaughtersInvisible() ) ; @@ -428,6 +428,12 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume } if ( vis_attr ) { vol->SetVisAttributes(vis_attr); + + std::stringstream ss ; + ss << *vis_attr ; + printout(INFO,"Geant4Converter","************** vol->SetVisAttributes(vis_attr) %s ", ss.str().c_str() ) ;// vis_attr->IsVisible() ) ; + + } if ( sd ) { printout(DEBUG,"Geant4Converter","++ Volume: + %s <> %s Solid:%s Mat:%s SD:%s",