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
@@ -25,8 +25,8 @@
//
// Guy Barrand 8th April 2021
#ifndef G4TOOLSSGQTVIEWER_HH
#define G4TOOLSSGQTVIEWER_HH
#ifndef G4TOOLSSGQTGLESVIEWER_HH
#define G4TOOLSSGQTGLESVIEWER_HH
#include "G4ToolsSGViewer.hh"
@@ -55,33 +55,33 @@ private:
G4VViewer* fViewer;
};
class G4ToolsSGQtViewer : public G4ToolsSGViewer<toolx::Qt::session,toolx::Qt::sg_viewer> {
class G4ToolsSGQtGLESViewer : public G4ToolsSGViewer<toolx::Qt::session,toolx::Qt::sg_viewer> {
typedef G4ToolsSGViewer<toolx::Qt::session,toolx::Qt::sg_viewer> parent;
public:
G4ToolsSGQtViewer(toolx::Qt::session& a_session,G4ToolsSGSceneHandler& a_scene_handler, const G4String& a_name)
G4ToolsSGQtGLESViewer(toolx::Qt::session& a_session,G4ToolsSGSceneHandler& a_scene_handler, const G4String& a_name)
:parent(a_session,a_scene_handler,a_name)
,fSGQWidget(nullptr)
,fDestroyCallback(0)
{
fDestroyCallback = new G4ToolsSGQtDestroyCallback(this);
}
virtual ~G4ToolsSGQtViewer() {
virtual ~G4ToolsSGQtGLESViewer() {
delete fDestroyCallback; //it will remove the below signal/slot connection.
}
protected:
G4ToolsSGQtViewer(const G4ToolsSGQtViewer& a_from):parent(a_from){}
G4ToolsSGQtViewer& operator=(const G4ToolsSGQtViewer&) {return *this;}
G4ToolsSGQtGLESViewer(const G4ToolsSGQtGLESViewer& a_from):parent(a_from){}
G4ToolsSGQtGLESViewer& operator=(const G4ToolsSGQtGLESViewer&) {return *this;}
public:
virtual void Initialise() {
if(fSGQWidget) return; //done.
parent::Initialise();
if(!fSGViewer) {
G4cerr << "G4ToolsSGQtViewer::Initialise: ERROR: G4ToolsSGQtViewer has no toolx::Qt::sg_viewer." << G4endl;
G4cerr << "G4ToolsSGQtGLESViewer::Initialise: ERROR: G4ToolsSGQtGLESViewer has no toolx::Qt::sg_viewer." << G4endl;
return;
}
fSGQWidget = fSGViewer->shell();
if (!fSGQWidget) {
G4cerr << "G4ToolsSGQtViewer::Initialise: ERROR: toolx::Qt::sg_viewer has no QWidget shell." << G4endl;
G4cerr << "G4ToolsSGQtGLESViewer::Initialise: ERROR: toolx::Qt::sg_viewer has no QWidget shell." << G4endl;
return;
}
@@ -315,7 +315,7 @@ public:
//
// Only do this if there are end-of-event models (e.g., trajectories) that
// may require it.
if (fSceneHandler.GetScene()->GetEndOfEventModelList().size()) {
if (fSceneHandler.GetScene() && fSceneHandler.GetScene()->GetEndOfEventModelList().size()) {
fNeedKernelVisit = true;
DrawView(); // Draw trajectories, etc., from kept events
}