Import Geant4 10.3.1 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.cc 101046 2016-11-04 10:44:26Z gcosmo $
|
||||
// $Id: G4IntersectionSolid.cc 102530 2017-02-08 13:41:59Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -258,28 +258,22 @@ G4IntersectionSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
}
|
||||
#endif
|
||||
|
||||
// OLD: if(fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToOut(p) )
|
||||
|
||||
// On the surface of both is difficult ... treat it like on A now!
|
||||
//
|
||||
// if( (insideA == kSurface) && (insideB == kSurface) )
|
||||
// normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
// else
|
||||
if( insideA == kSurface )
|
||||
{
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
{
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else if( insideB == kSurface )
|
||||
{
|
||||
normal= fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
// We are on neither surface, so we should generate an exception
|
||||
else
|
||||
{
|
||||
if(fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToOut(p) )
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
else
|
||||
normal= fPtrSolidB->SurfaceNormal(p) ;
|
||||
{
|
||||
normal= fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
else // We are on neither surface, so we should generate an exception
|
||||
{
|
||||
if(fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToOut(p) )
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
else
|
||||
normal= fPtrSolidB->SurfaceNormal(p) ;
|
||||
#ifdef G4BOOLDEBUG
|
||||
G4cout << "WARNING - Invalid call in "
|
||||
<< "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc 101046 2016-11-04 10:44:26Z gcosmo $
|
||||
// $Id: G4SubtractionSolid.cc 102530 2017-02-08 13:41:59Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -221,8 +221,11 @@ G4ThreeVector
|
||||
G4SubtractionSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
{
|
||||
G4ThreeVector normal;
|
||||
EInside insideThis= Inside(p);
|
||||
if( insideThis == kOutside )
|
||||
|
||||
EInside InsideA = fPtrSolidA->Inside(p);
|
||||
EInside InsideB = fPtrSolidB->Inside(p);
|
||||
|
||||
if( InsideA == kOutside )
|
||||
{
|
||||
#ifdef G4BOOLDEBUG
|
||||
G4cout << "WARNING - Invalid call [1] in "
|
||||
@@ -234,46 +237,41 @@ G4SubtractionSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
<< " Point p is outside !" << G4endl;
|
||||
G4cerr << " p = " << p << G4endl;
|
||||
#endif
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
EInside InsideA = fPtrSolidA->Inside(p);
|
||||
EInside InsideB = fPtrSolidB->Inside(p);
|
||||
|
||||
if( InsideA == kSurface &&
|
||||
InsideB != kInside )
|
||||
else if( InsideA == kSurface &&
|
||||
InsideB != kInside )
|
||||
{
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else if( InsideA == kInside &&
|
||||
InsideB != kOutside )
|
||||
{
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToIn(p) )
|
||||
{
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else if( InsideA == kInside &&
|
||||
InsideB != kOutside )
|
||||
else
|
||||
{
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToIn(p) )
|
||||
{
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
#ifdef G4BOOLDEBUG
|
||||
if(insideThis == kInside)
|
||||
{
|
||||
G4cout << "WARNING - Invalid call [2] in "
|
||||
if(Inside(p) == kInside)
|
||||
{
|
||||
G4cout << "WARNING - Invalid call [2] in "
|
||||
<< "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
|
||||
<< " Point p is inside !" << G4endl;
|
||||
G4cout << " p = " << p << G4endl;
|
||||
G4cerr << "WARNING - Invalid call [2] in "
|
||||
G4cout << " p = " << p << G4endl;
|
||||
G4cerr << "WARNING - Invalid call [2] in "
|
||||
<< "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
|
||||
<< " Point p is inside !" << G4endl;
|
||||
G4cerr << " p = " << p << G4endl;
|
||||
}
|
||||
#endif
|
||||
G4cerr << " p = " << p << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return normal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user