Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -16,6 +16,60 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
28 November 2019 Gabriele Cosmo (opengl-V10-05-18)
|
||||
- Fixed QT_VERSION protection for use of screening function in
|
||||
G4OpenGLQtViewer.
|
||||
|
||||
25 November 2019 Gabriele Cosmo (opengl-V10-05-17)
|
||||
- Fixed deprecation compilation warning on Qt5 related to use of
|
||||
QProcess::setProcessChannelMode() in place of setReadChannelMode().
|
||||
|
||||
25 November 2019 Gabriele Cosmo (opengl-V10-05-16)
|
||||
- Fixed protection for compilation on older versions of Qt, including Qt4.
|
||||
|
||||
21 November 2019 Laurent Garnier (opengl-V10-05-15)
|
||||
- Remove Qt deprecation warnings
|
||||
* Replacing availableGeometry() by QGuiApplication::screenAt(QPoint(20,20))->availableGeometry()
|
||||
* Replace QProcess::setReadChannelMode() by setProcessChannelMode
|
||||
* Remove unused function hasPendingEvents()
|
||||
* Replace QFontMetrics::width()) by boundingRect(textCString[0]).width()
|
||||
|
||||
20 November 2019 Laurent Garnier (opengl-V10-05-14)
|
||||
- Remove deprecated QSignalMapper class
|
||||
|
||||
19 november 2019 Laurent Garnier (opengl-V10-05-13)
|
||||
- Refine DisplayListLimit command guidance and output
|
||||
|
||||
07 November 2019 Ben Morgan (opengl-V10-05-12)
|
||||
- Only link to imported targets for Motif and X11
|
||||
- Remove inclusion of QT_USE_FILE from CMake scripts.
|
||||
All usage is now through the qtX_ macros and imported targets
|
||||
- Only use Wt through imported targets
|
||||
|
||||
04 November 2019 John Allison (opengl-V10-05-11)
|
||||
- Part of vis-V10-05-26.
|
||||
- G4OpenGLSceneHandler::ScaledFlush:
|
||||
o Extend glFlush scaling to all circumstances (not just in the event loop).
|
||||
|
||||
22 October 2019 Gabriele Cosmo (opengl-V10-05-10)
|
||||
- Rationalise headers inclusion in G4OpenGLQtViewer.cc.
|
||||
|
||||
11 Sept 2019 Laurent Garnier (opengl-V10-05-09)
|
||||
- remove default font size and police
|
||||
|
||||
16 July 2019 John Allison (opengl-V10-05-08)
|
||||
- Part of vis-V10-05-22.
|
||||
- G4OpenGLImmediateXViewer:
|
||||
o Revert fix in OpenGL-V10-05-05. The fix in OpenGL-V10-05-07 is better.
|
||||
|
||||
06 July 2019 Guy Barrand (OpenGL-V10-05-07)
|
||||
- Part of vis-V10-05-21.
|
||||
- G4OpenGLXmViewer.cc:
|
||||
Fix argument compatibility in calls to XmVaCreateSimpleMenuBar and similar.
|
||||
Use (KeySym)XK_S instead of 'S', etc.
|
||||
- G4OpenGLXViewer.cc:
|
||||
Improve logic for finding a colormap.
|
||||
|
||||
13 June 2019 John Allison (OpenGL-V10-05-06)
|
||||
- Part of vis-V10-05-20.
|
||||
- Final changes for introduction of cloud drawing:
|
||||
|
||||
@@ -73,7 +73,9 @@ class QColor;
|
||||
class G4OpenGLSceneHandler;
|
||||
class G4OpenGLQtMovieDialog;
|
||||
class QLineEdit;
|
||||
#if QT_VERSION < 0x050600
|
||||
class QSignalMapper;
|
||||
#endif
|
||||
class G4UIQt;
|
||||
class QTableWidget;
|
||||
class QTableWidgetItem;
|
||||
@@ -184,7 +186,6 @@ protected:
|
||||
|
||||
protected:
|
||||
QWidget* fGLWidget;
|
||||
bool hasPendingEvents();
|
||||
void savePPMToTemp();
|
||||
int fRecordFrameNumber;
|
||||
|
||||
@@ -355,10 +356,11 @@ private:
|
||||
int fNumber;
|
||||
int fMaxPOindexInserted;
|
||||
G4UIQt* fUiQt;
|
||||
#if QT_VERSION < 0x050600
|
||||
QSignalMapper *fSignalMapperMouse;
|
||||
QSignalMapper *fSignalMapperSurface;
|
||||
QSignalMapper *fSignalMapperPicking;
|
||||
|
||||
#endif
|
||||
// quick map index to find next item
|
||||
std::map <int, QTreeWidgetItem*>::const_iterator fLastSceneTreeWidgetAskForIterator;
|
||||
std::map <int, QTreeWidgetItem*>::const_iterator fLastSceneTreeWidgetAskForIteratorEnd;
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
void AddSolid (const G4Polyhedra&);
|
||||
void AddSolid (const G4Orb&);
|
||||
void AddSolid (const G4Ellipsoid&);
|
||||
void AddSolid (const G4TessellatedSolid&);
|
||||
void AddSolid (const G4VSolid&);
|
||||
void AddCompound (const G4VTrajectory&);
|
||||
void AddCompound (const G4VHit&);
|
||||
|
||||
@@ -76,6 +76,10 @@ inline void G4OpenGLSceneHandler::AddSolid (const G4Ellipsoid& ellipsoid) {
|
||||
G4VSceneHandler::AddSolid (ellipsoid);
|
||||
}
|
||||
|
||||
inline void G4OpenGLSceneHandler::AddSolid (const G4TessellatedSolid& tess) {
|
||||
G4VSceneHandler::AddSolid (tess);
|
||||
}
|
||||
|
||||
inline void G4OpenGLSceneHandler::AddSolid (const G4VSolid& vsolid) {
|
||||
G4VSceneHandler::AddSolid (vsolid);
|
||||
}
|
||||
|
||||
@@ -81,10 +81,10 @@ set(G4VIS_MODULE_OPENGL_SOURCES
|
||||
)
|
||||
|
||||
#
|
||||
# May need OpenGL include here
|
||||
# Core OpenGL settings
|
||||
#
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
set(G4VIS_MODULE_OPENGL_LINK_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
set(G4VIS_MODULE_OPENGL_LINK_LIBRARIES OpenGL::GL OpenGL::GLU)
|
||||
|
||||
|
||||
#
|
||||
# All files must have the G4VIS_BUILD_OPENGL_DRIVER definition
|
||||
@@ -114,13 +114,16 @@ if(GEANT4_USE_OPENGL_X11)
|
||||
G4OpenGLXViewer.cc)
|
||||
|
||||
# Add the includes for X11
|
||||
include_directories(${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
|
||||
#include_directories(${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
|
||||
|
||||
# Add the compile definitions needed for the X11 component
|
||||
add_definitions(-DG4VIS_BUILD_OPENGLX_DRIVER)
|
||||
|
||||
# Add in X11 libraries, plus Xmu library
|
||||
list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES ${X11_LIBRARIES} ${X11_Xmu_LIBRARY})
|
||||
list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES X11::SM X11::ICE X11::X11 X11::Xext X11::Xmu)
|
||||
if(APPLE)
|
||||
list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES XQuartzGL::GL XQuartzGL::GLU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -191,24 +194,12 @@ if(GEANT4_USE_XM)
|
||||
add_definitions(-DG4VIS_BUILD_OPENGLX_DRIVER)
|
||||
endif()
|
||||
|
||||
# Add the includes for X11, Xmu and Motif
|
||||
include_directories(
|
||||
${X11_INCLUDE_DIR}
|
||||
${X11_Xmu_INCLUDE_PATH}
|
||||
${MOTIF_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Add the compile definitions needed for the Xm component, remembering
|
||||
# to add those for the UI part as well!!!
|
||||
add_definitions(-DG4VIS_BUILD_OPENGLXM_DRIVER -DG4INTY_BUILD_XT -DG4UI_BUILD_XM_SESSION)
|
||||
|
||||
# Add in Xm, X11 libraries, plus Xmu library
|
||||
set(G4VIS_MODULE_OPENGL_LINK_LIBRARIES ${MOTIF_LIBRARIES} ${X11_LIBRARIES} ${X11_Xmu_LIBRARY} ${G4VIS_MODULE_OPENGL_LINK_LIBRARIES})
|
||||
#list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES
|
||||
# ${MOTIF_LIBRARIES}
|
||||
# ${X11_LIBRARIES}
|
||||
# ${X11_Xmu_LIBRARY}
|
||||
#)
|
||||
set(G4VIS_MODULE_OPENGL_LINK_LIBRARIES Motif::Xm X11::SM X11::ICE X11::X11 X11::Xext X11::Xmu ${G4VIS_MODULE_OPENGL_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -244,9 +235,6 @@ if(GEANT4_USE_QT)
|
||||
G4OpenGLStoredQtViewer.cc)
|
||||
|
||||
|
||||
# Include the UseQt file to build the moc wrappers
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
# Add the moc sources - must use absolute path to the files
|
||||
QT4_WRAP_CPP(G4OPENGL_MOC_SOURCES
|
||||
${CMAKE_SOURCE_DIR}/source/visualization/OpenGL/include/G4OpenGLQtExportDialog.hh
|
||||
@@ -285,10 +273,6 @@ if(GEANT4_USE_WT)
|
||||
G4OpenGLVboDrawer.cc
|
||||
G4OpenGLWtViewer.cc)
|
||||
|
||||
# Must have Wt includes...
|
||||
include_directories(${Wt_INCLUDE_DIR})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
|
||||
# Add the definitions - these will also be used to compile the moc sources
|
||||
# Argh.. Have to remember about INTY and UI because of their use...
|
||||
# Use the compile definitions to avoid "signal/slot" keyword
|
||||
@@ -298,7 +282,7 @@ if(GEANT4_USE_WT)
|
||||
-DG4UI_BUILD_WT_SESSION)
|
||||
|
||||
# Add in Wt libraries
|
||||
list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES ${Wt_LIBRARY})
|
||||
list(APPEND G4VIS_MODULE_OPENGL_LINK_LIBRARIES Wt::Wt Wt::HTTP)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -331,7 +315,8 @@ if(GEANT4_USE_OPENGL_WIN32)
|
||||
# That should be it for Win32...
|
||||
endif()
|
||||
|
||||
|
||||
# May have duplicates in link list, so remove
|
||||
list(REMOVE_DUPLICATES G4VIS_MODULE_OPENGL_LINK_LIBRARIES)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Define the Geant4 Module.
|
||||
|
||||
@@ -61,13 +61,7 @@ G4OpenGLImmediateXViewer::~G4OpenGLImmediateXViewer () {}
|
||||
|
||||
void G4OpenGLImmediateXViewer::Initialise () {
|
||||
|
||||
// CreateGLXContext (vi_immediate);
|
||||
// Force double buffer context. (This can happen anyway when the display
|
||||
// list limit is reached in stored mode. Seems to be no problem. We were
|
||||
// finding that the single buffer visual gave an X Error (BadMatch) on
|
||||
// some systems, so let us force the use if a double buffer. All systems
|
||||
// have double buffers nowadays.
|
||||
CreateGLXContext (vi_stored);
|
||||
CreateGLXContext (vi_immediate);
|
||||
CreateMainWindow ();
|
||||
CreateFontLists ();
|
||||
|
||||
|
||||
@@ -34,16 +34,6 @@
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#include "G4OpenGLQtViewer.hh"
|
||||
|
||||
#include "G4OpenGLSceneHandler.hh"
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4OpenGLQtExportDialog.hh"
|
||||
#include "G4OpenGLQtMovieDialog.hh"
|
||||
#include "G4Qt.hh"
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4VisCommandsGeometrySet.hh"
|
||||
@@ -53,6 +43,15 @@
|
||||
#include "G4OpenGLStoredQtViewer.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
#include "G4OpenGLQtViewer.hh"
|
||||
#include "G4OpenGLSceneHandler.hh"
|
||||
#include "G4OpenGLQtExportDialog.hh"
|
||||
#include "G4OpenGLQtMovieDialog.hh"
|
||||
#include "G4Qt.hh"
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include <typeinfo>
|
||||
@@ -84,7 +83,11 @@
|
||||
#include <qgroupbox.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#if QT_VERSION < 0x050600
|
||||
#include <qsignalmapper.h>
|
||||
#else
|
||||
#include <qscreen.h>
|
||||
#endif
|
||||
#include <qmainwindow.h>
|
||||
#include <qtablewidget.h>
|
||||
#include <qheaderview.h>
|
||||
@@ -94,8 +97,6 @@
|
||||
#include <qcursor.h>
|
||||
#include <qthread.h>
|
||||
|
||||
#include "G4Threading.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
G4Mutex mWaitForVisSubThreadQtOpenGLContextMoved = G4MUTEX_INITIALIZER;
|
||||
@@ -184,9 +185,14 @@ void G4OpenGLQtViewer::CreateMainWindow (
|
||||
|
||||
|
||||
//useful for MACOSX, we have to compt the menuBar height
|
||||
int offset = QApplication::desktop()->height()
|
||||
- QApplication::desktop()->availableGeometry().height();
|
||||
|
||||
#if QT_VERSION >= 0x050a00
|
||||
G4int offset = QApplication::desktop()->height()
|
||||
- QGuiApplication::screenAt(QPoint(20,20))->availableGeometry().height();
|
||||
#else
|
||||
G4int offset = QApplication::desktop()->height()
|
||||
- QApplication::desktop()->availableGeometry().height();
|
||||
#endif
|
||||
|
||||
G4int YPos= fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height());
|
||||
if (fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height())< offset) {
|
||||
YPos = offset;
|
||||
@@ -259,9 +265,11 @@ G4OpenGLQtViewer::G4OpenGLQtViewer (
|
||||
,fModelShortNameItem(NULL)
|
||||
,fMaxPOindexInserted(-1)
|
||||
,fUiQt(NULL)
|
||||
#if QT_VERSION < 0x050600
|
||||
,fSignalMapperMouse(NULL)
|
||||
,fSignalMapperSurface(NULL)
|
||||
,fSignalMapperPicking(NULL)
|
||||
#endif
|
||||
,fTreeIconOpen(NULL)
|
||||
,fTreeIconClosed(NULL)
|
||||
,fLastExportSliderValue(80)
|
||||
@@ -289,9 +297,10 @@ G4OpenGLQtViewer::G4OpenGLQtViewer (
|
||||
initMovieParameters();
|
||||
|
||||
fLastEventTime = new QTime();
|
||||
#if QT_VERSION < 0x050600
|
||||
fSignalMapperMouse = new QSignalMapper(this);
|
||||
fSignalMapperSurface = new QSignalMapper(this);
|
||||
|
||||
#endif
|
||||
// Set default path and format
|
||||
fFileSavePath = QDir::currentPath();
|
||||
|
||||
@@ -532,11 +541,19 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
|
||||
QMenu *mMouseAction = fContextMenu->addMenu("&Mouse actions");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fMouseRotateAction = mMouseAction->addAction("Rotate", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseMoveAction = mMouseAction->addAction("Move", fSignalMapperMouse, SLOT(map()));
|
||||
fMousePickAction = mMouseAction->addAction("Pick", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseZoomOutAction = mMouseAction->addAction("Zoom out", fSignalMapperMouse, SLOT(map()));
|
||||
fMouseZoomInAction = mMouseAction->addAction("Zoom in", fSignalMapperMouse, SLOT(map()));
|
||||
#else
|
||||
fMouseRotateAction = mMouseAction->addAction("Rotate", this, [=](){ this->toggleMouseAction(1); });
|
||||
fMouseMoveAction = mMouseAction->addAction("Move", this, [=](){ this->toggleMouseAction(2); });
|
||||
fMousePickAction = mMouseAction->addAction("Pick", this, [=](){ this->toggleMouseAction(3); });
|
||||
fMouseZoomOutAction = mMouseAction->addAction("Zoom out", this, [=](){ this->toggleMouseAction(4); });
|
||||
fMouseZoomInAction = mMouseAction->addAction("Zoom in", this, [=](){ this->toggleMouseAction(5); });
|
||||
#endif
|
||||
QAction *shortcutsAction = mMouseAction->addAction("Show shortcuts");
|
||||
|
||||
fMouseRotateAction->setCheckable(true);
|
||||
@@ -546,14 +563,16 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
fMouseZoomInAction->setCheckable(true);
|
||||
shortcutsAction->setCheckable(false);
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperMouse, SIGNAL(mapped(int)),this, SLOT(toggleMouseAction(int)));
|
||||
fSignalMapperMouse->setMapping(fMouseRotateAction,1);
|
||||
fSignalMapperMouse->setMapping(fMouseMoveAction,2);
|
||||
fSignalMapperMouse->setMapping(fMousePickAction,3);
|
||||
fSignalMapperMouse->setMapping(fMouseZoomOutAction,4);
|
||||
fSignalMapperMouse->setMapping(fMouseZoomInAction,5);
|
||||
#endif
|
||||
|
||||
QObject::connect(shortcutsAction,
|
||||
QObject::connect(shortcutsAction,
|
||||
SIGNAL(triggered(bool)),
|
||||
this,
|
||||
SLOT(showShortcuts()));
|
||||
@@ -563,6 +582,7 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
|
||||
QMenu *mProjection = mStyle->addMenu("&Projection");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fProjectionOrtho = mProjection->addAction("Orthographic", fSignalMapperSurface, SLOT(map()));
|
||||
fProjectionPerspective = mProjection->addAction("Persepective", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
@@ -572,10 +592,15 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
} else {
|
||||
createRadioAction(fProjectionOrtho, fProjectionPerspective,SLOT(toggleProjection(bool)),2);
|
||||
}
|
||||
|
||||
#else
|
||||
// no more radioAction, not realy useful and could be confusing to use context menu and icon at the same time
|
||||
fProjectionOrtho = mProjection->addAction("Orthographic", this, [=](){ this->toggleProjection(1); });
|
||||
fProjectionPerspective = mProjection->addAction("Persepective", this, [=](){ this->toggleProjection(2); });
|
||||
#endif
|
||||
// === Drawing Menu ===
|
||||
QMenu *mDrawing = mStyle->addMenu("&Drawing");
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
fDrawingWireframe = mDrawing->addAction("Wireframe", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
fDrawingLineRemoval = mDrawing->addAction("Hidden line removal", fSignalMapperSurface, SLOT(map()));
|
||||
@@ -583,18 +608,25 @@ void G4OpenGLQtViewer::createPopupMenu() {
|
||||
fDrawingSurfaceRemoval = mDrawing->addAction("Hidden Surface removal", fSignalMapperSurface, SLOT(map()));
|
||||
|
||||
fDrawingLineSurfaceRemoval = mDrawing->addAction("Hidden line and surface removal", fSignalMapperSurface, SLOT(map()));
|
||||
#endif
|
||||
|
||||
fDrawingWireframe->setCheckable(true);
|
||||
fDrawingLineRemoval->setCheckable(true);
|
||||
fDrawingSurfaceRemoval->setCheckable(true);
|
||||
fDrawingLineSurfaceRemoval->setCheckable(true);
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperSurface, SIGNAL(mapped(int)),this, SLOT(toggleSurfaceAction(int)));
|
||||
fSignalMapperSurface->setMapping(fDrawingWireframe,1);
|
||||
fSignalMapperSurface->setMapping(fDrawingLineRemoval,2);
|
||||
fSignalMapperSurface->setMapping(fDrawingSurfaceRemoval,3);
|
||||
fSignalMapperSurface->setMapping(fDrawingLineSurfaceRemoval,4);
|
||||
#else
|
||||
fDrawingWireframe = mDrawing->addAction("Wireframe", this, [=](){ this->toggleSurfaceAction(1); });
|
||||
fDrawingLineRemoval = mDrawing->addAction("Hidden line removal", this, [=](){ this->toggleSurfaceAction(2); });
|
||||
fDrawingSurfaceRemoval = mDrawing->addAction("Hidden Surface removal", this, [=](){ this->toggleSurfaceAction(3); });
|
||||
fDrawingLineSurfaceRemoval = mDrawing->addAction("Hidden line and surface removal", this, [=](){ this->toggleSurfaceAction(4); });
|
||||
#endif
|
||||
|
||||
fDrawingWireframe->setCheckable(true);
|
||||
fDrawingLineRemoval->setCheckable(true);
|
||||
fDrawingSurfaceRemoval->setCheckable(true);
|
||||
fDrawingLineSurfaceRemoval->setCheckable(true);
|
||||
|
||||
// Background Color
|
||||
|
||||
@@ -1855,7 +1887,7 @@ void G4OpenGLQtViewer::initMovieParameters() {
|
||||
|
||||
QObject ::connect(fProcess,SIGNAL(finished ( int)),
|
||||
this,SLOT(processLookForFinished()));
|
||||
fProcess->setReadChannelMode(QProcess::MergedChannels);
|
||||
fProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
fProcess->start ("which ppmtompeg");
|
||||
|
||||
}
|
||||
@@ -2171,12 +2203,6 @@ bool G4OpenGLQtViewer::exportImage(std::string name, int width, int height) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool G4OpenGLQtViewer::hasPendingEvents () {
|
||||
return ((QApplication*)G4Qt::getInstance ())->hasPendingEvents ();
|
||||
}
|
||||
|
||||
bool G4OpenGLQtViewer::generateMpegEncoderParameters () {
|
||||
|
||||
// save the parameter file
|
||||
@@ -2344,7 +2370,11 @@ void G4OpenGLQtViewer::encodeVideo()
|
||||
QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
|
||||
this,SLOT(processEncodeStdout()));
|
||||
#endif
|
||||
#if QT_VERSION < 0x050a00
|
||||
fProcess->setReadChannelMode(QProcess::MergedChannels);
|
||||
#else
|
||||
fProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
#endif
|
||||
fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
|
||||
}
|
||||
}
|
||||
@@ -2777,7 +2807,11 @@ void G4OpenGLQtViewer::DrawText(const G4Text& g4text)
|
||||
|
||||
// Calculate move for centre and right adjustment
|
||||
QFontMetrics* f = new QFontMetrics (font);
|
||||
#if QT_VERSION > 0x050110
|
||||
G4double span = f->boundingRect(textCString[0]).width();
|
||||
#else
|
||||
G4double span = f->width(textCString);
|
||||
#endif
|
||||
G4double xmove = 0., ymove = 0.;
|
||||
switch (g4text.GetLayout()) {
|
||||
case G4Text::left: break;
|
||||
@@ -4480,8 +4514,10 @@ void G4OpenGLQtViewer::updatePickInfosWidget(int aX, int aY) {
|
||||
}
|
||||
|
||||
// Create a new signalMapper
|
||||
#if QT_VERSION < 0x050600
|
||||
delete fSignalMapperPicking;
|
||||
fSignalMapperPicking = new QSignalMapper(this);
|
||||
#endif
|
||||
|
||||
// parse all pick results
|
||||
G4int nPickedObjectsWithAttributes = 0;
|
||||
@@ -4544,19 +4580,24 @@ void G4OpenGLQtViewer::updatePickInfosWidget(int aX, int aY) {
|
||||
newStr = QStringList(QString(content.str().c_str()).trimmed());
|
||||
|
||||
QTextEdit* ed = new QTextEdit();
|
||||
ed->setFontFamily("Courier");
|
||||
ed->setFontPointSize(12);
|
||||
ed->setReadOnly(true);
|
||||
fPickInfosWidget->layout()->addWidget(ed);
|
||||
ed->setVisible((false));
|
||||
ed->append(newStr.join(""));
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(pickCoutButton, SIGNAL(clicked()), fSignalMapperPicking, SLOT(map()));
|
||||
fSignalMapperPicking->setMapping(pickCoutButton,fPickInfosWidget->layout()->count()-1);
|
||||
#else
|
||||
std::cout << pickCoutButton->text().toStdString() << " "<< fPickInfosWidget->layout()->count()-1<< std::endl;
|
||||
int tmp = fPickInfosWidget->layout()->count()-1;
|
||||
connect(pickCoutButton, &QPushButton::clicked , [=](){ this->toggleSceneTreeComponentPickingCout(tmp);});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050600
|
||||
connect(fSignalMapperPicking, SIGNAL(mapped(int)),this, SLOT(toggleSceneTreeComponentPickingCout(int)));
|
||||
#endif
|
||||
|
||||
// add a label to push everything up!
|
||||
QLabel * pushUp = new QLabel("");
|
||||
|
||||
@@ -120,28 +120,31 @@ void G4OpenGLSceneHandler::ScaledFlush()
|
||||
// Drawing transients, e.g., trajectories.
|
||||
|
||||
if (!fpScene) {
|
||||
// No scene, so probably not in event loop.
|
||||
// No scene - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
// Get event from modeling parameters
|
||||
if (!fpModel) {
|
||||
// No model, so probably not in event loop
|
||||
// No model - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4ModelingParameters* modelingParameters =
|
||||
fpModel->GetModelingParameters();
|
||||
if (!modelingParameters) {
|
||||
// No modeling parameters, so probably not in event loop.
|
||||
// No modeling parameters - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4Event* thisEvent = modelingParameters->GetEvent();
|
||||
if (!thisEvent) {
|
||||
// No event, so probably not in event loop.
|
||||
glFlush();
|
||||
return;
|
||||
// No event, so not in event loop.
|
||||
if (fFlushAction == endOfEvent) {
|
||||
fFlushAction = endOfRun;
|
||||
} else if (fFlushAction == NthEvent) {
|
||||
fFlushAction = NthPrimitive;
|
||||
}
|
||||
}
|
||||
G4RunManager* runMan = G4RunManager::GetRunManager();
|
||||
#ifdef G4MULTITHREADED
|
||||
@@ -150,13 +153,18 @@ void G4OpenGLSceneHandler::ScaledFlush()
|
||||
}
|
||||
#endif
|
||||
if (!runMan) {
|
||||
// No run manager - shouldn't happen
|
||||
glFlush();
|
||||
return;
|
||||
}
|
||||
const G4Run* thisRun = runMan->GetCurrentRun();
|
||||
if (!thisRun) {
|
||||
glFlush();
|
||||
return;
|
||||
// No run, so not in event loop.
|
||||
if (fFlushAction == endOfRun) {
|
||||
fFlushAction = NthPrimitive;
|
||||
} else if (fFlushAction == NthEvent) {
|
||||
fFlushAction = NthPrimitive;
|
||||
}
|
||||
}
|
||||
|
||||
switch (fFlushAction) {
|
||||
|
||||
@@ -353,7 +353,7 @@ end_of_display_list_reuse_test:
|
||||
"********************* WARNING! ********************"
|
||||
"\n* Display list limit reached in OpenGL."
|
||||
"\n* Continuing drawing WITHOUT STORING. Scene only partially refreshable."
|
||||
"\n* Current limit: " << fDisplayListLimit <<
|
||||
"\n* Current limit: " << fDisplayListLimit << " primitives"
|
||||
". Change with \"/vis/ogl/set/displayListLimit\"."
|
||||
"\n***************************************************"
|
||||
<< G4endl;
|
||||
|
||||
@@ -203,7 +203,7 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
|
||||
fpCommandDisplayListLimit =
|
||||
new G4UIcmdWithAnInteger("/vis/ogl/set/displayListLimit", this);
|
||||
fpCommandDisplayListLimit->SetGuidance
|
||||
("Set/reset display list limit (to avoid memory exhaustion).");
|
||||
("Set/reset display list number of primitive limit (to avoid memory exhaustion).");
|
||||
fpCommandDisplayListLimit->SetParameterName("limit", omitable = true);
|
||||
fpCommandDisplayListLimit->SetDefaultValue(50000);
|
||||
fpCommandDisplayListLimit->SetRange("limit>=10000");
|
||||
|
||||
@@ -190,7 +190,6 @@ void G4OpenGLXViewer::CreateGLXContext (XVisualInfo* v) {
|
||||
// New stab at getting a colormap
|
||||
|
||||
Status status;
|
||||
XStandardColormap *standardCmaps = XAllocStandardColormap ();
|
||||
int i, numCmaps;
|
||||
|
||||
status = XmuLookupStandardColormap (dpy,
|
||||
@@ -203,36 +202,48 @@ void G4OpenGLXViewer::CreateGLXContext (XVisualInfo* v) {
|
||||
|
||||
if (status == 1) {
|
||||
cmap = 0;
|
||||
XStandardColormap* standardCmaps = XAllocStandardColormap ();
|
||||
status = XGetRGBColormaps (dpy,
|
||||
XRootWindow (dpy, vi -> screen),
|
||||
&standardCmaps,
|
||||
&numCmaps,
|
||||
XA_RGB_BEST_MAP);
|
||||
if (status == 1)
|
||||
if (status == 1) {
|
||||
for (i = 0; i < numCmaps; i++) {
|
||||
if (standardCmaps[i].visualid == vi -> visualid) {
|
||||
cmap = standardCmaps[i].colormap;
|
||||
XFree (standardCmaps);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!cmap) {
|
||||
fViewId = -1; // This flags an error.
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cerr <<
|
||||
"G4OpenGLXViewer::G4OpenGLXViewer failed to allocate a standard colormap."
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Got standard cmap" << G4endl;
|
||||
XFree (standardCmaps);
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Got standard cmap" << G4endl;
|
||||
} else {
|
||||
//if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
// G4cerr << "G4OpenGLXViewer::G4OpenGLXViewer failed to allocate a standard colormap."
|
||||
// << G4endl;
|
||||
cmap = XCreateColormap (dpy,
|
||||
XRootWindow(dpy, vi -> screen),
|
||||
vi -> visual,
|
||||
AllocNone);
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
}
|
||||
//G.Barrand : at end, we should do a XFreeColormap(dpy,cmap) when cmap is no more used.
|
||||
}
|
||||
} else {
|
||||
cmap = XCreateColormap (dpy,
|
||||
XRootWindow(dpy, vi -> screen),
|
||||
vi -> visual,
|
||||
AllocNone);
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
if(cmap) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Created own cmap" << G4endl;
|
||||
}
|
||||
//G.Barrand : at end, we should do a XFreeColormap(dpy,cmap) when cmap is no more used.
|
||||
}
|
||||
|
||||
if (!cmap) {
|
||||
@@ -467,10 +478,12 @@ cmap (0)
|
||||
if (!vi_single_buffer) {
|
||||
vi_single_buffer =
|
||||
glXChooseVisual (dpy, XDefaultScreen (dpy), snglBuf_RGBA);
|
||||
//G.Barrand : we should do a XFree(vi_single_buffer) at end;
|
||||
}
|
||||
if (!vi_double_buffer) {
|
||||
vi_double_buffer =
|
||||
glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA);
|
||||
//G.Barrand : we should do a XFree(vi_double_buffer) at end;
|
||||
}
|
||||
|
||||
if (vi_single_buffer || vi_double_buffer) {
|
||||
@@ -531,6 +544,7 @@ G4OpenGLXViewer::~G4OpenGLXViewer () {
|
||||
glXDestroyContext (dpy, cxMaster);
|
||||
if (win) XDestroyWindow (dpy, win); // ...if already deleted in
|
||||
// sub-class G4OpenGLXmViewer.
|
||||
// We should do a XFreeColormap(dpy,cmap); if cmap had been get with XCreateColormap.
|
||||
XFlush (dpy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,10 +247,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
|
||||
menubar = XmVaCreateSimpleMenuBar (main_win,
|
||||
(char*)"menubar",
|
||||
XmVaCASCADEBUTTON, style_str, 'S',
|
||||
XmVaCASCADEBUTTON, actions_str, 'A',
|
||||
XmVaCASCADEBUTTON, misc_str, 'M',
|
||||
XmVaCASCADEBUTTON, spec_str, 'p',
|
||||
XmVaCASCADEBUTTON, style_str, (KeySym)XK_S, /*G.Barrand : cast to KeySym and use XK_*/
|
||||
XmVaCASCADEBUTTON, actions_str, (KeySym)XK_A,
|
||||
XmVaCASCADEBUTTON, misc_str, (KeySym)XK_M,
|
||||
XmVaCASCADEBUTTON, spec_str, (KeySym)XK_p,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -275,8 +275,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"style",
|
||||
0,
|
||||
NULL,
|
||||
XmVaCASCADEBUTTON, draw_str, 'D',
|
||||
XmVaCASCADEBUTTON, bgnd_str, 'B',
|
||||
XmVaCASCADEBUTTON, draw_str, (KeySym)XK_D,
|
||||
XmVaCASCADEBUTTON, bgnd_str, (KeySym)XK_B,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -300,10 +300,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"drawing_style",
|
||||
1,
|
||||
drawing_style_callback,
|
||||
XmVaRADIOBUTTON, wireframe_str, 'W', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlr_str, 'L', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hsr_str, 'S', NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlhsr_str, 'H', NULL, NULL,
|
||||
XmVaRADIOBUTTON, wireframe_str, (KeySym)XK_W, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlr_str, (KeySym)XK_L, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hsr_str, (KeySym)XK_S, NULL, NULL,
|
||||
XmVaRADIOBUTTON, hlhsr_str, (KeySym)XK_H, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -362,8 +362,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"background_color",
|
||||
2,
|
||||
background_color_callback,
|
||||
XmVaRADIOBUTTON, white_str, 'W', NULL, NULL,
|
||||
XmVaRADIOBUTTON, black_str, 'B', NULL, NULL,
|
||||
XmVaRADIOBUTTON, white_str, (KeySym)XK_W, NULL, NULL,
|
||||
XmVaRADIOBUTTON, black_str, (KeySym)XK_B, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -403,9 +403,9 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"actions",
|
||||
1,
|
||||
actions_callback,
|
||||
XmVaPUSHBUTTON, rot_str, 'R', NULL, NULL,
|
||||
XmVaPUSHBUTTON, pan_str, 'P', NULL, NULL,
|
||||
XmVaPUSHBUTTON, set_str, 'S', NULL, NULL,
|
||||
XmVaPUSHBUTTON, rot_str, (KeySym)XK_R, NULL, NULL,
|
||||
XmVaPUSHBUTTON, pan_str, (KeySym)XK_P, NULL, NULL,
|
||||
XmVaPUSHBUTTON, set_str, (KeySym)XK_S, NULL, NULL,
|
||||
XmNuserData, this,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
@@ -429,9 +429,9 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"miscellany",
|
||||
2,
|
||||
misc_callback,
|
||||
XmVaPUSHBUTTON, misc_str, 'M', NULL, NULL,
|
||||
XmVaPUSHBUTTON, exit_str, 'E', NULL, NULL,
|
||||
XmVaPUSHBUTTON, print_str, 'P', NULL, NULL,
|
||||
XmVaPUSHBUTTON, misc_str, (KeySym)XK_M, NULL, NULL,
|
||||
XmVaPUSHBUTTON, exit_str, (KeySym)XK_E, NULL, NULL,
|
||||
XmVaPUSHBUTTON, print_str, (KeySym)XK_P, NULL, NULL,
|
||||
XmNuserData, this,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
@@ -456,10 +456,10 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"special",
|
||||
3,
|
||||
NULL,
|
||||
XmVaCASCADEBUTTON, trans_str, 'T',
|
||||
XmVaCASCADEBUTTON, anti_str, 'A',
|
||||
XmVaCASCADEBUTTON, halo_str, 'H',
|
||||
XmVaCASCADEBUTTON, aux_edge_str, 'E',
|
||||
XmVaCASCADEBUTTON, trans_str, (KeySym)XK_T,
|
||||
XmVaCASCADEBUTTON, anti_str, (KeySym)XK_A,
|
||||
XmVaCASCADEBUTTON, halo_str, (KeySym)XK_H,
|
||||
XmVaCASCADEBUTTON, aux_edge_str, (KeySym)XK_E,
|
||||
XtNvisual, vi -> visual,
|
||||
XtNdepth, vi -> depth,
|
||||
XtNcolormap, cmap,
|
||||
@@ -483,8 +483,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"transparency",
|
||||
0,
|
||||
transparency_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -518,8 +518,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"antialias",
|
||||
1,
|
||||
antialias_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -553,8 +553,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"haloing",
|
||||
2,
|
||||
haloing_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
@@ -588,8 +588,8 @@ void G4OpenGLXmViewer::CreateMainWindow () {
|
||||
(char*)"aux_edge",
|
||||
3,
|
||||
aux_edge_callback,
|
||||
XmVaRADIOBUTTON, off_str, 'f', NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, 'n', NULL, NULL,
|
||||
XmVaRADIOBUTTON, off_str, (KeySym)XK_f, NULL, NULL,
|
||||
XmVaRADIOBUTTON, on_str, (KeySym)XK_n, NULL, NULL,
|
||||
XmNradioBehavior, True,
|
||||
XmNradioAlwaysOne, True,
|
||||
XmNuserData, this,
|
||||
|
||||
Reference in New Issue
Block a user