Import Geant4 11.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2023-12-08 10:43:34 +01:00
parent dd1f179cda
commit 860a2b92bf
3962 changed files with 139318 additions and 164259 deletions
+15 -1
View File
@@ -6,7 +6,21 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
# 2023-05-31 Ben Morgan (opengl-V11-01-09)
## 2023-09-05 Ben Morgan (opengl-V11-01-13)
- Set AUTOMOC property on module when Qt used.
## 2023-08-14 John Allison (opengl-V11-01-12)
- G4OpenGLQt, G4OpenGLXm:
- Simplify IsUISessionCompatible.
- Exploit new method, G4UImanager::GetBaseSession (intercoms-V11-01-07).
## 2023-07-03 Ben Morgan (opengl-V11-01-11)
- Address Coverity reports 56371, 60839
## 2023-07-01 John Allison (opengl-V11-01-10)
- Fix precision-loss warning.
## 2023-05-31 Ben Morgan (opengl-V11-01-09)
- Remove support for Qt < 5.9
- Clarify remaining version checks using QT_VERSION_CHECK instead of raw hex
- Add inclusion of qdesktopwidget header required by Qt < 5.10
@@ -188,6 +188,8 @@ if(GEANT4_USE_QT)
PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets OpenGL::GL
PRIVATE G4UIimplementation)
geant4_set_module_property(G4OpenGL PROPERTY AUTOMOC ON)
if(QT_VERSION_MAJOR GREATER 5)
geant4_module_link_libraries(G4OpenGL PRIVATE Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
endif()
+4 -24
View File
@@ -46,28 +46,8 @@ G4VGraphicsSystem (name,
G4bool G4OpenGLQt::IsUISessionCompatible () const
{
G4bool isCompatible = false;
G4UImanager* ui = G4UImanager::GetUIpointer();
G4UIsession* session = ui->GetSession();
// If session is a batch session, it may be:
// a) this is a batch job (the user has not instantiated any UI session);
// b) we are currently processing a UI command, in which case the UI
// manager creates a temporary batch session and to find out if there is
// a genuine UI session that the user has instantiated we must drill
// down through previous sessions to a possible non-batch session.
while (G4UIbatch* batch = dynamic_cast<G4UIbatch*>(session)) {
session = batch->GetPreviousSession();
}
// Qt windows are only appropriate in a Qt session.
if (session) {
// If non-zero, this is the originating non-batch session
// The user has instantiated a UI session...
if (dynamic_cast<G4UIQt*>(session)) {
// ...and it's a G4UIQt session, which is OK.
isCompatible = true;
}
}
return isCompatible;
// Qt windows require a Qt session.
G4UIsession* baseSession = G4UImanager::GetUIpointer()->GetBaseSession();
if (dynamic_cast<G4UIQt*>(baseSession) != nullptr) return true;
return false;
}
@@ -60,6 +60,7 @@ G4OpenGLQtExportDialog::G4OpenGLQtExportDialog(
originalHeight = aHeight;
// Initializations
vectorEPSCheckBox = NULL;
qualitySlider = NULL;
width = NULL;
height = NULL;
@@ -1300,7 +1300,7 @@ void G4OpenGLQtViewer::G4MouseReleaseEvent(QMouseEvent *evnt)
float correctionFactor = 5;
while (fAutoMove) {
if ( lastMoveTime.elapsed() >= (int)(1000/fNbMaxFramesPerSec)) {
float lTime = 1000/lastMoveTime.elapsed();
float lTime = 1000.0f/lastMoveTime.elapsed();
if (((((float)delta.x())/correctionFactor)*lTime > fNbMaxAnglePerSec) ||
((((float)delta.x())/correctionFactor)*lTime < -fNbMaxAnglePerSec) ) {
correctionFactor = (float)delta.x()*(lTime/fNbMaxAnglePerSec);
@@ -2332,7 +2332,7 @@ void G4OpenGLQtViewer::encodeVideo()
void G4OpenGLQtViewer::processEncodeStdout()
{
QString tmp = fProcess->readAllStandardOutput ().data();
int start = tmp.lastIndexOf("ESTIMATED TIME");
auto start = tmp.lastIndexOf("ESTIMATED TIME");
tmp = tmp.mid(start,tmp.indexOf("\n",start)-start);
setRecordingInfos(tmp);
}
+4 -21
View File
@@ -45,26 +45,9 @@ G4VGraphicsSystem (name,
G4bool G4OpenGLXm::IsUISessionCompatible () const
{
G4bool isCompatible = false;
G4UImanager* ui = G4UImanager::GetUIpointer();
G4UIsession* session = ui->GetSession();
// If session is a batch session, it may be:
// a) this is a batch job (the user has not instantiated any UI session);
// b) we are currently processing a UI command, in which case the UI
// manager creates a temporary batch session and to find out if there is
// a genuine UI session that the user has instantiated we must drill
// down through previous sessions to a possible non-batch session.
while (G4UIbatch* batch = dynamic_cast<G4UIbatch*>(session)) {
session = batch->GetPreviousSession();
}
// Xm windows are not appropriate in a batch session.
if (session) {
// If non-zero, this is the originating non-batch session
// The user has instantiated a UI session...
isCompatible = true;
}
return isCompatible;
G4UIsession* baseSession = G4UImanager::GetUIpointer()->GetBaseSession();
if (baseSession == nullptr // Pure batch session
|| dynamic_cast<G4UIbatch*>(baseSession) != nullptr) return false;
return true;
}