2 // ********************************************************************
3 // * License and Disclaimer *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
27 // $Id: G4NormalNavigation.icc 90009 2015-05-08 07:42:39Z gcosmo $
30 // G4NormalNavigation Inline Implementation
32 // --------------------------------------------------------------------
34 // ********************************************************************
36 // ********************************************************************
39 void G4NormalNavigation::CheckMode(G4bool mode)
44 // ********************************************************************
46 // ********************************************************************
50 G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
51 const G4VPhysicalVolume* blockedVol,
53 const G4ThreeVector& globalPoint,
54 const G4ThreeVector* globalDirection,
55 const G4bool pLocatedOnEdge,
56 G4ThreeVector &localPoint )
58 G4VPhysicalVolume *targetPhysical, *samplePhysical;
59 G4LogicalVolume *targetLogical;
60 G4VSolid *sampleSolid;
61 G4ThreeVector samplePoint;
62 G4int targetNoDaughters;
64 targetPhysical = history.GetTopVolume();
65 targetLogical = targetPhysical->GetLogicalVolume();
66 targetNoDaughters = targetLogical->GetNoDaughters();
70 if (targetNoDaughters!=0)
73 // Search daughters in volume
75 for ( G4int sampleNo=targetNoDaughters-1; sampleNo>=0; sampleNo-- )
77 samplePhysical = targetLogical->GetDaughter(sampleNo);
78 if ( samplePhysical!=blockedVol )
82 history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
83 sampleSolid = samplePhysical->GetLogicalVolume()->GetSolid();
84 samplePoint = history.GetTopTransform().TransformPoint(globalPoint);
85 if( G4AuxiliaryNavServices::
86 CheckPointOnSurface(sampleSolid, samplePoint, globalDirection,
87 history.GetTopTransform(), pLocatedOnEdge) )
89 // Enter this daughter
91 localPoint = samplePoint;