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 "G4ORNLFemaleBodyFactory.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 G4ORNLFemaleBodyFactory::G4ORNLFemaleBodyFactory()
0044 {
0045 }
0046
0047 G4ORNLFemaleBodyFactory::~G4ORNLFemaleBodyFactory()
0048 {
0049 }
0050
0051 G4VPhysicalVolume* G4ORNLFemaleBodyFactory::CreateOrgan(const G4String& gdmlFile, G4VPhysicalVolume* motherVolume,
0052 const G4String& colourName, G4bool visAttribute,
0053 G4bool)
0054 {
0055 G4cout<< "ORNLBodyFactory: "<< "gdmlData/Female/ORNL"<< gdmlFile <<".gdml" << G4endl;
0056
0057 G4GDMLParser parser;
0058 G4String filename = "gdmlData/Female/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
0072 G4VPhysicalVolume* physOrgan = new G4PVPlacement(rm,position,
0073 "physicalOrgan",
0074 logicOrgan,
0075 motherVolume,
0076 false,
0077 0);
0078
0079
0080 if ( (gdmlFile == "Trunk" ) ||
0081 (gdmlFile == "Head" ) ||
0082 (gdmlFile == "LeftLeg" ) ||
0083 (gdmlFile == "RightLeg" ))
0084 {
0085 logicOrgan->SetVisAttributes(G4VisAttributes::GetInvisible());
0086 }
0087 else
0088 {
0089
0090 G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour();
0091 G4Colour colour = colourPointer -> GetColour(colourName);
0092 G4VisAttributes* organVisAtt = new G4VisAttributes(colour);
0093
0094 organVisAtt->SetForceSolid(visAttribute);
0095 logicOrgan->SetVisAttributes(organVisAtt);
0096 }
0097 G4cout << "Organ created !!!!!! from " << filename <<G4endl;
0098
0099 return physOrgan;
0100 }
0101
0102 #endif