Import Geant4 6.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:41:53 +02:00
parent 4aea781e80
commit 96686e0c8f
6560 changed files with 153347 additions and 238155 deletions
+33 -14
View File
@@ -23,6 +23,9 @@
//
/**
* We allow only one HepRep Scene handler and one attached Viewer.
* The sceneHandler associates with the output file
*
* @author Mark Donszelmann
*/
@@ -30,37 +33,53 @@
#include "G4Types.hh"
#include "G4HepRepViewer.hh"
#include "G4HepRepSceneHandler.hh"
#include "G4HepRepMessenger.hh"
//This
#include "G4HepRep.hh"
using namespace HEPREP;
using namespace std;
G4HepRep::G4HepRep ()
: G4VGraphicsSystem ("G4HepRep",
"HepRepXML",
"HepRep Generic Driver for XML, RMI and CORBA",
G4VGraphicsSystem::threeD) {
"HepRep Generic Driver for XML, RMI and CORBA",
G4VGraphicsSystem::threeD),
sceneHandler(NULL),
viewer(NULL) {
messenger = new G4HepRepMessenger();
}
G4HepRep::~G4HepRep () {
delete messenger;
}
G4VSceneHandler* G4HepRep::CreateSceneHandler (const G4String& name) {
G4HepRepSceneHandler* scene = new G4HepRepSceneHandler (*this, name);
return scene;
if (sceneHandler != NULL) {
cout << "G4HepRep::CreateSceneHandler: Cannot create more than one G4HepRepSceneHandler" << endl;
return NULL;
}
sceneHandler = new G4HepRepSceneHandler (*this, *messenger, name);
return sceneHandler;
}
G4VViewer* G4HepRep::CreateViewer (G4VSceneHandler& scene, const G4String& name) {
G4VViewer* view = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, name);
if (view) {
if (view->GetViewId() < 0) {
G4cout << "G4HepRep::CreateViewer: ERROR flagged by negative view ID." << G4endl;
delete view;
view = NULL;
}
} else {
G4cout << "G4HepRep::CreateViewer: null pointer on new G4HepRepViewer." << G4endl;
if (viewer != NULL) {
cout << "G4HepRep::CreateViewer: Cannot create more than one G4HepRepViewer" << endl;
return NULL;
}
return view;
viewer = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, name);
return viewer;
}
void G4HepRep::removeSceneHandler() {
// actual deletion is done in VisManager
sceneHandler = NULL;
}
void G4HepRep::removeViewer() {
// actual deletion is done in VisManager
viewer = NULL;
}