Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -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 ||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DisplacedSolid.cc,v 1.23 2005/03/23 17:16:31 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4DisplacedSolid.cc,v 1.26 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Implementation for G4DisplacedSolid class for boolean
|
||||
// operations between other solids
|
||||
@@ -55,7 +55,7 @@ G4DisplacedSolid::G4DisplacedSolid( const G4String& pName,
|
||||
G4VSolid* pSolid ,
|
||||
G4RotationMatrix* rotMatrix,
|
||||
const G4ThreeVector& transVector )
|
||||
: G4VSolid(pName), fpPolyhedron (0)
|
||||
: G4VSolid(pName), fpPolyhedron(0)
|
||||
{
|
||||
fPtrSolid = pSolid ;
|
||||
fPtrTransform = new G4AffineTransform(rotMatrix,transVector) ;
|
||||
@@ -70,7 +70,7 @@ G4DisplacedSolid::G4DisplacedSolid( const G4String& pName,
|
||||
G4DisplacedSolid::G4DisplacedSolid( const G4String& pName,
|
||||
G4VSolid* pSolid ,
|
||||
const G4Transform3D& transform )
|
||||
: G4VSolid(pName), fpPolyhedron (0)
|
||||
: G4VSolid(pName), fpPolyhedron(0)
|
||||
{
|
||||
fPtrSolid = pSolid ;
|
||||
fDirectTransform = new G4AffineTransform(transform.getRotation().inverse(),
|
||||
@@ -89,13 +89,24 @@ G4DisplacedSolid::G4DisplacedSolid( const G4String& pName,
|
||||
G4DisplacedSolid::G4DisplacedSolid( const G4String& pName,
|
||||
G4VSolid* pSolid ,
|
||||
const G4AffineTransform directTransform )
|
||||
: G4VSolid(pName), fpPolyhedron (0)
|
||||
: G4VSolid(pName), fpPolyhedron(0)
|
||||
{
|
||||
fPtrSolid = pSolid ;
|
||||
fDirectTransform = new G4AffineTransform( directTransform );
|
||||
fPtrTransform = new G4AffineTransform( directTransform.Inverse() ) ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fake default constructor - sets only member data and allocates memory
|
||||
// for usage restricted to object persistency.
|
||||
|
||||
G4DisplacedSolid::G4DisplacedSolid( __void__& a )
|
||||
: G4VSolid(a), fPtrSolid(0), fPtrTransform(0),
|
||||
fDirectTransform(0), fpPolyhedron(0)
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Destructor
|
||||
@@ -329,6 +340,18 @@ G4DisplacedSolid::ComputeDimensions( G4VPVParameterisation*,
|
||||
"Method not applicable in this context!");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Returns a point (G4ThreeVector) randomly and uniformly selected
|
||||
// on the solid surface
|
||||
//
|
||||
|
||||
G4ThreeVector G4DisplacedSolid::GetPointOnSurface() const
|
||||
{
|
||||
G4ThreeVector p = fPtrSolid->GetPointOnSurface();
|
||||
return fDirectTransform->TransformPoint(p);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Stream object contents to an output stream
|
||||
@@ -355,7 +378,7 @@ std::ostream& G4DisplacedSolid::StreamInfo(std::ostream& os) const
|
||||
return os;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
@@ -365,7 +388,7 @@ G4DisplacedSolid::DescribeYourselfTo ( G4VGraphicsScene& scene ) const
|
||||
scene.AddSolid (*this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
@@ -378,7 +401,7 @@ G4DisplacedSolid::CreatePolyhedron () const
|
||||
return polyhedron;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
@@ -390,7 +413,7 @@ G4DisplacedSolid::CreateNURBS () const
|
||||
return 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.cc,v 1.24 2005/03/03 16:04:14 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4IntersectionSolid.cc,v 1.25 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -60,7 +60,6 @@ G4IntersectionSolid::G4IntersectionSolid( const G4String& pName,
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
@@ -85,6 +84,20 @@ G4IntersectionSolid::G4IntersectionSolid( const G4String& pName,
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fake default constructor - sets only member data and allocates memory
|
||||
// for usage restricted to object persistency.
|
||||
|
||||
G4IntersectionSolid::G4IntersectionSolid( __void__& a )
|
||||
: G4BooleanSolid(a)
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4IntersectionSolid::~G4IntersectionSolid()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc,v 1.25 2005/05/09 13:44:58 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4SubtractionSolid.cc,v 1.26 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -83,6 +83,15 @@ G4SubtractionSolid::G4SubtractionSolid( const G4String& pName,
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fake default constructor - sets only member data and allocates memory
|
||||
// for usage restricted to object persistency.
|
||||
|
||||
G4SubtractionSolid::G4SubtractionSolid( __void__& a )
|
||||
: G4BooleanSolid(a)
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.cc,v 1.29 2005/05/09 13:44:58 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4UnionSolid.cc,v 1.30 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -83,6 +83,15 @@ G4UnionSolid::G4UnionSolid( const G4String& pName,
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fake default constructor - sets only member data and allocates memory
|
||||
// for usage restricted to object persistency.
|
||||
|
||||
G4UnionSolid::G4UnionSolid( __void__& a )
|
||||
: G4BooleanSolid(a)
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user