00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 inline
00039 G4bool
00040 G4NormalNavigation::LevelLocate( G4NavigationHistory& history,
00041 const G4VPhysicalVolume* blockedVol,
00042 const G4int,
00043 const G4ThreeVector& globalPoint,
00044 const G4ThreeVector* globalDirection,
00045 const G4bool pLocatedOnEdge,
00046 G4ThreeVector &localPoint )
00047 {
00048 G4VPhysicalVolume *targetPhysical, *samplePhysical;
00049 G4LogicalVolume *targetLogical;
00050 G4VSolid *sampleSolid;
00051 G4ThreeVector samplePoint;
00052 G4int targetNoDaughters;
00053
00054 targetPhysical = history.GetTopVolume();
00055 targetLogical = targetPhysical->GetLogicalVolume();
00056 targetNoDaughters = targetLogical->GetNoDaughters();
00057
00058 G4bool found = false;
00059
00060 if (targetNoDaughters!=0)
00061 {
00062
00063
00064
00065 for ( register int sampleNo=targetNoDaughters-1; sampleNo>=0; sampleNo-- )
00066 {
00067 samplePhysical = targetLogical->GetDaughter(sampleNo);
00068 if ( samplePhysical!=blockedVol )
00069 {
00070
00071
00072 history.NewLevel(samplePhysical, kNormal, samplePhysical->GetCopyNo());
00073 sampleSolid = samplePhysical->GetLogicalVolume()->GetSolid();
00074 samplePoint = history.GetTopTransform().TransformPoint(globalPoint);
00075 if( G4AuxiliaryNavServices::
00076 CheckPointOnSurface(sampleSolid, samplePoint, globalDirection,
00077 history.GetTopTransform(), pLocatedOnEdge) )
00078 {
00079
00080
00081 localPoint = samplePoint;
00082 found = true;
00083 break;
00084 }
00085 else
00086 {
00087 history.BackLevel();
00088 }
00089 }
00090 }
00091 }
00092 return found;
00093 }
00094
00095
00096
00097
00098
00099 inline
00100 G4int G4NormalNavigation::GetVerboseLevel() const
00101 {
00102 return fLogger->GetVerboseLevel();
00103 }
00104
00105
00106
00107
00108
00109 inline
00110 void G4NormalNavigation::SetVerboseLevel(G4int level)
00111 {
00112 fLogger->SetVerboseLevel(level);
00113 }
00114
00115
00116
00117
00118
00119 inline
00120 void G4NormalNavigation::CheckMode(G4bool mode)
00121 {
00122 fCheck = mode;
00123 }