File indexing completed on 2025-02-23 09:20:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifdef G4LIB_USE_GDML
0033
0034 #include "G4ORNLMaleBodyFactory.hh"
0035 #include "G4PhysicalVolumeStore.hh"
0036 #include "G4GDMLParser.hh"
0037 #include "globals.hh"
0038 #include "G4PVPlacement.hh"
0039 #include "G4SDManager.hh"
0040 #include "G4VisAttributes.hh"
0041 #include "G4HumanPhantomColour.hh"
0042
0043 G4ORNLMaleBodyFactory::G4ORNLMaleBodyFactory()
0044 {
0045 }
0046
0047 G4ORNLMaleBodyFactory::~G4ORNLMaleBodyFactory()
0048 {
0049 }
0050
0051 G4VPhysicalVolume* G4ORNLMaleBodyFactory::CreateOrgan(const G4String& gdmlFile,
0052 G4VPhysicalVolume* motherVolume,
0053 const G4String& colourName, G4bool visAttribute, G4bool)
0054 {
0055
0056 G4cout<< "ORNLBodyFactory: "<< "gdmlData/Male/ORNL"<< gdmlFile <<".gdml" << G4endl;
0057 G4GDMLParser parser;
0058 G4String filename = "gdmlData/Male/ORNL"+ gdmlFile + ".gdml";
0059 parser.Read(filename);
0060
0061 G4String logicalVolumeName = gdmlFile + "Volume";
0062 G4LogicalVolume* logicOrgan = parser.GetVolume(logicalVolumeName);
0063 G4ThreeVector position = parser.GetPosition("OrganPos");
0064 G4ThreeVector rot = parser.GetRotation("OrganRot");
0065 G4RotationMatrix* rm = new G4RotationMatrix();
0066 rm->rotateX(rot.x()); rm->rotateY(rot.y()); rm->rotateZ(rot.z());
0067
0068 G4PhysicalVolumeStore::DeRegister(parser.GetWorldVolume());
0069
0070
0071 G4VPhysicalVolume* physOrgan = new G4PVPlacement(rm,position,
0072 "physicalOrgan",
0073 logicOrgan,
0074 motherVolume,
0075 false,
0076 0);
0077
0078
0079
0080 G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour();
0081 G4Colour colour = colourPointer -> GetColour(colourName);
0082 G4VisAttributes* organVisAtt = new G4VisAttributes(colour);
0083
0084 organVisAtt->SetForceSolid(visAttribute);
0085 logicOrgan->SetVisAttributes(organVisAtt);
0086
0087 G4cout << "Organ created !!!!!! from " << filename <<G4endl;
0088
0089 return physOrgan;
0090 }
0091 #endif