- Timestamp:
- Jun 14, 2010, 3:54:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/hadrontherapy/src/HadrontherapyDetectorMessenger.cc
r1230 r1313 31 31 #include "HadrontherapyDetectorConstruction.hh" 32 32 #include "G4UIdirectory.hh" 33 #include "G4UIcmdWithADoubleAndUnit.hh" 33 #include "G4UIcmdWith3VectorAndUnit.hh" 34 #include "G4UIcmdWithoutParameter.hh" 34 35 #include "G4UIcmdWithAString.hh" 35 #include "G4UIcmdWith3VectorAndUnit.hh"36 36 37 37 ///////////////////////////////////////////////////////////////////////////// … … 49 49 "PhantomSizeAlongZ", false); 50 50 changeThePhantomSizeCmd -> SetDefaultUnit("mm"); 51 changeThePhantomSizeCmd -> SetUnitCandidates(" um mm cm");51 changeThePhantomSizeCmd -> SetUnitCandidates("nm um mm cm"); 52 52 changeThePhantomSizeCmd -> AvailableForStates(G4State_Idle); 53 53 54 55 // Change Phantom material 56 changeThePhantomMaterialCmd = new G4UIcmdWithAString("/changePhantom/material", this); 57 changeThePhantomMaterialCmd -> SetGuidance("Change the Phantom and the detector material"); 58 changeThePhantomMaterialCmd -> SetParameterName("PhantomMaterial", false); 59 changeThePhantomMaterialCmd -> SetDefaultValue("G4_WATER"); 60 changeThePhantomMaterialCmd -> AvailableForStates(G4State_Idle); 54 61 55 62 // Change Phantom position … … 61 68 "PositionAlongZ", false); 62 69 changeThePhantomPositionCmd -> SetDefaultUnit("mm"); 63 changeThePhantomPositionCmd -> SetUnitCandidates(" mm cm m");70 changeThePhantomPositionCmd -> SetUnitCandidates("um mm cm m"); 64 71 changeThePhantomPositionCmd -> AvailableForStates(G4State_Idle); 65 72 73 74 updateCmd = new G4UIcmdWithoutParameter("/changePhantom/update",this); 75 updateCmd->SetGuidance("Update Phantom/Detector geometry."); 76 updateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 77 updateCmd->SetGuidance("if you changed geometrical value(s)."); 78 updateCmd->AvailableForStates(G4State_Idle); 66 79 67 80 // Change detector size … … 74 87 changeTheDetectorSizeCmd -> SetParameterName("DetectorSizeAlongX", "DetectorSizeAlongY", "DetectorSizeAlongZ", false); 75 88 changeTheDetectorSizeCmd -> SetDefaultUnit("mm"); 76 changeTheDetectorSizeCmd -> SetUnitCandidates(" um mm cm");89 changeTheDetectorSizeCmd -> SetUnitCandidates("nm um mm cm"); 77 90 changeTheDetectorSizeCmd -> AvailableForStates(G4State_Idle); 78 91 … … 85 98 "DisplacementAlongZ", false); 86 99 changeTheDetectorToPhantomPositionCmd -> SetDefaultUnit("mm"); 87 changeTheDetectorToPhantomPositionCmd -> SetUnitCandidates(" um mm cm");100 changeTheDetectorToPhantomPositionCmd -> SetUnitCandidates("nm um mm cm"); 88 101 changeTheDetectorToPhantomPositionCmd -> AvailableForStates(G4State_Idle); 89 102 … … 94 107 changeTheDetectorVoxelCmd -> SetParameterName("VoxelSizeAlongX", "VoxelSizeAlongY", "VoxelSizeAlongZ", false); 95 108 changeTheDetectorVoxelCmd -> SetDefaultUnit("mm"); 96 changeTheDetectorVoxelCmd -> SetUnitCandidates(" um mm cm");109 changeTheDetectorVoxelCmd -> SetUnitCandidates("nm um mm cm"); 97 110 changeTheDetectorVoxelCmd -> AvailableForStates(G4State_Idle); 98 111 } … … 104 117 delete changeThePhantomSizeCmd; 105 118 delete changeThePhantomPositionCmd; 119 delete changeThePhantomMaterialCmd; 120 delete updateCmd; 106 121 delete changeTheDetectorDir; 107 122 delete changeTheDetectorSizeCmd; … … 124 139 hadrontherapyDetector -> SetPhantomPosition(size); 125 140 } 141 else if (command == changeThePhantomMaterialCmd) 142 { 143 hadrontherapyDetector -> SetPhantomMaterial(newValue); 144 } 126 145 else if (command == changeTheDetectorSizeCmd) 127 146 { … … 137 156 { 138 157 G4ThreeVector size = changeTheDetectorVoxelCmd -> GetNew3VectorValue(newValue); 139 hadrontherapyDetector -> SetNumberOfVoxelBySize(size.getX(),size.getY(),size.getZ()); 158 hadrontherapyDetector -> SetVoxelSize(size.getX(),size.getY(),size.getZ()); 159 } 160 else if (command == updateCmd) 161 { 162 hadrontherapyDetector -> UpdateGeometry(); 140 163 } 141 164 }
Note: See TracChangeset
for help on using the changeset viewer.