Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
//
|
||||
// History:
|
||||
//
|
||||
// 12.09.98 V.Grichine
|
||||
// 12.09.98 V.Grichine, implementation
|
||||
// 28.11.98 V.Grichine, J. Apostolakis, while loops in DistToIn/Out
|
||||
// 27.07.99 V.Grichine, modifications in Distance ToOut(p,v,...)
|
||||
// while -> do-while
|
||||
|
||||
#include "G4UnionSolid.hh"
|
||||
// #include "G4PlacedSolid.hh"
|
||||
@@ -94,7 +97,9 @@ G4UnionSolid::CalculateExtent(const EAxis pAxis,
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
// Important comment: When solids A and B touch together along flat
|
||||
// surface the surface points will be considered as kSurface, while points
|
||||
// located around will correspond to kInside
|
||||
|
||||
EInside G4UnionSolid::Inside(const G4ThreeVector& p) const
|
||||
{
|
||||
@@ -197,7 +202,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
G4bool *validNorm,
|
||||
G4ThreeVector *n ) const
|
||||
{
|
||||
G4double disTmp = 0.0, dist = 0.0 ;
|
||||
G4double dist = 0.0, disTmp = 0.0 ;
|
||||
G4ThreeVector normTmp;
|
||||
G4ThreeVector* nTmp= &normTmp;
|
||||
|
||||
@@ -209,46 +214,45 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
{
|
||||
EInside positionA = fPtrSolidA->Inside(p) ;
|
||||
EInside positionB = fPtrSolidB->Inside(p) ;
|
||||
|
||||
|
||||
if( positionA != kOutside )
|
||||
{
|
||||
|
||||
while( Inside(p+dist*v) == kInside )
|
||||
do
|
||||
{
|
||||
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
dist += disTmp ;
|
||||
if( Inside(p+dist*v) == kInside )
|
||||
|
||||
if(fPtrSolidB->Inside(p+dist*v) != kOutside)
|
||||
{
|
||||
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
dist += disTmp ;
|
||||
}
|
||||
else
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
// while( Inside(p+dist*v) == kInside ) ;
|
||||
while( fPtrSolidA->Inside(p+dist*v) != kOutside &&
|
||||
disTmp > 0.5*kCarTolerance ) ;
|
||||
*n = *nTmp ;
|
||||
}
|
||||
else
|
||||
else // if( positionB != kOutside )
|
||||
{
|
||||
while( Inside(p+dist*v) == kInside )
|
||||
do
|
||||
{
|
||||
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
validNorm,nTmp) ;
|
||||
dist += disTmp ;
|
||||
if( Inside(p+dist*v) == kInside )
|
||||
|
||||
if(fPtrSolidA->Inside(p+dist*v) != kOutside)
|
||||
{
|
||||
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
|
||||
validNorm,nTmp) ;
|
||||
dist += disTmp ;
|
||||
}
|
||||
else
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
// while( Inside(p+dist*v) == kInside ) ;
|
||||
while( fPtrSolidB->Inside(p+dist*v) != kOutside &&
|
||||
disTmp > 0.5*kCarTolerance ) ;
|
||||
*n = *nTmp ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user