G4ModelCmdAddIntervalContext< M > Class Template Reference

#include <G4ModelCompoundCommandsT.hh>

Inheritance diagram for G4ModelCmdAddIntervalContext< M >:

G4ModelCmdApplyString< M > G4VModelCommand< M > G4UImessenger

Public Member Functions

 G4ModelCmdAddIntervalContext (M *model, const G4String &placement, const G4String &cmdName="addInterval")
virtual ~G4ModelCmdAddIntervalContext ()

Protected Member Functions

virtual void Apply (const G4String &param)

Detailed Description

template<typename M>
class G4ModelCmdAddIntervalContext< M >

Definition at line 43 of file G4ModelCompoundCommandsT.hh.


Constructor & Destructor Documentation

template<typename M>
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   }

template<typename M>
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   }


Member Function Documentation

template<typename M>
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   }


The documentation for this class was generated from the following file:
Generated on Mon May 27 17:52:29 2013 for Geant4 by  doxygen 1.4.7