42 : suffix (
""), geometry(true), solids(true), invisibles(true),
43 kgMocrenVolumeName(
"gMocrenVolume"),
44 kgMocrenScoringMeshName(
"gMocrenScoringMesh"),
45 kDrawVolumeGrid(false) {
48 kgMocrenDirectory->
SetGuidance(
"gMocren commands.");
50 setEventNumberSuffixCommand =
new G4UIcmdWithAString(
"/vis/gMocren/setEventNumberSuffix",
this);
51 setEventNumberSuffixCommand->
SetGuidance(
"Write separate event files, appended with given suffix.");
52 setEventNumberSuffixCommand->
SetGuidance(
"Define the suffix with a pattern such as '-0000'.");
57 appendGeometryCommand =
new G4UIcmdWithABool(
"/vis/gMocren/appendGeometry",
this);
58 appendGeometryCommand->
SetGuidance(
"Appends copy of geometry to every event.");
63 addPointAttributesCommand =
new G4UIcmdWithABool(
"/vis/gMocren/addPointAttributes",
this);
64 addPointAttributesCommand->
SetGuidance(
"Adds point attributes to the points of trajectories.");
70 useSolidsCommand->
SetGuidance(
"Use GMocren Solids, rather than Geant4 Primitives.");
83 kSetgMocrenVolumeNameCommand =
new G4UIcmdWithAString(
"/vis/gMocren/setVolumeName",
this);
84 kSetgMocrenVolumeNameCommand->
SetGuidance(
"detector name for a volume data in gMocren data.");
90 kAddgMocrenHitNameCommand->
SetGuidance(
"hit name for a dose distribution in gMocren data.");
95 kResetgMocrenHitNameCommand->
SetGuidance(
"reset all hit names.");
98 kSetgMocrenScoringMeshNameCommand =
new G4UIcmdWithAString(
"/vis/gMocren/setScoringMeshName",
this);
99 kSetgMocrenScoringMeshNameCommand->
SetGuidance(
"scoring mesh name for a dose distribution in gMocren data.");
100 kSetgMocrenScoringMeshNameCommand->
SetParameterName(
"kgMocrenScoringMeshName",
false);
101 kSetgMocrenScoringMeshNameCommand->
SetDefaultValue(
"gMocrenScoringMesh");
104 kAddgMocrenHitScorerNameCommand =
new G4UIcmdWithAString(
"/vis/gMocren/addHitScorerName",
this);
105 kAddgMocrenHitScorerNameCommand->
SetGuidance(
"hit scorer name for a dose distribution in gMocren data.");
106 kAddgMocrenHitScorerNameCommand->
SetParameterName(
"kgMocrenHitScorerNames",
false);
110 kResetgMocrenHitScorerNameCommand->
SetGuidance(
"reset all hit scorer names.");
113 kSetgMocrenNoVoxelsCommand =
new G4UIcommand(
"/vis/gMocren/setNumberOfVoxels",
this);
114 kSetgMocrenNoVoxelsCommand->
SetGuidance(
"set number of voxels.");
130 kListgMocrenCommand->
SetGuidance(
"list gMocren command parameters.");
133 kDrawVolumeGridCommand =
new G4UIcmdWithABool(
"/vis/gMocren/drawVolumeGrid",
this);
134 kDrawVolumeGridCommand->
SetGuidance(
"Add grid of the volume.");
142 delete setEventNumberSuffixCommand;
143 delete appendGeometryCommand;
144 delete addPointAttributesCommand;
145 delete useSolidsCommand;
147 delete kSetgMocrenVolumeNameCommand;
148 delete kAddgMocrenHitNameCommand;
149 delete kResetgMocrenHitNameCommand;
151 delete kSetgMocrenScoringMeshNameCommand;
152 delete kAddgMocrenHitScorerNameCommand;
153 delete kResetgMocrenHitScorerNameCommand;
155 delete kSetgMocrenNoVoxelsCommand;
157 delete kgMocrenDirectory;
159 delete kDrawVolumeGridCommand;
163 if (command==setEventNumberSuffixCommand) {
165 }
else if (command==appendGeometryCommand) {
167 }
else if (command==addPointAttributesCommand) {
169 }
else if (command==useSolidsCommand) {
173 }
else if (command == kSetgMocrenVolumeNameCommand) {
174 return kgMocrenVolumeName;
175 }
else if (command == kAddgMocrenHitNameCommand) {
177 std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
178 for(; itr != kgMocrenHitNames.end(); itr++) {
183 }
else if (command == kSetgMocrenScoringMeshNameCommand) {
184 return kgMocrenScoringMeshName;
185 }
else if (command == kAddgMocrenHitScorerNameCommand) {
187 std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
188 for(; itr != kgMocrenHitScorerNames.end(); itr++) {
193 }
else if (command==kDrawVolumeGridCommand) {
201 if (command==setEventNumberSuffixCommand) {
203 }
else if (command==appendGeometryCommand) {
205 }
else if (command==addPointAttributesCommand) {
206 pointAttributes = addPointAttributesCommand->
GetNewBoolValue(newValue);
207 }
else if (command==useSolidsCommand) {
211 }
else if (command == kSetgMocrenVolumeNameCommand) {
212 kgMocrenVolumeName = newValue;
213 }
else if (command == kAddgMocrenHitNameCommand) {
214 kgMocrenHitNames.push_back(newValue);
215 }
else if (command == kResetgMocrenHitNameCommand) {
216 kgMocrenHitNames.clear();
217 }
else if (command == kSetgMocrenScoringMeshNameCommand) {
218 kgMocrenScoringMeshName = newValue;
219 }
else if (command == kAddgMocrenHitScorerNameCommand) {
220 kgMocrenHitScorerNames.push_back(newValue);
221 }
else if (command == kResetgMocrenHitScorerNameCommand) {
222 kgMocrenHitScorerNames.clear();
223 }
else if (command == kListgMocrenCommand) {
225 }
else if (command == kSetgMocrenNoVoxelsCommand) {
227 for(
int i = 0; i < 3; i++) {
228 kgMocrenNoVoxels[i] =
StoI(next());
230 }
else if (command==kDrawVolumeGridCommand) {
244 return pointAttributes;
256 return kgMocrenVolumeName;
260 return kgMocrenHitNames;
264 return kgMocrenScoringMeshName;
268 return kgMocrenHitScorerNames;
272 G4cout <<
" Current valuess of gMocren command parameters:" <<
G4endl;
274 G4cout <<
" volume name: " << kgMocrenVolumeName <<
G4endl;
277 if(kgMocrenHitNames.size() > 0) {
278 std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
279 for(; itr != kgMocrenHitNames.end(); itr++)
285 G4cout <<
" scoring mesh name: " << kgMocrenScoringMeshName <<
G4endl;
287 G4cout <<
" scorer names: ";
288 if(kgMocrenHitScorerNames.size() > 0) {
289 std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
290 for(; itr != kgMocrenHitScorerNames.end(); itr++)
299 nx = kgMocrenNoVoxels[0];
300 ny = kgMocrenNoVoxels[1];
301 nz = kgMocrenNoVoxels[2];
G4DLLIMPORT std::ostream G4cout
virtual G4bool useSolids()
virtual std::vector< G4String > getHitNames()
virtual std::vector< G4String > getHitScorerNames()
virtual void getNoVoxels(G4int &nx, G4int &ny, G4int &nz) const
virtual G4bool appendGeometry()
virtual G4String GetCurrentValue(G4UIcommand *command)
virtual G4bool writeInvisibles()
virtual G4String getVolumeName()
virtual G4bool addPointAttributes()
virtual G4String getScoringMeshName()
virtual G4String getEventNumberSuffix()
virtual ~G4GMocrenMessenger()
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void AvailableForStates(G4ApplicationState s1)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)