- Timestamp:
- Nov 16, 2009, 4:56:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/src/G4VisManager.cc
r1140 r1170 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VisManager.cc,v 1.12 1 2009/10/30 16:03:41allison Exp $26 // $Id: G4VisManager.cc,v 1.122 2009/11/04 12:58:00 allison Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 87 87 fpSceneHandler (0), 88 88 fpViewer (0), 89 fVerbosity ( all),//warnings),89 fVerbosity (warnings), 90 90 fpStateDependent (0), 91 91 fEventRefreshing (false), … … 98 98 // All other objects use default constructors. 99 99 { 100 101 #ifdef G4DEBUG_VIS_MANAGEMENT102 printf("G4VisManager::G4VisManager\n");103 #endif104 100 fpTrajDrawModelMgr = new G4VisModelManager<G4VTrajectoryModel>("/vis/modeling/trajectories"); 105 101 fpTrajFilterMgr = new G4VisFilterManager<G4VTrajectory>("/vis/filtering/trajectories"); … … 178 174 179 175 G4VisManager::~G4VisManager () { 176 printf("G4VisManager::~G4VisManager DELETING \n"); 180 177 fpInstance = 0; 181 178 size_t i; 182 179 for (i = 0; i < fSceneList.size (); ++i) { 180 printf("G4VisManager::~G4VisManager DELETING 1 \n"); 183 181 delete fSceneList[i]; 184 182 } 185 183 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) { 184 printf("G4VisManager::~G4VisManager DELETING 2\n"); 185 if (fAvailableSceneHandlers[i] != NULL) { 186 186 delete fAvailableSceneHandlers[i]; 187 187 } 188 } 188 189 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) { 189 delete fAvailableGraphicsSystems[i]; 190 printf("G4VisManager::~G4VisManager DELETING 3\n"); 191 if (fAvailableGraphicsSystems[i]) { 192 delete fAvailableGraphicsSystems[i]; 193 } 190 194 } 191 195 if (fVerbosity >= startup) { … … 194 198 } 195 199 for (i = 0; i < fMessengerList.size (); ++i) { 200 printf("G4VisManager::~G4VisManager DELETING 4\n"); 196 201 delete fMessengerList[i]; 197 202 } 198 203 for (i = 0; i < fDirectoryList.size (); ++i) { 204 printf("G4VisManager::~G4VisManager DELETING 5\n"); 199 205 delete fDirectoryList[i]; 200 206 } 201 207 208 printf("G4VisManager::~G4VisManager DELETING 6\n"); 202 209 delete fpTrajDrawModelMgr; 210 printf("G4VisManager::~G4VisManager DELETING 7\n"); 203 211 delete fpTrajFilterMgr; 212 printf("G4VisManager::~G4VisManager DELETING 8\n"); 204 213 delete fpHitFilterMgr; 214 printf("G4VisManager::~G4VisManager DELETING 9\n"); 205 215 } 206 216 … … 379 389 } 380 390 391 392 381 393 const G4VTrajectoryModel* 382 394 G4VisManager::CurrentTrajDrawModel() const … … 665 677 666 678 void G4VisManager::CreateViewer (G4String name,G4String XGeometry) { 667 printf("G4VisManager::CreateViewer -------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());668 679 669 680 if (!fInitialised) Initialise (); … … 674 685 } 675 686 676 printf("G4VisManager::CreateViewer 1-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());677 687 G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name); 678 printf("G4VisManager::CreateViewer 2-------------------- %s ----%s\n",name.c_str(),XGeometry.c_str());679 688 680 689 if (!p) { … … 749 758 750 759 void G4VisManager::GeometryHasChanged () { 751 #ifdef G4DEBUG_VIS_MANAGEMENT752 printf("G4VisManager::GeometryHasChanged \n");753 #endif754 760 if (fVerbosity >= confirmations) { 755 761 G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl; … … 816 822 // Check the manager's current scene... 817 823 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) { 818 #ifdef G4DEBUG_VIS_MANAGEMENT819 printf("G4VisManager::GeometryHasChanged NO MODELS\n");820 #endif821 824 if (fVerbosity >= warnings) { 822 825 G4cout << "WARNING: The current scene \"" … … 827 830 } 828 831 829 }832 } 830 833 void G4VisManager::NotifyHandlers () { 831 834 832 #ifdef G4DEBUG_VIS_MANAGEMENT833 printf("G4VisManager::NotifyHandlers \n");834 #endif835 835 if (fVerbosity >= confirmations) { 836 836 G4cout << "G4VisManager::NotifyHandler() called." << G4endl; … … 861 861 } 862 862 863 #ifdef G4DEBUG_VIS_MANAGEMENT864 printf("G4VisManager::NotifyHandlers END\n");865 #endif866 863 } 867 864 … … 1266 1263 void G4VisManager::EndOfEvent () 1267 1264 { 1268 printf("G4VisManager::EndOfEvent \n");1269 1270 1265 //G4cout << "G4VisManager::EndOfEvent" << G4endl; 1271 1266 … … 1283 1278 if (!currentEvent) return; 1284 1279 1285 // FIXME : OK1286 printf("G4VisManager::EndOfEvent 0\n");1287 1280 ClearTransientStoreIfMarked(); 1288 printf("G4VisManager::EndOfEvent 1\n");1289 // FIXME : OK1290 1281 fpSceneHandler->DrawEvent(currentEvent); 1291 1282 … … 1293 1284 G4int nKeptEvents = 0; 1294 1285 G4int eventID = -2; // (If no run manager, triggers ShowView as normal.) 1295 printf("G4VisManager::EndOfEvent 2\n");1296 1286 if (currentRun) { 1297 printf("G4VisManager::EndOfEvent currentRun?\n");1298 1287 nEventsToBeProcessed = currentRun->GetNumberOfEventToBeProcessed(); 1299 1288 eventID = currentEvent->GetEventID(); … … 1302 1291 if (events) nKeptEvents = events->size(); 1303 1292 } 1304 1293 1305 1294 if (fpScene->GetRefreshAtEndOfEvent()) { 1306 printf("G4VisManager::EndOfEvent GetRefreshAtEndOfEvent()\n");1307 1295 1308 1296 // Unless last event (in which case wait end of run)... 1309 1297 if (eventID < nEventsToBeProcessed - 1) { 1310 printf("G4VisManager::EndOfEvent 3 \n");1311 1298 fpViewer->ShowView(); 1312 1299 fpSceneHandler->SetMarkForClearingTransientStore(true); 1313 1300 } else { // Last event... 1314 printf("G4VisManager::EndOfEvent 4 \n");1315 1301 // Keep, but only if user has not kept any... 1316 1302 if (!nKeptEvents) { … … 1321 1307 1322 1308 } else { // Accumulating events... 1323 printf("G4VisManager::EndOfEvent NOT GetRefreshAtEndOfEvent()\n");1324 1309 1325 1310 G4int maxNumberOfKeptEvents = fpScene->GetMaxNumberOfKeptEvents(); 1326 1311 if (maxNumberOfKeptEvents > 0 && nKeptEvents >= maxNumberOfKeptEvents) { 1327 printf("G4VisManager::EndOfEvent 5 \n");1328 1312 fEventKeepingSuspended = true; 1329 1313 static G4bool warned = false; 1330 1314 if (!warned) { 1331 printf("G4VisManager::EndOfEvent 6 \n");1332 1315 if (fVerbosity >= warnings) { 1333 printf("G4VisManager::EndOfEvent 7 \n");1334 1316 G4cout << 1335 1317 "WARNING: G4VisManager::EndOfEvent: Automatic event keeping suspended." … … 1342 1324 } 1343 1325 } else if (maxNumberOfKeptEvents != 0) { 1344 printf("G4VisManager::EndOfEvent 8 \n");1345 1326 eventManager->KeepTheCurrentEvent(); 1346 1327 } 1347 1328 } 1348 printf("G4VisManager::EndOfEvent 9 \n");1349 1329 } 1350 1330 … … 1352 1332 { 1353 1333 //G4cout << "G4VisManager::EndOfRun" << G4endl; 1354 printf("G4VisManager::EndOfRun 1\n"); 1334 1355 1335 // Don't call IsValidView unless there is a scene handler. This 1356 1336 // avoids WARNING message at end of event and run when the user has 1357 1337 // not instantiated a scene handler, e.g., in batch mode. 1358 1338 G4bool valid = GetConcreteInstance() && fpSceneHandler && IsValidView(); 1359 printf("G4VisManager::EndOfRun 2\n");1360 1339 if (valid) { 1361 printf("G4VisManager::EndOfRun 3\n");1362 1340 if (!fpSceneHandler->GetMarkForClearingTransientStore()) { 1363 printf("G4VisManager::EndOfRun 4\n");1364 1341 if (fpScene->GetRefreshAtEndOfRun()) { 1365 printf("G4VisManager::EndOfRun 5\n");1342 fpSceneHandler->DrawEndOfRunModels(); 1366 1343 fpViewer->ShowView(); 1367 printf("G4VisManager::EndOfRun 6\n");1368 1344 fpSceneHandler->SetMarkForClearingTransientStore(true); 1369 printf("G4VisManager::EndOfRun 7\n"); 1370 } 1371 } 1372 1373 printf("G4VisManager::EndOfRun 8\n"); 1345 } 1346 } 1347 1374 1348 if (fEventKeepingSuspended && fVerbosity >= warnings) { 1375 1349 G4cout << … … 1386 1360 fEventRefreshing = false; 1387 1361 1388 printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");1389 1362 G4RunManager* runManager = G4RunManager::GetRunManager(); 1390 1363 const G4Run* currentRun = runManager->GetCurrentRun();
Note: See TracChangeset
for help on using the changeset viewer.