Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BoundingSphereScene.cc,v 1.3 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4BoundingSphereScene.cc,v 1.4 2000/05/15 11:09:32 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 7th June 1997
@@ -24,6 +24,12 @@ G4BoundingSphereScene::G4BoundingSphereScene ():
G4BoundingSphereScene::~G4BoundingSphereScene () {}
void G4BoundingSphereScene::PreAddThis
(const G4Transform3D& objectTransformation,
const G4VisAttributes&) {
fpObjectTransformation = &objectTransformation;
}
G4VisExtent G4BoundingSphereScene::GetBoundingSphereExtent () {
return G4VisExtent (fCentre, fRadius);
}
@@ -73,3 +79,4 @@ void G4BoundingSphereScene::AccrueBoundingSphere
}
}
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FlavoredParallelWorldModel.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
// P. Mora de Freitas et M.Verderi - 19 June 1998.
// Model for flavored parallel world volumes.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4HitsModel.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 26th August 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LogicalVolumeModel.cc,v 1.4 2000/01/17 10:34:48 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4LogicalVolumeModel.cc,v 1.5 2000/04/12 13:02:40 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 26th July 1999.
@@ -66,7 +66,7 @@ void G4LogicalVolumeModel::DescribeYourselfTo
G4PhysicalVolumeModel::DescribeYourselfTo (sceneHandler);
fpMP = tpMP;
if (fpTopPV -> GetLogicalVolume () -> GetVoxelHeader ()) {
if (fpTopPV->GetLogicalVolume()->GetVoxelHeader()) {
// Add Voxels.
G4DrawVoxels dv;
G4PlacedPolyhedronList* pPPL =
@@ -81,3 +81,31 @@ void G4LogicalVolumeModel::DescribeYourselfTo
delete pPPL;
}
}
// This called from G4PhysicalVolumeModel::DescribeAndDescend by the
// virtual function mechanism.
void G4LogicalVolumeModel::DescribeSolid
(const G4Transform3D& theAT,
G4VSolid* pSol,
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler) {
// Look for "constituents". Could be a Boolean solid.
G4VSolid* pSol0 = pSol -> GetConstituentSolid (0);
if (pSol0) { // Composite solid...
G4VSolid* pSol1 = pSol -> GetConstituentSolid (1);
if (!pSol1) {
G4Exception
("G4PhysicalVolumeModel::DescribeSolid:"
" 2nd component solid is missing.");
}
// Draw these constituents white and "forced wireframe"...
G4VisAttributes constituentAttributes;
constituentAttributes.SetForceWireframe(true);
DescribeSolid (theAT, pSol0, &constituentAttributes, sceneHandler);
DescribeSolid (theAT, pSol1, &constituentAttributes, sceneHandler);
}
// In any case draw the original/resultant solid...
sceneHandler.PreAddThis (theAT, *pVisAttribs);
pSol -> DescribeYourselfTo (sceneHandler);
sceneHandler.PostAddThis ();
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ModelingParameters.cc,v 1.4 1999/12/15 14:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 31st December 1997.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4NullModel.cc,v 1.3 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 4th April 1998.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicalVolumeModel.cc,v 1.8 2000/01/11 17:19:07 johna Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PhysicalVolumeModel.cc,v 1.11 2000/05/29 09:59:15 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 31st December 1997.
@@ -20,8 +20,6 @@
#include "G4VPVParameterisation.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4BooleanSolid.hh"
#include "G4DisplacedSolid.hh"
#include "G4Material.hh"
#include "G4VisAttributes.hh"
#include "G4BoundingSphereScene.hh"
@@ -158,14 +156,6 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
// local variables to preserve re-entrancy.
G4LogicalVolume* pLV = pVPV -> GetLogicalVolume ();
// Maintain data members and store in working space (via pointers to
// working space).
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
fpCurrentPV = pVPV;
fpCurrentLV = pLV;
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
G4VSolid* pSol;
G4Material* pMaterial;
@@ -191,7 +181,7 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
pMaterial = pP -> ComputeMaterial (n, pVPV);
pP -> ComputeTransformation (n, pVPV);
pSol -> ComputeDimensions (pP, n, pVPV);
pVPV -> SetCopyNo (n);
// pVPV -> SetCopyNo (n); // Uncertain of effect of this.
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial,
theAT, sceneHandler);
}
@@ -249,7 +239,8 @@ void G4PhysicalVolumeModel::VisitGeometryAndGetVisReps
}
pVPV -> SetTranslation (translation);
pVPV -> SetRotation (pRotation);
pVPV -> SetCopyNo (n);
// pVPV -> SetCopyNo (n); // Has no effect and might even be
// dangerous.
pSol = pLV -> GetSolid ();
pMaterial = pLV -> GetMaterial ();
DescribeAndDescend (pVPV, soughtDepth, pLV, pSol, pMaterial,
@@ -270,6 +261,14 @@ void G4PhysicalVolumeModel::DescribeAndDescend
const G4Transform3D& theAT,
G4VGraphicsScene& sceneHandler) {
// Maintain data members and store in working space (via pointers to
// working space).
if (fpCurrentDepth) *fpCurrentDepth = fCurrentDepth;
fpCurrentPV = pVPV;
fpCurrentLV = pLV;
if (fppCurrentPV) *fppCurrentPV = fpCurrentPV;
if (fppCurrentLV) *fppCurrentLV = fpCurrentLV;
const HepRotation* pObjectRotation = pVPV -> GetObjectRotation ();
const Hep3Vector& translation = pVPV -> GetTranslation ();
G4Transform3D theLT (G4Transform3D (*pObjectRotation, translation));
@@ -338,34 +337,9 @@ void G4PhysicalVolumeModel::DescribeSolid
G4VSolid* pSol,
const G4VisAttributes* pVisAttribs,
G4VGraphicsScene& sceneHandler) {
// Look for "constituents". Could be a Boolean solid.
G4VSolid* pSol0 = pSol -> GetConstituentSolid (0);
if (pSol0) {
// Composite solid - describe components...
DescribeSolid (theAT, pSol0, pVisAttribs, sceneHandler);
G4VSolid* pSol1 = pSol -> GetConstituentSolid (1);
if (!pSol1) {
G4Exception
("G4PhysicalVolumeModel::DescribeSolid:"
" 2nd component solid is missing.");
}
DescribeSolid (theAT, pSol1, pVisAttribs, sceneHandler);
}
else { // Non-composite solid.
G4DisplacedSolid* pDisSol = pSol -> GetDisplacedSolidPtr ();
if (pDisSol) {
sceneHandler.PreAddThis
(theAT *
G4Transform3D (pDisSol -> GetObjectRotation ().inverse (),
pDisSol -> GetObjectTranslation ()),
*pVisAttribs);
}
else {
sceneHandler.PreAddThis (theAT, *pVisAttribs);
}
pSol -> DescribeYourselfTo (sceneHandler);
sceneHandler.PostAddThis ();
}
sceneHandler.PreAddThis (theAT, *pVisAttribs);
pSol -> DescribeYourselfTo (sceneHandler);
sceneHandler.PostAddThis ();
}
G4bool G4PhysicalVolumeModel::IsThisCulled (const G4LogicalVolume* pLV,
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4PhysicalVolumeSearchScene.cc,v 1.4 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 10th August 1998.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4TrajectoriesModel.cc,v 1.6 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 26th August 1998.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VModel.cc,v 1.4 1999/12/15 14:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 31st December 1997.
@@ -0,0 +1,43 @@
// This code implementation is the intellectual property of
// 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: G4VTreeGraphicsScene.cc,v 1.1 2000/05/22 07:39:41 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// John Allison 18th May 2000
// An artificial graphics scene to find dump geometry hierarchy.
#include "G4VTreeGraphicsScene.hh"
#include "G4VSolid.hh"
#include "G4Vector3D.hh"
#include "G4PhysicalVolumeModel.hh"
G4VTreeGraphicsScene::G4VTreeGraphicsScene():
fCurrentDepth (0),
fpCurrentPV (0),
fpCurrentLV (0),
fpCurrentObjectTransformation (0)
{}
G4VTreeGraphicsScene::~G4VTreeGraphicsScene () {}
void G4VTreeGraphicsScene::EstablishSpecials
(G4PhysicalVolumeModel& pvModel) {
pvModel.DefinePointersToWorkingSpace (&fCurrentDepth,
&fpCurrentPV,
&fpCurrentLV);
}
void G4VTreeGraphicsScene::Dump (const G4VSolid& solid) {
for (G4int i = 0; i < fCurrentDepth; i++ ) G4cout << " ";
G4cout << "\"" << fpCurrentPV -> GetName ()
<< "\", copy no. " << fpCurrentPV -> GetCopyNo ()
<< G4endl;
return;
}