Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIArrayString.hh,v 1.3 2006-06-29 19:09:27 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIArrayString_h
@@ -23,8 +23,7 @@
// * 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: not supported by cvs2svn $
// $Id$
//
// ====================================================================
// G4UIExecutive.hh
@@ -50,33 +49,54 @@
// ...
//
// ====================================================================
#ifndef G4UI_EXECUTIVE_H
#define G4UI_EXECUTIVE_H 1
#ifndef G4UI_EXECUTIVE_HH
#define G4UI_EXECUTIVE_HH
#include "G4VUIshell.hh"
#include <map>
class G4UIsession;
class G4UIExecutive {
private:
G4UIsession* session;
G4VUIshell* shell;
G4bool isGUI;
public:
G4UIExecutive(G4int argc, char** argv);
G4UIExecutive(G4int argc, char** argv, const G4String& type = "");
~G4UIExecutive();
G4bool IsGUI() const;
G4UIsession* GetSession() const;
G4bool IsGUI() const;
void SetPrompt(const G4String& prompt);
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor);
void SessionStart();
private:
enum SessionType { kNone, kQt, kXm, kWin32, kWt, kGag, kTcsh, kCsh };
SessionType selected;
G4UIsession* session;
G4VUIshell* shell;
G4bool isGUI;
std::map<G4String, G4String> sessionMap;
void SelectSessionByArg(const G4String& stype);
void SelectSessionByEnv();
void SelectSessionByFile(const G4String& appname);
void SelectSessionByBestGuess();
};
#include "G4UIExecutive.icc"
// ====================================================================
inline G4UIsession* G4UIExecutive::GetSession() const
{
return session;
}
inline G4bool G4UIExecutive::IsGUI() const
{
return isGUI;
}
#endif
@@ -1,150 +0,0 @@
//
// ********************************************************************
// * 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.7 2010-05-28 08:12:27 kmura Exp $
// GEANT4 tag $Name: geant4-09-04-patch-02 $
//
// ====================================================================
// G4UIExecutive.icc
//
// ====================================================================
#include "G4UIsession.hh"
#include "G4UImanager.hh"
#if defined(G4UI_USE_QT)
#include "G4UIQt.hh"
#include "G4Qt.hh"
#elif defined(G4UI_USE_WT)
#include "G4UIWt.hh"
#elif defined(G4UI_USE_XM)
#include "G4UIXm.hh"
#elif defined(G4UI_USE_WIN32)
#include "G4UIWin32.hh"
#elif defined(G4UI_USE_TCSH)
#include "G4UIterminal.hh"
#include "G4UItcsh.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_QT)
session = new G4UIQt(argc, argv);
isGUI = true;
#elif defined(G4UI_USE_WT)
session = new G4UIWt(argc, argv);
isGUI = true;
#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_TCSH)
DISCARD_PARAMETER(argc);
DISCARD_PARAMETER(argv);
shell = new G4UItcsh;
session = new G4UIterminal(shell);
#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();
#if defined(G4UI_USE_WT)
#else
delete session;
#endif
}
+70 -21
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIQt.hh,v 1.23 2010-06-10 15:37:13 lgarnier Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIQt_h
#define G4UIQt_h
@@ -51,9 +50,10 @@ class QTreeWidgetItem;
class QTextEdit;
class QLabel;
class QResizeEvent;
class QToolBox;
class QTabWidget;
class QStringList;
class QSplitter;
class QToolBar;
// Class description :
//
@@ -61,7 +61,7 @@ class QSplitter;
// G4UIQt is the Qt version of G4UIterminal.
//
// A command box is at disposal for entering/recalling Geant4 commands.
// A menubar could be customized through the AddMenu, AddButton methods.
// A menubar could be customized through the AddMenu, AddButton, AddIcon methods.
// Note that there are corresponding Geant4 commands to add a
// menus in the menubar and add buttons in a menu.
// Ex :
@@ -106,37 +106,71 @@ public: // With description
// Second argument is the label of the button.
// Third argument is the Geant4 command executed when the button is fired.
// Ex : AddButton("my_menu","Run","/run/beamOn 1");
void AddIcon(const char* userLabel, const char* iconFile, const char* command, const char* file_name="");
// To add a icon in the toolbar
// First argument is the label of the icon.
// Second argument is the icon file.
// Third argument is the Geant4 command executed when the button is fired.
// Ex : AddButton("change background color","../background.xpm"," /vis/viewer/set/background");
bool AddTabWidget(QWidget*,QString,int,int);
// To add a tab for vis openGL Qt driver
QWidget* GetViewComponentsTBWidget();
QTabWidget* GetSceneTreeComponentsTBWidget();
// Get the viewComponent
bool IsSplitterReleased();
inline bool IsIconMoveSelected() {
return fMoveSelected;
};
inline bool IsIconRotateSelected() {
return fRotateSelected;
};
inline bool IsIconPickSelected() {
return fPickSelected;
};
inline bool IsIconZoomInSelected() {
return fZoomInSelected;
};
inline bool IsIconZoomOutSelected() {
return fZoomOutSelected;
};
void SetIconMoveSelected();
void SetIconRotateSelected();
void SetIconPickSelected();
void SetIconZoomInSelected();
void SetIconZoomOutSelected();
void SetIconHLHSRSelected();
void SetIconHLRSelected();
void SetIconSolidSelected();
void SetIconWireframeSelected();
void SetIconPerspectiveSelected();
void SetIconOrthoSelected();
public:
~G4UIQt();
void Prompt(G4String);
void SessionTerminate();
void PauseSessionStart(G4String);
G4int ReceiveG4cout(G4String);
G4int ReceiveG4cerr(G4String);
virtual void PauseSessionStart(const G4String&);
virtual G4int ReceiveG4cout(const G4String&);
virtual G4int ReceiveG4cerr(const G4String&);
// G4String GetCommand(Widget);
private:
void SecondaryLoop(G4String); // a VIRER
void CreateHelpWidget();
void InitHelpTree();
void InitHelpTreeAndVisParametersWidget();
void FillHelpTree();
void ExitHelp();
virtual void ExitHelp() const;
void CreateChildTree(QTreeWidgetItem*,G4UIcommandTree*);
void CreateHelpTree(QTreeWidgetItem*,G4UIcommandTree*);
QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,const QString&);
QString GetCommandList(const G4UIcommand*);
G4bool GetHelpChoice(G4int&) ;// have to be implemeted because we heritate from G4VBasicShell
virtual G4bool GetHelpChoice(G4int&);// have to be implemeted because we heritate from G4VBasicShell
bool eventFilter(QObject*,QEvent*);
void ActivateCommand(G4String);
QMap<int,QString> LookForHelpStringInChildTree(G4UIcommandTree *,const QString&);
@@ -148,19 +182,18 @@ private:
void OpenHelpTreeOnCommand(const QString &);
QString GetShortCommandPath(QString);
QString GetLongCommandPath(QTreeWidgetItem*);
G4bool IsGUICommand(const G4UIcommand*);
bool CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool isDialog);
bool CreateCommandWidget(G4UIcommand* command, QWidget* parent, bool isDialog);
private:
// Widget form,shell,command,menuBar,text;
// std::map<QAction*,G4String, std::less<QAction*> > commands;
// static void commandEnteredCallback(Widget,XtPointer,XtPointer);
// static void keyHandler(Widget,XtPointer,XEvent*,Boolean*);
QMainWindow * fMainWindow;
QLabel *fCommandLabel;
QLineEdit * fCommandArea;
QTextEdit *fCoutTBTextArea;
QTextEdit *fHelpArea;
QToolBox* fToolBox;
QTabWidget* fUITabWidget;
QStringList fG4cout;
QLineEdit * fCoutFilter;
@@ -169,17 +202,26 @@ private:
QWidget* fHelpTBWidget;
QWidget* fHistoryTBWidget;
QWidget* fCoutTBWidget;
QWidget* fVisParametersTBWidget;
QWidget* fViewComponentsTBWidget;
QTabWidget* fSceneTreeComponentsTBWidget;
QLineEdit* fHelpLine;
G4QTabWidget* fTabWidget;
G4QTabWidget* fViewerTabWidget;
QString fCoutText;
QLabel *fEmptyViewerTabLabel;
QSplitter * fMyVSplitter;
QSplitter * fMainSplitterWidget;
QSplitter* fRightSplitterWidget;
QSplitter * fHelpVSplitter;
int fLastQTabSizeX;
int fLastQTabSizeY;
QToolBar *fToolbarApp;
QToolBar *fToolbarUser;
bool fMoveSelected;
bool fRotateSelected;
bool fPickSelected;
bool fZoomInSelected;
bool fZoomOutSelected;
private Q_SLOTS :
void ExitSession();
void ClearButtonCallback();
@@ -195,6 +237,13 @@ private Q_SLOTS :
void CoutFilterCallback(const QString&);
void TabCloseCallback(int);
void ToolBoxActivated(int);
void VisParameterCallback(QWidget*);
void ChangeColorCallback(QWidget*);
void ChangeCursorStyle(const QString&);
void ChangeSurfaceStyle(const QString&);
void OpenIconCallback(const QString&);
void SaveIconCallback(const QString&);
void ChangePerspectiveOrtho(const QString&);
};
#endif
+7 -8
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIWin32.hh,v 1.14 2006-06-29 19:09:29 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIWin32_h
#define G4UIWin32_h
@@ -81,17 +80,17 @@ public: // With description
// Ex : AddButton("my_menu","Run","/run/beamOn 1");
public:
~G4UIWin32 ();
void Prompt (G4String);
void Prompt (const G4String&);
void SessionTerminate ();
void PauseSessionStart (G4String);
G4int ReceiveG4cout(G4String);
G4int ReceiveG4cerr(G4String);
void PauseSessionStart (const G4String&);
G4int ReceiveG4cout(const G4String&);
G4int ReceiveG4cerr(const G4String&);
G4String GetCommand (int);
void TextAppendString(char*);
private:
void SecondaryLoop (G4String);
void SecondaryLoop (const G4String&);
G4bool GetHelpChoice(G4int&);
void ExitHelp();
void ExitHelp() const;
private:
G4VInteractorManager* interactorManager;
HWND mainWindow;
+5 -6
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIXaw.hh,v 1.6 2006-06-29 19:09:31 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIXaw_h
#define G4UIXaw_h
@@ -57,14 +56,14 @@ public:
G4UIXaw(int,char**);
~G4UIXaw();
G4UIsession* SessionStart();
void Prompt(G4String);
void Prompt(const G4String&);
void SessionTerminate();
void PauseSessionStart(G4String);
virtual void PauseSessionStart(const G4String&);
Widget GetDialog();
private:
void SecondaryLoop(G4String);
G4bool GetHelpChoice(G4int&);
void ExitHelp();
virtual G4bool GetHelpChoice(G4int&);
virtual void ExitHelp() const;
private:
Widget shell,dialog;
G4bool fHelp;
+5 -6
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIXm.hh,v 1.14 2008-11-14 16:21:42 lgarnier Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIXm_h
#define G4UIXm_h
@@ -82,14 +81,14 @@ public:
~G4UIXm();
void Prompt(G4String);
void SessionTerminate();
void PauseSessionStart(G4String);
G4int ReceiveG4cout(G4String);
G4int ReceiveG4cerr(G4String);
virtual void PauseSessionStart(const G4String&);
virtual G4int ReceiveG4cout(const G4String&);
virtual G4int ReceiveG4cerr(const G4String&);
G4String GetCommand(Widget);
private:
void SecondaryLoop(G4String);
G4bool GetHelpChoice(G4int&);
void ExitHelp();
void ExitHelp() const;
private:
Widget form,shell,command,menuBar,text;
std::map<Widget,G4String, std::less<Widget> > commands;
+2 -3
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIcsh.hh,v 1.4 2006-06-29 19:09:35 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UIcsh_h
@@ -45,7 +44,7 @@ public:
G4UIcsh(const G4String& prompt="%s> ");
~G4UIcsh();
virtual G4String GetCommandLine(const char* msg=0);
virtual G4String GetCommandLineString(const char* msg=0);
};
+3 -4
View File
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UItcsh.hh,v 1.8 2007-06-14 05:44:58 kmura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4UItcsh_h
@@ -97,7 +96,7 @@ protected:
void PreviousCommand(); // previous command
void ListMatchedCommand(); // list matched commands
void CompleteCommand(); // complete command
void CompleteCommand(); // complete command
// utilities...
G4String GetFirstMatchedString(const G4String& str1,
@@ -124,7 +123,7 @@ public:
~G4UItcsh();
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor);
virtual G4String GetCommandLine(const char* msg=0);
virtual G4String GetCommandLineString(const char* msg=0);
virtual void ResetTerminal();
};
@@ -23,8 +23,7 @@
// * 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: not supported by cvs2svn $
// $Id$
//
// ====================================================================
// G4UIterminal.cc
@@ -86,19 +85,18 @@ public:
void SetPrompt(const G4String& prompt);
private:
void ExecuteCommand(G4String aCommand);
virtual void ExecuteCommand(const G4String& aCommand);
virtual G4bool GetHelpChoice(G4int& aInt);
virtual void ExitHelp() const;
G4String GetCommand(const char* msg=0);
G4bool GetHelpChoice(G4int& aInt);
void ExitHelp();
public:
// These methods are implementation of corresponding virtual methods
// of G4UIsession class.
virtual G4UIsession* SessionStart();
virtual void PauseSessionStart(G4String msg);
virtual G4int ReceiveG4cout(G4String coutString);
virtual G4int ReceiveG4cerr(G4String cerrString);
virtual void PauseSessionStart(const G4String& msg);
virtual G4int ReceiveG4cout(const G4String& coutString);
virtual G4int ReceiveG4cerr(const G4String& cerrString);
};
#endif
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VUIshell.hh,v 1.8 2009-05-13 09:01:36 kmura Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#ifndef G4VUIshell_h
@@ -37,7 +36,7 @@
// Description:
// This class is the abstract base class for various UI shells.
//
// GetCommadLine() (virtual) returns a command string input from
// GetCommadLineString() (virtual) returns a command string input from
// a commad line.
//
// Two pre-inplemented shell commands(still virtual) are also included,
@@ -95,7 +94,7 @@ public:
// "candidate" is specified with full path.
// get command string from a command line
virtual G4String GetCommandLine(const char* msg=0)= 0;
virtual G4String GetCommandLineString(const char* msg=0)= 0;
virtual void ResetTerminal();
};