Changeset 1337 for trunk/examples/extended/field/field01/field01.cc
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/field/field01/field01.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: field01.cc,v 1. 8 2006/06/29 17:15:22 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: field01.cc,v 1.9 2010/05/12 16:30:59 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // … … 40 40 #include "G4RunManager.hh" 41 41 #include "G4UImanager.hh" 42 #include "G4UIterminal.hh"43 42 #include "Randomize.hh" 44 45 #ifdef G4VIS_USE46 #include "G4VisExecutive.hh"47 #endif48 43 49 44 #include "F01DetectorConstruction.hh" … … 55 50 #include "F01SteppingAction.hh" 56 51 #include "F01SteppingVerbose.hh" 52 53 #ifdef G4VIS_USE 54 #include "G4VisExecutive.hh" 55 #endif 56 57 #ifdef G4UI_USE 58 #include "G4UIExecutive.hh" 59 #endif 57 60 58 61 int main(int argc,char** argv) … … 82 85 runManager->SetUserInitialization(new F01PhysicsList(detector)); 83 86 84 #ifdef G4VIS_USE85 86 // visualization manager87 88 G4VisManager* visManager = new G4VisExecutive;89 visManager->Initialize();90 91 #endif92 93 87 // Set user action classes 94 88 … … 110 104 runManager->Initialize(); 111 105 106 #ifdef G4VIS_USE 107 108 // visualization manager 109 110 G4VisManager* visManager = new G4VisExecutive; 111 visManager->Initialize(); 112 113 #endif 114 112 115 // Get the pointer to the User Interface manager 113 116 114 G4UImanager* UI = G4UImanager::GetUIpointer();117 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 115 118 116 if (argc==1) // Define UI terminal for interactive mode 117 { 118 G4UIsession * session = new G4UIterminal; 119 session->SessionStart(); 120 delete session; 121 } 122 else // Batch mode 123 { 124 G4String command = "/control/execute "; 125 G4String fileName = argv[1]; 126 UI->ApplyCommand(command+fileName); 127 } 128 119 if (argc!=1) // batch mode 120 { 121 G4String command = "/control/execute "; 122 G4String fileName = argv[1]; 123 UImanager->ApplyCommand(command+fileName); 124 } 125 else 126 { // interactive mode : define UI session 127 #ifdef G4UI_USE 128 G4UIExecutive* ui = new G4UIExecutive(argc, argv); 129 ui->SessionStart(); 130 delete ui; 131 #endif 132 } 133 129 134 // job termination 130 135
Note: See TracChangeset
for help on using the changeset viewer.