Changeset 1337 for trunk/examples/extended/analysis/N03Con/exampleN03Con.cc
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/analysis/N03Con/exampleN03Con.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: exampleN03Con.cc,v 1. 2 2007/05/26 00:24:09 tkoiExp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: exampleN03Con.cc,v 1.4 2010/05/12 12:45:06 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // … … 34 34 #include "G4RunManager.hh" 35 35 #include "G4UImanager.hh" 36 #include "G4UIterminal.hh"37 #include "G4UItcsh.hh"38 39 #ifdef G4UI_USE_XM40 #include "G4UIXm.hh"41 #endif42 43 #ifdef G4UI_USE_WIN3244 #include "G4UIWin32.hh"45 #endif46 36 47 37 #include "Randomize.hh" … … 49 39 #ifdef G4VIS_USE 50 40 #include "G4VisExecutive.hh" 41 #endif 42 43 #ifdef G4UI_USE 44 #include "G4UIExecutive.hh" 51 45 #endif 52 46 … … 84 78 runManager->SetUserInitialization(physics); 85 79 86 G4UIsession* session=0;87 88 if (argc==1) // Define UI session for interactive mode.89 {90 // G4UIterminal is a (dumb) terminal91 //92 #if defined(G4UI_USE_XM)93 session = new G4UIXm(argc,argv);94 #elif defined(G4UI_USE_WIN32)95 session = new G4UIWin32();96 #elif defined(G4UI_USE_TCSH)97 session = new G4UIterminal(new G4UItcsh);98 #else99 session = new G4UIterminal();100 #endif101 }102 103 #ifdef G4VIS_USE104 // Visualization manager105 //106 G4VisManager* visManager = new G4VisExecutive;107 visManager->Initialize();108 #endif109 110 80 // Set user action classes 111 81 // … … 127 97 runManager->Initialize(); 128 98 99 #ifdef G4VIS_USE 100 // Visualization manager 101 // 102 G4VisManager* visManager = new G4VisExecutive; 103 visManager->Initialize(); 104 #endif 105 129 106 // Get the pointer to the User Interface manager 130 107 // 131 G4UImanager* UI = G4UImanager::GetUIpointer();108 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 132 109 133 if ( session) // Define UI session for interactivemode110 if (argc!=1) // batch mode 134 111 { 135 // G4UIterminal is a (dumb) terminal136 //137 // UI->ApplyCommand("/control/execute vis.mac");138 #if defined(G4UI_USE_XM) || defined(G4UI_USE_WIN32)139 // Customize the G4UIXm,Win32 menubar with a macro file140 //141 // UI->ApplyCommand("/control/execute visTutor/gui.mac");142 #endif143 session->SessionStart();144 delete session;145 }146 else // Batch mode147 {148 112 #ifdef G4VIS_USE 149 113 visManager->SetVerboseLevel("quiet"); … … 151 115 G4String command = "/control/execute "; 152 116 G4String fileName = argv[1]; 153 UI->ApplyCommand(command+fileName); 117 UImanager->ApplyCommand(command+fileName); 118 } 119 else 120 { // interactive mode : define UI session 121 #ifdef G4UI_USE 122 G4UIExecutive* ui = new G4UIExecutive(argc, argv); 123 ui->SessionStart(); 124 delete ui; 125 #endif 154 126 } 155 127
Note: See TracChangeset
for help on using the changeset viewer.