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 | // |
---|
27 | // $Id: G4ParameterisedNavigation.hh,v 1.6 2007/11/09 16:06:02 gcosmo Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-cand-01 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // class G4ParameterisedNavigation |
---|
32 | // |
---|
33 | // Class description: |
---|
34 | // |
---|
35 | // Utility for navigation in volumes containing a single G4PVParameterised |
---|
36 | // volume for which voxels for the replicated volumes have been constructed. |
---|
37 | // [Voxels MUST be along one axis only: NOT refined] |
---|
38 | |
---|
39 | // History: |
---|
40 | // - Created. Paul Kent, Aug 96 |
---|
41 | // -------------------------------------------------------------------- |
---|
42 | #ifndef G4PARAMETERISEDNAVIGATION_HH |
---|
43 | #define G4PARAMETERISEDNAVIGATION_HH |
---|
44 | |
---|
45 | #include "G4Types.hh" |
---|
46 | |
---|
47 | #include <vector> |
---|
48 | |
---|
49 | #include "G4VoxelNavigation.hh" |
---|
50 | #include "G4NavigationHistory.hh" |
---|
51 | #include "G4AffineTransform.hh" |
---|
52 | #include "G4VPhysicalVolume.hh" |
---|
53 | #include "G4VPVParameterisation.hh" |
---|
54 | #include "G4LogicalVolume.hh" |
---|
55 | #include "G4VSolid.hh" |
---|
56 | #include "G4ThreeVector.hh" |
---|
57 | #include "G4BlockingList.hh" |
---|
58 | |
---|
59 | class G4ParameterisedNavigation : public G4VoxelNavigation |
---|
60 | { |
---|
61 | public: // with description |
---|
62 | |
---|
63 | G4ParameterisedNavigation(); |
---|
64 | ~G4ParameterisedNavigation(); |
---|
65 | |
---|
66 | inline G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead, |
---|
67 | const G4ThreeVector& localPoint ); |
---|
68 | |
---|
69 | G4bool LevelLocate( G4NavigationHistory& history, |
---|
70 | const G4VPhysicalVolume* blockedVol, |
---|
71 | const G4int blockedNum, |
---|
72 | const G4ThreeVector& globalPoint, |
---|
73 | const G4ThreeVector* globalDirection, |
---|
74 | const G4bool pLocatedOnEdge, |
---|
75 | G4ThreeVector& localPoint ); |
---|
76 | |
---|
77 | G4double ComputeStep( const G4ThreeVector& globalPoint, |
---|
78 | const G4ThreeVector& globalDirection, |
---|
79 | const G4double currentProposedStepLength, |
---|
80 | G4double& newSafety, |
---|
81 | G4NavigationHistory& history, |
---|
82 | G4bool& validExitNormal, |
---|
83 | G4ThreeVector& exitNormal, |
---|
84 | G4bool& exiting, |
---|
85 | G4bool& entering, |
---|
86 | G4VPhysicalVolume *(*pBlockedPhysical), |
---|
87 | G4int& blockedReplicaNo ); |
---|
88 | |
---|
89 | G4double ComputeSafety( const G4ThreeVector& localPoint, |
---|
90 | const G4NavigationHistory& history, |
---|
91 | const G4double pProposedMaxLength=DBL_MAX ); |
---|
92 | |
---|
93 | private: |
---|
94 | |
---|
95 | G4double ComputeVoxelSafety( const G4ThreeVector& localPoint, |
---|
96 | const EAxis pAxis ) const; |
---|
97 | G4bool LocateNextVoxel( const G4ThreeVector& localPoint, |
---|
98 | const G4ThreeVector& localDirection, |
---|
99 | const G4double currentStep, |
---|
100 | const EAxis pAxis ); |
---|
101 | private: |
---|
102 | |
---|
103 | // Necessary to resolve cases with nested parameterisations |
---|
104 | |
---|
105 | inline G4VSolid* IdentifyAndPlaceSolid( G4int num, |
---|
106 | G4VPhysicalVolume* apparentPhys, |
---|
107 | G4VPVParameterisation* curParam ); |
---|
108 | // Call virtual 'Compute' methods, and copy information if nested. |
---|
109 | // 'ApparentPhys' is potentially a PhysV or PhysT. |
---|
110 | |
---|
111 | G4VPhysicalVolume* CreateVolumeWithParent(G4VPhysicalVolume* curPhysical, |
---|
112 | const G4NavigationHistory& hist ); |
---|
113 | // Create necessary parent touchable and physical with parent. |
---|
114 | |
---|
115 | private: |
---|
116 | |
---|
117 | // Voxel Stack information (for 1D optimisation only) |
---|
118 | // |
---|
119 | EAxis fVoxelAxis; |
---|
120 | G4int fVoxelNoSlices; |
---|
121 | G4double fVoxelSliceWidth; |
---|
122 | G4int fVoxelNodeNo; |
---|
123 | G4SmartVoxelHeader* fVoxelHeader; |
---|
124 | }; |
---|
125 | |
---|
126 | #include "G4ParameterisedNavigation.icc" |
---|
127 | |
---|
128 | #endif |
---|