Ignore:
Timestamp:
Sep 30, 2010, 2:47:17 PM (14 years ago)
Author:
garnier
Message:

tag geant4.9.4 beta 1 + modifs locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/field/field01/field01.cc

    r1230 r1337  
    2525//
    2626//
    27 // $Id: field01.cc,v 1.8 2006/06/29 17:15:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-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 $
    2929//
    3030//
     
    4040#include "G4RunManager.hh"
    4141#include "G4UImanager.hh"
    42 #include "G4UIterminal.hh"
    4342#include "Randomize.hh"
    44 
    45 #ifdef G4VIS_USE
    46 #include "G4VisExecutive.hh"
    47 #endif
    4843
    4944#include "F01DetectorConstruction.hh"
     
    5550#include "F01SteppingAction.hh"
    5651#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
    5760
    5861int main(int argc,char** argv)
     
    8285  runManager->SetUserInitialization(new F01PhysicsList(detector));
    8386 
    84 #ifdef G4VIS_USE
    85 
    86   // visualization manager
    87 
    88   G4VisManager* visManager = new G4VisExecutive;
    89   visManager->Initialize();
    90 
    91 #endif
    92  
    9387  // Set user action classes
    9488
     
    110104  runManager->Initialize();
    111105   
     106#ifdef G4VIS_USE
     107
     108  // visualization manager
     109
     110  G4VisManager* visManager = new G4VisExecutive;
     111  visManager->Initialize();
     112
     113#endif
     114 
    112115  // Get the pointer to the User Interface manager
    113116
    114   G4UImanager* UI = G4UImanager::GetUIpointer(); 
     117  G4UImanager* UImanager = G4UImanager::GetUIpointer(); 
    115118 
    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
    129134  // job termination
    130135
Note: See TracChangeset for help on using the changeset viewer.