Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc,v 1.8 2000/06/26 16:16:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SubtractionSolid.cc,v 1.11 2000/11/20 17:56:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -17,6 +17,8 @@
|
||||
// J.Apostolakis recommendations (while loops)
|
||||
// 02.08.99 V.Grichine, bugs fixed in DistanceToOut(p,v,...)
|
||||
// while -> do-while & surfaceA limitations
|
||||
// 13.09.00 V.Grichine, bug fixed in SurfaceNormal(p), p can be inside
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4SubtractionSolid.hh"
|
||||
@@ -145,16 +147,24 @@ G4SubtractionSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
if( fPtrSolidA->Inside(p) == kSurface &&
|
||||
fPtrSolidB->Inside(p) != kInside )
|
||||
{
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else if( fPtrSolidA->Inside(p) == kInside &&
|
||||
fPtrSolidB->Inside(p) != kOutside )
|
||||
{
|
||||
normal= -fPtrSolidB->SurfaceNormal(p) ;
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("Invalid call in G4SubtractionSolid::SurfaceNormal(p), point p is inside rather than on surface") ;
|
||||
if ( fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToIn(p) )
|
||||
{
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
G4cerr<<"G4SubtractionSolid::SurfaceNormal(p), point p is inside"<<G4endl ;
|
||||
}
|
||||
}
|
||||
return normal;
|
||||
@@ -314,7 +324,7 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
G4double
|
||||
G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
{
|
||||
G4double dist;
|
||||
G4double dist=kInfinity;
|
||||
|
||||
if( Inside(p) == kOutside )
|
||||
{
|
||||
@@ -323,7 +333,7 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
else
|
||||
{
|
||||
dist= G4std::min(fPtrSolidA->DistanceToOut(p),
|
||||
fPtrSolidB->DistanceToIn(p) ) ;
|
||||
fPtrSolidB->DistanceToIn(p) ) ;
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
@@ -332,6 +342,15 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
//
|
||||
//
|
||||
|
||||
G4GeometryType G4SubtractionSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4SubtractionSolid");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void
|
||||
G4SubtractionSolid::ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
|
||||
Reference in New Issue
Block a user