// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4AuxiliaryNavServices.icc,v 1.2 2003/11/03 17:15:20 gcosmo Exp $ // GEANT4 tag $Name: geant4-06-00-patch-01 $ // // // class G4AuxiliaryNavServices Inline implementation // // -------------------------------------------------------------------- inline G4bool G4AuxiliaryNavServices:: CheckPointOnSurface( const G4VSolid* sampleSolid, const G4ThreeVector& localPoint, const G4ThreeVector* globalDirection, const G4AffineTransform& sampleTransform, const G4bool locatedOnEdge) { G4ThreeVector localDirection, sampleNormal; G4bool enter = false; EInside insideSolid = sampleSolid->Inside(localPoint); if ( insideSolid!=kOutside ) { G4bool checkDirection= locatedOnEdge && (globalDirection!=0); if( (insideSolid==kSurface) && checkDirection) { // We are probably located on an edge. // localDirection= sampleTransform.TransformAxis(*globalDirection); // Check whether we enter the volume // sampleNormal = sampleSolid->SurfaceNormal(localPoint); if ( sampleNormal.dot(localDirection) <= 0 ) { if( sampleNormal.dot(localDirection) == 0 ) { // We can't decide yet, let's make sure we're entering the solid. // If by a confusion we entered the next solid we find out now // whether to leave or to enter. // This happens when we're on the surface or edge shared by two // solids // G4double distanceToIn = sampleSolid->DistanceToIn( localPoint, localDirection ); if( distanceToIn != kInfinity ) { enter = true; } } else { enter = true; } } } else { enter = true; } } return enter; }