Import Geant4 10.2.0 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
$Id: History 86201 2014-11-07 15:22:50Z gcosmo $
|
||||
$Id: History 93153 2015-10-08 11:54:58Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
October 7, 2015 G.Cosmo geom-bool-V10-01-02
|
||||
- Protected compilation of USolid wrappers with G4GEOM_USE_USOLIDS flag.
|
||||
|
||||
August 13, 2015 G.Cosmo geom-bool-V10-01-01
|
||||
- Checked for potential never-ending loops. Replaced while-do loop with
|
||||
bounded for-loop in G4IntersectionSolid::DistanceToIn(p,v).
|
||||
|
||||
March 3, 2015 G.Cosmo geom-bool-V10-01-00
|
||||
- Use accessors x(), y() and z() from UVector3, instead of directly accessing
|
||||
its data-members. Co-work with tag "geom-usolids-V10-01-09".
|
||||
|
||||
November 7, 2014 G.Cosmo geom-bool-V10-00-09
|
||||
- Fixed Coverity defects in G4UMultiUnion::CreatePolyhedron() for
|
||||
memory leaks.
|
||||
|
||||
@@ -44,6 +44,13 @@
|
||||
|
||||
#include "G4UMultiUnion.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
|
||||
typedef G4UMultiUnion G4MultiUnion;
|
||||
|
||||
#else
|
||||
|
||||
typedef void G4MultiUnion;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
|
||||
#include <CLHEP/Vector/Rotation.h>
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
|
||||
#include "G4USolid.hh"
|
||||
#include "UMultiUnion.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
@@ -116,7 +118,7 @@ inline G4Transform3D* G4UMultiUnion::GetTransformation(G4int index) const
|
||||
rot(CLHEP::HepRep3x3(tr.fRot[0], tr.fRot[1], tr.fRot[2],
|
||||
tr.fRot[3], tr.fRot[4], tr.fRot[5],
|
||||
tr.fRot[6], tr.fRot[7], tr.fRot[8]));
|
||||
G4ThreeVector transl(tr.fTr.x, tr.fTr.y, tr.fTr.z);
|
||||
G4ThreeVector transl(tr.fTr.x(), tr.fTr.y(), tr.fTr.z());
|
||||
|
||||
return new G4Transform3D(rot, transl);
|
||||
}
|
||||
@@ -136,4 +138,7 @@ inline void G4UMultiUnion::Voxelize()
|
||||
{
|
||||
GetShape()->Voxelize();
|
||||
}
|
||||
|
||||
#endif // G4GEOM_USE_USOLIDS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.cc 83572 2014-09-01 15:23:27Z gcosmo $
|
||||
// $Id: G4BooleanSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
|
||||
//
|
||||
// Implementation for the abstract base class for solids created by boolean
|
||||
// operations between other solids
|
||||
@@ -249,7 +249,7 @@ G4ThreeVector G4BooleanSolid::GetPointOnSurface() const
|
||||
G4double rand;
|
||||
G4ThreeVector p;
|
||||
|
||||
do
|
||||
do // Loop checking, 13.08.2015, G.Cosmo
|
||||
{
|
||||
rand = G4UniformRand();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
// $Id: G4IntersectionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -296,7 +296,8 @@ G4IntersectionSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
G4double dB = 0., dB1=0., dB2=0.;
|
||||
G4bool doA = true, doB = true;
|
||||
|
||||
while(true)
|
||||
static const size_t max_trials=10000;
|
||||
for (size_t trial=0; trial<max_trials; ++trial)
|
||||
{
|
||||
if(doA)
|
||||
{
|
||||
@@ -359,6 +360,11 @@ G4IntersectionSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef G4BOOLDEBUG
|
||||
G4Exception("G4IntersectionSolid::DistanceToIn(p,v)",
|
||||
"GeomSolids0001", JustWarning,
|
||||
"Reached maximum number of iterations! Returning zero.");
|
||||
#endif
|
||||
return dist ;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
// $Id: G4SubtractionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -284,7 +284,7 @@ G4SubtractionSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
if( fPtrSolidA->Inside(p+dist*v) != kInside )
|
||||
{
|
||||
G4int count1=0;
|
||||
do
|
||||
do // Loop checking, 13.08.2015, G.Cosmo
|
||||
{
|
||||
disTmp = fPtrSolidA->DistanceToIn(p+dist*v,v) ;
|
||||
|
||||
@@ -377,7 +377,7 @@ G4SubtractionSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
return dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Loop checking, 13.08.2015, G.Cosmo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4UMultiUnion.hh"
|
||||
|
||||
#if defined(G4GEOM_USE_USOLIDS)
|
||||
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4DisplacedSolid.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
@@ -123,3 +126,5 @@ G4Polyhedron* G4UMultiUnion::CreatePolyhedron() const
|
||||
if (processor.execute(*top)) { return top; }
|
||||
else { return 0; }
|
||||
}
|
||||
|
||||
#endif // G4GEOM_USE_USOLIDS
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
// $Id: G4UnionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -345,41 +345,39 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
|
||||
if( positionA != kOutside )
|
||||
{
|
||||
do
|
||||
do // Loop checking, 13.08.2015, G.Cosmo
|
||||
{
|
||||
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
validNorm,nTmp);
|
||||
dist += disTmp ;
|
||||
|
||||
if(fPtrSolidB->Inside(p+dist*v) != kOutside)
|
||||
{
|
||||
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
validNorm,nTmp);
|
||||
dist += disTmp ;
|
||||
}
|
||||
}
|
||||
// while( Inside(p+dist*v) == kInside ) ;
|
||||
while( fPtrSolidA->Inside(p+dist*v) != kOutside &&
|
||||
disTmp > 0.5*kCarTolerance ) ;
|
||||
while( (fPtrSolidA->Inside(p+dist*v) != kOutside)
|
||||
&& (disTmp > 0.5*kCarTolerance) );
|
||||
}
|
||||
else // if( positionB != kOutside )
|
||||
{
|
||||
do
|
||||
do // Loop checking, 13.08.2015, G.Cosmo
|
||||
{
|
||||
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
validNorm,nTmp);
|
||||
dist += disTmp ;
|
||||
|
||||
if(fPtrSolidA->Inside(p+dist*v) != kOutside)
|
||||
{
|
||||
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
validNorm,nTmp);
|
||||
dist += disTmp ;
|
||||
}
|
||||
}
|
||||
// while( Inside(p+dist*v) == kInside ) ;
|
||||
while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
|
||||
&& (disTmp > 0.5*kCarTolerance) ) ;
|
||||
while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
|
||||
&& (disTmp > 0.5*kCarTolerance) );
|
||||
}
|
||||
}
|
||||
if( calcNorm )
|
||||
|
||||
Reference in New Issue
Block a user