Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // class G4ParameterisedNavigation 27 // 28 // Class description: 29 // 30 // Utility for navigation in volumes containing a single G4PVParameterised 31 // volume for which voxels for the replicated volumes have been constructed. 32 // [Voxels MUST be along one axis only: NOT refined] 33 34 // History: 35 // - Created. Paul Kent, Aug 96 36 // -------------------------------------------------------------------- 37 #ifndef G4PARAMETERISEDNAVIGATION_HH 38 #define G4PARAMETERISEDNAVIGATION_HH 39 40 #include "G4Types.hh" 41 42 #include <vector> 43 44 #include "G4VoxelNavigation.hh" 45 #include "G4NavigationHistory.hh" 46 #include "G4AffineTransform.hh" 47 #include "G4VPhysicalVolume.hh" 48 #include "G4VPVParameterisation.hh" 49 #include "G4LogicalVolume.hh" 50 #include "G4VSolid.hh" 51 #include "G4ThreeVector.hh" 52 #include "G4BlockingList.hh" 53 54 class G4ParameterisedNavigation : public G4VoxelNavigation 55 { 56 public: // with description 57 58 G4ParameterisedNavigation(); 59 ~G4ParameterisedNavigation() override; 60 61 inline G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead, 62 const G4ThreeVector& localPoint ); 63 64 G4bool LevelLocate( G4NavigationHistory& history, 65 const G4VPhysicalVolume* blockedVol, 66 const G4int blockedNum, 67 const G4ThreeVector& globalPoint, 68 const G4ThreeVector* globalDirection, 69 const G4bool pLocatedOnEdge, 70 G4ThreeVector& localPoint ) override; 71 72 G4double ComputeStep( const G4ThreeVector& globalPoint, 73 const G4ThreeVector& globalDirection, 74 const G4double currentProposedStepLength, 75 G4double& newSafety, 76 G4NavigationHistory& history, 77 G4bool& validExitNormal, 78 G4ThreeVector& exitNormal, 79 G4bool& exiting, 80 G4bool& entering, 81 G4VPhysicalVolume *(*pBlockedPhysical), 82 G4int& blockedReplicaNo ) override; 83 84 G4double ComputeSafety( const G4ThreeVector& localPoint, 85 const G4NavigationHistory& history, 86 const G4double pProposedMaxLength=DBL_MAX ) override; 87 88 void RelocateWithinVolume( G4VPhysicalVolume* motherPhysical, 89 const G4ThreeVector& localPoint ) override; 90 91 private: 92 93 G4double ComputeVoxelSafety( const G4ThreeVector& localPoint, 94 const EAxis pAxis ) const; 95 G4bool LocateNextVoxel( const G4ThreeVector& localPoint, 96 const G4ThreeVector& localDirection, 97 const G4double currentStep, 98 const EAxis pAxis ); 99 private: 100 101 // Necessary to resolve cases with nested parameterisations 102 103 inline G4VSolid* IdentifyAndPlaceSolid( G4int num, 104 G4VPhysicalVolume* apparentPhys, 105 G4VPVParameterisation* curParam ); 106 // Call virtual 'Compute' methods, and copy information if nested. 107 // 'ApparentPhys' is potentially a PhysV or PhysT. 108 109 G4VPhysicalVolume* CreateVolumeWithParent(G4VPhysicalVolume* curPhysical, 110 const G4NavigationHistory& hist ); 111 // Create necessary parent touchable and physical with parent. 112 113 private: 114 115 // Voxel Stack information (for 1D optimisation only) 116 // 117 EAxis fVoxelAxis = kUndefined; 118 G4int fVoxelNoSlices = 0; 119 G4double fVoxelSliceWidth = 0.0; 120 std::size_t fVoxelNodeNo = 0; 121 G4SmartVoxelHeader* fVoxelHeader = nullptr; 122 }; 123 124 #include "G4ParameterisedNavigation.icc" 125 126 #endif 127