G4NavigationHistory Class Reference

#include <G4NavigationHistory.hh>


Public Member Functions

 G4NavigationHistory ()
 ~G4NavigationHistory ()
 G4NavigationHistory (const G4NavigationHistory &h)
G4NavigationHistoryoperator= (const G4NavigationHistory &h)
void Reset ()
void Clear ()
void SetFirstEntry (G4VPhysicalVolume *pVol)
const G4AffineTransformGetTopTransform () const
const G4AffineTransformGetPtrTopTransform () const
G4int GetTopReplicaNo () const
EVolume GetTopVolumeType () const
G4VPhysicalVolumeGetTopVolume () const
G4int GetDepth () const
G4int GetMaxDepth () const
const G4AffineTransformGetTransform (G4int n) const
G4int GetReplicaNo (G4int n) const
EVolume GetVolumeType (G4int n) const
G4VPhysicalVolumeGetVolume (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)


Detailed Description

Definition at line 56 of file G4NavigationHistory.hh.


Constructor & Destructor Documentation

G4NavigationHistory::G4NavigationHistory (  ) 

Definition at line 48 of file G4NavigationHistory.cc.

References Clear().

00049   : fNavHistory(kHistoryMax), fStackDepth(0)
00050 {
00051   Clear();
00052 }

G4NavigationHistory::~G4NavigationHistory (  ) 

Definition at line 59 of file G4NavigationHistory.cc.

00060 {
00061 }

G4NavigationHistory::G4NavigationHistory ( const G4NavigationHistory h  ) 

Definition at line 54 of file G4NavigationHistory.cc.

00055   : fNavHistory(h.fNavHistory), fStackDepth(h.fStackDepth)
00056 {
00057 }


Member Function Documentation

void G4NavigationHistory::BackLevel ( G4int  n  )  [inline]

Definition at line 171 of file G4NavigationHistory.icc.

00172 {
00173   assert( n<=fStackDepth );
00174   fStackDepth-=n;
00175 }

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().

00124 {
00125   return fStackDepth;
00126 }

G4int G4NavigationHistory::GetMaxDepth (  )  const [inline]

Definition at line 154 of file G4NavigationHistory.icc.

00155 {
00156   return fNavHistory.size();
00157 }

const G4AffineTransform * G4NavigationHistory::GetPtrTopTransform (  )  const [inline]

Definition at line 93 of file G4NavigationHistory.icc.

00094 {
00095   return fNavHistory[fStackDepth].GetPtrTransform();
00096 }

G4int G4NavigationHistory::GetReplicaNo ( G4int  n  )  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().

00106 {
00107   return fNavHistory[fStackDepth].GetReplicaNo();
00108 }

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().

00100 {
00101   return fNavHistory[fStackDepth].GetTransform();
00102 }

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().

00118 {
00119   return fNavHistory[fStackDepth].GetPhysicalVolume();
00120 }

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().

00112 {
00113   return fNavHistory[fStackDepth].GetVolumeType();
00114 }

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 }

EVolume G4NavigationHistory::GetVolumeType ( G4int  n  )  const [inline]

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().

00057 {
00058   fStackDepth=0;
00059 }

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 }


Friends And Related Function Documentation

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 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:33 2013 for Geant4 by  doxygen 1.4.7