00001 #ifdef USE_GDML
00002 #include "BDSGlobalConstants.hh"
00003 #include "BDSGeometryGDML.hh"
00004 #include "BDSMaterials.hh"
00005 #include "G4Colour.hh"
00006 #include "G4GDMLParser.hh"
00007 #include "G4LogicalVolume.hh"
00008 #include "G4PVPlacement.hh"
00009 #include "G4VisAttributes.hh"
00010 #include "G4VPhysicalVolume.hh"
00011 #include <cstdlib>
00012 #include <cstring>
00013
00014 BDSGeometryGDML::BDSGeometryGDML(G4String GDMLfile):itsMarkerVol(NULL){
00015 itsGDMLfile = GDMLfile;
00016 }
00017
00018 BDSGeometryGDML::~BDSGeometryGDML(){
00019 }
00020
00021 void BDSGeometryGDML::Construct(G4LogicalVolume *marker){
00022 itsMarkerVol = marker;
00023 G4GDMLParser *parser = new G4GDMLParser();
00024 parser->Read(itsGDMLfile);
00025
00026 G4LogicalVolume* topvol = parser->GetWorldVolume()->GetLogicalVolume();
00027
00028 G4VisAttributes* VisAtt = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0));
00029 VisAtt->SetVisibility(false);
00030
00031 G4VisAttributes* VisAtt2 = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0));
00032 VisAtt2->SetVisibility(false);
00033
00034 for (int i=0; i<topvol->GetNoDaughters(); i++){
00035 topvol->GetDaughter(i)->GetLogicalVolume()->SetVisAttributes(VisAtt);
00036 }
00037
00038 topvol->SetVisAttributes(VisAtt2);
00039
00040 new G4PVPlacement(NULL,
00041 G4ThreeVector(0.,0.,0.),
00042 topvol,
00043 topvol->GetName()+"_PhysiComp",
00044 itsMarkerVol,
00045 false,
00046 0, BDSGlobalConstants::Instance()->GetCheckOverlaps());
00047 }
00048 #endif