Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
+72 -1
View File
@@ -1,4 +1,4 @@
$Id: History 97524 2016-06-03 14:26:34Z gcosmo $
$Id: History 101789 2016-11-28 15:31:24Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,77 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
25th November 2016 Laurent Garnier (interfaces-V10-02-13-interfaces-V10-02-14)
- G4UIQt:
o Fix a bug on Qt5.7 with an extra whitespace
- at the end of "search" in help tree
- at the end a the command line
11th November 2016 Laurent Garnier (interfaces-V10-02-12)
- G4UIQt:
o Fix a problem /run/beamOn 1. The parameter was not taken in account in the icon toolbar
8th November 2016 Laurent Garnier (interfaces-V10-02-11)
- G4UIQt:
o Fix a problem without default icon on mac + Qt5.5 : Sometimes I have a gray panel on left due do a to-early
show event for QToolbar
o Add a few protection against null pointer
7th November 2016 Laurent Garnier (interfaces-V10-02-10)
- G4UIQt:
o Fix Warning: "A toolBar icon "Run beam on" already exists with the same name!"
o Fix Warning: "command 'exit' does not exist"
o Fix a problem with selected icons (without default icons)
4th November 2016 Laurent Garnier (interfaces-V10-02-09 co-works with opengl-V10-02-20)
- G4UIQt:
o Remove (multiple) scene tree from a tab to put it in a single, auto-update widget
o Remove (multiple) viewer properties from a tab to put it in a outside dialog
o Remove (multiple) pick infos from a tab to put it in a outside dialog
o Lot of remaning in order to do previous work
o Fix a bd signal/slot connection for the filter of the scene tree (perhaps a bug in some cases)
o Change the pick icon
o Remove unused parameter
o Rename GetSceneTreeComponentsTBWidget -> GetSceneTreeWidget
3rd Nov 2016 Laurent Garnier (interfaces-V10-02-08)
- G4UIQt
o Bugfix on the /gui/defaultIcons command (does nothing before)
27th Oct 2016 Laurent Garnier (interfaces-V10-02-06, interfaces-V10-02-07)
- G4UIQt/G4InteractorMessenger/G4VInteractiveSession
o Add a new command /gui/defaultIcons to enable/disable Geant4 default icon toolbar
- G4UIQt :
o Add a default icon toolbar
27th Oct 2016 Brian Smith
- G4UIQt :
o Prevent potential Windows crash by protecting masterG4coutDestination assignment with #ifdef G4MULTITHREADED
7th Oct 2016 Laurent Garnier (interfaces-V10-02-05)
- G4UIQt :
o Fix a uninitialized value
7th Oct 2016 Laurent Garnier (interfaces-V10-02-04)
- G4UIQt :
o Move eventFilter init at sessionStart() : avoid bad init state in help tree and
events to be send twice or more
o Fix "Tab" completion on command line, was previously break by the QCompleter
o Fix tooltip on completion. Now tooltips are diplayed in multiple lines
6th Oct 2016 Laurent Garnier (interfaces-V10-02-03)
- G4UIQt
o completion widget for UIQt
15th Sept 2016 Laurent Garnier
- G4UIQt
o First draft of a completion widget for UIQt
8th June 2016 Laurent Garnier
- G4UIQt
o Add "save output" icon
o Better icon management in the code
3rd June 2016 Laurent Garnier (interfaces-V10-02-02)
- G4UIWin32: Re-Fixed compilation warnings on Win32 about HMENU.
+67 -8
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UIQt.hh 97174 2016-05-27 12:41:02Z gcosmo $
// $Id: G4UIQt.hh 101111 2016-11-07 08:18:31Z gcosmo $
//
#ifndef G4UIQt_h
#define G4UIQt_h
@@ -41,6 +41,7 @@
#include <qstringlist.h>
#include <qtabwidget.h>
#include <qdockwidget.h>
#include <qdialog.h>
class QMainWindow;
class QLineEdit;
@@ -58,6 +59,10 @@ class QToolBar;
class QTableWidget;
class QPixmap;
class QComboBox;
class QCompleter;
class QtGlobal;
class QStandardItemModel;
class QToolButton;
// Class description :
//
@@ -144,11 +149,24 @@ 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");
void DefaultIcons(bool aVal);
// Enable/Disable the default icon ToolBar in Qt
bool AddTabWidget(QWidget*,QString);
// To add a tab for vis openGL Qt driver
QTabWidget* GetSceneTreeComponentsTBWidget();
// Get the viewComponent
inline QTabWidget* GetViewerTabWidget() {
return fViewerTabWidget;
};
QWidget* GetSceneTreeWidget();
// Get the scene tree component
QWidget* GetViewerPropertiesWidget();
// Get the Viewer Properties Widget
QWidget* GetPickInfosWidget();
// Get the Pick Widget
bool IsSplitterReleased();
@@ -210,7 +228,7 @@ public: // With description
};
// Return the UserInterface widget (including scene tree, help and History widgets)
inline QTabWidget* GetViewersWidget() {
inline QTabWidget* GetUITabWidget() {
return fUITabWidget;
}
// return the viewer widget including all viewers
@@ -245,7 +263,10 @@ private:
void CreateHelpWidget();
void InitHelpTreeAndVisParametersWidget();
void FillHelpTree();
void UpdateCommandCompleter();
void CreateIcons();
virtual void ExitHelp() const;
void SetDefaultIconsToolbar();
void CreateHelpTree(QTreeWidgetItem*,G4UIcommandTree*);
QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,const QString&);
@@ -262,7 +283,7 @@ private:
G4UIDockWidget* CreateCoutTBWidget();
QWidget* CreateHistoryTBWidget();
G4UIDockWidget* CreateUITabWidget();
QWidget* CreateSceneTreeComponentsTBWidget();
QWidget* CreateSceneTreeWidget();
void CreateViewerWidget();
void OpenHelpTreeOnCommand(const QString &);
QString GetShortCommandPath(QString);
@@ -270,12 +291,18 @@ private:
G4bool IsGUICommand(const G4UIcommand*);
bool CreateVisCommandGroupAndToolBox(G4UIcommand*, QWidget*, int, bool isDialog);
bool CreateCommandWidget(G4UIcommand* command, QWidget* parent, bool isDialog);
void CreateViewerPropertiesDialog();
void CreatePickInfosDialog();
#ifdef G4MULTITHREADED
void UpdateCoutThreadFilter();
#endif
void FilterAllOutputTextArea();
QString FilterOutput(const G4UIOutputString&,const QString&,const QString&);
G4String GetThreadPrefix();
bool CheckG4EnvironmentVariable(char* txt, char* version);
QStandardItemModel* CreateCompleterModel(G4String aCmd);
void CreateEmptyViewerPropertiesWidget();
void CreateEmptyPickInfosWidget();
private:
QMainWindow * fMainWindow;
@@ -285,14 +312,18 @@ private:
QTabWidget* fUITabWidget;
std::vector <G4UIOutputString> fG4OutputString;
QLineEdit * fCoutFilter;
QCompleter* fCompleter;
bool fDefaultIcons;
QListWidget *fHistoryTBTableList;
QTreeWidget *fHelpTreeWidget;
QWidget* fHelpTBWidget;
QWidget* fHistoryTBWidget;
G4UIDockWidget* fCoutDockWidget;
G4UIDockWidget* fUIDockWidget;
QTabWidget* fSceneTreeComponentsTBWidget;
QWidget* fSceneTreeWidget;
QWidget* fViewerPropertiesWidget;
QWidget* fPickInfosWidget;
QLineEdit* fHelpLine;
G4QTabWidget* fViewerTabWidget;
QString fCoutText;
@@ -306,12 +337,38 @@ private:
QString fStringSeparator;
G4String fLastErrMessage;
QString fLastOpenPath;
QToolButton* fViewModePopupButton;
QToolButton* fSurfaceModePopupButton;
QPixmap* fSearchIcon;
QPixmap* fClearIcon;
QPixmap* fSaveIcon;
QPixmap* fOpenIcon;
QPixmap* fMoveIcon;
QPixmap* fRotateIcon;
QPixmap* fPickIcon;
QPixmap* fZoomInIcon;
QPixmap* fZoomOutIcon;
QPixmap* fWireframeIcon;
QPixmap* fSolidIcon;
QPixmap* fHiddenLineRemovalIcon;
QPixmap* fHiddenLineAndSurfaceRemovalIcon;
QPixmap* fPerspectiveIcon;
QPixmap* fOrthoIcon;
QPixmap* fCommandIcon;
QPixmap* fDirIcon;
QPixmap* fRunIcon;
QPixmap* fParamIcon;
QPixmap* fPickTargetIcon;
#ifdef G4MULTITHREADED
QComboBox* fThreadsFilterComboBox;
#endif
std::string fDefaultViewerFirstPageHTMLText;
QDialog* fViewerPropertiesDialog;
QDialog* fPickInfosDialog;
bool fMoveSelected;
bool fRotateSelected;
bool fPickSelected;
@@ -321,6 +378,7 @@ private:
private Q_SLOTS :
void ExitSession();
void ClearButtonCallback();
void SaveOutputCallback();
void CommandEnteredCallback();
void CommandEditedCallback(const QString & text);
void ButtonCallback(const QString&);
@@ -337,10 +395,11 @@ private Q_SLOTS :
void ToolBoxActivated(int);
void VisParameterCallback(QWidget*);
void ChangeColorCallback(QWidget*);
void ChangeCursorStyle(const QString&);
void ChangeCursorAction(const QString&);
void ChangeSurfaceStyle(const QString&);
void OpenIconCallback(const QString&);
void SaveIconCallback(const QString&);
void ViewerPropertiesIconCallback(int);
void ChangePerspectiveOrtho(const QString&);
};
+52 -47
View File
@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file 'G4UIQt.hh'
**
** Created: Fri Jun 3 16:33:38 2016
** Created: Mon Nov 28 16:38:20 2016
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
@@ -23,7 +23,7 @@ static const uint qt_meta_data_G4UIQt[] = {
6, // revision
0, // classname
0, 0, // classinfo
23, 14, // methods
25, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -34,34 +34,36 @@ static const uint qt_meta_data_G4UIQt[] = {
8, 7, 7, 7, 0x08,
22, 7, 7, 7, 0x08,
44, 7, 7, 7, 0x08,
74, 69, 7, 7, 0x08,
105, 7, 7, 7, 0x08,
129, 7, 7, 7, 0x08,
152, 7, 7, 7, 0x08,
181, 7, 7, 7, 0x08,
200, 7, 7, 7, 0x08,
225, 7, 7, 7, 0x08,
253, 7, 7, 7, 0x08,
65, 7, 7, 7, 0x08,
95, 90, 7, 7, 0x08,
126, 7, 7, 7, 0x08,
150, 7, 7, 7, 0x08,
173, 7, 7, 7, 0x08,
202, 7, 7, 7, 0x08,
221, 7, 7, 7, 0x08,
246, 7, 7, 7, 0x08,
274, 7, 7, 7, 0x08,
305, 7, 7, 7, 0x08,
333, 7, 7, 7, 0x08,
361, 7, 7, 7, 0x08,
383, 7, 7, 7, 0x08,
405, 7, 7, 7, 0x08,
436, 7, 7, 7, 0x08,
466, 7, 7, 7, 0x08,
493, 7, 7, 7, 0x08,
521, 7, 7, 7, 0x08,
547, 7, 7, 7, 0x08,
573, 7, 7, 7, 0x08,
295, 7, 7, 7, 0x08,
326, 7, 7, 7, 0x08,
354, 7, 7, 7, 0x08,
382, 7, 7, 7, 0x08,
404, 7, 7, 7, 0x08,
426, 7, 7, 7, 0x08,
457, 7, 7, 7, 0x08,
487, 7, 7, 7, 0x08,
515, 7, 7, 7, 0x08,
543, 7, 7, 7, 0x08,
569, 7, 7, 7, 0x08,
595, 7, 7, 7, 0x08,
629, 7, 7, 7, 0x08,
0 // eod
};
static const char qt_meta_stringdata_G4UIQt[] = {
"G4UIQt\0\0ExitSession()\0ClearButtonCallback()\0"
"CommandEnteredCallback()\0text\0"
"CommandEditedCallback(QString)\0"
"SaveOutputCallback()\0CommandEnteredCallback()\0"
"text\0CommandEditedCallback(QString)\0"
"ButtonCallback(QString)\0HelpTreeClicCallback()\0"
"HelpTreeDoubleClicCallback()\0"
"ShowHelpCallback()\0CommandHistoryCallback()\0"
@@ -73,10 +75,11 @@ static const char qt_meta_stringdata_G4UIQt[] = {
"TabCloseCallback(int)\0ToolBoxActivated(int)\0"
"VisParameterCallback(QWidget*)\0"
"ChangeColorCallback(QWidget*)\0"
"ChangeCursorStyle(QString)\0"
"ChangeCursorAction(QString)\0"
"ChangeSurfaceStyle(QString)\0"
"OpenIconCallback(QString)\0"
"SaveIconCallback(QString)\0"
"ViewerPropertiesIconCallback(int)\0"
"ChangePerspectiveOrtho(QString)\0"
};
@@ -88,27 +91,29 @@ void G4UIQt::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void
switch (_id) {
case 0: _t->ExitSession(); break;
case 1: _t->ClearButtonCallback(); break;
case 2: _t->CommandEnteredCallback(); break;
case 3: _t->CommandEditedCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 4: _t->ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 5: _t->HelpTreeClicCallback(); break;
case 6: _t->HelpTreeDoubleClicCallback(); break;
case 7: _t->ShowHelpCallback(); break;
case 8: _t->CommandHistoryCallback(); break;
case 9: _t->LookForHelpStringCallback(); break;
case 10: _t->UpdateTabWidget((*reinterpret_cast< int(*)>(_a[1]))); break;
case 11: _t->ResizeTabWidget((*reinterpret_cast< QResizeEvent*(*)>(_a[1]))); break;
case 12: _t->CoutFilterCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 13: _t->ThreadComboBoxCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
case 14: _t->TabCloseCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
case 15: _t->ToolBoxActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
case 16: _t->VisParameterCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
case 17: _t->ChangeColorCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
case 18: _t->ChangeCursorStyle((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 19: _t->ChangeSurfaceStyle((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 20: _t->OpenIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 21: _t->SaveIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 22: _t->ChangePerspectiveOrtho((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 2: _t->SaveOutputCallback(); break;
case 3: _t->CommandEnteredCallback(); break;
case 4: _t->CommandEditedCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 5: _t->ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 6: _t->HelpTreeClicCallback(); break;
case 7: _t->HelpTreeDoubleClicCallback(); break;
case 8: _t->ShowHelpCallback(); break;
case 9: _t->CommandHistoryCallback(); break;
case 10: _t->LookForHelpStringCallback(); break;
case 11: _t->UpdateTabWidget((*reinterpret_cast< int(*)>(_a[1]))); break;
case 12: _t->ResizeTabWidget((*reinterpret_cast< QResizeEvent*(*)>(_a[1]))); break;
case 13: _t->CoutFilterCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 14: _t->ThreadComboBoxCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
case 15: _t->TabCloseCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
case 16: _t->ToolBoxActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
case 17: _t->VisParameterCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
case 18: _t->ChangeColorCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
case 19: _t->ChangeCursorAction((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 20: _t->ChangeSurfaceStyle((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 21: _t->OpenIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 22: _t->SaveIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 23: _t->ViewerPropertiesIconCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
case 24: _t->ChangePerspectiveOrtho((*reinterpret_cast< const QString(*)>(_a[1]))); break;
default: ;
}
}
@@ -150,9 +155,9 @@ int G4UIQt::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 23)
if (_id < 25)
qt_static_metacall(this, _c, _id, _a);
_id -= 23;
_id -= 25;
}
return _id;
}
File diff suppressed because it is too large Load Diff
@@ -46,6 +46,7 @@ private:
G4UIcommand* addMenu;
G4UIcommand* addButton;
G4UIcommand* addIcon;
G4UIcommand* defaultIcons;
G4UIcommand* sys;
};
@@ -50,6 +50,7 @@ class G4VInteractiveSession
virtual void AddMenu (const char*,const char*);
virtual void AddButton (const char*,const char*,const char*);
virtual void AddIcon (const char*,const char*,const char*,const char*);
virtual void DefaultIcons (bool);
void AddInteractor(G4String,G4Interactor);
G4Interactor GetInteractor(G4String);
@@ -73,6 +73,15 @@ G4InteractorMessenger::G4InteractorMessenger (
parameter->SetDefaultValue("");
addButton->SetParameter (parameter);
// /gui/defaultIcons :
defaultIcons = new G4UIcommand("/gui/defaultIcons",this);
defaultIcons->SetGuidance("Set the Geant4 defaults icons in Qt driver.");
defaultIcons->SetGuidance("By default, Geant4 icons are enable.");
parameter = new G4UIparameter("bool",'b',true);
parameter->SetDefaultValue("true");
defaultIcons->SetParameter (parameter);
// /gui/addIcon :
addIcon = new G4UIcommand("/gui/addIcon",this);
addIcon->SetGuidance
@@ -145,6 +154,8 @@ void G4InteractorMessenger::SetNewValue (
session->AddButton((const char*)params[0],(const char*)params[1],(const char*)params[2]);
} else if(command==addIcon) {
session->AddIcon((const char*)params[0],(const char*)params[1],(const char*)params[2],(const char*)params[3]);
} else if(command==defaultIcons) {
session->DefaultIcons(command->ConvertToBool(newValue));
} else if(command==sys) {
system((const char*)params[0]);
}
@@ -51,6 +51,11 @@ void G4VInteractiveSession::AddButton (const char*,const char*,const char*)
{
}
/***************************************************************************/
void G4VInteractiveSession::DefaultIcons (bool)
{
}
/***************************************************************************/
void G4VInteractiveSession::AddIcon (const char*,const char*,const char*,const char*)
{