#include <G4NavigationHistory.hh>
Public Member Functions | |
G4NavigationHistory () | |
~G4NavigationHistory () | |
G4NavigationHistory (const G4NavigationHistory &h) | |
G4NavigationHistory & | operator= (const G4NavigationHistory &h) |
void | Reset () |
void | Clear () |
void | SetFirstEntry (G4VPhysicalVolume *pVol) |
const G4AffineTransform & | GetTopTransform () const |
const G4AffineTransform * | GetPtrTopTransform () const |
G4int | GetTopReplicaNo () const |
EVolume | GetTopVolumeType () const |
G4VPhysicalVolume * | GetTopVolume () const |
G4int | GetDepth () const |
G4int | GetMaxDepth () const |
const G4AffineTransform & | GetTransform (G4int n) const |
G4int | GetReplicaNo (G4int n) const |
EVolume | GetVolumeType (G4int n) const |
G4VPhysicalVolume * | GetVolume (G4int n) const |
void | NewLevel (G4VPhysicalVolume *pNewMother, EVolume vType=kNormal, G4int nReplica=-1) |
void | BackLevel () |
void | BackLevel (G4int n) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const G4NavigationHistory &h) |
Definition at line 56 of file G4NavigationHistory.hh.
G4NavigationHistory::G4NavigationHistory | ( | ) |
Definition at line 48 of file G4NavigationHistory.cc.
References Clear().
00049 : fNavHistory(kHistoryMax), fStackDepth(0) 00050 { 00051 Clear(); 00052 }
G4NavigationHistory::~G4NavigationHistory | ( | ) |
G4NavigationHistory::G4NavigationHistory | ( | const G4NavigationHistory & | h | ) |
Definition at line 54 of file G4NavigationHistory.cc.
00055 : fNavHistory(h.fNavHistory), fStackDepth(h.fStackDepth) 00056 { 00057 }
void G4NavigationHistory::BackLevel | ( | G4int | n | ) | [inline] |
void G4NavigationHistory::BackLevel | ( | ) | [inline] |
Definition at line 160 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4VoxelNavigation::LevelLocate(), G4ParameterisedNavigation::LevelLocate(), G4NormalNavigation::LevelLocate(), G4Navigator::LocateGlobalPointAndSetup(), G4ITNavigator::LocateGlobalPointAndSetup(), and G4TouchableHistory::MoveUpHistory().
00161 { 00162 assert( fStackDepth>0 ); 00163 00164 // Tell the level that I am forgetting it 00165 // delete fNavHistory(fStackDepth); 00166 // 00167 fStackDepth--; 00168 }
void G4NavigationHistory::Clear | ( | ) | [inline] |
Definition at line 62 of file G4NavigationHistory.icc.
References kNormal, and Reset().
Referenced by G4NavigationHistory().
00063 { 00064 G4AffineTransform origin(G4ThreeVector(0.,0.,0.)); 00065 G4NavigationLevel tmpNavLevel = G4NavigationLevel(0, origin, kNormal, -1) ; 00066 00067 Reset(); 00068 for (register G4int ilev=fNavHistory.size()-1; ilev>=0; ilev--) 00069 { 00070 fNavHistory[ilev] = tmpNavLevel; 00071 } 00072 }
G4int G4NavigationHistory::GetDepth | ( | ) | const [inline] |
Definition at line 123 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), G4Navigator::ComputeStep(), G4RegularNavigation::ComputeStepSkippingEqualMaterials(), G4TouchableHistory::GetHistoryDepth(), G4Navigator::LocateGlobalPointAndSetup(), G4ITNavigator::LocateGlobalPointAndSetup(), G4TouchableHistory::MoveUpHistory(), operator<<(), G4Navigator::SetupHierarchy(), and G4ITNavigator::SetupHierarchy().
G4int G4NavigationHistory::GetMaxDepth | ( | ) | const [inline] |
const G4AffineTransform * G4NavigationHistory::GetPtrTopTransform | ( | ) | const [inline] |
Definition at line 136 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), G4TouchableHistory::GetReplicaNumber(), operator<<(), G4Navigator::SetupHierarchy(), and G4ITNavigator::SetupHierarchy().
00137 { 00138 return fNavHistory[n].GetReplicaNo(); 00139 }
G4int G4NavigationHistory::GetTopReplicaNo | ( | ) | const [inline] |
Definition at line 105 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), G4Navigator::LocateGlobalPointAndSetup(), and G4ITNavigator::LocateGlobalPointAndSetup().
const G4AffineTransform & G4NavigationHistory::GetTopTransform | ( | ) | const [inline] |
Definition at line 99 of file G4NavigationHistory.icc.
Referenced by G4Navigator::ComputeLocalAxis(), G4ITNavigator::ComputeLocalAxis(), G4Navigator::ComputeLocalPoint(), G4ITNavigator::ComputeLocalPoint(), G4ReplicaNavigation::ComputeStep(), G4RegularNavigation::ComputeStep(), G4Navigator::CreateGRSSolid(), G4ITNavigator::CreateGRSSolid(), G4Navigator::CreateGRSVolume(), G4ITNavigator::CreateGRSVolume(), G4TouchableHistory::G4TouchableHistory(), G4Navigator::GetGlobalToLocalTransform(), G4ITNavigator::GetGlobalToLocalTransform(), G4Navigator::GetLocalToGlobalTransform(), G4ITNavigator::GetLocalToGlobalTransform(), G4VoxelNavigation::LevelLocate(), G4RegularNavigation::LevelLocate(), G4ParameterisedNavigation::LevelLocate(), G4NormalNavigation::LevelLocate(), G4Navigator::LocateGlobalPointAndSetup(), G4ITNavigator::LocateGlobalPointAndSetup(), G4Navigator::NetRotation(), G4ITNavigator::NetRotation(), G4Navigator::NetTranslation(), G4ITNavigator::NetTranslation(), and G4TouchableHistory::UpdateYourself().
G4VPhysicalVolume * G4NavigationHistory::GetTopVolume | ( | ) | const [inline] |
Definition at line 117 of file G4NavigationHistory.icc.
Referenced by G4VoxelNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeSafety(), G4ParameterisedNavigation::ComputeSafety(), G4NormalNavigation::ComputeSafety(), G4Navigator::ComputeSafety(), G4ITNavigator::ComputeSafety(), G4VoxelNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), G4RegularNavigation::ComputeStep(), G4ParameterisedNavigation::ComputeStep(), G4NormalNavigation::ComputeStep(), G4Navigator::ComputeStep(), G4ITNavigator::ComputeStep(), G4Navigator::CreateGRSSolid(), G4ITNavigator::CreateGRSSolid(), G4Navigator::CreateGRSVolume(), G4ITNavigator::CreateGRSVolume(), G4Navigator::GetLocalExitNormal(), G4ITNavigator::GetLocalExitNormal(), G4VoxelNavigation::LevelLocate(), G4ReplicaNavigation::LevelLocate(), G4RegularNavigation::LevelLocate(), G4ParameterisedNavigation::LevelLocate(), G4NormalNavigation::LevelLocate(), G4Navigator::LocateGlobalPointAndSetup(), G4ITNavigator::LocateGlobalPointAndSetup(), G4Navigator::LocateGlobalPointWithinVolume(), and G4ITNavigator::LocateGlobalPointWithinVolume().
EVolume G4NavigationHistory::GetTopVolumeType | ( | ) | const [inline] |
Definition at line 111 of file G4NavigationHistory.icc.
Referenced by G4Navigator::ComputeSafety(), G4ITNavigator::ComputeSafety(), G4Navigator::ComputeStep(), G4ITNavigator::ComputeStep(), G4Navigator::LocateGlobalPointAndSetup(), G4ITNavigator::LocateGlobalPointAndSetup(), G4Navigator::LocateGlobalPointWithinVolume(), and G4ITNavigator::LocateGlobalPointWithinVolume().
const G4AffineTransform & G4NavigationHistory::GetTransform | ( | G4int | n | ) | const [inline] |
Definition at line 130 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), G4Navigator::ComputeStep(), G4RegularNavigation::ComputeStepSkippingEqualMaterials(), G4TouchableHistory::GetRotation(), G4TouchableHistory::GetTranslation(), and NewLevel().
00131 { 00132 return fNavHistory[n].GetTransform(); 00133 }
G4VPhysicalVolume * G4NavigationHistory::GetVolume | ( | G4int | n | ) | const [inline] |
Definition at line 148 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), G4TouchableHistory::GetSolid(), G4TouchableHistory::GetVolume(), operator<<(), G4Navigator::SetupHierarchy(), and G4ITNavigator::SetupHierarchy().
00149 { 00150 return fNavHistory[n].GetPhysicalVolume(); 00151 }
Definition at line 142 of file G4NavigationHistory.icc.
Referenced by G4ReplicaNavigation::BackLocate(), G4ReplicaNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeStep(), operator<<(), G4Navigator::SetupHierarchy(), and G4ITNavigator::SetupHierarchy().
00143 { 00144 return fNavHistory[n].GetVolumeType(); 00145 }
void G4NavigationHistory::NewLevel | ( | G4VPhysicalVolume * | pNewMother, | |
EVolume | vType = kNormal , |
|||
G4int | nReplica = -1 | |||
) | [inline] |
Definition at line 192 of file G4NavigationHistory.icc.
References G4VPhysicalVolume::GetRotation(), GetTransform(), and G4VPhysicalVolume::GetTranslation().
Referenced by G4VoxelNavigation::LevelLocate(), G4ReplicaNavigation::LevelLocate(), G4RegularNavigation::LevelLocate(), G4ParameterisedNavigation::LevelLocate(), G4NormalNavigation::LevelLocate(), G4Navigator::LocateGlobalPointAndSetup(), and G4ITNavigator::LocateGlobalPointAndSetup().
00195 { 00196 fStackDepth++; 00197 EnlargeHistory(); // Enlarge if required 00198 fNavHistory[fStackDepth] = 00199 G4NavigationLevel( pNewMother, 00200 fNavHistory[fStackDepth-1].GetTransform(), 00201 G4AffineTransform(pNewMother->GetRotation(), 00202 pNewMother->GetTranslation()), 00203 vType, 00204 nReplica ); 00205 // The constructor computes the new global->local transform 00206 }
G4NavigationHistory & G4NavigationHistory::operator= | ( | const G4NavigationHistory & | h | ) | [inline] |
Definition at line 36 of file G4NavigationHistory.icc.
References fNavHistory, and fStackDepth.
00037 { 00038 if (&h == this) { return *this; } 00039 00040 // fNavHistory=h.fNavHistory; // This works, but is very slow. 00041 00042 if( this->GetMaxDepth() < h.fStackDepth ) 00043 { 00044 fNavHistory.resize( h.fStackDepth ); 00045 } 00046 for ( register G4int ilev=h.fStackDepth; ilev>=0; ilev-- ) 00047 { 00048 fNavHistory[ilev] = h.fNavHistory[ilev]; 00049 } 00050 fStackDepth=h.fStackDepth; 00051 00052 return *this; 00053 }
void G4NavigationHistory::Reset | ( | ) | [inline] |
Definition at line 56 of file G4NavigationHistory.icc.
Referenced by Clear(), G4Navigator::ResetStackAndState(), and G4ITNavigator::ResetStackAndState().
void G4NavigationHistory::SetFirstEntry | ( | G4VPhysicalVolume * | pVol | ) | [inline] |
Definition at line 75 of file G4NavigationHistory.icc.
References G4VPhysicalVolume::GetCopyNo(), G4VPhysicalVolume::GetTranslation(), and kNormal.
Referenced by G4TouchableHistory::G4TouchableHistory(), G4Navigator::SetWorldVolume(), G4ITNavigator::SetWorldVolume(), and G4TouchableHistory::UpdateYourself().
00076 { 00077 G4ThreeVector translation(0.,0.,0.); 00078 G4int copyNo = -1; 00079 00080 // Protection needed in case pVol=null 00081 // so that a touchable-history can signal OutOfWorld 00082 // 00083 if( pVol!=0 ) 00084 { 00085 translation = pVol->GetTranslation(); 00086 copyNo = pVol->GetCopyNo(); 00087 } 00088 fNavHistory[0] = 00089 G4NavigationLevel( pVol, G4AffineTransform(translation), kNormal, copyNo ); 00090 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const G4NavigationHistory & | h | |||
) | [friend] |
Definition at line 64 of file G4NavigationHistory.cc.
00065 { 00066 G4cout << "History depth=" << nav.GetDepth() << G4endl; 00067 for ( G4int i=0; i<=nav.GetDepth(); i++ ) 00068 { 00069 os << "Level=["<<i<<"]: "; 00070 if( nav.GetVolume(i) != 0 ) 00071 { 00072 os << "Phys Name=["<< nav.GetVolume(i)->GetName() 00073 << "] Type=["; 00074 switch(nav.GetVolumeType(i)) 00075 { 00076 case kNormal: 00077 os << "N"; 00078 break; 00079 case kReplica: 00080 os << "R" << nav.GetReplicaNo(i); 00081 break; 00082 case kParameterised: 00083 os << "P" << nav.GetReplicaNo(i); 00084 break; 00085 } 00086 os << "]"; 00087 } 00088 else 00089 { 00090 os << "Phys = <Null>"; 00091 } 00092 os << G4endl; 00093 } 00094 return os; 00095 }