Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
$Id: History,v 1.52 2005/05/09 13:46:03 gcosmo Exp $
|
||||
$Id: History,v 1.55 2005/11/09 15:00:43 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,15 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov 09, 2005 G.Cosmo geom-bool-V07-01-01
|
||||
- Added fake default constructor for concrete solids types and relevant
|
||||
utility classes, for usage of direct object persistency.
|
||||
|
||||
Sep 15, 2005 V.Grichine geom-bool-V07-01-00
|
||||
- Added concrete implementation for GetPointOnSurface() to
|
||||
G4BooleanSolid and G4DisplacedSolid.
|
||||
- Updated unit tests testG4DisplacedSolid and testG4IntersectionSolid.
|
||||
|
||||
May 04, 2005 V.Grichine geom-bool-V07-00-03
|
||||
- Make the new implementation of Inside() with surface-normal for
|
||||
edges/vertices the deafult one.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.hh,v 1.11 2004/10/10 10:50:46 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4BooleanSolid.hh,v 1.13 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// class G4BooleanSolid
|
||||
@@ -85,6 +85,14 @@ class G4BooleanSolid : public G4VSolid
|
||||
inline G4double GetCubVolEpsilon() const;
|
||||
inline void SetCubVolStatistics(G4int st);
|
||||
inline void SetCubVolEpsilon(G4double ep);
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
|
||||
public: // without description
|
||||
|
||||
G4BooleanSolid(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.icc,v 1.1 2004/09/22 09:27:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DisplacedSolid.hh,v 1.16 2004/10/10 10:50:48 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4DisplacedSolid.hh,v 1.18 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// class G4DisplacedSolid
|
||||
@@ -101,6 +101,8 @@ class G4DisplacedSolid : public G4VSolid
|
||||
|
||||
void CleanTransformations();
|
||||
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
|
||||
public: // with description
|
||||
|
||||
virtual G4GeometryType GetEntityType() const;
|
||||
@@ -137,6 +139,11 @@ class G4DisplacedSolid : public G4VSolid
|
||||
|
||||
public: // without description
|
||||
|
||||
G4DisplacedSolid(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
void DescribeYourselfTo ( G4VGraphicsScene& scene ) const ;
|
||||
G4Polyhedron* CreatePolyhedron () const ;
|
||||
G4NURBS* CreateNURBS () const ;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.hh,v 1.7 2003/11/03 17:48:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4IntersectionSolid.hh,v 1.8 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// class G4IntersectionSolid
|
||||
@@ -73,6 +73,11 @@ class G4IntersectionSolid : public G4BooleanSolid
|
||||
|
||||
public: // without description
|
||||
|
||||
G4IntersectionSolid(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.hh,v 1.7 2003/11/03 17:48:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4SubtractionSolid.hh,v 1.8 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// class G4SubtractionSolid
|
||||
@@ -73,6 +73,11 @@ class G4SubtractionSolid : public G4BooleanSolid
|
||||
|
||||
public: // without description
|
||||
|
||||
G4SubtractionSolid(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.hh,v 1.8 2003/11/03 17:48:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4UnionSolid.hh,v 1.9 2005/11/09 15:00:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// class G4UnionSolid
|
||||
@@ -72,6 +72,11 @@ class G4UnionSolid : public G4BooleanSolid
|
||||
|
||||
public: // without description
|
||||
|
||||
G4UnionSolid(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
G4bool CalculateExtent( const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
|
||||
@@ -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