| 1342 | } |
| 1343 | |
| 1344 | void G4VisManager::GeometryHasChanged () { |
| 1345 | if (fVerbosity >= confirmations) { |
| 1346 | G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl; |
| 1347 | } |
| 1348 | |
| 1349 | // Change the world... |
| 1350 | G4VPhysicalVolume* pWorld = |
| 1351 | G4TransportationManager::GetTransportationManager () |
| 1352 | -> GetNavigatorForTracking () -> GetWorldVolume (); |
| 1353 | if (!pWorld) { |
| 1354 | if (fVerbosity >= warnings) { |
| 1355 | G4warn << "WARNING: There is no world volume!" << G4endl; |
| 1356 | } |
| 1357 | } |
| 1358 | |
| 1359 | // Check scenes. |
| 1360 | G4SceneList& sceneList = fSceneList; |
| 1361 | std::size_t iScene, nScenes = sceneList.size (); |
| 1362 | for (iScene = 0; iScene < nScenes; ++iScene) { |
| 1363 | G4Scene* pScene = sceneList [iScene]; |
| 1364 | std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList (); |
| 1365 | if (modelList.size ()) { |
| 1366 | G4bool modelInvalid; |
| 1367 | do { // Remove, if required, one at a time. |
| 1368 | modelInvalid = false; |
| 1369 | std::vector<G4Scene::Model>::iterator iterModel; |
| 1370 | for (iterModel = modelList.begin(); |
| 1371 | iterModel != modelList.end(); |
| 1372 | ++iterModel) { |
| 1373 | modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=warnings)); |
| 1374 | if (modelInvalid) { |
| 1375 | // Model invalid - remove and break. |
| 1376 | if (fVerbosity >= warnings) { |
| 1377 | G4warn << "WARNING: Model \"" |
| 1378 | << iterModel->fpModel->GetGlobalDescription () |
| 1379 | << "\" is no longer valid - being removed\n from scene \"" |
| 1380 | << pScene -> GetName () |
| 1381 | << "\". You may have to re-establish the scene." |
| 1382 | << G4endl; |
| 1383 | } |
| 1384 | modelList.erase (iterModel); |
| 1385 | break; |
| 1386 | } |
| 1387 | } |
| 1388 | } while (modelInvalid); |
| 1389 | |
| 1390 | if (modelList.size () == 0) { |
| 1391 | if (fVerbosity >= warnings) { |
| 1392 | G4warn << "WARNING: No run-duration models left in this scene \"" |
| 1393 | << pScene -> GetName () |
| 1394 | << "\"." |
| 1395 | << G4endl; |
| 1396 | } |
| 1397 | if (pWorld) { |
| 1398 | if (fVerbosity >= warnings) { |
| 1399 | G4warn << " Adding current world to \"" |
| 1400 | << pScene -> GetName () |
| 1401 | << "\"." |
no test coverage detected