source: trunk/source/geometry/navigation/include/G4NormalNavigation.icc@ 1353

Last change on this file since 1353 was 1347, checked in by garnier, 15 years ago

geant4 tag 9.4

File size: 4.5 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
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. *
10// * *
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. *
17// * *
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// ********************************************************************
25//
26//
27// $Id: G4NormalNavigation.icc,v 1.5 2010/11/04 08:57:56 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-04-ref-00 $
29//
30//
31// G4NormalNavigation Inline Implementation
32//
33// --------------------------------------------------------------------
34
35// ********************************************************************
36// LevelLocate
37// ********************************************************************
38//
39inline
40G4bool
41G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
42 const G4VPhysicalVolume* blockedVol,
43 const G4int,
44 const G4ThreeVector& globalPoint,
45 const G4ThreeVector* globalDirection,
46 const G4bool pLocatedOnEdge,
47 G4ThreeVector &localPoint )
48{
49 G4VPhysicalVolume *targetPhysical, *samplePhysical;
50 G4LogicalVolume *targetLogical;
51 G4VSolid *sampleSolid;
52 G4ThreeVector samplePoint;
53 G4int targetNoDaughters;
54
55 targetPhysical = history.GetTopVolume();
56 targetLogical = targetPhysical->GetLogicalVolume();
57 targetNoDaughters = targetLogical->GetNoDaughters();
58
59 G4bool found = false;
60
61 if (targetNoDaughters!=0)
62 {
63 //
64 // Search daughters in volume
65 //
66 for ( register int sampleNo=targetNoDaughters-1; sampleNo>=0; sampleNo-- )
67 {
68 samplePhysical = targetLogical->GetDaughter(sampleNo);
69 if ( samplePhysical!=blockedVol )
70 {
71 // Setup history
72 //
73 history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
74 sampleSolid = samplePhysical->GetLogicalVolume()->GetSolid();
75 samplePoint = history.GetTopTransform().TransformPoint(globalPoint);
76 if( G4AuxiliaryNavServices::
77 CheckPointOnSurface(sampleSolid, samplePoint, globalDirection,
78 history.GetTopTransform(), pLocatedOnEdge) )
79 {
80 // Enter this daughter
81 //
82 localPoint = samplePoint;
83 found = true;
84 break;
85 }
86 else
87 {
88 history.BackLevel();
89 }
90 }
91 }
92 }
93 return found;
94}
95
96// ********************************************************************
97// GetVerboseLevel
98// ********************************************************************
99//
100inline
101G4int G4NormalNavigation::GetVerboseLevel() const
102{
103 return fLogger->GetVerboseLevel();
104}
105
106// ********************************************************************
107// SetVerboseLevel
108// ********************************************************************
109//
110inline
111void G4NormalNavigation::SetVerboseLevel(G4int level)
112{
113 fLogger->SetVerboseLevel(level);
114}
115
116// ********************************************************************
117// CheckMode
118// ********************************************************************
119//
120inline
121void G4NormalNavigation::CheckMode(G4bool mode)
122{
123 fCheck = mode;
124}
Note: See TracBrowser for help on using the repository browser.