Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIGAG.hh,v 1.7 2006/06/29 19:09:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G4UIGAG.hh
|
||||
// GAG(Geant4 adaptive GUI) interface class
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIGainServer.hh,v 1.5 2006/06/29 19:09:21 gunter Exp $
|
||||
// $Name: geant4-09-00 $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIGAG.cc,v 1.18 2006/06/29 19:09:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4UIGAG.cc,v 1.19 2007/10/30 10:14:34 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G4UIGAG.cc
|
||||
// 18.Feb.98 M.Nagamatu and T.Kodama created G4UIGAG from G4UIterminal
|
||||
@@ -413,7 +413,7 @@ void G4UIGAG::ListDirectory( G4String newCommand )
|
||||
void G4UIGAG::TerminalHelp(G4String newCommand)
|
||||
{
|
||||
G4UIcommandTree * treeTop = UI->GetTree();
|
||||
/*int*/unsigned i = newCommand.index(" ");
|
||||
/*int*/str_size i = newCommand.index(" ");
|
||||
if( i != std::string::npos )
|
||||
{
|
||||
G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
//
|
||||
//
|
||||
// 12/06/2002 G4UIGainServer H. MInamimoto and H. Yoshida created
|
||||
// $Id: G4UIGainServer.cc,v 1.10 2006/06/29 19:09:25 gunter Exp $
|
||||
// $Name: geant4-09-00 $
|
||||
// $Id: G4UIGainServer.cc,v 1.11 2007/11/16 14:59:35 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
#ifndef WIN32
|
||||
|
||||
@@ -537,7 +537,7 @@ void G4UIGainServer::ListDirectory(G4String newCommand){
|
||||
void G4UIGainServer::TerminalHelp(G4String newCommand){
|
||||
///////////////////////////////////////////////
|
||||
G4UIcommandTree* treeTop = UI->GetTree();
|
||||
unsigned i = newCommand.index(" ");
|
||||
str_size i = newCommand.index(" ");
|
||||
|
||||
if(i!=std::string::npos){
|
||||
G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.82 2007/06/19 10:38:28 gcosmo Exp $
|
||||
$Id: History,v 1.90 2007/11/16 15:03:17 kmura Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,43 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
16 November 2007, Koichi Murakami (interfaces-V09-00-03)
|
||||
- G4UIGainServer.cc: cleared a compilation warning.
|
||||
- tagged for the 9.1 release.
|
||||
|
||||
15 Nov 2007, Laurent Garnier
|
||||
- G4UIQt,G4Qt : Adding a GEANT4_QT_DEBUG flag to hide all debug messages
|
||||
- G4UIQt,G4Qt : Compilation improvements for Qt3
|
||||
- G4UIQt,G4Qt : Minors corrections on G4UIQt helpWidget
|
||||
|
||||
13 Nov 2007, Laurent Garnier
|
||||
- G4UIQt,G4Qt : Moving all moc in one big file interface/G4UIQT_moc.cc,
|
||||
including Qt3 and Qt4 moc support
|
||||
|
||||
09 Nov 2007, Laurent Garnier
|
||||
- G4UIQt,G4Qt : Change all include directive to be compatible with Qt3
|
||||
|
||||
27 Sept 2007, Laurent Garnier
|
||||
- Adding sur files for G4UIQt driver
|
||||
|
||||
06 November Koichi Murakami
|
||||
- G4UItcsh.cc: store shell history across sessions.
|
||||
|
||||
30 October 2007 Koichi Murakami (interfaces-V09-00-02)
|
||||
- Guy committed the new Qt interface (28/Sep).
|
||||
- Add "#ifdef G4UI_BUILD_QT_SESSION" protection in src/G4UIQt_moc.cc.
|
||||
- Remove Qt interface from the current tag.
|
||||
- G4UIGAG.cc: suppress a compilation warning.
|
||||
|
||||
30 October 2007 Koichi Murakami (interfaces-V09-00-01)
|
||||
- Makoto updated the implementation of the signal handler for Ctrl-C.
|
||||
|
||||
28 October 2007, Makoto Asai
|
||||
- Remove improper dependency from interfaces/basic to run in GNUmakefile
|
||||
|
||||
02 August 2007, Koichi Murakami (interfaces-V09-00-00)
|
||||
- Fix compilation warning on SUN-CC in G4UIterminal.cc
|
||||
|
||||
19 June 2007, Gabriele Cosmo (interfaces-V08-03-02)
|
||||
- Fix compilation error on Windows ('theShell' not declared).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.3 2007/05/21 07:30:33 kmura Exp $
|
||||
# $Id: GNUmakefile,v 1.4 2007/10/29 18:49:45 asaim Exp $
|
||||
# -------------------------------------------------------------
|
||||
# GNUmakefile for interfaces/basic library. John Allison, 6/7/98.
|
||||
|
||||
@@ -15,32 +15,6 @@ include $(G4INSTALL)/config/interactivity.gmk
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include
|
||||
CPPFLAGS += -I$(G4BASE)/interfaces/common/include
|
||||
CPPFLAGS += -I$(G4BASE)/intercoms/include
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/run/include \
|
||||
-I$(G4BASE)/event/include \
|
||||
-I$(G4BASE)/track/include \
|
||||
-I$(G4BASE)/tracking/include \
|
||||
-I$(G4BASE)/particles/management/include \
|
||||
-I$(G4BASE)/processes/management/include \
|
||||
-I$(G4BASE)/processes/cuts/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/utils/include \
|
||||
-I$(G4BASE)/processes/transportation/include \
|
||||
-I$(G4BASE)/processes/decay/include \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/navigation/include \
|
||||
-I$(G4BASE)/geometry/magneticfield/include \
|
||||
-I$(G4BASE)/geometry/biasing/include \
|
||||
-I$(G4BASE)/digits_hits/detector/include \
|
||||
-I$(G4BASE)/digits_hits/hits/include \
|
||||
-I$(G4BASE)/digits_hits/digits/include \
|
||||
-I$(G4BASE)/interfaces/common/include \
|
||||
-I$(G4BASE)/interfaces/basic/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/graphics_reps/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIArrayString.hh,v 1.3 2006/06/29 19:09:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef G4UIArrayString_h
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4UIQt.hh,v 1.7 2007/11/15 18:53:59 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
#ifndef G4UIQt_h
|
||||
#define G4UIQt_h
|
||||
|
||||
#if defined(G4UI_BUILD_QT_SESSION) || defined(G4UI_USE_QT)
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "G4VBasicShell.hh"
|
||||
#include "G4VInteractiveSession.hh"
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
class QMainWindow;
|
||||
class QLineEdit;
|
||||
class G4UIsession;
|
||||
#if QT_VERSION < 0x040000
|
||||
class QListView;
|
||||
class QListViewItem;
|
||||
#else
|
||||
class QListWidget;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
#endif
|
||||
class QTextEdit;
|
||||
class QLabel;
|
||||
class QDialog;
|
||||
|
||||
// Class description :
|
||||
//
|
||||
// G4UIQt : class to handle a Motif interactive session.
|
||||
// G4UIQt is the Motif version of G4UIterminal.
|
||||
//
|
||||
// A command box is at disposal for entering/recalling Geant4 commands.
|
||||
// A menubar could be customized through the AddMenu, AddButton methods.
|
||||
// Note that there are corresponding Geant4 commands to add a
|
||||
// menus in the menubar and add buttons in a menu.
|
||||
// Ex :
|
||||
// /gui/addMenu test Test
|
||||
// /gui/addButton test Init /run/initialize
|
||||
// /gui/addButton test "Set gun" "/control/execute gun.g4m"
|
||||
// /gui/addButton test "Run one event" "/run/beamOn 1"
|
||||
//
|
||||
// Command completion, by typing "tab" key, is available on the
|
||||
// command line.
|
||||
//
|
||||
// Class description - end :
|
||||
|
||||
class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSession {
|
||||
Q_OBJECT
|
||||
|
||||
public: // With description
|
||||
G4UIQt(int,char**);
|
||||
// (argv, argc) or (0, NULL) had to be given.
|
||||
G4UIsession* SessionStart();
|
||||
// To enter interactive X loop ; waiting/executing command,...
|
||||
void AddMenu(const char*,const char*);
|
||||
// To add a pulldown menu in the menu bar.
|
||||
// First argument is the name of the menu.
|
||||
// Second argument is the label of the cascade button.
|
||||
// Ex : AddMenu("my_menu","My menu")
|
||||
void AddButton(const char*,const char*,const char*);
|
||||
// To add a push button in a pulldown menu.
|
||||
// First argument is the name of the menu.
|
||||
// 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");
|
||||
public:
|
||||
~G4UIQt();
|
||||
void Prompt(G4String);
|
||||
void SessionTerminate();
|
||||
void PauseSessionStart(G4String);
|
||||
G4int ReceiveG4cout(G4String);
|
||||
G4int ReceiveG4cerr(G4String);
|
||||
// G4String GetCommand(Widget);
|
||||
|
||||
private:
|
||||
void SecondaryLoop(G4String); // a VIRER
|
||||
void TerminalHelp(G4String);
|
||||
#if QT_VERSION < 0x040000
|
||||
void CreateChildTree(QListViewItem*,G4UIcommandTree*);
|
||||
QListViewItem* FindTreeItem(QListViewItem *,const QString&);
|
||||
#else
|
||||
void CreateChildTree(QTreeWidgetItem*,G4UIcommandTree*);
|
||||
QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,const QString&);
|
||||
#endif
|
||||
|
||||
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*);
|
||||
|
||||
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 *fTextArea;
|
||||
QTextEdit *fHelpArea;
|
||||
#if QT_VERSION < 0x040000
|
||||
QListView *fCommandHistoryArea;
|
||||
QListView *fHelpTreeWidget;
|
||||
#else
|
||||
QListWidget *fCommandHistoryArea;
|
||||
QTreeWidget *fHelpTreeWidget;
|
||||
#endif
|
||||
QDialog *fHelpDialog;
|
||||
|
||||
signals :
|
||||
void myClicked(const QString &text);
|
||||
|
||||
private slots :
|
||||
void ExitSession();
|
||||
void ClearButtonCallback();
|
||||
void CommandEnteredCallback();
|
||||
void ButtonCallback(const QString&);
|
||||
void HelpTreeClicCallback();
|
||||
#if QT_VERSION < 0x040000
|
||||
void HelpTreeDoubleClicCallback( QListViewItem*, int);
|
||||
#else
|
||||
void HelpTreeDoubleClicCallback( QTreeWidgetItem*, int);
|
||||
#endif
|
||||
void ShowHelpCallback();
|
||||
void CommandHistoryCallback();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIWin32.hh,v 1.14 2006/06/29 19:09:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
#ifndef G4UIWin32_h
|
||||
#define G4UIWin32_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXaw.hh,v 1.6 2006/06/29 19:09:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
#ifndef G4UIXaw_h
|
||||
#define G4UIXaw_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXm.hh,v 1.13 2006/06/29 19:09:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
#ifndef G4UIXm_h
|
||||
#define G4UIXm_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIcsh.hh,v 1.4 2006/06/29 19:09:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcsh_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UItcsh.hh,v 1.8 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef G4UItcsh_h
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4UIterminal.hh,v 1.10 2007/05/22 01:51:05 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUIshell.hh,v 1.7 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VUIshell_h
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIArrayString.cc,v 1.8 2006/06/29 19:09:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,297 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/****************************************************************************
|
||||
** G4UIQt meta object code from reading C++ file 'G4UIQt.hh'
|
||||
**
|
||||
** Created: Tue Nov 13 18:13:09 2007
|
||||
** by: The Qt MOC ($Id: G4UIQt_moc.cc,v 1.8.2.1 2007/12/10 16:30:42 gunter Exp $)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef G4UI_BUILD_QT_SESSION
|
||||
|
||||
#undef QT_NO_COMPAT
|
||||
#include "../include/G4UIQt.hh"
|
||||
#include <qmetaobject.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
|
||||
#include <private/qucomextra_p.h>
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
|
||||
#error "This file was generated using the moc from 3.3.8. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
const char *G4UIQt::className() const
|
||||
{
|
||||
return "G4UIQt";
|
||||
}
|
||||
|
||||
QMetaObject *G4UIQt::metaObj = 0;
|
||||
static QMetaObjectCleanUp cleanUp_G4UIQt( "G4UIQt", &G4UIQt::staticMetaObject );
|
||||
|
||||
#ifndef QT_NO_TRANSLATION
|
||||
QString G4UIQt::tr( const char *s, const char *c )
|
||||
{
|
||||
if ( qApp )
|
||||
return qApp->translate( "G4UIQt", s, c, QApplication::DefaultCodec );
|
||||
else
|
||||
return QString::fromLatin1( s );
|
||||
}
|
||||
#ifndef QT_NO_TRANSLATION_UTF8
|
||||
QString G4UIQt::trUtf8( const char *s, const char *c )
|
||||
{
|
||||
if ( qApp )
|
||||
return qApp->translate( "G4UIQt", s, c, QApplication::UnicodeUTF8 );
|
||||
else
|
||||
return QString::fromUtf8( s );
|
||||
}
|
||||
#endif // QT_NO_TRANSLATION_UTF8
|
||||
|
||||
#endif // QT_NO_TRANSLATION
|
||||
|
||||
QMetaObject* G4UIQt::staticMetaObject()
|
||||
{
|
||||
if ( metaObj )
|
||||
return metaObj;
|
||||
QMetaObject* parentObject = QObject::staticMetaObject();
|
||||
static const QUMethod slot_0 = {"ExitSession", 0, 0 };
|
||||
static const QUMethod slot_1 = {"ClearButtonCallback", 0, 0 };
|
||||
static const QUMethod slot_2 = {"CommandEnteredCallback", 0, 0 };
|
||||
static const QUParameter param_slot_3[] = {
|
||||
{ 0, &static_QUType_QString, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod slot_3 = {"ButtonCallback", 1, param_slot_3 };
|
||||
static const QUMethod slot_4 = {"HelpTreeClicCallback", 0, 0 };
|
||||
static const QUParameter param_slot_5[] = {
|
||||
{ 0, &static_QUType_ptr, "QListViewItem", QUParameter::In },
|
||||
{ 0, &static_QUType_int, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 2, param_slot_5 };
|
||||
static const QUMethod slot_6 = {"ShowHelpCallback", 0, 0 };
|
||||
static const QUMethod slot_7 = {"CommandHistoryCallback", 0, 0 };
|
||||
static const QMetaData slot_tbl[] = {
|
||||
{ "ExitSession()", &slot_0, QMetaData::Private },
|
||||
{ "ClearButtonCallback()", &slot_1, QMetaData::Private },
|
||||
{ "CommandEnteredCallback()", &slot_2, QMetaData::Private },
|
||||
{ "ButtonCallback(const QString&)", &slot_3, QMetaData::Private },
|
||||
{ "HelpTreeClicCallback()", &slot_4, QMetaData::Private },
|
||||
{ "HelpTreeDoubleClicCallback(QListViewItem*,int)", &slot_5, QMetaData::Private },
|
||||
{ "ShowHelpCallback()", &slot_6, QMetaData::Private },
|
||||
{ "CommandHistoryCallback()", &slot_7, QMetaData::Private }
|
||||
};
|
||||
static const QUParameter param_signal_0[] = {
|
||||
{ "text", &static_QUType_QString, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod signal_0 = {"myClicked", 1, param_signal_0 };
|
||||
static const QMetaData signal_tbl[] = {
|
||||
{ "myClicked(const QString&)", &signal_0, QMetaData::Private }
|
||||
};
|
||||
metaObj = QMetaObject::new_metaobject(
|
||||
"G4UIQt", parentObject,
|
||||
slot_tbl, 8,
|
||||
signal_tbl, 1,
|
||||
#ifndef QT_NO_PROPERTIES
|
||||
0, 0,
|
||||
0, 0,
|
||||
#endif // QT_NO_PROPERTIES
|
||||
0, 0 );
|
||||
cleanUp_G4UIQt.setMetaObject( metaObj );
|
||||
return metaObj;
|
||||
}
|
||||
|
||||
void* G4UIQt::qt_cast( const char* clname )
|
||||
{
|
||||
if ( !qstrcmp( clname, "G4UIQt" ) )
|
||||
return this;
|
||||
if ( !qstrcmp( clname, "G4VBasicShell" ) )
|
||||
return (G4VBasicShell*)this;
|
||||
if ( !qstrcmp( clname, "G4VInteractiveSession" ) )
|
||||
return (G4VInteractiveSession*)this;
|
||||
return QObject::qt_cast( clname );
|
||||
}
|
||||
|
||||
// SIGNAL myClicked
|
||||
void G4UIQt::myClicked( const QString& t0 )
|
||||
{
|
||||
activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
|
||||
}
|
||||
|
||||
bool G4UIQt::qt_invoke( int _id, QUObject* _o )
|
||||
{
|
||||
switch ( _id - staticMetaObject()->slotOffset() ) {
|
||||
case 0: ExitSession(); break;
|
||||
case 1: ClearButtonCallback(); break;
|
||||
case 2: CommandEnteredCallback(); break;
|
||||
case 3: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break;
|
||||
case 4: HelpTreeClicCallback(); break;
|
||||
case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
|
||||
case 6: ShowHelpCallback(); break;
|
||||
case 7: CommandHistoryCallback(); break;
|
||||
default:
|
||||
return QObject::qt_invoke( _id, _o );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool G4UIQt::qt_emit( int _id, QUObject* _o )
|
||||
{
|
||||
switch ( _id - staticMetaObject()->signalOffset() ) {
|
||||
case 0: myClicked((const QString&)static_QUType_QString.get(_o+1)); break;
|
||||
default:
|
||||
return QObject::qt_emit(_id,_o);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#ifndef QT_NO_PROPERTIES
|
||||
|
||||
bool G4UIQt::qt_property( int id, int f, QVariant* v)
|
||||
{
|
||||
return QObject::qt_property( id, f, v);
|
||||
}
|
||||
|
||||
bool G4UIQt::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
|
||||
#endif // QT_NO_PROPERTIES
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4UIQt.hh'
|
||||
**
|
||||
** Created: Mon Oct 1 10:59:35 2007
|
||||
** by: The Qt Meta Object Compiler version 59 (Qt 4.2.2)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
|
||||
#ifdef G4UI_BUILD_QT_SESSION
|
||||
|
||||
#include "../include/G4UIQt.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4UIQt.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 59
|
||||
#error "This file was generated using the moc from 4.2.2. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
static const uint qt_meta_data_G4UIQt[] = {
|
||||
|
||||
// content:
|
||||
1, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
9, 10, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
|
||||
// signals: signature, parameters, type, tag, flags
|
||||
7, 26, 31, 31, 0x05,
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
32, 31, 31, 31, 0x08,
|
||||
46, 31, 31, 31, 0x08,
|
||||
68, 31, 31, 31, 0x08,
|
||||
93, 31, 31, 31, 0x08,
|
||||
117, 31, 31, 31, 0x08,
|
||||
140, 189, 31, 31, 0x08,
|
||||
191, 31, 31, 31, 0x08,
|
||||
210, 31, 31, 31, 0x08,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4UIQt[] = {
|
||||
"G4UIQt\0myClicked(QString)\0text\0\0"
|
||||
"ExitSession()\0ClearButtonCallback()\0"
|
||||
"CommandEnteredCallback()\0"
|
||||
"ButtonCallback(QString)\0HelpTreeClicCallback()\0"
|
||||
"HelpTreeDoubleClicCallback(QTreeWidgetItem*,int)\0"
|
||||
",\0ShowHelpCallback()\0CommandHistoryCallback()\0"
|
||||
};
|
||||
|
||||
const QMetaObject G4UIQt::staticMetaObject = {
|
||||
{ &QObject::staticMetaObject, qt_meta_stringdata_G4UIQt,
|
||||
qt_meta_data_G4UIQt, 0 }
|
||||
};
|
||||
|
||||
const QMetaObject *G4UIQt::metaObject() const
|
||||
{
|
||||
return &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4UIQt::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4UIQt))
|
||||
return static_cast<void*>(const_cast<G4UIQt*>(this));
|
||||
if (!strcmp(_clname, "G4VBasicShell"))
|
||||
return static_cast<G4VBasicShell*>(const_cast<G4UIQt*>(this));
|
||||
if (!strcmp(_clname, "G4VInteractiveSession"))
|
||||
return static_cast<G4VInteractiveSession*>(const_cast<G4UIQt*>(this));
|
||||
return QObject::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4UIQt::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QObject::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
switch (_id) {
|
||||
case 0: myClicked((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 1: ExitSession(); break;
|
||||
case 2: ClearButtonCallback(); break;
|
||||
case 3: CommandEnteredCallback(); break;
|
||||
case 4: ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 5: HelpTreeClicCallback(); break;
|
||||
case 6: HelpTreeDoubleClicCallback((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
|
||||
case 7: ShowHelpCallback(); break;
|
||||
case 8: CommandHistoryCallback(); break;
|
||||
}
|
||||
_id -= 9;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
|
||||
// SIGNAL 0
|
||||
void G4UIQt::myClicked(const QString & _t1)
|
||||
{
|
||||
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
|
||||
QMetaObject::activate(this, &staticMetaObject, 0, _a);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIWin32.cc,v 1.13 2006/06/29 19:09:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXaw.cc,v 1.6 2006/06/29 19:09:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIcsh.cc,v 1.8 2006/06/29 19:09:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4UIcsh.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UItcsh.cc,v 1.14 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4UItcsh.cc,v 1.15 2007/11/06 09:36:23 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "G4UItcsh.hh"
|
||||
#include <ctype.h>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <stdlib.h>
|
||||
|
||||
// ASCII character code
|
||||
static const char AsciiCtrA = '\001';
|
||||
@@ -58,6 +60,9 @@ static const char AsciiESC = '\033';
|
||||
|
||||
static const int AsciiPrintableMin = 32;
|
||||
|
||||
// history file
|
||||
static const G4String historyFileName= "/.g4_hist";
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4UItcsh::G4UItcsh(const G4String& prompt, G4int maxhist)
|
||||
: G4VUIshell(prompt),
|
||||
@@ -68,12 +73,45 @@ G4UItcsh::G4UItcsh(const G4String& prompt, G4int maxhist)
|
||||
{
|
||||
// get current terminal mode
|
||||
tcgetattr(0, &tios);
|
||||
|
||||
// read a shell history file
|
||||
G4String homedir= getenv("HOME");
|
||||
G4String fname= homedir + historyFileName;
|
||||
|
||||
std::ifstream histfile;
|
||||
enum { BUFSIZE= 1024 }; char linebuf[BUFSIZE];
|
||||
|
||||
histfile.open(fname, std::ios::in);
|
||||
while (histfile.good()) {
|
||||
if(histfile.eof()) break;
|
||||
|
||||
histfile.getline(linebuf, BUFSIZE);
|
||||
G4String aline= linebuf;
|
||||
aline.strip(G4String::both);
|
||||
if(aline.size() != 0) StoreHistory(linebuf);
|
||||
}
|
||||
histfile.close();
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
G4UItcsh::~G4UItcsh()
|
||||
/////////////////////
|
||||
{
|
||||
// store a shell history
|
||||
G4String homedir= getenv("HOME");
|
||||
G4String fname= homedir + historyFileName;
|
||||
|
||||
std::ofstream histfile;
|
||||
histfile.open(fname, std::ios::out);
|
||||
|
||||
G4int n0hist= 1;
|
||||
if( currentHistoryNo > maxHistory ) n0hist= currentHistoryNo-maxHistory+1;
|
||||
|
||||
for (G4int i=n0hist; i<= currentHistoryNo; i++) {
|
||||
histfile << RestoreHistory(i) << G4endl;
|
||||
}
|
||||
|
||||
histfile.close();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////
|
||||
@@ -600,9 +638,9 @@ G4String G4UItcsh::ReadLine()
|
||||
return commandLine;
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
G4String G4UItcsh::GetCommandLine(const char* msg)
|
||||
///////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
{
|
||||
SetTermToInputMode();
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIterminal.cc,v 1.25 2007/06/19 10:38:29 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4UIterminal.cc,v 1.27 2007/10/29 18:49:45 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <sstream>
|
||||
|
||||
#ifndef WIN32
|
||||
#include "G4RunManager.hh"
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
@@ -53,29 +52,31 @@ static G4VUIshell* theshell= 0;
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
extern "C" {
|
||||
|
||||
////////////////////////////////
|
||||
static void SignalHandler(G4int)
|
||||
////////////////////////////////
|
||||
{
|
||||
G4RunManager* runManager= G4RunManager::GetRunManager();
|
||||
G4StateManager* stateManager= G4StateManager::GetStateManager();
|
||||
G4ApplicationState state= stateManager-> GetCurrentState();
|
||||
|
||||
if(state==G4State_GeomClosed || state==G4State_EventProc) {
|
||||
G4cout << "aborting Run ...";
|
||||
runManager-> AbortRun(true);
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/abort");
|
||||
G4cout << G4endl;
|
||||
} else {
|
||||
G4cout << G4endl
|
||||
<< "Session terminated." << G4endl;
|
||||
theshell-> ResetTerminal();
|
||||
delete runManager;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// for original Unix / System V
|
||||
signal(SIGINT, SignalHandler);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// ====================================================================
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUIshell.cc,v 1.10 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Qt.hh,v 1.2 2007/11/08 17:00:09 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// To unify Qt event treatment between
|
||||
// G4/interfaces Qt sessions and G4/visualizations Qt drivers.
|
||||
// L. Garnier
|
||||
|
||||
#ifndef G4QT_HH
|
||||
#define G4QT_HH
|
||||
|
||||
#if defined(G4INTY_BUILD_QT) || defined(G4INTY_USE_QT)
|
||||
|
||||
#include "G4VInteractorManager.hh"
|
||||
|
||||
// Class description :
|
||||
//
|
||||
// G4Qt : a singleton to handle GUI sessions and visualization
|
||||
// drivers built over Qt. It permits to have one Qt main loop for
|
||||
// the whole application. The Qt toolkit is inited in the
|
||||
// constructor. It is done once for the whole application.
|
||||
//
|
||||
// Class description - end :
|
||||
|
||||
class G4Qt : public G4VInteractorManager {
|
||||
public:
|
||||
static G4Qt* getInstance();
|
||||
static G4Qt* getInstance(int,char**,char*);
|
||||
G4bool Inited();
|
||||
void* GetEvent();
|
||||
void FlushAndWaitExecution();
|
||||
virtual ~G4Qt();
|
||||
private:
|
||||
G4Qt (int,char**,char*);
|
||||
static G4Qt* instance; // Pointer to single instance.
|
||||
};
|
||||
|
||||
#endif //HAS_QT
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VBasicShell.hh,v 1.7 2006/06/29 19:10:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VBasicShell_H
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VInteractorManager.hh,v 1.9 2006/06/29 19:10:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Win32.hh,v 1.8 2006/06/29 19:10:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// To unify Windows message treatment between
|
||||
// G4/interfaces Windows sessions and G4/visualizations Windows drivers.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Xt.hh,v 1.6 2006/06/29 19:10:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// To unify X11 event treatment between
|
||||
// G4/interfaces Xt sessions and G4/visualizations Xt drivers.
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Qt.cc,v 1.7 2007/11/15 18:24:28 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// L. Garnier
|
||||
|
||||
#if defined(G4INTY_BUILD_QT) || defined(G4INTY_USE_QT)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4Qt.hh"
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
G4Qt* G4Qt::instance = NULL;
|
||||
|
||||
static G4bool QtInited = FALSE;
|
||||
//static int argn = 0;
|
||||
//static char** args = NULL;
|
||||
// static QtAppContext appContext = NULL;
|
||||
//static QApplication app = NULL;
|
||||
|
||||
/***************************************************************************/
|
||||
G4Qt* G4Qt::getInstance (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
return G4Qt::getInstance (0,NULL,(char*)"Geant4");
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4Qt* G4Qt::getInstance (
|
||||
int a_argn
|
||||
,char** a_args
|
||||
,char* a_class
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if (instance==NULL) {
|
||||
instance = new G4Qt(a_argn,a_args,a_class);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4Qt::G4Qt (
|
||||
int a_argn
|
||||
,char** a_args
|
||||
,char* a_class
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4Qt::G4Qt try to inited Qt\n");
|
||||
#endif
|
||||
if(QtInited==FALSE) { //Qt should be Inited once !
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4Qt::G4Qt inited Qt\n");
|
||||
#endif
|
||||
#if QT_VERSION < 0x040000
|
||||
qApp = new QApplication (a_argn, a_args);
|
||||
// QApplication qApp(a_argn, a_args);
|
||||
// if(&qApp == NULL) {
|
||||
#else
|
||||
new QApplication (a_argn, a_args);
|
||||
#endif
|
||||
if(!qApp) {
|
||||
|
||||
G4cout << "G4Qt : Unable to init Qt." << G4endl;
|
||||
} else {
|
||||
QtInited = TRUE;
|
||||
//#if QT_VERSION < 0x040000
|
||||
// SetMainInteractor (&qApp);
|
||||
//#else
|
||||
SetMainInteractor (qApp);
|
||||
//#endif
|
||||
SetArguments (a_argn,a_args);
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4Qt::G4Qt inited Qt END\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
if (qApp) {
|
||||
printf("G4Qt::qApp exist\n");
|
||||
} else {
|
||||
printf("G4Qt::qApp not exist\n");
|
||||
}
|
||||
#endif
|
||||
// AddDispatcher ((G4DispatchFunction)XtDispatchEvent);
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4Qt::~G4Qt (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(this==instance) {
|
||||
instance = NULL;
|
||||
}
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4bool G4Qt::Inited (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
return QtInited;
|
||||
}
|
||||
/***************************************************************************/
|
||||
/**
|
||||
Si j'ai bien compris, cette fonction ne sert à rien
|
||||
*/
|
||||
void* G4Qt::GetEvent (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
//FIXME
|
||||
// G4cout << "G4Qt : Rien compris a cette fonction G4Qt::GetEvent." << G4endl;
|
||||
// static XEvent event;
|
||||
// if(appContext==NULL) return NULL;
|
||||
// if(mainApp==NULL) return NULL;
|
||||
// QtAppNextEvent (appContext, &event);
|
||||
// return &event;
|
||||
printf("*");
|
||||
return 0;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4Qt::FlushAndWaitExecution (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
// printf("G4Qt::FlushAndWaitExecution :: Flush ....\n");
|
||||
if(!qApp) return;
|
||||
qApp->processEvents();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VBasicShell.cc,v 1.12 2006/06/29 19:10:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
|
||||
#include "G4VBasicShell.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VInteractorManager.cc,v 1.13 2006/06/29 19:10:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Win32.cc,v 1.9 2006/06/29 19:10:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Xt.cc,v 1.11 2006/06/29 19:10:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
Reference in New Issue
Block a user