File indexing completed on 2026-04-09 07:49:29
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009 #include <string>
0010 #include <cstring>
0011
0012 class G4LogicalSurface ;
0013 class G4VPhysicalVolume ;
0014
0015 struct S4Surface
0016 {
0017 static G4LogicalSurface* Find( const G4VPhysicalVolume* thePrePV, const G4VPhysicalVolume* thePostPV ) ;
0018 };
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 inline G4LogicalSurface* S4Surface::Find( const G4VPhysicalVolume* thePrePV, const G4VPhysicalVolume* thePostPV )
0036 {
0037 if(thePostPV == nullptr || thePrePV == nullptr ) return nullptr ;
0038 G4LogicalSurface* Surface = G4LogicalBorderSurface::GetSurface(thePrePV, thePostPV);
0039 if(Surface == nullptr)
0040 {
0041 G4bool enteredDaughter = thePostPV->GetMotherLogical() == thePrePV->GetLogicalVolume();
0042 if(enteredDaughter)
0043 {
0044 Surface = G4LogicalSkinSurface::GetSurface(thePostPV->GetLogicalVolume());
0045 if(Surface == nullptr)
0046 Surface = G4LogicalSkinSurface::GetSurface(thePrePV->GetLogicalVolume());
0047 }
0048 else
0049 {
0050 Surface = G4LogicalSkinSurface::GetSurface(thePrePV->GetLogicalVolume());
0051 if(Surface == nullptr)
0052 Surface = G4LogicalSkinSurface::GetSurface(thePostPV->GetLogicalVolume());
0053 }
0054 }
0055 return Surface ;
0056 }
0057
0058