35#ifndef G4VISCOMMANDSMODELCREATE_HH
36#define G4VISCOMMANDSMODELCREATE_HH
45template <
typename Factory>
69 std::vector<G4UIcommand*> fDirectoryList;
73template <
typename Factory>
76 ,fPlacement(placement)
79 G4String factoryName = factory->Name();
82 G4String guidance =
"Create a "+factoryName+
" model and associated messengers.";
86 fpCommand->
SetGuidance(
"Generated model becomes current.");
90template <
typename Factory>
96 for (i=0; i<fDirectoryList.size(); ++i) {
97 delete fDirectoryList[i];
101template <
typename Factory>
108template <
typename Factory>
112 std::ostringstream oss;
113 oss <<fpFactory->Name()<<
"-" << fId++;
117template <
typename Factory>
124template <
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 SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
G4String GetCurrentValue(G4UIcommand *)
G4VisCommandModelCreate(Factory *, const G4String &placement)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandModelCreate()
G4String Placement() const