Import Geant4 9.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.2 2005/01/26 08:50:58 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.3 2007/05/21 07:30:33 kmura Exp $
|
||||
# -------------------------------------------------------------
|
||||
# GNUmakefile for interfaces/basic library. John Allison, 6/7/98.
|
||||
|
||||
@@ -15,5 +15,32 @@ include $(G4INSTALL)/config/interactivity.gmk
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
CPPFLAGS += -I$(G4BASE)/interfaces/common/include
|
||||
CPPFLAGS += -I$(G4BASE)/intercoms/include
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/run/include \
|
||||
-I$(G4BASE)/event/include \
|
||||
-I$(G4BASE)/track/include \
|
||||
-I$(G4BASE)/tracking/include \
|
||||
-I$(G4BASE)/particles/management/include \
|
||||
-I$(G4BASE)/processes/management/include \
|
||||
-I$(G4BASE)/processes/cuts/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/utils/include \
|
||||
-I$(G4BASE)/processes/transportation/include \
|
||||
-I$(G4BASE)/processes/decay/include \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/navigation/include \
|
||||
-I$(G4BASE)/geometry/magneticfield/include \
|
||||
-I$(G4BASE)/geometry/biasing/include \
|
||||
-I$(G4BASE)/digits_hits/detector/include \
|
||||
-I$(G4BASE)/digits_hits/hits/include \
|
||||
-I$(G4BASE)/digits_hits/digits/include \
|
||||
-I$(G4BASE)/interfaces/common/include \
|
||||
-I$(G4BASE)/interfaces/basic/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/graphics_reps/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIArrayString.hh,v 1.3 2006/06/29 19:09:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIArrayString_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIWin32.hh,v 1.14 2006/06/29 19:09:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
#ifndef G4UIWin32_h
|
||||
#define G4UIWin32_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXaw.hh,v 1.6 2006/06/29 19:09:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
#ifndef G4UIXaw_h
|
||||
#define G4UIXaw_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXm.hh,v 1.13 2006/06/29 19:09:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
#ifndef G4UIXm_h
|
||||
#define G4UIXm_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIcsh.hh,v 1.4 2006/06/29 19:09:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcsh_h
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UItcsh.hh,v 1.7 2006/06/29 19:09:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4UItcsh.hh,v 1.8 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UItcsh_h
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
|
||||
//
|
||||
// ====================================================================
|
||||
// Description:
|
||||
// This class gives tcsh-like shell.
|
||||
//
|
||||
@@ -67,6 +67,7 @@
|
||||
// %/ ... current working directory
|
||||
// %h ... history# (different from G4 history#)
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class G4UItcsh : public G4VUIshell {
|
||||
protected:
|
||||
@@ -124,8 +125,13 @@ public:
|
||||
|
||||
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor);
|
||||
virtual G4String GetCommandLine(const char* msg=0);
|
||||
|
||||
virtual void ResetTerminal();
|
||||
};
|
||||
|
||||
// ====================================================================
|
||||
// inline functions
|
||||
// ====================================================================
|
||||
inline G4bool G4UItcsh::IsCursorLast() const
|
||||
{
|
||||
if(cursorPosition == G4int(commandLine.length()+1)) return TRUE;
|
||||
|
||||
@@ -23,19 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4UIterminal.hh,v 1.10 2007/05/22 01:51:05 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// $Id: G4UIterminal.hh,v 1.9 2006/06/29 19:09:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
|
||||
#ifndef G4UIterminal_h
|
||||
#define G4UIterminal_h 1
|
||||
|
||||
#include <fstream>
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VBasicShell.hh"
|
||||
#include "G4VUIshell.hh"
|
||||
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
@@ -68,7 +60,14 @@
|
||||
// - Add more functionality, if need.
|
||||
//
|
||||
// For more detail, see source codes.
|
||||
//
|
||||
// ====================================================================
|
||||
#ifndef G4UIterminal_h
|
||||
#define G4UIterminal_h 1
|
||||
|
||||
#include <fstream>
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VBasicShell.hh"
|
||||
#include "G4VUIshell.hh"
|
||||
|
||||
class G4UIterminal : public G4VBasicShell {
|
||||
private:
|
||||
@@ -81,7 +80,7 @@ private:
|
||||
G4bool iCont;
|
||||
|
||||
public:
|
||||
G4UIterminal(G4VUIshell* aShell=0);
|
||||
G4UIterminal(G4VUIshell* aShell=0, G4bool qsig=true);
|
||||
~G4UIterminal();
|
||||
|
||||
void SetPrompt(const G4String& prompt);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUIshell.hh,v 1.6 2006/06/29 19:09:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VUIshell.hh,v 1.7 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VUIshell_h
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
//
|
||||
// ====================================================================
|
||||
// Description:
|
||||
// This class is the abstract base class for various UI shells.
|
||||
//
|
||||
@@ -49,6 +49,7 @@
|
||||
// %s ... current application status
|
||||
// %/ ... current working directory
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
// terminal color index
|
||||
enum TermColorIndex{ BLACK=0, RED, GREEN, YELLOW,
|
||||
@@ -94,10 +95,13 @@ public:
|
||||
|
||||
// get command string from a command line
|
||||
virtual G4String GetCommandLine(const char* msg=0)= 0;
|
||||
|
||||
virtual void ResetTerminal();
|
||||
};
|
||||
|
||||
|
||||
// inlines...
|
||||
// ====================================================================
|
||||
// inline functions
|
||||
// ====================================================================
|
||||
inline void G4VUIshell::SetNColumn(G4int ncol)
|
||||
{
|
||||
nColumn= ncol;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIArrayString.cc,v 1.8 2006/06/29 19:09:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIWin32.cc,v 1.13 2006/06/29 19:09:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXaw.cc,v 1.6 2006/06/29 19:09:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIcsh.cc,v 1.8 2006/06/29 19:09:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include "G4UIcsh.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UItcsh.cc,v 1.12 2006/06/29 19:09:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4UItcsh.cc,v 1.14 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -75,10 +75,10 @@ G4UItcsh::~G4UItcsh()
|
||||
/////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
|
||||
//////////////////////////////////////////
|
||||
void G4UItcsh::MakePrompt(const char* msg)
|
||||
///////////////////////////
|
||||
//////////////////////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
promptString= promptSetting;
|
||||
@@ -129,6 +129,15 @@ void G4UItcsh::MakePrompt(const char* msg)
|
||||
promptString.append(G4String(promptSetting[i]));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
void G4UItcsh::ResetTerminal()
|
||||
//////////////////////////////
|
||||
{
|
||||
RestoreTerm();
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// commad line operations
|
||||
// --------------------------------------------------------------------
|
||||
@@ -464,14 +473,14 @@ void G4UItcsh::CompleteCommand()
|
||||
else jhead++;
|
||||
|
||||
G4int jt= input.find_last_of('/');
|
||||
if(jt<jhead) jt=G4String::npos;
|
||||
if(jt<jhead) jt=G4int(G4String::npos);
|
||||
|
||||
if(jt==G4int(G4String::npos)) jt= jhead;
|
||||
else jt++;
|
||||
|
||||
G4String dspstr;
|
||||
G4int i;
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); // cleanup
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(' ');
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
|
||||
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIterminal.cc,v 1.21 2006/06/29 19:09:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4UIterminal.cc,v 1.25 2007/06/19 10:38:29 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
//
|
||||
// ====================================================================
|
||||
#include "G4Types.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
@@ -37,10 +40,53 @@
|
||||
#include "G4UIcsh.hh"
|
||||
#include <sstream>
|
||||
|
||||
#ifndef WIN32
|
||||
#include "G4RunManager.hh"
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////
|
||||
G4UIterminal::G4UIterminal(G4VUIshell* aShell)
|
||||
//////////////////////////////////////////////
|
||||
// ====================================================================
|
||||
// signal handler for soft-abort
|
||||
// ====================================================================
|
||||
|
||||
static G4VUIshell* theshell= 0;
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
////////////////////////////////
|
||||
static void SignalHandler(G4int)
|
||||
////////////////////////////////
|
||||
{
|
||||
G4RunManager* runManager= G4RunManager::GetRunManager();
|
||||
G4StateManager* stateManager= G4StateManager::GetStateManager();
|
||||
G4ApplicationState state= stateManager-> GetCurrentState();
|
||||
|
||||
if(state==G4State_GeomClosed || state==G4State_EventProc) {
|
||||
G4cout << "aborting Run ...";
|
||||
runManager-> AbortRun(true);
|
||||
G4cout << G4endl;
|
||||
} else {
|
||||
G4cout << G4endl
|
||||
<< "Session terminated." << G4endl;
|
||||
theshell-> ResetTerminal();
|
||||
delete runManager;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// for original Unix / System V
|
||||
signal(SIGINT, SignalHandler);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
G4UIterminal::G4UIterminal(G4VUIshell* aShell, G4bool qsig)
|
||||
///////////////////////////////////////////////////////////
|
||||
{
|
||||
UI= G4UImanager::GetUIpointer();
|
||||
UI-> SetSession(this);
|
||||
@@ -51,6 +97,14 @@ G4UIterminal::G4UIterminal(G4VUIshell* aShell)
|
||||
|
||||
if(aShell) shell= aShell;
|
||||
else shell= new G4UIcsh;
|
||||
theshell= shell; // locally stored for the signal handler
|
||||
|
||||
// add signal handler
|
||||
if(qsig) {
|
||||
#ifndef WIN32
|
||||
signal(SIGINT, SignalHandler);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUIshell.cc,v 1.9 2006/06/29 19:09:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VUIshell.cc,v 1.10 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
@@ -58,9 +58,9 @@ G4VUIshell::~G4VUIshell()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
////////////////////////////////////////////
|
||||
void G4VUIshell::MakePrompt(const char* msg)
|
||||
/////////////////////////////
|
||||
////////////////////////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
promptString= promptSetting;
|
||||
@@ -105,6 +105,13 @@ void G4VUIshell::MakePrompt(const char* msg)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
void G4VUIshell::ResetTerminal()
|
||||
////////////////////////////////
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// G4command operations
|
||||
// --------------------------------------------------------------------
|
||||
@@ -307,3 +314,4 @@ void G4VUIshell::ListCommand(const G4String& dir,
|
||||
G4UIArrayString arrayString(stream);
|
||||
arrayString.Show(nColumn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user