Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -38,14 +38,9 @@
|
||||
#include "G4UImanager.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "UVA_VisAction.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4UI_USE
|
||||
#include "G4UIExecutive.hh"
|
||||
#endif
|
||||
|
||||
#include "Randomize.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
@@ -54,6 +49,13 @@
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = 0;
|
||||
if ( argc == 1 ) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
// Choose the Random engine
|
||||
//
|
||||
G4Random::setTheEngine(new CLHEP::RanecuEngine);
|
||||
@@ -79,42 +81,31 @@ int main(int argc,char** argv)
|
||||
// User action initialization
|
||||
runManager->SetUserInitialization(new B1ActionInitialization());
|
||||
|
||||
// Initialize G4 kernel
|
||||
//
|
||||
runManager->Initialize();
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Initialize visualization
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
// Register User Vis Action with optional extent
|
||||
visManager->SetUserAction
|
||||
(new UVA_VisAction, G4VisExtent(-20*cm,-10*cm,-25*cm,-15*cm,20*cm,40*cm));
|
||||
#endif
|
||||
visManager->RegisterRunDurationUserVisAction
|
||||
("My nice logo",
|
||||
new UVA_VisAction,
|
||||
G4VisExtent(-20*cm,-10*cm,-25*cm,-15*cm,20*cm,40*cm));
|
||||
visManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc!=1) {
|
||||
if ( ! ui ) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode : define UI session
|
||||
#ifdef G4UI_USE
|
||||
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
|
||||
#ifdef G4VIS_USE
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
#else
|
||||
UImanager->ApplyCommand("/control/execute init.mac");
|
||||
#endif
|
||||
// interactive mode
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Job termination
|
||||
@@ -122,9 +113,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;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user