Skip to content
Snippets Groups Projects
Commit 268c2f29 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Adding option to open new Geometry in DetectorMessenger

parent 9c9860db
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,14 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction* Det):Detector(Det){
UpdateCmd->SetGuidance("Apply this command after editing your geometry file ");
UpdateCmd->AvailableForStates(G4State_Idle);
OpenCmd = new G4UIcmdWithAString("/det/open",this);
OpenCmd->SetGuidance("Open detector geometry.");
OpenCmd->SetGuidance("Apply this command to open a new geometry file");
OpenCmd->SetGuidance("NB: The new detector file should contain the same detectors as the original one");
OpenCmd->AvailableForStates(G4State_Idle);
ExportCmd = new G4UIcmdWithAString("/det/export_gdml",this);
ExportCmd->SetGuidance("export current geomtry to gdml");
ExportCmd->SetGuidance("export current geometry to gdml");
ExportCmd->AvailableForStates(G4State_Idle);
}
......@@ -61,6 +67,9 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String value){
if( command == UpdateCmd ){
Detector->RedefineGeometry("");
}
else if( command == OpenCmd ){
Detector->RedefineGeometry(value);
}
else if(command ==ExportCmd ){
Detector->ExportGeometry(value);
}
......
......@@ -48,6 +48,7 @@ class DetectorMessenger: public G4UImessenger{
G4UIdirectory* detDir;
G4UIcmdWithoutParameter* UpdateCmd;
G4UIcmdWithAString* OpenCmd;
G4UIcmdWithAString* ExportCmd;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment