G4AuxiliaryNavServices Class Reference

#include <G4AuxiliaryNavServices.hh>


Static Public Member Functions

static G4bool CheckPointOnSurface (const G4VSolid *sampleSolid, const G4ThreeVector &localPoint, const G4ThreeVector *globalDirection, const G4AffineTransform &sampleTransform, const G4bool locatedOnEdge)
static G4bool CheckPointExiting (const G4VSolid *sampleSolid, const G4ThreeVector &localPoint, const G4ThreeVector *globalDirection, const G4AffineTransform &sampleTransform)


Detailed Description

Definition at line 47 of file G4AuxiliaryNavServices.hh.


Member Function Documentation

G4bool G4AuxiliaryNavServices::CheckPointExiting ( const G4VSolid sampleSolid,
const G4ThreeVector localPoint,
const G4ThreeVector globalDirection,
const G4AffineTransform sampleTransform 
) [inline, static]

Definition at line 93 of file G4AuxiliaryNavServices.icc.

References G4VSolid::DistanceToIn(), G4VSolid::Inside(), kSurface, G4VSolid::SurfaceNormal(), and G4AffineTransform::TransformAxis().

00097 {
00098   if( !globalDirection )  { return false; }
00099 
00100   G4ThreeVector localDirection, sampleNormal;
00101   G4bool        exiting = false;
00102 
00103   EInside insideSolid = sampleSolid->Inside(localPoint); 
00104   if( insideSolid==kSurface )
00105   {
00106     localDirection= sampleTransform.TransformAxis(*globalDirection); 
00107 
00108     // Check whether we are exiting the volume
00109     // 
00110     sampleNormal = sampleSolid->SurfaceNormal(localPoint);
00111     if ( sampleNormal.dot(localDirection) >= 0 )
00112     {
00113       if( sampleNormal.dot(localDirection) == 0 )
00114       {
00115         // We can't decide yet, let's make sure we're entering the solid.
00116         // If by a confusion we entered the next solid we find out now
00117         // whether to leave or to exiting.
00118         // This happens when we're on the surface or edge shared by two
00119         // solids
00120         //
00121         G4double distanceToIn =
00122                  sampleSolid->DistanceToIn( localPoint, localDirection );
00123         if( distanceToIn != kInfinity )
00124         {
00125           exiting = true;
00126         } 
00127       }
00128       else
00129       {
00130         exiting = true;
00131       }
00132     }
00133   }
00134   return exiting;
00135 }

G4bool G4AuxiliaryNavServices::CheckPointOnSurface ( const G4VSolid sampleSolid,
const G4ThreeVector localPoint,
const G4ThreeVector globalDirection,
const G4AffineTransform sampleTransform,
const G4bool  locatedOnEdge 
) [inline, static]

Definition at line 36 of file G4AuxiliaryNavServices.icc.

References G4VSolid::DistanceToIn(), G4VSolid::Inside(), kOutside, kSurface, G4VSolid::SurfaceNormal(), and G4AffineTransform::TransformAxis().

Referenced by G4VoxelNavigation::LevelLocate(), and G4ParameterisedNavigation::LevelLocate().

00041 {
00042   G4ThreeVector localDirection, sampleNormal;
00043   G4bool        enter = false;
00044 
00045   EInside insideSolid = sampleSolid->Inside(localPoint); 
00046   if ( insideSolid!=kOutside ) 
00047   {
00048     G4bool checkDirection= locatedOnEdge && (globalDirection!=0);
00049     if( (insideSolid==kSurface) && checkDirection)
00050     {
00051       // We are probably located on an edge.
00052       //
00053       localDirection= sampleTransform.TransformAxis(*globalDirection); 
00054 
00055       // Check whether we enter the volume
00056       // 
00057       sampleNormal = sampleSolid->SurfaceNormal(localPoint);
00058       if ( sampleNormal.dot(localDirection) <= 0 )
00059       {
00060         if( sampleNormal.dot(localDirection) == 0 )
00061         {
00062           // We can't decide yet, let's make sure we're entering the solid.
00063           // If by a confusion we entered the next solid we find out now
00064           // whether to leave or to enter.
00065           // This happens when we're on the surface or edge shared by two
00066           // solids
00067           //
00068           G4double distanceToIn =
00069                    sampleSolid->DistanceToIn( localPoint, localDirection );
00070           if( distanceToIn != kInfinity )
00071           {
00072             enter = true;
00073           } 
00074         }
00075         else
00076         {
00077           enter = true;
00078         }
00079       }
00080     }
00081     else
00082     {
00083       enter = true;
00084     }
00085   }
00086   return enter;
00087 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:29 2013 for Geant4 by  doxygen 1.4.7