Ignore:
Timestamp:
Nov 19, 2009, 12:25:47 PM (15 years ago)
Author:
garnier
Message:

update par rapport a CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/novice/N02/exampleN02.cc

    r893 r1189  
    2525//
    2626//
    27 // $Id: exampleN02.cc,v 1.15 2008/05/07 09:52:59 allison Exp $
     27// $Id: exampleN02.cc,v 1.16 2009/10/30 14:59:59 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4242#include "G4RunManager.hh"
    4343#include "G4UImanager.hh"
    44 #include "G4UIterminal.hh"
    45 #include "G4UItcsh.hh"
    4644
    4745#ifdef G4VIS_USE
    4846#include "G4VisExecutive.hh"
     47#endif
     48
     49#ifdef G4UI_USE
     50#include "G4UIExecutive.hh"
    4951#endif
    5052
     
    8890  runManager->Initialize();
    8991     
     92#ifdef G4VIS_USE
     93  G4VisManager* visManager = new G4VisExecutive;
     94  visManager->Initialize();
     95#endif   
     96     
    9097  // Get the pointer to the User Interface manager
    9198  //
    92   G4UImanager * UI = G4UImanager::GetUIpointer(); 
     99  G4UImanager * UImanager = G4UImanager::GetUIpointer(); 
    93100
    94101  if (argc!=1)   // batch mode 
    95102    {
    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);
    99106    }
    100    
    101   else           // interactive mode : define visualization and UI terminal
     107  else           // interactive mode : define UI session
    102108    {
     109#ifdef G4UI_USE
     110      G4UIExecutive * ui = new G4UIExecutive(argc,argv);
    103111#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");     
    113113#endif
    114 #ifdef G4VIS_USE
    115       UI->ApplyCommand("/control/execute vis.mac");     
     114      ui->SessionStart();
     115      delete ui;
    116116#endif
    117       session->SessionStart();
    118       delete session;
    119117     
    120118#ifdef G4VIS_USE
Note: See TracChangeset for help on using the changeset viewer.