Import Geant4 8.2.0 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
$Id: History,v 1.56 2006/05/03 10:33:28 gcosmo Exp $
|
||||
$Id: History,v 1.60 2006/11/08 09:39:37 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,22 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov 08, 2006 G.Cosmo geom-bool-V08-01-02
|
||||
- Fixed compilation problems on SUN-CC for changes in the last tag.
|
||||
Added inclusion of <sstream> header in G4IntersectionSolid.cc and
|
||||
G4UnionSolid.cc.
|
||||
|
||||
Nov 06, 2006 J.Allison geom-bool-V08-01-01
|
||||
- G4IntersectionSolid, G4SubtractionSolid, G4UnionSolid:
|
||||
fixed CreatePolyhedron() for case of component that does
|
||||
not have a G4Polyhedron representation.
|
||||
- Added checks for point on boolean surface to unit tests
|
||||
testG4DisplacedSolid and testG4SubtractionSolid (V.Grichine).
|
||||
|
||||
Oct 19, 2006 G.Cosmo geom-bool-V08-01-00
|
||||
- Added GetSurfaceArea() method, accessors and modifiers to base class
|
||||
G4BooleanSolid, implementing the caching mechanism as for volumes.
|
||||
|
||||
May 03, 2006 V.Grichine geom-bool-V08-00-00
|
||||
- Fix in G4IntersectionSolid::CalculateExtent() for the correctly handling
|
||||
extent computation for nested intersections and always respect the rule
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.hh,v 1.14 2006/06/29 18:43:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4BooleanSolid.hh,v 1.15 2006/10/19 15:34:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// class G4BooleanSolid
|
||||
@@ -78,8 +78,10 @@ class G4BooleanSolid : public G4VSolid
|
||||
// return the corresponding solid (for no=0 and 1).
|
||||
// If the solid is not a "Boolean", return 0.
|
||||
|
||||
virtual G4GeometryType GetEntityType() const;
|
||||
inline G4double GetCubicVolume();
|
||||
inline G4double GetSurfaceArea();
|
||||
|
||||
virtual G4GeometryType GetEntityType() const;
|
||||
virtual G4Polyhedron* GetPolyhedron () const;
|
||||
|
||||
std::ostream& StreamInfo(std::ostream& os) const;
|
||||
@@ -88,6 +90,12 @@ class G4BooleanSolid : public G4VSolid
|
||||
inline G4double GetCubVolEpsilon() const;
|
||||
inline void SetCubVolStatistics(G4int st);
|
||||
inline void SetCubVolEpsilon(G4double ep);
|
||||
|
||||
inline G4int GetAreaStatistics() const;
|
||||
inline G4double GetAreaAccuracy() const;
|
||||
inline void SetAreaStatistics(G4int st);
|
||||
inline void SetAreaAccuracy(G4double ep);
|
||||
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
|
||||
public: // without description
|
||||
@@ -110,9 +118,12 @@ class G4BooleanSolid : public G4VSolid
|
||||
|
||||
private:
|
||||
|
||||
G4int fCubVolStatistics;
|
||||
G4int fStatistics;
|
||||
G4double fCubVolEpsilon;
|
||||
G4double fAreaAccuracy;
|
||||
G4double fCubicVolume;
|
||||
G4double fSurfaceArea;
|
||||
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
|
||||
G4bool createdDisplacedSolid;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.icc,v 1.2 2006/06/29 18:43:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4BooleanSolid.icc,v 1.4 2006/10/20 14:20:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
@@ -38,7 +38,7 @@
|
||||
inline
|
||||
G4int G4BooleanSolid::GetCubVolStatistics() const
|
||||
{
|
||||
return fCubVolStatistics;
|
||||
return fStatistics;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -50,21 +50,55 @@ G4double G4BooleanSolid::GetCubVolEpsilon() const
|
||||
inline
|
||||
void G4BooleanSolid::SetCubVolStatistics(G4int st)
|
||||
{
|
||||
fCubVolStatistics=st;
|
||||
fCubicVolume=0.;
|
||||
fStatistics=st;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4BooleanSolid::SetCubVolEpsilon(G4double ep)
|
||||
{
|
||||
fCubicVolume=0.;
|
||||
fCubVolEpsilon=ep;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
inline
|
||||
G4int G4BooleanSolid::GetAreaStatistics() const
|
||||
{
|
||||
return fStatistics;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4BooleanSolid::GetAreaAccuracy() const
|
||||
{
|
||||
return fAreaAccuracy;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4BooleanSolid::SetAreaStatistics(G4int st)
|
||||
{
|
||||
fSurfaceArea=0.;
|
||||
fStatistics=st;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4BooleanSolid::SetAreaAccuracy(G4double ep)
|
||||
{
|
||||
fSurfaceArea=0.;
|
||||
fAreaAccuracy=ep;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4BooleanSolid::GetCubicVolume()
|
||||
{
|
||||
if(fCubicVolume != 0.) ;
|
||||
else fCubicVolume = EstimateCubicVolume(fCubVolStatistics,fCubVolEpsilon);
|
||||
if(fCubicVolume != 0.) {;}
|
||||
else { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); }
|
||||
return fCubicVolume;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4BooleanSolid::GetSurfaceArea()
|
||||
{
|
||||
if(fSurfaceArea != 0.) {;}
|
||||
else { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); }
|
||||
return fSurfaceArea;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DisplacedSolid.hh,v 1.19 2006/06/29 18:43:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// class G4DisplacedSolid
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.hh,v 1.9 2006/06/29 18:43:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// class G4IntersectionSolid
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.hh,v 1.9 2006/06/29 18:43:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// class G4SubtractionSolid
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.hh,v 1.10 2006/06/29 18:43:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// class G4UnionSolid
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user