Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+52 -20
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Scene.cc,v 1.3 1999/05/25 09:14:15 johna Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Scene.cc,v 1.4.4.1 1999/12/07 20:53:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// Scene data John Allison 19th July 1996.
@@ -25,29 +25,39 @@ G4Scene::G4Scene (const G4String& name):
G4Scene::~G4Scene () {}
void G4Scene::AddRunDurationModel (G4VModel* pModel) {
G4bool G4Scene::AddRunDurationModel (G4VModel* pModel) {
G4int i, nModels = fRunDurationModelList.entries ();
for (i = 0; i < nModels; i++) {
if (pModel -> GetGlobalDescription () ==
fRunDurationModelList [i] -> GetGlobalDescription ()) break;
}
if (i < nModels) {
G4cout << "G4Scene::AddRunDurationModel: model \""
<< pModel -> GetGlobalDescription ()
<< "\"\n is already in the run-duration list of scene \""
<< fName
<< "\"."
<< endl;
return false;
}
fRunDurationModelList.append (pModel);
G4int nModels = fRunDurationModelList.entries ();
nModels = fRunDurationModelList.entries (); // ...has increased by 1...
G4BoundingSphereScene boundingSphereScene;
for (int i = 0; i < nModels; i++) {
for (i = 0; i < nModels; i++) {
const G4VisExtent& thisExtent =
fRunDurationModelList[i] -> GetExtent ();
G4Point3D thisCentre = thisExtent.GetExtentCentre ();
G4double thisRadius = thisExtent.GetExtentRadius ();
//thisCentre.transform (fRunDurationModelList[i] -> GetTransformation ());
// To by-pass temporary CLHEP non-const problem...
G4Transform3D modelTransformation =
fRunDurationModelList[i] -> GetTransformation ();
thisCentre.transform (modelTransformation);
thisCentre.transform (fRunDurationModelList[i] -> GetTransformation ());
boundingSphereScene.AccrueBoundingSphere (thisCentre, thisRadius);
}
fExtent = boundingSphereScene.GetBoundingSphereExtent ();
fStandardTargetPoint = fExtent.GetExtentCentre ();
return true;
}
void G4Scene::AddWorldIfEmpty () {
G4bool G4Scene::AddWorldIfEmpty () {
G4bool successful = false;
if (IsEmpty ()) {
G4VPhysicalVolume* pWorld =
G4TransportationManager::GetTransportationManager ()
@@ -64,14 +74,36 @@ void G4Scene::AddWorldIfEmpty () {
" SetVisAttributes (G4VisAttributes::Invisible);"
<< endl;
}
AddRunDurationModel (new G4PhysicalVolumeModel (pWorld));
successful = AddRunDurationModel (new G4PhysicalVolumeModel (pWorld));
// Note: default depth and no modeling parameters.
G4cout <<
"G4Scene::AddWorldIfEmpty: The scene was empty,"
"\n \"world\" has been added.";
G4cout << endl;
if (successful) {
G4cout <<
"G4Scene::AddWorldIfEmpty: The scene was empty,"
"\n \"world\" has been added.";
G4cout << endl;
}
}
}
return successful;
}
G4bool G4Scene::AddEndOfEventModel (G4VModel* pModel) {
G4int i, nModels = fEndOfEventModelList.entries ();
for (i = 0; i < nModels; i++) {
if (pModel -> GetGlobalDescription () ==
fEndOfEventModelList [i] -> GetGlobalDescription ()) break;
}
if (i < nModels) {
G4cout << "G4Scene::AddEndOfEventModel: model \""
<< pModel -> GetGlobalDescription ()
<< "\"\n is already in the run-duration list of scene \""
<< fName
<< "\"."
<< endl;
return false;
}
fEndOfEventModelList.append (pModel);
return true;
}
void G4Scene::Clear () {