Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -41,26 +41,19 @@
|
||||
#include "FTFP_BERT.hh"
|
||||
#include "G4StepLimiterPhysics.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4VisExecutive.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4UI_USE
|
||||
#include "G4UIExecutive.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
#ifdef G4UI_USE
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = 0;
|
||||
if ( argc == 1 ) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
@@ -80,37 +73,29 @@ int main(int argc,char** argv)
|
||||
// User action initialization
|
||||
runManager->SetUserInitialization(new B5ActionInitialization());
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization manager construction
|
||||
auto visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
auto UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if ( argc != 1 ) {
|
||||
if ( !ui ) {
|
||||
// execute an argument macro file if exist
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
else {
|
||||
#ifdef G4UI_USE
|
||||
#ifdef G4VIS_USE
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
#else
|
||||
UImanager->ApplyCommand("/control/execute init.mac");
|
||||
#endif
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
if (ui->IsGUI()) {
|
||||
UImanager->ApplyCommand("/control/execute gui.mac");
|
||||
}
|
||||
// start interactive session
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Job termination
|
||||
@@ -118,9 +103,7 @@ int main(int argc,char** argv)
|
||||
// owned and deleted by the run manager, so they should not be deleted
|
||||
// in the main() program !
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user