| 1 | cafagna | 1.1 |  | 
| 2 |  |  |  | 
| 3 |  |  | #include "SteppingActionMessenger.hh" | 
| 4 |  |  | #include "SteppingAction.hh" | 
| 5 |  |  |  | 
| 6 |  |  | #include "globals.hh" | 
| 7 |  |  | #include "G4UIdirectory.hh" | 
| 8 |  |  | #include "G4UIcmdWithABool.hh" | 
| 9 |  |  |  | 
| 10 |  |  | SteppingActionMessenger::SteppingActionMessenger(SteppingAction* SA) | 
| 11 |  |  | :SteppingAct(SA) | 
| 12 |  |  | { | 
| 13 |  |  | stepDirectory = new G4UIdirectory("/step/"); | 
| 14 |  |  | stepDirectory->SetGuidance("Step draw control command."); | 
| 15 |  |  |  | 
| 16 |  |  | drawStepCmd = new G4UIcmdWithABool("/step/draw",this); | 
| 17 |  |  | drawStepCmd->SetGuidance("Draw each step on the fly. (default = true)"); | 
| 18 |  |  | drawStepCmd->SetParameterName("draw", true); | 
| 19 |  |  | drawStepCmd->SetDefaultValue(true); | 
| 20 |  |  | } | 
| 21 |  |  |  | 
| 22 |  |  | void SteppingActionMessenger::SetNewValue(G4UIcommand* command, G4String newValues) | 
| 23 |  |  | { | 
| 24 |  |  | if( command->GetCommandName() == "draw" ) | 
| 25 |  |  | { | 
| 26 |  |  | G4int vl; | 
| 27 |  |  | const char* t = newValues; | 
| 28 |  |  | std::istrstream is((char*)t); | 
| 29 |  |  | is >> vl; | 
| 30 |  |  | SteppingAct->SetDrawFlag(vl!=0); | 
| 31 |  |  | } | 
| 32 |  |  | } | 
| 33 |  |  |  | 
| 34 |  |  | // 2005 by G.I.Vasilyev |