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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /geometry/management/include/G4NavigationHistory.icc (Version 11.3.0) and /geometry/management/include/G4NavigationHistory.icc (Version 9.6.p3)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 // class G4NavigationHistory Inline implementa    
 27 //                                                
 28 // -------------------------------------------    
 29                                                   
 30 extern G4GEOM_DLL G4Allocator<G4NavigationHist    
 31                                                   
 32 // There is no provision that this class is su    
 33 // If it is subclassed & new data members are     
 34 // following "new" & "delete" will fail and gi    
 35 //                                                
 36 inline                                            
 37 void* G4NavigationHistory::operator new(std::s    
 38 {                                                 
 39   if (aNavigHistoryAllocator() == nullptr)        
 40   {                                               
 41     aNavigHistoryAllocator() = new G4Allocator    
 42   }                                               
 43   return (void *) aNavigHistoryAllocator()->Ma    
 44 }                                                 
 45                                                   
 46 inline                                            
 47 void G4NavigationHistory::operator delete(void    
 48 {                                                 
 49   aNavigHistoryAllocator()->FreeSingle((G4Navi    
 50 }                                                 
 51                                                   
 52 inline                                            
 53 G4NavigationHistory&                              
 54 G4NavigationHistory::operator=(const G4Navigat    
 55 {                                                 
 56   if (&h == this)  { return *this; }              
 57                                                   
 58   // *fNavHistory=*(h.fNavHistory);   // This     
 59                                                   
 60   if( GetMaxDepth() != h.GetMaxDepth() )          
 61   {                                               
 62     fNavHistory->resize( h.GetMaxDepth() );       
 63   }                                               
 64                                                   
 65   for ( auto  ilev=G4int(h.fStackDepth); ilev>    
 66   {                                               
 67     (*fNavHistory)[ilev] = (*h.fNavHistory)[il    
 68   }                                               
 69   fStackDepth = h.fStackDepth;                    
 70                                                   
 71   return *this;                                   
 72 }                                                 
 73                                                   
 74 inline                                            
 75 void G4NavigationHistory::Reset()                 
 76 {                                                 
 77   fStackDepth=0;                                  
 78 }                                                 
 79                                                   
 80 inline                                            
 81 void G4NavigationHistory::Clear()                 
 82 {                                                 
 83   G4AffineTransform origin(G4ThreeVector(0.,0.    
 84   G4NavigationLevel tmpNavLevel = G4Navigation    
 85                                                   
 86   Reset();                                        
 87   for (auto  ilev=G4long(fNavHistory->size()-1    
 88   {                                               
 89      (*fNavHistory)[ilev] = tmpNavLevel;          
 90   }                                               
 91 }                                                 
 92                                                   
 93 inline                                            
 94 void G4NavigationHistory::SetFirstEntry(G4VPhy    
 95 {                                                 
 96   G4ThreeVector translation(0.,0.,0.);            
 97   G4int copyNo = -1;                              
 98                                                   
 99   // Protection needed in case pVol=null          
100   // so that a touchable-history can signal Ou    
101   //                                              
102   if( pVol != nullptr )                           
103   {                                               
104     translation = pVol->GetTranslation();         
105     copyNo = pVol->GetCopyNo();                   
106   }                                               
107   (*fNavHistory)[0] =                             
108     G4NavigationLevel( pVol, G4AffineTransform    
109 }                                                 
110                                                   
111 inline                                            
112 const G4AffineTransform* G4NavigationHistory::    
113 {                                                 
114   return (*fNavHistory)[fStackDepth].GetPtrTra    
115 }                                                 
116                                                   
117 inline                                            
118 const G4AffineTransform& G4NavigationHistory::    
119 {                                                 
120   return (*fNavHistory)[fStackDepth].GetTransf    
121 }                                                 
122                                                   
123 inline                                            
124 G4int G4NavigationHistory::GetTopReplicaNo() c    
125 {                                                 
126   return (*fNavHistory)[fStackDepth].GetReplic    
127 }                                                 
128                                                   
129 inline                                            
130 EVolume G4NavigationHistory::GetTopVolumeType(    
131 {                                                 
132   return (*fNavHistory)[fStackDepth].GetVolume    
133 }                                                 
134                                                   
135 inline                                            
136 G4VPhysicalVolume* G4NavigationHistory::GetTop    
137 {                                                 
138   return (*fNavHistory)[fStackDepth].GetPhysic    
139 }                                                 
140                                                   
141 inline                                            
142 std::size_t G4NavigationHistory::GetDepth() co    
143 {                                                 
144   return fStackDepth;                             
145 }                                                 
146                                                   
147 inline                                            
148 const G4AffineTransform&                          
149 G4NavigationHistory::GetTransform(G4int n) con    
150 {                                                 
151   return (*fNavHistory)[n].GetTransform();        
152 }                                                 
153                                                   
154 inline                                            
155 G4int G4NavigationHistory::GetReplicaNo(G4int     
156 {                                                 
157   return (*fNavHistory)[n].GetReplicaNo();        
158 }                                                 
159                                                   
160 inline                                            
161 EVolume G4NavigationHistory::GetVolumeType(G4i    
162 {                                                 
163   return (*fNavHistory)[n].GetVolumeType();       
164 }                                                 
165                                                   
166 inline                                            
167 G4VPhysicalVolume* G4NavigationHistory::GetVol    
168 {                                                 
169   return (*fNavHistory)[n].GetPhysicalVolume()    
170 }                                                 
171                                                   
172 inline                                            
173 std::size_t G4NavigationHistory::GetMaxDepth()    
174 {                                                 
175   return fNavHistory->size();                     
176 }                                                 
177                                                   
178 inline                                            
179 void G4NavigationHistory::BackLevel()             
180 {                                                 
181   assert( fStackDepth>0 );                        
182                                                   
183   // Tell  the  level  that I am forgetting it    
184   // delete (*fNavHistory)[fStackDepth];          
185   //                                              
186   --fStackDepth;                                  
187 }                                                 
188                                                   
189 inline                                            
190 void G4NavigationHistory::BackLevel(G4int n)      
191 {                                                 
192   assert( n<=G4int(fStackDepth) );                
193   fStackDepth-=n;                                 
194 }                                                 
195                                                   
196 inline                                            
197 void G4NavigationHistory::EnlargeHistory()        
198 {                                                 
199   std::size_t len = fNavHistory->size();          
200   if ( len == fStackDepth )                       
201   {                                               
202     // Note: Resize operation clears additiona    
203     //                                            
204     std::size_t nlen = len+kHistoryStride;        
205     fNavHistory->resize(nlen);                    
206   }                                               
207 }                                                 
208                                                   
209                                                   
210 inline                                            
211 void G4NavigationHistory::NewLevel( G4VPhysica    
212                                     EVolume vT    
213                                     G4int nRep    
214 {                                                 
215   ++fStackDepth;                                  
216   EnlargeHistory();  // Enlarge if required       
217   (*fNavHistory)[fStackDepth] =                   
218     G4NavigationLevel( pNewMother,                
219                        (*fNavHistory)[fStackDe    
220                        G4AffineTransform(pNewM    
221                        pNewMother->GetTranslat    
222                        vType,                     
223                        nReplica );                
224   // The constructor computes the new global->    
225 }                                                 
226