Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4BooleanSolid.cc,v 1.16 2005/04/04 09:44:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4BooleanSolid.cc,v 1.19 2005/11/09 15:00:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Implementation for the abstract base class for solids created by boolean
// operations between other solids
@@ -36,6 +36,7 @@
#include "G4BooleanSolid.hh"
#include "G4VSolid.hh"
#include "G4Polyhedron.hh"
#include "Randomize.hh"
//////////////////////////////////////////////////////////////////
//
@@ -82,6 +83,18 @@ G4BooleanSolid::G4BooleanSolid( const G4String& pName,
fPtrSolidB = new G4DisplacedSolid("placedB",pSolidB,transform) ;
}
///////////////////////////////////////////////////////////////
//
// Fake default constructor - sets only member data and allocates memory
// for usage restricted to object persistency.
G4BooleanSolid::G4BooleanSolid( __void__& a )
: G4VSolid(a), fPtrSolidA(0), fPtrSolidB(0),
fCubVolStatistics(1000000), fCubVolEpsilon(0.001),
fCubicVolume(0.), fpPolyhedron(0), createdDisplacedSolid(false)
{
}
///////////////////////////////////////////////////////////////
//
// Destructor deletes transformation contents of the created displaced solid
@@ -171,6 +184,34 @@ std::ostream& G4BooleanSolid::StreamInfo(std::ostream& os) const
return os;
}
//////////////////////////////////////////////////////////////////////////
//
// Returns a point (G4ThreeVector) randomly and uniformly selected
// on the solid surface
//
G4ThreeVector G4BooleanSolid::GetPointOnSurface() const
{
G4bool condition = true;
G4double rand;
G4ThreeVector p;
while(condition)
{
rand = G4UniformRand();
if(rand > 0.5) { p = fPtrSolidA->GetPointOnSurface(); }
else { p = fPtrSolidB->GetPointOnSurface(); }
if(Inside(p) == kSurface) { break; }
}
return p;
}
//////////////////////////////////////////////////////////////////////////
//
// Returns polyhedron for visualization
G4Polyhedron* G4BooleanSolid::GetPolyhedron () const
{
if (!fpPolyhedron ||