|
Geant4 examples
|
Messenger class that defines commands for ExG4DetectorConstruction02. More...
#include <Doxymodules_common.h>
Public Member Functions | |
| ExG4DetectorConstruction02Messenger (ExG4DetectorConstruction02 *) | |
| virtual | ~ExG4DetectorConstruction02Messenger () |
| virtual void | SetNewValue (G4UIcommand *command, G4String newValue) |
Private Attributes | |
| ExG4DetectorConstruction02 * | fDetectorConstruction |
| G4UIdirectory * | fTopDirectory |
| G4UIdirectory * | fDirectory |
| G4UIcmdWithAString * | fSetBoxMaterialCmd |
| G4UIcmdWithAString * | fSetWorldMaterialCmd |
| G4UIcmdWith3VectorAndUnit * | fSetBoxDimensionsCmd |
| G4UIcmdWithADouble * | fSetWorldSizeFactorCmd |
Messenger class that defines commands for ExG4DetectorConstruction02.
It implements commands:
Definition at line 32 of file Doxymodules_common.h.
| ExG4DetectorConstruction02Messenger::ExG4DetectorConstruction02Messenger | ( | ExG4DetectorConstruction02 * | detectorConstruction | ) |
Definition at line 41 of file ExG4DetectorConstruction02Messenger.cc.
: G4UImessenger(), fDetectorConstruction(detectorConstruction), fTopDirectory(0), fDirectory(0), fSetBoxMaterialCmd(0), fSetWorldMaterialCmd(0), fSetBoxDimensionsCmd(0), fSetWorldSizeFactorCmd(0) { fTopDirectory = new G4UIdirectory("/ExG4/"); fTopDirectory->SetGuidance("UI commands of common example classes"); fDirectory = new G4UIdirectory("/ExG4/det/"); fDirectory->SetGuidance("Detector control"); fSetBoxMaterialCmd = new G4UIcmdWithAString("/ExG4/det/setBoxMaterial",this); fSetBoxMaterialCmd->SetGuidance("Select material of the box."); fSetBoxMaterialCmd->SetParameterName("BoxMaterial", false); fSetBoxMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); fSetWorldMaterialCmd = new G4UIcmdWithAString("/ExG4/det/setWorldMaterial",this); fSetWorldMaterialCmd->SetGuidance("Select material of the world."); fSetWorldMaterialCmd->SetParameterName("WorldMaterial", false); fSetWorldMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); fSetBoxDimensionsCmd = new G4UIcmdWith3VectorAndUnit("/ExG4/det/setBoxDimensions",this); fSetBoxDimensionsCmd->SetGuidance("Set box dimensions (in half lentgh)."); fSetBoxDimensionsCmd->SetParameterName( "BoxDimensionsHx", "BoxDimensionsHy","BoxDimensionsHz", false); //fSetBoxDimensionsCmd->SetUnitCategory("Length"); fSetBoxDimensionsCmd->AvailableForStates(G4State_PreInit); fSetWorldSizeFactorCmd = new G4UIcmdWithADouble("/ExG4/det/setWorldSizeFactor",this); fSetWorldSizeFactorCmd->SetGuidance( "Set the multiplication factor from box dimensions to world dimensions."); fSetWorldSizeFactorCmd->SetParameterName("WorldSizeFactor", false); fSetWorldSizeFactorCmd->SetRange("WorldSizeFactor >= 1"); fSetWorldSizeFactorCmd->AvailableForStates(G4State_PreInit); }
| ExG4DetectorConstruction02Messenger::~ExG4DetectorConstruction02Messenger | ( | ) | [virtual] |
Definition at line 91 of file ExG4DetectorConstruction02Messenger.cc.
{
delete fTopDirectory;
delete fDirectory;
delete fSetBoxMaterialCmd;
delete fSetWorldMaterialCmd;
delete fSetBoxDimensionsCmd;
delete fSetWorldSizeFactorCmd;
}
| void ExG4DetectorConstruction02Messenger::SetNewValue | ( | G4UIcommand * | command, |
| G4String | newValue | ||
| ) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 103 of file ExG4DetectorConstruction02Messenger.cc.
{
if( command == fSetBoxMaterialCmd ) {
fDetectorConstruction->SetBoxMaterial(newValue);
}
else if( command == fSetWorldMaterialCmd ) {
fDetectorConstruction->SetWorldMaterial(newValue);
}
else if( command == fSetBoxDimensionsCmd ) {
G4ThreeVector newDimensions
= fSetBoxDimensionsCmd->GetNew3VectorValue(newValue);
fDetectorConstruction
->SetBoxDimensions(
newDimensions.x(), newDimensions.y(), newDimensions.z());
}
else if ( command == fSetWorldSizeFactorCmd ) {
fDetectorConstruction
->SetWorldSizeFactor(fSetWorldSizeFactorCmd->GetNewDoubleValue(newValue));
}
}
Definition at line 62 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 63 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 64 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 65 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 66 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 67 of file ExG4DetectorConstruction02Messenger.hh.
Definition at line 68 of file ExG4DetectorConstruction02Messenger.hh.
1.7.4