Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // 27 // Code developed by: 24 // Code developed by: 28 // S.Guatelli, A. Le << 25 // S.Guatelli 29 // 26 // 30 // ********************************* 27 // ********************************* 31 // * * 28 // * * 32 // * BrachyDetectorMessenger.cc * 29 // * BrachyDetectorMessenger.cc * 33 // * * 30 // * * 34 // ********************************* 31 // ********************************* 35 // 32 // 36 // 33 // >> 34 // $Id: BrachyDetectorMessenger.cc,v 1.9 2004/11/24 09:53:05 guatelli Exp $ >> 35 // GEANT4 tag $Name: geant4-08-00-patch-01 $ >> 36 // >> 37 // >> 38 37 #include "BrachyDetectorMessenger.hh" 39 #include "BrachyDetectorMessenger.hh" >> 40 #include "BrachyFactoryIr.hh" >> 41 #include "BrachyRunAction.hh" 38 #include "BrachyDetectorConstruction.hh" 42 #include "BrachyDetectorConstruction.hh" 39 #include "G4UIdirectory.hh" 43 #include "G4UIdirectory.hh" 40 #include "G4UIcmdWithAString.hh" 44 #include "G4UIcmdWithAString.hh" >> 45 #include "G4UIcmdWithAnInteger.hh" >> 46 #include "G4UIcmdWithADoubleAndUnit.hh" >> 47 #include "G4UIcmdWithoutParameter.hh" 41 48 42 BrachyDetectorMessenger::BrachyDetectorMesseng << 49 BrachyDetectorMessenger::BrachyDetectorMessenger( BrachyDetectorConstruction* Det): detector(Det) 43 { 50 { 44 fDetectorDir = new G4UIdirectory("/phantom/" << 51 detectorDir = new G4UIdirectory("/phantom/"); 45 fDetectorDir -> SetGuidance(" phantom contro << 52 detectorDir->SetGuidance(" phantom control."); 46 53 47 fPhantomMaterialCmd = new G4UIcmdWithAString << 54 phantomMaterialCmd = new G4UIcmdWithAString("/phantom/selectMaterial",this); 48 fPhantomMaterialCmd -> SetGuidance("Select M << 55 phantomMaterialCmd->SetGuidance("Select Material of the phantom."); 49 fPhantomMaterialCmd -> SetParameterName("cho << 56 phantomMaterialCmd->SetParameterName("choice",false); 50 fPhantomMaterialCmd -> AvailableForStates(G4 << 57 phantomMaterialCmd->AvailableForStates(G4State_Idle); 51 58 52 fSourceCmd = new G4UIcmdWithAString("/source << 59 sourceCmd = new G4UIcmdWithAString("/source/switch",this); 53 fSourceCmd -> SetGuidance("Assign the select << 60 sourceCmd->SetGuidance("Assign the selected geometry to G4RunManager."); 54 fSourceCmd -> SetParameterName("choice",true << 61 sourceCmd->SetParameterName("choice",true); 55 fSourceCmd -> SetDefaultValue(" "); << 62 sourceCmd->SetDefaultValue(" "); 56 fSourceCmd -> SetCandidates("TG186 Flexi Iod << 63 sourceCmd->SetCandidates("Iridium Iodium Leipzig "); 57 fSourceCmd -> AvailableForStates(G4State_Pre << 64 sourceCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 58 } 65 } 59 66 60 BrachyDetectorMessenger::~BrachyDetectorMessen 67 BrachyDetectorMessenger::~BrachyDetectorMessenger() 61 { 68 { 62 delete fSourceCmd; << 69 delete sourceCmd; 63 delete fPhantomMaterialCmd; << 70 delete phantomMaterialCmd; 64 delete fDetectorDir; << 71 delete detectorDir; 65 } 72 } 66 73 67 void BrachyDetectorMessenger::SetNewValue(G4UI 74 void BrachyDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 68 { 75 { 69 // Change the material of the phantom << 76 if( command == phantomMaterialCmd ) 70 if( command == fPhantomMaterialCmd ) << 77 { detector->SetPhantomMaterial(newValue);} 71 { fDetector -> SetPhantomMaterial(newValue) << 72 78 73 // Switch the source in the phantom << 79 if( command == sourceCmd ) 74 if( command == fSourceCmd ) << 75 { 80 { 76 if(newValue=="Iodine" || newValue=="TG186" << 81 if(newValue=="Iodium" || newValue=="Iridium"|| newValue=="Leipzig") 77 { 82 { 78 fDetector -> SelectBrachytherapicSeed(n << 83 detector->SelectBrachytherapicSeed(newValue); 79 fDetector -> SwitchBrachytherapicSeed() << 84 detector->SwitchBrachytherapicSeed(); 80 } 85 } 81 } 86 } 82 } 87 } 83 88 84 89