#include <G4ModelCompoundCommandsT.hh>
Inheritance diagram for G4ModelCmdAddIntervalContext< M >:
Public Member Functions | |
G4ModelCmdAddIntervalContext (M *model, const G4String &placement, const G4String &cmdName="addInterval") | |
virtual | ~G4ModelCmdAddIntervalContext () |
Protected Member Functions | |
virtual void | Apply (const G4String ¶m) |
Definition at line 43 of file G4ModelCompoundCommandsT.hh.
G4ModelCmdAddIntervalContext< M >::G4ModelCmdAddIntervalContext | ( | M * | model, | |
const G4String & | placement, | |||
const G4String & | cmdName = "addInterval" | |||
) | [inline] |
Definition at line 47 of file G4ModelCompoundCommandsT.hh.
References G4ModelCmdApplyString< M >::Command(), and G4UIcommand::SetGuidance().
00049 :G4ModelCmdApplyString<M>(model, placement, cmdName) 00050 { 00051 G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command(); 00052 cmd->SetGuidance("Add interval."); 00053 }
virtual G4ModelCmdAddIntervalContext< M >::~G4ModelCmdAddIntervalContext | ( | ) | [inline, virtual] |
Definition at line 55 of file G4ModelCompoundCommandsT.hh.
00055 { 00056 std::vector<G4UImessenger*>::iterator iter = fMessengers.begin(); 00057 00058 while (iter != fMessengers.end()) { 00059 delete *iter; 00060 iter++; 00061 } 00062 }
virtual void G4ModelCmdAddIntervalContext< M >::Apply | ( | const G4String & | param | ) | [inline, protected, virtual] |
Implements G4ModelCmdApplyString< M >.
Definition at line 66 of file G4ModelCompoundCommandsT.hh.
References G4ModelCommandUtils::AddContextMsgrs(), G4VModelCommand< T >::Model(), and G4VModelCommand< T >::Placement().
00066 { 00067 G4String myString(param); 00068 00069 G4String name; 00070 std::istringstream is(param); 00071 00072 is >> name; 00073 00074 myString.erase(0, name.size()); 00075 00076 G4String dir = G4VModelCommand<M>::Placement()+"/"+G4VModelCommand<M>::Model()->Name(); 00077 00078 G4VisTrajContext* context = new G4VisTrajContext(name); 00079 00080 G4ModelCommandUtils::AddContextMsgrs(context, fMessengers, dir); 00081 G4VModelCommand<M>::Model()->AddIntervalContext(myString, context); 00082 }