34#ifndef G4VISCOMMANDSMODELCREATE_HH
35#define G4VISCOMMANDSMODELCREATE_HH
44template <
typename Factory>
68 std::vector<G4UIcommand*> fDirectoryList;
72template <
typename Factory>
75 ,fPlacement(placement)
78 G4String factoryName = factory->Name();
81 G4String guidance =
"Create a "+factoryName+
" model and associated messengers.";
85 fpCommand->
SetGuidance(
"Generated model becomes current.");
89template <
typename Factory>
95 for (i=0; i<fDirectoryList.size(); ++i) {
96 delete fDirectoryList[i];
100template <
typename Factory>
107template <
typename Factory>
111 std::ostringstream oss;
112 oss <<fpFactory->Name()<<
"-" << fId++;
116template <
typename Factory>
123template <
typename Factory>
126 if (newName.empty()) newName = NextName();
128 assert (0 != fpFactory);
131 G4String title = Placement()+
"/"+newName+
"/";
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);
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