Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
+192 -1
View File
@@ -1,4 +1,4 @@
$Id: History 78056 2013-12-03 08:29:59Z gcosmo $
$Id: History 86972 2014-11-21 11:56:23Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,197 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
20th November 2014 Laurent Garnier (interfaces-V10-00-23)
- G4UIQt.cc
o Fix recursive calls caused by qApp->processEvent() in some cases (cms.gdml)
19th November 2014 Laurent Garnier (interfaces-V10-00-22)
- G4UIQt.cc
o Add public methods
o Fix a public method return type
7th November 2014 Laurent Garnier (interfaces-V10-00-19 - interfaces-V10-00-20 - interfaces-V10-00-21)
- G4UIQt.cc
o Fix G4Vis thread number in G4Cout
o Set focus on command line at the beggining
o Better fix for the "Recreate help tree each time we create a new viewer"
o Fix qt warning "QObject::connect: Cannot queue arguments of type 'QTextCursor'"
5th November 2014 Laurent Garnier
- G4UIQt.cc:
o Recreate help tree each time we create a new viewer
- G4UIWt.cc:
o Remove a warning
31th October 2014 Laurent Garnier
- G4UIQt.cc:
o Use FindMacroPath() instead of GetMacroSearchPath()
o Display G4Exception warning messages in G4cerr
o Fix a problem with Wt include names on case sensitive systems
o Try to fix the fact that the cout widget does not update in real
time when run in progress. Do not totally fix this, but update
is more frequent now.
30th October 2014 John Allison (interfaces-V10-00-18)
- G4UIQt.cc: Added a mutex in ReceiveG4cout and ReceiveG4cerr.
29th October 2014 Laurent Garnier (interfaces-V10-00-16 retagged interfaces-V10-00-17)
- G4UIQt :
o For all methods who need a file, instead of getting the file from current path,
look for it in MacroPath
o Set viewer text tab "read only"
o When closing a dock panel, hide it instead of removing it. Prevent from null
pointer exception
22th October 2014 Laurent Garnier (interfaces-V10-00-15)
- G4UIQt :
o Remove viewer size parameter (it was no longer used)
o Add the ability to have HTML tags inside the file given by AddViewerTabFromFile.
This will allow to include for example a README file with an <img> or other HTML tags
Ex :
===================== README ==============================
<p align="center">
<img src="exampleB1.jpg" width="300">
</p>
And the code to be place in main() function :
UIQt->AddViewerTabFromFile("README", "README from my own example");
21th October 2014 Laurent Garnier
- G4UIQt :
o Do not remove the first tab widget when creating a viewer
o add new method AddViewerTab(QWidget*, std::string), this will allow users to define their
own tab.
o Add new method AddViewerTabFromFile(std::string, std::string): add a tab in the viewer from
a file
o Fix a problem with updating viewer
o Activate Help Widget at the beginning instead of sceneTree
o Move clear G4cout icon on the right side
o Add left panel tab tooltips
o Change text on StartPage
14th October 2014 Laurent Garnier
- G4UIQt :
o Add methods GetCoutWidget(), GetUserInterfaceWidget(), GetViewersWidget()
o Rename SetViewerFirstPageHTMLText() to SetStartPage()
14th October 2014 Laurent Garnier (interfaces-V10-00-14 need global-V10-00-35)
- G4UIQt :
o Revert mdi/tabbed widgets to old tab style : It was not working so good. In tabbed mode, some
stranges effects when adding/switching OGL viewer : A small window was create
inside other tabs.
o Get the thread prefix string directly from G4MTcoutDestination
13th October 2014 Laurent Garnier
- G4UIQt : Fix a bug with Qt4.6
7th October 2014 Laurent Garnier
- G4UIQt : Fix a problem refreshing tab
6th October 2014 Laurent Garnier
- G4UIQt : Fix a problem when creating the first tab viewer
1st October 2014 Laurent Garnier
- G4UIQt :
o Add a "mdi" and "tabbed" icon, only in the code for the moment, no way to trigger them
o Suppress the way to switch between "tabbed view" and "side by side view", will be replace
next by this icon
28th August 2014 Laurent Garnier
- G4UIQt :
o Replace the tab viewer by a MDIArea in order to manage both side by side view and tabbed view
o Minor change in text for the first page widget
o Fix a problem in coloring cout sometimes after a cerr was send. Sometimes, the default color stay in red. Fixed
o Set the focus on the command line after a command was send
o For the moment, the way to switch between "tabbed view" and "side by side view" is to type "s" in the command line.
TO BE FIXED !
o Fix problem when closing the last tab. Now the first page is displayed
23rd September 2014 Gabriele Cosmo (interfaces-V10-00-13)
- G4UIQt :
o Use GetThreadId() from G4UImanager...
23rd September 2014 Laurent Garnier (interfaces-V10-00-12)
- G4UIQt :
o Change threadId by getThreadId()
19th September 2014 Laurent Garnier (interfaces-V10-00-11)
- G4UIQt :
o Fix the Dock output panel on the bottom right on the window
18th August 2014 Laurent Garnier
- G4UIQt :
o Fix a problem with closing dockable widgets
14th August 2014 Laurent Garnier
- G4UIQt :
o Begginning of adding dockable widgets. Still problems on :
- cout (should be on the right)
- Dock titles
13th August 2014 Laurent Garnier
- G4UIQt :
o Fix a bug introduced in interfaces-V10-00-07. The first time we open the viewer, is was small and dark.
Note: Perhaps this fix will create (in some cases) a widget outside of UI for a really short moment.
13th August 2014 Laurent Garnier
- G4UIQt :
o Fix a typo in SetViewerFirstPageHTMLText text
o Add better implementation of thread prefix before "GetPrefixString()" is implemented
11th August 2014 Laurent Garnier (interfaces-V10-00-09)
- G4UIQt :
o Fix a bug for single threading output in last tag
o Add a "SetViewerFirstPageHTMLText" method to be able to set the first tab widget text.
This could be used to make some kind of a start page to display useful informations
7th August 2014 Laurent Garnier (interfaces-V10-00-08)
- G4UIQt :
o Add Mutilthreading outputs
o New cout internal management
o Add a filter on thread in output
1th August 2014 Laurent Garnier
- G4UIQt : Change UI look by moving "search" at the top of the G4cout area
10th July 2014 Laurent Garnier (interfaces-V10-00-07)
- G4UIQt : BugFix #1604
- G4UIWt : Minor things
6th June 2014 Laurent Garnier (interfaces-V10-00-06)
- G4UIQt :
o Fix a Qt function that was only defined for Qt5
5th June 2014 Laurent Garnier (interfaces-V10-00-05 co-works opengl-V10-00-06)
- G4UIQt :
o Change help display to render parameters in a QTableView
o Change window expanding policy. Now when expanding main window, it will keep the size of the viewer
o When choosing "pick" icon, it will now apply /vis/viewer/set/picking true
27th May 2014 Laurent Garnier
- G4UIQt :
o Change help display in help tree
May 25th 2014 Koichi Murakami, interfaces-V10-00-04
- basic/src/G4UIterminal.cc, fixed the problem that some commands cannot be
processed, because of a bug in G4SubString== operator like nC(0,3)="xxx".
Use substr() instead of () operator for the comparison of substr.
20th May 2014 Laurent Garnier (interfaces-V10-00-02, interfaces-V10-00-03)
- G4UIQt :
o Change help tree splitter from vertical to horizontal
o Add method to display text in HTML
22th Janvier 2014 Laurent Garnier (interfaces-V10-00-01)
- G4Qt : BUGFIX : bugzilla 1487 : Explicitly set the LC_NUMBERIC locale to "C"
4nd December 2013 Laurent Garnier (interfaces-V09-06-18)
- G4UIQt :
o Fix problem with resizing the QGLwidget when a macro which open a OGL
widget was called by user in UI. Before the OGL widget get the minimum size
(about 50 pixel height), now it does grow as much as it can without going out
of the window.
o Suppress a "printf" non protected by ifdef
2nd December 2013 Laurent Garnier (interfaces-V09-06-17)
- G4UIQt : Fix a bad bug fixed 29th November 2013. The menu name was displayed
instead of the label.
+87 -16
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIQt.hh 76743 2013-11-14 15:48:22Z gcosmo $
// $Id: G4UIQt.hh 86866 2014-11-19 14:43:02Z gcosmo $
//
#ifndef G4UIQt_h
#define G4UIQt_h
@@ -40,6 +40,7 @@
#include <qmap.h>
#include <qstringlist.h>
#include <qtabwidget.h>
#include <qdockwidget.h>
class QMainWindow;
class QLineEdit;
@@ -54,6 +55,9 @@ class QTabWidget;
class QStringList;
class QSplitter;
class QToolBar;
class QTableWidget;
class QPixmap;
class QComboBox;
// Class description :
//
@@ -96,6 +100,23 @@ public :
}
};
class G4UIOutputString {
public :
G4UIOutputString(QString text,G4String thread = "",G4String outputstream= "info");
inline QString GetOutputList() { return " all info warning error ";};
QString fText;
G4String fThread;
G4String fOutputStream; // Error, Warning, Info
};
class G4UIDockWidget : public QDockWidget {
public:
G4UIDockWidget(QString txt);
void closeEvent(QCloseEvent *);
};
class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSession {
Q_OBJECT
@@ -123,7 +144,7 @@ public: // With description
// Fourth argument is the path to the icon file if "user_icon" selected
// Ex : AddButton("change background color","../background.xpm"," /vis/viewer/set/background");
bool AddTabWidget(QWidget*,QString,int,int);
bool AddTabWidget(QWidget*,QString);
// To add a tab for vis openGL Qt driver
QTabWidget* GetSceneTreeComponentsTBWidget();
@@ -162,6 +183,48 @@ public: // With description
inline QMainWindow * GetMainWindow() {
return fMainWindow;
};
// Return the main window
inline QPixmap* getSearchIcon() { return fSearchIcon;};
// return the "search" icon pixmap
inline QPixmap* getClearIcon() { return fClearIcon;};
// return the "clear" icon pixmap
void SetStartPage(const std::string&);
// Set the text on the first page of the viewer. If "", will take the last value as default
// Note: Qt Rich text format could be used, see link for example :
// https://qt-project.org/doc/qt-4.8/richtext-html-subset.html#table-cell-attributes
inline QWidget* GetCoutWidget() {
return fCoutDockWidget->widget();
};
// Return the G4cout widget with filters
inline G4UIDockWidget* GetUserInterfaceWidget() {
return fUIDockWidget;
};
// Return the UserInterface widget (including scene tree, help and History widgets)
inline QTabWidget* GetViewersWidget() {
return fUITabWidget;
}
// return the viewer widget including all viewers
inline QWidget* GetHistoryWidget() {
return fHistoryTBWidget;
}
// return the history widget
inline QWidget* GetHelpWidget() {
return fHelpTBWidget;
}
// return the help widget
bool AddViewerTab(QWidget* w, std::string title);
// Add a new tab in the viewer, could be used to add your own component
bool AddViewerTabFromFile(std::string fileName, std::string title);
// Add a new tab in the viewer containing the content of the file in a QLabel
public:
~G4UIQt();
@@ -183,7 +246,7 @@ private:
QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,const QString&);
QString GetCommandList(const G4UIcommand*);
void updateHelpArea(const G4UIcommand*);
virtual G4bool GetHelpChoice(G4int&);// have to be implemeted because we heritate from G4VBasicShell
bool eventFilter(QObject*,QEvent*);
void ActivateCommand(G4String);
@@ -191,45 +254,47 @@ private:
QWidget* CreateVisParametersTBWidget();
QWidget* CreateHelpTBWidget();
QWidget* CreateCoutTBWidget();
G4UIDockWidget* CreateCoutTBWidget();
QWidget* CreateHistoryTBWidget();
QWidget* CreateUITabWidget();
G4UIDockWidget* CreateUITabWidget();
QWidget* CreateSceneTreeComponentsTBWidget();
QWidget* CreateRightSplitterWidget();
QWidget* CreateLeftSplitterWidget();
QWidget* CreateViewerWidget();
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);
#ifdef G4MULTITHREADED
void UpdateCoutThreadFilter();
#endif
void FilterAllOutputTextArea();
QString FilterOutput(const G4UIOutputString&,const QString&,const QString&);
G4String GetThreadPrefix();
private:
QMainWindow * fMainWindow;
QLabel *fCommandLabel;
QLineEdit * fCommandArea;
QTextEdit *fCoutTBTextArea;
QTextEdit *fHelpArea;
QTabWidget* fUITabWidget;
QStringList fG4cout;
std::vector <G4UIOutputString> fG4OutputString;
QLineEdit * fCoutFilter;
QListWidget *fHistoryTBTableList;
QTreeWidget *fHelpTreeWidget;
QWidget* fHelpTBWidget;
QWidget* fHistoryTBWidget;
QWidget* fCoutTBWidget;
G4UIDockWidget* fCoutDockWidget;
G4UIDockWidget* fUIDockWidget;
QTabWidget* fSceneTreeComponentsTBWidget;
QLineEdit* fHelpLine;
G4QTabWidget* fViewerTabWidget;
QString fCoutText;
QLabel *fEmptyViewerTabLabel;
QSplitter * fMainSplitterWidget;
QSplitter* fRightSplitterWidget;
QWidget* fLeftSplitterWidget;
QTextEdit *fStartPage;
QSplitter * fHelpVSplitter;
QWidget* fViewerTabHandleWidget;
QTextEdit* fParameterHelpLabel;
QTableWidget* fParameterHelpTable;
QToolBar *fToolbarApp;
QToolBar *fToolbarUser;
@@ -237,6 +302,11 @@ private:
G4String fLastErrMessage;
QString fLastOpenPath;
QPixmap* fSearchIcon;
QPixmap* fClearIcon;
QComboBox* fThreadsFilterComboBox;
std::string fDefaultViewerFirstPageHTMLText;
bool fMoveSelected;
bool fRotateSelected;
bool fPickSelected;
@@ -257,6 +327,7 @@ private Q_SLOTS :
void UpdateTabWidget(int);
void ResizeTabWidget( QResizeEvent* );
void CoutFilterCallback(const QString&);
void ThreadComboBoxCallback(int);
void TabCloseCallback(int);
void ToolBoxActivated(int);
void VisParameterCallback(QWidget*);
+1 -1
View File
@@ -38,7 +38,7 @@
#include <Wt/WObject>
#include <Wt/WWidget>
#include <Wt/WPushbutton>
#include <Wt/WPushButton>
#include <Wt/WTree>
#include <Wt/WTreeNode>
#include <Wt/WMenu>
File diff suppressed because it is too large Load Diff
+15 -9
View File
@@ -41,13 +41,13 @@
#include "G4Wt.hh"
#include <Wt/WLabel>
#include <Wt/WLineedit>
#include <Wt/WTextarea>
#include <Wt/Wmessagebox>
#include <Wt/Wlayout>
#include <Wt/Wradiobutton>
#include <Wt/Wbuttongroup>
#include <Wt/Wcombobox>
#include <Wt/WLineEdit>
#include <Wt/WTextArea>
#include <Wt/WMessageBox>
#include <Wt/WLayout>
#include <Wt/WRadioButton>
#include <Wt/WButtonGroup>
#include <Wt/WComboBox>
#include <Wt/WVBoxLayout>
#include <Wt/WHBoxLayout>
#include <Wt/WGridLayout>
@@ -434,8 +434,8 @@ Wt::WTabWidget* G4UIWt::GetSceneTreeComponentsTBWidget(
bool G4UIWt::AddTabWidget(
Wt::WWidget* aWidget
,Wt::WString name
,int
,int
,int /* width */
,int /* height */
)
{
/*
@@ -473,6 +473,7 @@ bool G4UIWt::AddTabWidget(
}
if (!aWidget) {
return false;
}
@@ -486,7 +487,12 @@ bool G4UIWt::AddTabWidget(
// Problems with resize. The widgets are not realy drawn at this step,
// then we have to force them on order to check the size
// aWidget->resize(width,height);
// aWidget->resize(600,600);
// fViewerTabWidget->resize(620,621);
fViewerTabWidget->addTab(new Wt::WLabel("test"),"test1");
fViewerTabWidget->addTab(aWidget,name);
fViewerTabWidget->addTab(new Wt::WLabel("test"),"test2");
// Change Color
aWidget->decorationStyle().setBackgroundColor (Wt::WColor(245,245,245));
+5 -5
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIterminal.cc 66892 2013-01-17 10:57:59Z gunter $
// $Id: G4UIterminal.cc 81292 2014-05-26 09:32:37Z gcosmo $
//
// ====================================================================
// G4UIterminal.cc
@@ -225,11 +225,11 @@ G4String G4UIterminal::GetCommand(const char* msg)
G4cout << nC << G4endl;
newCommand= nullString;
} else if(nC=="ls" || nC(0,3)=="ls " ) { // list commands
} else if(nC=="ls" || nC.substr(0,3)=="ls " ) { // list commands
ListDirectory(nC);
newCommand= nullString;
} else if(nC=="lc" || nC(0,3)=="lc " ) { // ... by shell
} else if(nC=="lc" || nC.substr(0,3)=="lc " ) { // ... by shell
shell-> ListCommand(nC.remove(0,2));
newCommand= nullString;
@@ -242,12 +242,12 @@ G4String G4UIterminal::GetCommand(const char* msg)
shell-> ShowCurrentDirectory();
newCommand= nullString;
} else if(nC == "cd" || nC(0,3) == "cd ") { // "cd"
} else if(nC == "cd" || nC.substr(0,3) == "cd ") { // "cd"
ChangeDirectoryCommand(nC);
shell-> SetCurrentDirectory(GetCurrentWorkingDirectory());
newCommand= nullString;
} else if(nC == "help" || nC(0,5) == "help ") { // "help"
} else if(nC == "help" || nC.substr(0,5) == "help ") { // "help"
TerminalHelp(nC);
newCommand= nullString;
+17 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Qt.cc 74547 2013-10-14 12:51:17Z gcosmo $
// $Id: G4Qt.cc 79026 2014-02-12 09:53:32Z gcosmo $
//
// L. Garnier
@@ -153,6 +153,22 @@ G4Qt::G4Qt (
}
#endif
// AddDispatcher ((G4DispatchFunction)XtDispatchEvent);
/*
* On some non-English locale, comma is used for the decimal separator instead of dot
* bringing to weird behavior of strtod (string to double) function in user application.
* This is "by design" from Qt, see https://bugreports.qt-project.org/browse/QTBUG-10994
*
* $ LC_NUMERIC=fr_FR.UTF-8 ./qtstrtod
* strtod(0.1) = 0
* $ LC_NUMERIC=C ./qtstrtod
* strtod(0.1) = 0.1
*
* Jerome Suhard, jerome@suhard.fr
*/
// explicitly set the LC_NUMBERIC locale to "C"
setlocale (LC_NUMERIC, "C");
}
/***************************************************************************/
G4Qt::~G4Qt (