Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UIExecutive.hh,v 1.4 2009/11/20 22:10:31 kmura Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// ====================================================================
// G4UIExecutive.hh
//
// This class helps automatic instantiation of user session
// according to your environment variable like G4UI_USE_XXX.
//
// Usage in main():
//
// ...
// #include "G4UIExecutive.hh"
//
// int main(int argc, char** argv)
// {
// ...
// G4UIExecutive* myapp = new G4UIExecutive(argc, argv);
// if (session->IsGUI())
// // Do any extra for a GUI session
//
// myapp-> SessionStart();
// ...
// delete myapp;
// ...
//
// ====================================================================
#ifndef G4UI_EXECUTIVE_H
#define G4UI_EXECUTIVE_H 1
#include "G4VUIshell.hh"
class G4UIsession;
class G4UIExecutive {
private:
G4UIsession* session;
G4VUIshell* shell;
G4bool isGUI;
public:
G4UIExecutive(G4int argc, char** argv);
~G4UIExecutive();
G4bool IsGUI() const;
G4UIsession* GetSession() const;
void SetPrompt(const G4String& prompt);
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor);
void SessionStart();
};
#include "G4UIExecutive.icc"
#endif
@@ -0,0 +1,137 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4UIExecutive.icc,v 1.6 2009/11/20 22:10:31 kmura Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// ====================================================================
// G4UIExecutive.icc
//
// ====================================================================
#include "G4UIsession.hh"
#include "G4UImanager.hh"
#if defined(G4UI_USE_TCSH)
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#elif defined(G4UI_USE_XM)
#include "G4UIXm.hh"
#elif defined(G4UI_USE_WIN32)
#include "G4UIWin32.hh"
#elif defined(G4UI_USE_QT)
#include "G4UIQt.hh"
#include "G4Qt.hh"
#else
#include "G4UIterminal.hh"
#include "G4UIcsh.hh"
#endif
#define DISCARD_PARAMETER(p) (void)p
/////////////////////////////////////////////////////
G4UIExecutive::G4UIExecutive(G4int argc, char** argv)
: session(0), shell(0),isGUI(false)
/////////////////////////////////////////////////////
{
#if defined(G4UI_USE_TCSH)
DISCARD_PARAMETER(argc);
DISCARD_PARAMETER(argv);
shell = new G4UItcsh;
session = new G4UIterminal(shell);
#elif defined(G4UI_USE_XM)
session = new G4UIXm(argc, argv);
isGUI = true;
#elif defined(G4UI_USE_WIN32)
DISCARD_PARAMETER(argc);
DISCARD_PARAMETER(argv);
session = new G4UIWin32();
#elif defined(G4UI_USE_QT)
session = new G4UIQt(argc, argv);
isGUI = true;
#else
DISCARD_PARAMETER(argc);
DISCARD_PARAMETER(argv);
shell = new G4UIcsh;
session = new G4UIterminal(shell);
#endif
}
///////////////////////////////
G4UIExecutive::~G4UIExecutive()
///////////////////////////////
{
}
//////////////////////////////////////////
inline G4bool G4UIExecutive::IsGUI() const
//////////////////////////////////////////
{
return isGUI;
}
/////////////////////////////////////////////////////
inline G4UIsession* G4UIExecutive::GetSession() const
/////////////////////////////////////////////////////
{
return session;
}
////////////////////////////////////////////////////////////
inline void G4UIExecutive::SetPrompt(const G4String& prompt)
////////////////////////////////////////////////////////////
{
if(shell) shell-> SetPrompt(prompt);
}
//////////////////////////////////////////////////////////////
inline void G4UIExecutive::SetLsColor(TermColorIndex dirColor,
TermColorIndex cmdColor)
//////////////////////////////////////////////////////////////
{
if(shell) shell-> SetLsColor(dirColor, cmdColor);
}
/////////////////////////////////////////
inline void G4UIExecutive::SessionStart()
/////////////////////////////////////////
{
session-> SessionStart();
delete session;
}
+3 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4UIQt.hh,v 1.15 2008/11/06 10:06:33 lgarnier Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4UIQt.hh,v 1.16 2009/02/16 11:40:26 lgarnier Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#ifndef G4UIQt_h
#define G4UIQt_h
@@ -102,6 +102,7 @@ public:
G4int ReceiveG4cout(G4String);
G4int ReceiveG4cerr(G4String);
// G4String GetCommand(Widget);
QMainWindow * getMainWindow();
private:
void SecondaryLoop(G4String); // a VIRER
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VUIshell.hh,v 1.7 2007/06/14 05:44:58 kmura Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4VUIshell.hh,v 1.8 2009/05/13 09:01:36 kmura Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#ifndef G4VUIshell_h
@@ -86,6 +86,7 @@ public:
void SetNColumn(G4int ncol);
void SetPrompt(const G4String& prompt);
void SetCurrentDirectory(const G4String& ccd);
virtual void SetLsColor(TermColorIndex, TermColorIndex);
// shell commands
virtual void ShowCurrentDirectory() const;
@@ -117,6 +118,10 @@ inline void G4VUIshell::SetCurrentDirectory(const G4String& dir)
currentCommandDir= dir;
}
inline void G4VUIshell::SetLsColor(TermColorIndex, TermColorIndex)
{
}
inline void G4VUIshell::ShowCurrentDirectory() const
{
G4cout << currentCommandDir << G4endl;