Changeset 1189 for trunk/examples/novice/N02/exampleN02.cc
- Timestamp:
- Nov 19, 2009, 12:25:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/novice/N02/exampleN02.cc
r893 r1189 25 25 // 26 26 // 27 // $Id: exampleN02.cc,v 1.1 5 2008/05/07 09:52:59 allison Exp $27 // $Id: exampleN02.cc,v 1.16 2009/10/30 14:59:59 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 42 42 #include "G4RunManager.hh" 43 43 #include "G4UImanager.hh" 44 #include "G4UIterminal.hh"45 #include "G4UItcsh.hh"46 44 47 45 #ifdef G4VIS_USE 48 46 #include "G4VisExecutive.hh" 47 #endif 48 49 #ifdef G4UI_USE 50 #include "G4UIExecutive.hh" 49 51 #endif 50 52 … … 88 90 runManager->Initialize(); 89 91 92 #ifdef G4VIS_USE 93 G4VisManager* visManager = new G4VisExecutive; 94 visManager->Initialize(); 95 #endif 96 90 97 // Get the pointer to the User Interface manager 91 98 // 92 G4UImanager * UI = G4UImanager::GetUIpointer();99 G4UImanager * UImanager = G4UImanager::GetUIpointer(); 93 100 94 101 if (argc!=1) // batch mode 95 102 { 96 G4String command = "/control/execute ";97 G4String fileName = argv[1];98 UI->ApplyCommand(command+fileName);103 G4String command = "/control/execute "; 104 G4String fileName = argv[1]; 105 UImanager->ApplyCommand(command+fileName); 99 106 } 100 101 else // interactive mode : define visualization and UI terminal 107 else // interactive mode : define UI session 102 108 { 109 #ifdef G4UI_USE 110 G4UIExecutive * ui = new G4UIExecutive(argc,argv); 103 111 #ifdef G4VIS_USE 104 G4VisManager* visManager = new G4VisExecutive; 105 visManager->Initialize(); 106 #endif 107 108 G4UIsession * session = 0; 109 #ifdef G4UI_USE_TCSH 110 session = new G4UIterminal(new G4UItcsh); 111 #else 112 session = new G4UIterminal(); 112 UImanager->ApplyCommand("/control/execute vis.mac"); 113 113 #endif 114 #ifdef G4VIS_USE 115 UI->ApplyCommand("/control/execute vis.mac");114 ui->SessionStart(); 115 delete ui; 116 116 #endif 117 session->SessionStart();118 delete session;119 117 120 118 #ifdef G4VIS_USE
Note: See TracChangeset
for help on using the changeset viewer.