#include <G4ModelCompoundCommandsT.hh>
Inheritance diagram for G4ModelCmdAddValueContext< M >:
Public Member Functions | |
G4ModelCmdAddValueContext (M *model, const G4String &placement, const G4String &cmdName="addValue") | |
virtual | ~G4ModelCmdAddValueContext () |
Protected Member Functions | |
virtual void | Apply (const G4String ¶m) |
Definition at line 93 of file G4ModelCompoundCommandsT.hh.
G4ModelCmdAddValueContext< M >::G4ModelCmdAddValueContext | ( | M * | model, | |
const G4String & | placement, | |||
const G4String & | cmdName = "addValue" | |||
) | [inline] |
Definition at line 97 of file G4ModelCompoundCommandsT.hh.
References G4ModelCmdApplyString< M >::Command(), and G4UIcommand::SetGuidance().
00099 :G4ModelCmdApplyString<M>(model, placement, cmdName) 00100 { 00101 G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command(); 00102 cmd->SetGuidance("Add value."); 00103 }
virtual G4ModelCmdAddValueContext< M >::~G4ModelCmdAddValueContext | ( | ) | [inline, virtual] |
Definition at line 105 of file G4ModelCompoundCommandsT.hh.
00105 { 00106 std::vector<G4UImessenger*>::iterator iter = fMessengers.begin(); 00107 00108 while (iter != fMessengers.end()) { 00109 delete *iter; 00110 iter++; 00111 } 00112 }
virtual void G4ModelCmdAddValueContext< M >::Apply | ( | const G4String & | param | ) | [inline, protected, virtual] |
Implements G4ModelCmdApplyString< M >.
Definition at line 116 of file G4ModelCompoundCommandsT.hh.
References G4ModelCommandUtils::AddContextMsgrs(), G4VModelCommand< T >::Model(), and G4VModelCommand< T >::Placement().
00116 { 00117 G4String myString(param); 00118 00119 G4String name; 00120 std::istringstream is(param); 00121 00122 is >> name; 00123 00124 myString.erase(0, name.size()); 00125 00126 G4String dir = G4VModelCommand<M>::Placement()+"/"+G4VModelCommand<M>::Model()->Name(); 00127 00128 G4VisTrajContext* context = new G4VisTrajContext(name); 00129 00130 G4ModelCommandUtils::AddContextMsgrs(context, fMessengers, dir); 00131 G4VModelCommand<M>::Model()->AddValueContext(myString, context); 00132 }