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
@@ -27,7 +27,7 @@
#include "G4ToolsSGQtGLES.hh"
#include "G4ToolsSGQtViewer.hh"
#include "G4ToolsSGQtGLESViewer.hh"
#include "G4Qt.hh"
@@ -72,7 +72,7 @@ G4VSceneHandler* G4ToolsSGQtGLES::CreateSceneHandler(const G4String& a_name) {
G4VViewer* G4ToolsSGQtGLES::CreateViewer(G4VSceneHandler& a_scene,const G4String& a_name) {
if(!fSGSession) Initialise();
if(!fSGSession) return nullptr;
G4VViewer* pView = new G4ToolsSGQtViewer(*fSGSession,(G4ToolsSGSceneHandler&)a_scene,a_name);
G4VViewer* pView = new G4ToolsSGQtGLESViewer(*fSGSession,(G4ToolsSGSceneHandler&)a_scene,a_name);
if (pView) {
if (pView->GetViewId() < 0) {
G4cerr << "G4ToolsSGQtGLES::CreateViewer:"
@@ -91,25 +91,8 @@ G4VViewer* G4ToolsSGQtGLES::CreateViewer(G4VSceneHandler& a_scene,const G4String
G4bool G4ToolsSGQtGLES::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.
// This is the originating non-batch 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;
}
@@ -24,6 +24,6 @@
// ********************************************************************
//
#include "G4ToolsSGQtViewer.hh"
#include "moc_G4ToolsSGQtViewer.cpp"
#include "G4ToolsSGQtGLESViewer.hh"
#include "moc_G4ToolsSGQtGLESViewer.cpp"
@@ -91,25 +91,8 @@ G4VViewer* G4ToolsSGQtZB::CreateViewer(G4VSceneHandler& a_scene,const G4String&
G4bool G4ToolsSGQtZB::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.
// This is the originating non-batch 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;
}