35 #ifndef G4VISCOMMANDSMODELCREATE_HH
36 #define G4VISCOMMANDSMODELCREATE_HH
39 #include "G4String.hh"
45 template <
typename Factory>
73 template <
typename Factory>
76 ,fPlacement(placement)
79 G4String factoryName = factory->Name();
82 G4String guidance =
"Create a "+factoryName+
" model and associated messengers.";
90 template <
typename Factory>
96 for (i=0; i<fDirectoryList.size(); ++i) {
97 delete fDirectoryList[i];
101 template <
typename Factory>
108 template <
typename Factory>
112 std::ostringstream oss;
113 oss <<fpFactory->Name()<<
"-" << fId++;
117 template <
typename Factory>
124 template <
typename Factory>
127 if (newName.
isNull()) newName = NextName();
129 assert (0 != fpFactory);
132 G4String title = Placement()+
"/"+newName+
"/";
133 G4String guidance =
"Commands for "+newName+
" model.";
137 fDirectoryList.push_back(directory);
140 typename Factory::ModelAndMessengers creation = fpFactory->Create(Placement(), newName);
143 fpVisManager->RegisterModel(creation.first);
146 typename Factory::Messengers::iterator iter = creation.second.begin();
148 while (iter != creation.second.end()) {
149 fpVisManager->RegisterMessenger(*iter);
void SetGuidance(const char *aGuidance)
G4UIcmdWithAString * fpCommand
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandModelCreate()
G4String GetCurrentValue(G4UIcommand *)
G4String Placement() const
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
std::vector< G4UIcommand * > fDirectoryList
G4VisCommandModelCreate(Factory *, const G4String &placement)