90 {
91
93
94 G4String searchString, activateString;
95 std::istringstream is (newValue);
96 is >> searchString >> activateString;
98
100 if (!pScene) {
102 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
103 }
104 return;
105 }
106
108 if (!pSceneHandler) {
110 G4warn <<
"ERROR: No current sceneHandler. Please create one." <<
G4endl;
111 }
112 return;
113 }
114
115 if (searchString == "all" && !activate) {
118 "WARNING: You are not allowed to de-activate all models."
119 "\n Command ignored."
121 }
122 return;
123 }
124
126
127 std::vector<G4Scene::Model>& runDurationModelList =
129 for (size_t i = 0; i < runDurationModelList.size(); i++) {
131 runDurationModelList[i].fpModel->GetGlobalDescription();
132 if (searchString == "all" || modelName.find(searchString)
133 != std::string::npos) {
134 any = true;
135 runDurationModelList[i].fActive = activate;
137 G4warn <<
"Model \"" << modelName;
138 if (activate)
G4warn <<
"\" activated.";
139 else G4warn <<
"\" de-activated.";
141 }
142 }
143 }
144
145 std::vector<G4Scene::Model>& endOfEventModelList =
147 for (size_t i = 0; i < endOfEventModelList.size(); i++) {
149 endOfEventModelList[i].fpModel->GetGlobalDescription();
150 if (searchString == "all" || modelName.find(searchString)
151 != std::string::npos) {
152 any = true;
153 endOfEventModelList[i].fActive = activate;
155 G4warn <<
"Model \"" << modelName;
156 if (activate)
G4warn <<
"\" activated.";
157 else G4warn <<
"\" de-activated.";
159 }
160 }
161 }
162
163 std::vector<G4Scene::Model>& endOfRunModelList =
165 for (size_t i = 0; i < endOfRunModelList.size(); i++) {
167 endOfRunModelList[i].fpModel->GetGlobalDescription();
168 if (searchString == "all" || modelName.find(searchString)
169 != std::string::npos) {
170 any = true;
171 endOfRunModelList[i].fActive = activate;
173 G4warn <<
"Model \"" << modelName;
174 if (activate)
G4warn <<
"\" activated.";
175 else G4warn <<
"\" de-activated.";
177 }
178 }
179 }
180
181 if (!any) {
184 }
185 return;
186 }
187
189}
std::vector< Model > & SetEndOfRunModelList()
std::vector< Model > & SetRunDurationModelList()
std::vector< Model > & SetEndOfEventModelList()
static G4bool ConvertToBool(const char *st)
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()