Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIExecutive.icc,v 1.6 2009/11/20 22:10:31 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4UIExecutive.icc,v 1.7 2010/05/28 08:12:27 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// G4UIExecutive.icc
|
||||
@@ -34,9 +34,9 @@
|
||||
#include "G4UIsession.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
#if defined(G4UI_USE_TCSH)
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
#if defined(G4UI_USE_QT)
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4Qt.hh"
|
||||
|
||||
#elif defined(G4UI_USE_XM)
|
||||
#include "G4UIXm.hh"
|
||||
@@ -44,9 +44,9 @@
|
||||
#elif defined(G4UI_USE_WIN32)
|
||||
#include "G4UIWin32.hh"
|
||||
|
||||
#elif defined(G4UI_USE_QT)
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4Qt.hh"
|
||||
#elif defined(G4UI_USE_TCSH)
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#else
|
||||
#include "G4UIterminal.hh"
|
||||
@@ -61,12 +61,9 @@ G4UIExecutive::G4UIExecutive(G4int argc, char** argv)
|
||||
: session(0), shell(0),isGUI(false)
|
||||
/////////////////////////////////////////////////////
|
||||
{
|
||||
#if defined(G4UI_USE_TCSH)
|
||||
DISCARD_PARAMETER(argc);
|
||||
DISCARD_PARAMETER(argv);
|
||||
|
||||
shell = new G4UItcsh;
|
||||
session = new G4UIterminal(shell);
|
||||
#if defined(G4UI_USE_QT)
|
||||
session = new G4UIQt(argc, argv);
|
||||
isGUI = true;
|
||||
|
||||
#elif defined(G4UI_USE_XM)
|
||||
session = new G4UIXm(argc, argv);
|
||||
@@ -78,10 +75,13 @@ G4UIExecutive::G4UIExecutive(G4int argc, char** argv)
|
||||
|
||||
session = new G4UIWin32();
|
||||
|
||||
#elif defined(G4UI_USE_QT)
|
||||
session = new G4UIQt(argc, argv);
|
||||
isGUI = true;
|
||||
|
||||
#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);
|
||||
@@ -120,7 +120,7 @@ inline void G4UIExecutive::SetPrompt(const G4String& prompt)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
inline void G4UIExecutive::SetLsColor(TermColorIndex dirColor,
|
||||
inline void G4UIExecutive::SetLsColor(TermColorIndex dirColor,
|
||||
TermColorIndex cmdColor)
|
||||
//////////////////////////////////////////////////////////////
|
||||
{
|
||||
@@ -132,6 +132,6 @@ inline void G4UIExecutive::SessionStart()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
session-> SessionStart();
|
||||
delete session;
|
||||
delete session;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIQt.hh,v 1.16 2009/02/16 11:40:26 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4UIQt.hh,v 1.23 2010/06/10 15:37:13 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04-beta-01 $
|
||||
//
|
||||
#ifndef G4UIQt_h
|
||||
#define G4UIQt_h
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qmap.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qtabwidget.h>
|
||||
|
||||
class QMainWindow;
|
||||
class QLineEdit;
|
||||
@@ -53,7 +55,10 @@ class QTreeWidgetItem;
|
||||
#endif
|
||||
class QTextEdit;
|
||||
class QLabel;
|
||||
class QDialog;
|
||||
class QResizeEvent;
|
||||
class QToolBox;
|
||||
class QStringList;
|
||||
class QSplitter;
|
||||
|
||||
// Class description :
|
||||
//
|
||||
@@ -75,6 +80,18 @@ class QDialog;
|
||||
//
|
||||
// Class description - end :
|
||||
|
||||
class G4QTabWidget : public QTabWidget {
|
||||
public :
|
||||
G4QTabWidget();
|
||||
G4QTabWidget(QSplitter*&);
|
||||
void paintEvent ( QPaintEvent * event );
|
||||
inline void setTabSelected(bool a) { tabSelected = a; };
|
||||
inline void setLastTabCreated(int a) { lastCreated = a; };
|
||||
inline bool isTabSelected() { return tabSelected; };
|
||||
bool tabSelected;
|
||||
int lastCreated;
|
||||
};
|
||||
|
||||
class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSession {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -94,6 +111,12 @@ 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");
|
||||
|
||||
bool AddTabWidget(QWidget*,QString,int,int);
|
||||
// To add a tab for vis openGL Qt driver
|
||||
|
||||
bool IsSplitterReleased();
|
||||
|
||||
public:
|
||||
~G4UIQt();
|
||||
void Prompt(G4String);
|
||||
@@ -102,16 +125,13 @@ public:
|
||||
G4int ReceiveG4cout(G4String);
|
||||
G4int ReceiveG4cerr(G4String);
|
||||
// G4String GetCommand(Widget);
|
||||
QMainWindow * getMainWindow();
|
||||
|
||||
private:
|
||||
void SecondaryLoop(G4String); // a VIRER
|
||||
void TerminalHelp(G4String);
|
||||
#if QT_VERSION < 0x040000
|
||||
QListView * CreateHelpTree();
|
||||
#else
|
||||
QTreeWidget * CreateHelpTree();
|
||||
#endif
|
||||
void CreateHelpWidget();
|
||||
void InitHelpTree();
|
||||
void FillHelpTree();
|
||||
void ExitHelp();
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
void CreateChildTree(QListViewItem*,G4UIcommandTree*);
|
||||
@@ -124,11 +144,22 @@ private:
|
||||
QString GetCommandList(const G4UIcommand*);
|
||||
|
||||
G4bool GetHelpChoice(G4int&) ;// have to be implemeted because we heritate from G4VBasicShell
|
||||
void ExitHelp();// have to be implemeted because we heritate from G4VBasicShell
|
||||
bool eventFilter(QObject*,QEvent*);
|
||||
void ActivateCommand(G4String);
|
||||
QMap<int,QString> LookForHelpStringInChildTree(G4UIcommandTree *,const QString&);
|
||||
|
||||
void CreateVisParametersTBWidget();
|
||||
void CreateViewComponentsTBWidget();
|
||||
void CreateHelpTBWidget();
|
||||
void CreateCoutTBWidget();
|
||||
void CreateHistoryTBWidget();
|
||||
void OpenHelpTreeOnCommand(const QString &);
|
||||
QString GetShortCommandPath(QString);
|
||||
#if QT_VERSION < 0x040000
|
||||
QString GetLongCommandPath(QListViewItem*);
|
||||
#else
|
||||
QString GetLongCommandPath(QTreeWidgetItem*);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -139,20 +170,32 @@ private:
|
||||
QMainWindow * fMainWindow;
|
||||
QLabel *fCommandLabel;
|
||||
QLineEdit * fCommandArea;
|
||||
QTextEdit *fTextArea;
|
||||
QTextEdit *fCoutTBTextArea;
|
||||
QTextEdit *fHelpArea;
|
||||
QToolBox* fToolBox;
|
||||
QStringList fG4cout;
|
||||
QLineEdit * fCoutFilter;
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QListView *fCommandHistoryArea;
|
||||
QListView *fHistoryTBTableList;
|
||||
QListView *fHelpTreeWidget;
|
||||
#else
|
||||
QListWidget *fCommandHistoryArea;
|
||||
QListWidget *fHistoryTBTableList;
|
||||
QTreeWidget *fHelpTreeWidget;
|
||||
#endif
|
||||
QDialog *fHelpDialog;
|
||||
QLineEdit *helpLine;
|
||||
|
||||
signals :
|
||||
void myClicked(const QString &text);
|
||||
QWidget* fHelpTBWidget;
|
||||
QWidget* fHistoryTBWidget;
|
||||
QWidget* fCoutTBWidget;
|
||||
QWidget* fVisParametersTBWidget;
|
||||
QWidget* fViewComponentsTBWidget;
|
||||
QLineEdit* fHelpLine;
|
||||
G4QTabWidget* fTabWidget;
|
||||
QString fCoutText;
|
||||
QLabel *fEmptyViewerTabLabel;
|
||||
QSplitter * fMyVSplitter;
|
||||
QSplitter * fHelpVSplitter;
|
||||
int fLastQTabSizeX;
|
||||
int fLastQTabSizeY;
|
||||
|
||||
private slots :
|
||||
void ExitSession();
|
||||
@@ -163,7 +206,12 @@ private slots :
|
||||
void HelpTreeDoubleClicCallback();
|
||||
void ShowHelpCallback();
|
||||
void CommandHistoryCallback();
|
||||
void lookForHelpStringCallback();
|
||||
void LookForHelpStringCallback();
|
||||
void UpdateTabWidget(int);
|
||||
void ResizeTabWidget( QResizeEvent* );
|
||||
void CoutFilterCallback(const QString&);
|
||||
void TabCloseCallback(int);
|
||||
void ToolBoxActivated(int);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user