Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
+23 -23
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VBasicShell.cc,v 1.6.4.1 2001/06/28 19:10:25 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VBasicShell.cc,v 1.8 2001/10/22 08:02:58 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#include "g4std/vector"
@@ -50,7 +50,7 @@ G4String G4VBasicShell::ModifyToFullPathCommand(const char* aCommandLine)
G4String commandLine = (G4String)rawCommandLine.strip(G4String::both);
G4String commandString;
G4String parameterString;
int i = commandLine.index(" ");
size_t i = commandLine.index(" ");
if( i != G4std::string::npos )
{
commandString = (G4String)commandLine(0,i);
@@ -93,10 +93,10 @@ G4UIcommandTree* G4VBasicShell::FindDirectory(const char* dirName)
G4UIcommandTree* comTree = G4UImanager::GetUIpointer()->GetTree();
if( targetDir == "/" )
{ return comTree; }
int idx = 1;
size_t idx = 1;
while( idx < targetDir.length()-1 )
{
int i = targetDir.index("/",idx);
size_t i = targetDir.index("/",idx);
comTree = comTree->GetTree((G4String)targetDir(0,i+1));
if( comTree == NULL )
{ return NULL; }
@@ -110,7 +110,7 @@ G4UIcommand* G4VBasicShell::FindCommand(const char* commandName)
G4String rawCommandLine = (G4String)commandName;
G4String commandLine = (G4String)rawCommandLine.strip(G4String::both);
G4String commandString;
int i = commandLine.index(" ");
size_t i = commandLine.index(" ");
if( i != G4std::string::npos )
{ commandString = (G4String)commandLine(0,i); }
else
@@ -167,7 +167,7 @@ G4String G4VBasicShell::Complete(G4String commandName)
{
G4String rawCommandLine = commandName;
G4String commandLine = rawCommandLine.strip(G4String::both);
int i = commandLine.index(" ");
size_t i = commandLine.index(" ");
if( i != G4std::string::npos ) return rawCommandLine; // Already entering parameters,
// assume command path is correct.
G4String commandString = commandLine;
@@ -189,12 +189,12 @@ G4String G4VBasicShell::FindMatchingPath(
if( aCommandPath.index( pathName ) == G4std::string::npos ) return empty;
G4String remainingPath = aCommandPath;
remainingPath.remove(0,pathName.length());
int i = remainingPath.first('/');
size_t i = remainingPath.first('/');
if( i == G4std::string::npos ) {
// Look for number of matching commands :
G4std::vector<G4UIcommand*> commands;
int n_commandEntry = aTree->GetCommandEntry();
for( int i_thCommand = 1; i_thCommand <= n_commandEntry; i_thCommand++ ) {
G4int n_commandEntry = aTree->GetCommandEntry();
for( G4int i_thCommand = 1; i_thCommand <= n_commandEntry; i_thCommand++ ) {
G4UIcommand* cmd = aTree->GetCommand(i_thCommand);
G4String ss = cmd->GetCommandName();
ss.resize(remainingPath.length());
@@ -205,7 +205,7 @@ G4String G4VBasicShell::FindMatchingPath(
return (pathName + commands[0]->GetCommandName());
} else if (n_commandEntry>=2) {
G4cout << "Matching commands :" << G4endl;
for( int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ ) {
for( G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ ) {
G4UIcommand* cmd = commands[i_thCommand];
G4cout << cmd->GetCommandName() << G4endl;
}
@@ -215,8 +215,8 @@ G4String G4VBasicShell::FindMatchingPath(
G4std::vector<G4UIcommandTree*> trees;
G4String nextPath = pathName;
nextPath.append(remainingPath);
int n_treeEntry = aTree->GetTreeEntry();
for( int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) {
G4int n_treeEntry = aTree->GetTreeEntry();
for( G4int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) {
G4UIcommandTree* tree = aTree->GetTree(i_thTree);
G4String ss = tree->GetPathName();
ss.resize(nextPath.length());
@@ -227,7 +227,7 @@ G4String G4VBasicShell::FindMatchingPath(
return trees[0]->GetPathName();
} else if (n_treeEntry>=2) {
G4cout << "Matching directories :" << G4endl;
for( int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ ) {
for( G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ ) {
G4UIcommandTree* tree = trees[i_thTree];
G4cout << tree->GetPathName() << G4endl;
}
@@ -239,8 +239,8 @@ G4String G4VBasicShell::FindMatchingPath(
// Find path
G4String nextPath = pathName;
nextPath.append(remainingPath(0,i+1));
int n_treeEntry = aTree->GetTreeEntry();
for( int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) {
G4int n_treeEntry = aTree->GetTreeEntry();
for( G4int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) {
G4UIcommandTree* tree = aTree->GetTree(i_thTree);
if( nextPath == tree->GetPathName() ) {
return FindMatchingPath(tree,aCommandPath );
@@ -263,7 +263,7 @@ void G4VBasicShell::ExecuteCommand (
if(aCommand.length()<2) return;
G4UImanager* UI = G4UImanager::GetUIpointer();
if(UI==NULL) return;
int commandStatus = UI->ApplyCommand(aCommand);
G4int commandStatus = UI->ApplyCommand(aCommand);
switch(commandStatus) {
case fCommandSucceeded:
break;
@@ -321,7 +321,7 @@ void G4VBasicShell::ApplyShellCommand (
} else if( command(0,4) == "hist" ) {
G4int nh = UI->GetNumberOfHistory();
for(int i=0;i<nh;i++) {
for(G4int i=0;i<nh;i++) {
G4cout << i << ": " << UI->GetPreviousCommand(i) << G4endl;
}
@@ -407,7 +407,7 @@ void G4VBasicShell::TerminalHelp(G4String newCommand)
G4UImanager* UI = G4UImanager::GetUIpointer();
if(UI==NULL) return;
G4UIcommandTree * treeTop = UI->GetTree();
int i = newCommand.index(" ");
size_t i = newCommand.index(" ");
if( i != G4std::string::npos )
{
G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
@@ -428,12 +428,12 @@ void G4VBasicShell::TerminalHelp(G4String newCommand)
G4UIcommandTree * floor[10];
floor[0] = treeTop;
int iFloor = 0;
int prefixIndex = 1;
G4int iFloor = 0;
size_t prefixIndex = 1;
G4String prefix = GetCurrentWorkingDirectory();
while( prefixIndex < prefix.length()-1 )
{
int ii = prefix.index("/",prefixIndex);
size_t ii = prefix.index("/",prefixIndex);
floor[iFloor+1] =
floor[iFloor]->GetTree(prefix(0,ii+1));
prefixIndex = ii+1;
@@ -456,7 +456,7 @@ void G4VBasicShell::TerminalHelp(G4String newCommand)
} else if(i == 0) {
break;
} else if( i > 0 ) {
int n_tree = floor[iFloor]->GetTreeEntry();
G4int n_tree = floor[iFloor]->GetTreeEntry();
if( i > n_tree )
{
if( i <= n_tree + floor[iFloor]->GetCommandEntry() )
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VInteractorManager.cc,v 1.8.4.1 2001/06/28 19:10:25 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VInteractorManager.cc,v 1.11 2001/12/03 08:07:45 barrand Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G.Barrand
@@ -59,7 +59,7 @@ G4VInteractorManager::~G4VInteractorManager (
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
if(argv!=NULL) {
for(int argi=0;argi<argc;argi++) {
for(G4int argi=0;argi<argc;argi++) {
if(argv[argi]!=NULL) free(argv[argi]);
}
free (argv);
@@ -76,7 +76,7 @@ G4VInteractorManager::~G4VInteractorManager (
}
/***************************************************************************/
void G4VInteractorManager::SetArguments (
int a_argc
G4int a_argc
,char** a_argv
)
/***************************************************************************/
@@ -84,7 +84,7 @@ void G4VInteractorManager::SetArguments (
{
// Free previous values.
if(argv!=NULL) {
for(int argi=0;argi<argc;argi++) {
for(G4int argi=0;argi<argc;argi++) {
if(argv[argi]!=NULL) free(argv[argi]);
}
free(argv);
@@ -96,7 +96,7 @@ void G4VInteractorManager::SetArguments (
argv = (char**)malloc(a_argc * sizeof(char*));
if(argv!=NULL) {
argc = a_argc;
for(int argi=0;argi<a_argc;argi++) {
for(G4int argi=0;argi<a_argc;argi++) {
argv[argi] = (char*)NewString (a_argv[argi]);
}
}
@@ -104,7 +104,7 @@ void G4VInteractorManager::SetArguments (
}
/***************************************************************************/
char** G4VInteractorManager::GetArguments (
int* a_argc
G4int* a_argc
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
@@ -163,7 +163,13 @@ void G4VInteractorManager::RemoveDispatcher (
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
G4std::remove(dispatchers.begin(),dispatchers.end(),a_dispatcher);
G4std::vector<G4DispatchFunction>::iterator it;
for (it = dispatchers.begin(); it != dispatchers.end(); it++) {
if (*it == a_dispatcher) {
dispatchers.erase(it);
break;
}
}
}
/***************************************************************************/
void G4VInteractorManager::DispatchEvent (
@@ -172,10 +178,9 @@ void G4VInteractorManager::DispatchEvent (
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
int dispatchern = dispatchers.size();
G4int dispatchern = dispatchers.size();
G4DispatchFunction func;
G4bool status;
for(int count=0;count<dispatchern;count++) {
for(G4int count=0;count<dispatchern;count++) {
func = dispatchers[count];
if(func!=NULL) {
if(func(a_event)==true) return;
@@ -199,8 +204,8 @@ void G4VInteractorManager::SecondaryLoopPreActions (
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
int preActionn = preActions.size();
for(int count=0;count<preActionn;count++) {
G4int preActionn = preActions.size();
for(G4int count=0;count<preActionn;count++) {
if(preActions[count]!=NULL) preActions[count]();
}
}
@@ -221,8 +226,8 @@ void G4VInteractorManager::SecondaryLoopPostActions (
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
int postActionn = postActions.size();
for(int count=0;count<postActionn;count++) {
G4int postActionn = postActions.size();
for(G4int count=0;count<postActionn;count++) {
if(postActions[count]!=NULL) postActions[count]();
}
}
@@ -243,7 +248,7 @@ void G4VInteractorManager::SecondaryLoop (
alreadyInSecondaryLoop = TRUE;
exitSecondaryLoop = 0;
SecondaryLoopPreActions ();
//for(int count=0;count<shelln;count++) XWidgetUniconify(shells[count]);
//for(G4int count=0;count<shelln;count++) XWidgetUniconify(shells[count]);
void* event;
while(1) {
event = GetEvent();
@@ -251,12 +256,13 @@ void G4VInteractorManager::SecondaryLoop (
DispatchEvent (event);
if(exitSecondaryLoop!=0) break;
}
G4cout << "Secondary X event loop exited." << G4endl;
SecondaryLoopPostActions ();
}
}
/***************************************************************************/
void G4VInteractorManager::RequireExitSecondaryLoop (
int a_code
G4int a_code
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
@@ -265,11 +271,11 @@ void G4VInteractorManager::RequireExitSecondaryLoop (
if(a_code==0) a_code = 1;
exitSecondaryLoop = a_code;
alreadyInSecondaryLoop = FALSE;
// for(int count=0;count<shelln;count++) XWidgetIconify(shells[count]);
// for(G4int count=0;count<shelln;count++) XWidgetIconify(shells[count]);
// if(shelln!=0) XSync(XtDisplay(topWidget),False);
}
/***************************************************************************/
int G4VInteractorManager::GetExitSecondaryLoopCode (
G4int G4VInteractorManager::GetExitSecondaryLoopCode (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
@@ -294,7 +300,13 @@ void G4VInteractorManager::RemoveShell (
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
G4std::remove(shells.begin(),shells.end(),a_shell);
G4std::vector<G4Interactor>::iterator it;
for (it = shells.begin(); it != shells.end(); it++) {
if (*it == a_shell) {
shells.erase(it);
break;
}
}
}
/***************************************************************************/
void G4VInteractorManager::SetParentInteractor (
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Win32.cc,v 1.5.4.1 2001/06/28 19:10:25 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Win32.cc,v 1.6 2001/07/11 10:01:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G.Barrand
+10 -25
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Xt.cc,v 1.6.4.1 2001/06/28 19:10:25 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Xt.cc,v 1.8 2001/12/03 08:01:47 barrand Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// G.Barrand
@@ -41,9 +41,9 @@
#define NewString(str) \
((str) != NULL ? (strcpy((char*)malloc((unsigned)strlen(str) + 1), str)) : NULL)
static void XWidgetIconify (Widget);
static void XWidgetUniconify (Widget);
static void XDisplaySetWindowToNormalState (Display*,Window);
//static void XWidgetIconify (Widget);
//static void XWidgetUniconify (Widget);
//static void XDisplaySetWindowToNormalState (Display*,Window);
G4Xt* G4Xt::instance = NULL;
@@ -188,38 +188,22 @@ void G4Xt::FlushAndWaitExecution (
/***************************************************************************/
/******* From OPACS Xx/v3 package ******************************************/
/***************************************************************************/
/***************************************************************************/
void XWidgetIconify (
Widget This
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
/*
void XWidgetIconify ( Widget This ) {
if(This==NULL) return;
if(!XtIsRealized(This)) return;
XIconifyWindow(XtDisplay(This),XtWindow(This),XScreenNumberOfScreen(XtScreen(This)));
}
/***************************************************************************/
void XWidgetUniconify (
Widget This
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
void XWidgetUniconify ( Widget This ) {
if(This==NULL) return;
if(!XtIsRealized(This)) return;
XDisplaySetWindowToNormalState (XtDisplay(This),XtWindow(This));
}
/***************************************************************************/
void XDisplaySetWindowToNormalState (
Display* This
,Window a_window
)
/***************************************************************************/
/*
Used to deiconify a window.
*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
// Used to deiconify a window.
{
XWMHints wh;
if(This==NULL) return;
@@ -229,6 +213,7 @@ void XDisplaySetWindowToNormalState (
XSetWMHints (This,a_window,&wh);
XMapWindow (This,a_window);
}
*/
#endif