45 :hadrontherapyDetector(detector)
49 changeThePhantomDir -> SetGuidance(
"Command to change the Phantom Size/position");
51 changeThePhantomSizeCmd -> SetGuidance(
"Insert sizes X Y and Z"
52 "\n 0 or negative values mean <<Don't change it!>>");
53 changeThePhantomSizeCmd -> SetParameterName(
"PhantomSizeAlongX",
55 "PhantomSizeAlongZ",
false);
56 changeThePhantomSizeCmd -> SetDefaultUnit(
"mm");
57 changeThePhantomSizeCmd -> SetUnitCandidates(
"nm um mm cm");
58 changeThePhantomSizeCmd -> AvailableForStates(
G4State_Idle);
63 changeThePhantomMaterialCmd -> SetGuidance(
"Change the Phantom and the detector material");
64 changeThePhantomMaterialCmd -> SetParameterName(
"PhantomMaterial",
false);
65 changeThePhantomMaterialCmd -> SetDefaultValue(
"G4_WATER");
66 changeThePhantomMaterialCmd -> AvailableForStates(
G4State_Idle);
70 changeThePhantomPositionCmd -> SetGuidance(
"Insert X Y and Z dimensions for the position of the center of the Phantom"
71 " respect to that of the \"World\"");
72 changeThePhantomPositionCmd -> SetParameterName(
"PositionAlongX",
74 "PositionAlongZ",
false);
75 changeThePhantomPositionCmd -> SetDefaultUnit(
"mm");
76 changeThePhantomPositionCmd -> SetUnitCandidates(
"um mm cm m");
77 changeThePhantomPositionCmd -> AvailableForStates(
G4State_Idle);
81 updateCmd->
SetGuidance(
"Update Phantom/Detector geometry.");
82 updateCmd->
SetGuidance(
"This command MUST be applied before \"beamOn\" ");
83 updateCmd->
SetGuidance(
"if you changed geometrical value(s).");
88 changeTheDetectorDir -> SetGuidance(
"Command to change the Detector's Size/position/Voxels");
91 changeTheDetectorSizeCmd -> SetGuidance(
"Insert sizes for X Y and Z dimensions of the Detector"
92 "\n 0 or negative values mean <<Don't change it>>");
93 changeTheDetectorSizeCmd -> SetParameterName(
"DetectorSizeAlongX",
"DetectorSizeAlongY",
"DetectorSizeAlongZ",
false);
94 changeTheDetectorSizeCmd -> SetDefaultUnit(
"mm");
95 changeTheDetectorSizeCmd -> SetUnitCandidates(
"nm um mm cm");
96 changeTheDetectorSizeCmd -> AvailableForStates(
G4State_Idle);
100 changeTheDetectorToPhantomPositionCmd -> SetGuidance(
"Insert X Y and Z displacements between Detector and Phantom"
101 "\nNegative values mean <<Don't change it!>>");
102 changeTheDetectorToPhantomPositionCmd -> SetParameterName(
"DisplacementAlongX",
103 "DisplacementAlongY",
104 "DisplacementAlongZ",
false);
105 changeTheDetectorToPhantomPositionCmd -> SetDefaultUnit(
"mm");
106 changeTheDetectorToPhantomPositionCmd -> SetUnitCandidates(
"nm um mm cm");
107 changeTheDetectorToPhantomPositionCmd -> AvailableForStates(
G4State_Idle);
111 changeTheDetectorVoxelCmd -> SetGuidance(
"Insert Voxel sizes for X Y and Z dimensions"
112 "\n 0 or negative values mean <<Don't change it!>>");
113 changeTheDetectorVoxelCmd -> SetParameterName(
"VoxelSizeAlongX",
"VoxelSizeAlongY",
"VoxelSizeAlongZ",
false);
114 changeTheDetectorVoxelCmd -> SetDefaultUnit(
"mm");
115 changeTheDetectorVoxelCmd -> SetUnitCandidates(
"nm um mm cm");
116 changeTheDetectorVoxelCmd -> AvailableForStates(
G4State_Idle);
122 delete changeThePhantomDir;
123 delete changeThePhantomSizeCmd;
124 delete changeThePhantomPositionCmd;
125 delete changeThePhantomMaterialCmd;
127 delete changeTheDetectorDir;
128 delete changeTheDetectorSizeCmd;
129 delete changeTheDetectorToPhantomPositionCmd;
130 delete changeTheDetectorVoxelCmd;
137 if( command == changeThePhantomSizeCmd)
139 G4ThreeVector size = changeThePhantomSizeCmd -> GetNew3VectorValue(newValue);
140 hadrontherapyDetector -> SetPhantomSize(size.
getX(),size.
getY(),size.
getZ());
142 else if (command == changeThePhantomPositionCmd )
144 G4ThreeVector size = changeThePhantomPositionCmd -> GetNew3VectorValue(newValue);
145 hadrontherapyDetector -> SetPhantomPosition(size);
147 else if (command == changeThePhantomMaterialCmd)
149 hadrontherapyDetector -> SetPhantomMaterial(newValue);
151 else if (command == changeTheDetectorSizeCmd)
153 G4ThreeVector size = changeTheDetectorSizeCmd -> GetNew3VectorValue(newValue);
154 hadrontherapyDetector -> SetDetectorSize(size.
getX(),size.
getY(),size.
getZ());
156 else if (command == changeTheDetectorToPhantomPositionCmd)
158 G4ThreeVector size = changeTheDetectorToPhantomPositionCmd-> GetNew3VectorValue(newValue);
159 hadrontherapyDetector -> SetDetectorToPhantomPosition(size);
161 else if (command == changeTheDetectorVoxelCmd)
163 G4ThreeVector size = changeTheDetectorVoxelCmd -> GetNew3VectorValue(newValue);
164 hadrontherapyDetector -> SetVoxelSize(size.
getX(),size.
getY(),size.
getZ());
166 else if (command == updateCmd)
168 hadrontherapyDetector -> UpdateGeometry();