87 {
88
90
91 G4String searchString, activateString;
92 std::istringstream is (newValue);
93 is >> searchString >> activateString;
95
97 if (!pScene) {
99 G4cout <<
"ERROR: No current scene. Please create one." <<
G4endl;
100 }
101 return;
102 }
103
105 if (!pSceneHandler) {
107 G4cout <<
"ERROR: No current sceneHandler. Please create one." <<
G4endl;
108 }
109 return;
110 }
111
112 if (searchString == "all" && !activate) {
115 "WARNING: You are not allowed to de-activate all models."
116 "\n Command ignored."
118 }
119 return;
120 }
121
123
124 std::vector<G4Scene::Model>& runDurationModelList =
126 for (size_t i = 0; i < runDurationModelList.size(); i++) {
128 runDurationModelList[i].fpModel->GetGlobalDescription();
129 if (searchString == "all" || modelName.find(searchString)
130 != std::string::npos) {
131 any = true;
132 runDurationModelList[i].fActive = activate;
134 G4cout <<
"Model \"" << modelName;
135 if (activate)
G4cout <<
"\" activated.";
136 else G4cout <<
"\" de-activated.";
138 }
139 }
140 }
141
142 std::vector<G4Scene::Model>& endOfEventModelList =
144 for (size_t i = 0; i < endOfEventModelList.size(); i++) {
146 endOfEventModelList[i].fpModel->GetGlobalDescription();
147 if (searchString == "all" || modelName.find(searchString)
148 != std::string::npos) {
149 any = true;
150 endOfEventModelList[i].fActive = activate;
152 G4cout <<
"Model \"" << modelName;
153 if (activate)
G4cout <<
"\" activated.";
154 else G4cout <<
"\" de-activated.";
156 }
157 }
158 }
159
160 std::vector<G4Scene::Model>& endOfRunModelList =
162 for (size_t i = 0; i < endOfRunModelList.size(); i++) {
164 endOfRunModelList[i].fpModel->GetGlobalDescription();
165 if (searchString == "all" || modelName.find(searchString)
166 != std::string::npos) {
167 any = true;
168 endOfRunModelList[i].fActive = activate;
170 G4cout <<
"Model \"" << modelName;
171 if (activate)
G4cout <<
"\" activated.";
172 else G4cout <<
"\" de-activated.";
174 }
175 }
176 }
177
178 if (!any) {
181 }
182 return;
183 }
184
185 const G4String& currentSceneName = pScene -> GetName ();
187}
G4DLLIMPORT std::ostream G4cout
std::vector< Model > & SetEndOfRunModelList()
std::vector< Model > & SetRunDurationModelList()
std::vector< Model > & SetEndOfEventModelList()
static G4bool ConvertToBool(const char *st)
static G4VisManager * fpVisManager
void UpdateVisManagerScene(const G4String &sceneName="")
G4Scene * GetCurrentScene() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()