34 #ifndef G4VISCOMMANDSMODELCREATE_HH
35 #define G4VISCOMMANDSMODELCREATE_HH
38 #include "G4String.hh"
44 template <
typename Factory>
72 template <
typename Factory>
75 ,fPlacement(placement)
78 G4String factoryName = factory->Name();
81 G4String guidance =
"Create a "+factoryName+
" model and associated messengers.";
89 template <
typename Factory>
95 for (i=0; i<fDirectoryList.size(); ++i) {
96 delete fDirectoryList[i];
100 template <
typename Factory>
107 template <
typename Factory>
111 std::ostringstream oss;
112 oss <<fpFactory->Name()<<
"-" << fId++;
116 template <
typename Factory>
123 template <
typename Factory>
126 if (newName.
isNull()) newName = NextName();
128 assert (0 != fpFactory);
132 G4String guidance =
"Commands for "+newName+
" model.";
136 fDirectoryList.push_back(directory);
139 typename Factory::ModelAndMessengers creation = fpFactory->Create(Placement(), newName);
142 fpVisManager->RegisterModel(creation.first);
145 typename Factory::Messengers::iterator iter = creation.second.begin();
147 while (iter != creation.second.end()) {
148 fpVisManager->RegisterMessenger(*iter);