Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4BooleanSolid.cc,v 1.20 2006/06/29 18:43:39 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4BooleanSolid.cc,v 1.21 2006/10/19 15:34:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Implementation for the abstract base class for solids created by boolean
// operations between other solids
@@ -48,8 +48,9 @@
G4BooleanSolid::G4BooleanSolid( const G4String& pName,
G4VSolid* pSolidA ,
G4VSolid* pSolidB ) :
G4VSolid(pName), fCubVolStatistics(1000000), fCubVolEpsilon(0.001),
fCubicVolume(0.), fpPolyhedron(0), createdDisplacedSolid(false)
G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
fAreaAccuracy(-1.), fCubicVolume(0.), fSurfaceArea(0.),
fpPolyhedron(0), createdDisplacedSolid(false)
{
fPtrSolidA = pSolidA ;
fPtrSolidB = pSolidB ;
@@ -64,8 +65,9 @@ G4BooleanSolid::G4BooleanSolid( const G4String& pName,
G4VSolid* pSolidB ,
G4RotationMatrix* rotMatrix,
const G4ThreeVector& transVector ) :
G4VSolid(pName), fCubVolStatistics(1000000), fCubVolEpsilon(0.001),
fCubicVolume(0.), fpPolyhedron(0), createdDisplacedSolid(true)
G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
fAreaAccuracy(-1.), fCubicVolume(0.), fSurfaceArea(0.),
fpPolyhedron(0), createdDisplacedSolid(true)
{
fPtrSolidA = pSolidA ;
fPtrSolidB = new G4DisplacedSolid("placedB",pSolidB,rotMatrix,transVector) ;
@@ -79,8 +81,9 @@ G4BooleanSolid::G4BooleanSolid( const G4String& pName,
G4VSolid* pSolidA ,
G4VSolid* pSolidB ,
const G4Transform3D& transform ) :
G4VSolid(pName), fCubVolStatistics(1000000), fCubVolEpsilon(0.001),
fCubicVolume(0.), fpPolyhedron(0), createdDisplacedSolid(true)
G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
fAreaAccuracy(-1.), fCubicVolume(0.), fSurfaceArea(0.),
fpPolyhedron(0), createdDisplacedSolid(true)
{
fPtrSolidA = pSolidA ;
fPtrSolidB = new G4DisplacedSolid("placedB",pSolidB,transform) ;
@@ -93,8 +96,9 @@ G4BooleanSolid::G4BooleanSolid( const G4String& pName,
G4BooleanSolid::G4BooleanSolid( __void__& a )
: G4VSolid(a), fPtrSolidA(0), fPtrSolidB(0),
fCubVolStatistics(1000000), fCubVolEpsilon(0.001),
fCubicVolume(0.), fpPolyhedron(0), createdDisplacedSolid(false)
fStatistics(1000000), fCubVolEpsilon(0.001),
fAreaAccuracy(-1.), fCubicVolume(0.), fSurfaceArea(0.),
fpPolyhedron(0), createdDisplacedSolid(false)
{
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4DisplacedSolid.cc,v 1.27 2006/06/29 18:43:41 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// GEANT4 tag $Name: geant4-08-02 $
//
// Implementation for G4DisplacedSolid class for boolean
// operations between other solids
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4IntersectionSolid.cc,v 1.27 2006/06/29 18:43:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4IntersectionSolid.cc,v 1.30 2006/11/08 09:37:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -42,6 +42,8 @@
#include "G4IntersectionSolid.hh"
#include <sstream>
#include "G4VoxelLimits.hh"
#include "G4VPVParameterisation.hh"
@@ -501,8 +503,21 @@ G4IntersectionSolid::CreatePolyhedron () const
{
G4Polyhedron* pA = fPtrSolidA->GetPolyhedron();
G4Polyhedron* pB = fPtrSolidB->GetPolyhedron();
G4Polyhedron* resultant = new G4Polyhedron (pA->intersect(*pB));
return resultant;
if (pA && pB)
{
G4Polyhedron* resultant = new G4Polyhedron (pA->intersect(*pB));
return resultant;
}
else
{
std::ostringstream oss;
oss << "Solid - " << GetName()
<< " - one of the Boolean components has no" << G4endl
<< " corresponding polyhedron. Returning NULL !";
G4Exception("G4IntersectionSolid::CreatePolyhedron()", "InvalidSetup",
JustWarning, oss.str().c_str());
return 0;
}
}
/////////////////////////////////////////////////////////
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4SubtractionSolid.cc,v 1.27 2006/06/29 18:43:46 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4SubtractionSolid.cc,v 1.29 2006/11/07 14:05:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -49,6 +49,8 @@
#include "G4NURBS.hh"
// #include "G4NURBSbox.hh"
#include <sstream>
///////////////////////////////////////////////////////////////////
//
// Transfer all data members to G4BooleanSolid which is responsible
@@ -453,8 +455,21 @@ G4SubtractionSolid::CreatePolyhedron () const
{
G4Polyhedron* pA = fPtrSolidA->GetPolyhedron();
G4Polyhedron* pB = fPtrSolidB->GetPolyhedron();
G4Polyhedron* resultant = new G4Polyhedron (pA->subtract(*pB));
return resultant;
if (pA && pB)
{
G4Polyhedron* resultant = new G4Polyhedron (pA->subtract(*pB));
return resultant;
}
else
{
std::ostringstream oss;
oss << "Solid - " << GetName()
<< " - one of the Boolean components has no" << G4endl
<< " corresponding polyhedron. Returning NULL !";
G4Exception("G4SubtractionSolid::CreatePolyhedron()", "InvalidSetup",
JustWarning, oss.str().c_str());
return 0;
}
}
/////////////////////////////////////////////////////////
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4UnionSolid.cc,v 1.31 2006/06/29 18:43:48 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4UnionSolid.cc,v 1.33 2006/11/08 09:37:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -40,6 +40,8 @@
#include "G4UnionSolid.hh"
#include <sstream>
#include "G4VoxelLimits.hh"
#include "G4VPVParameterisation.hh"
@@ -447,8 +449,17 @@ G4UnionSolid::CreatePolyhedron () const
{
G4Polyhedron* pA = fPtrSolidA->GetPolyhedron();
G4Polyhedron* pB = fPtrSolidB->GetPolyhedron();
G4Polyhedron* resultant = new G4Polyhedron (pA->add(*pB));
return resultant;
if (pA && pB) {
G4Polyhedron* resultant = new G4Polyhedron (pA->add(*pB));
return resultant;
} else {
std::ostringstream oss;
oss << GetName() <<
": one of the Boolean components has no corresponding polyhedron.";
G4Exception("G4UnionSolid::CreatePolyhedron",
"", JustWarning, oss.str().c_str());
return 0;
}
}
/////////////////////////////////////////////////////////