00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef G4VOXELNAVIGATION_HH
00041 #define G4VOXELNAVIGATION_HH
00042
00043 #include "geomdefs.hh"
00044 #include "G4NavigationHistory.hh"
00045 #include "G4NavigationLogger.hh"
00046 #include "G4AffineTransform.hh"
00047 #include "G4VPhysicalVolume.hh"
00048 #include "G4LogicalVolume.hh"
00049 #include "G4VSolid.hh"
00050 #include "G4ThreeVector.hh"
00051
00052 #include "G4BlockingList.hh"
00053
00054 class G4VoxelSafety;
00055
00056
00057
00058 #include "G4AuxiliaryNavServices.hh"
00059
00060
00061
00062 #include <vector>
00063 #include "G4SmartVoxelProxy.hh"
00064 #include "G4SmartVoxelNode.hh"
00065 #include "G4SmartVoxelHeader.hh"
00066
00067 class G4VoxelNavigation
00068 {
00069 public:
00070
00071 G4VoxelNavigation();
00072 virtual ~G4VoxelNavigation();
00073
00074 G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
00075 const G4ThreeVector& localPoint );
00076
00077 virtual G4bool LevelLocate( G4NavigationHistory& history,
00078 const G4VPhysicalVolume* blockedVol,
00079 const G4int blockedNum,
00080 const G4ThreeVector& globalPoint,
00081 const G4ThreeVector* globalDirection,
00082 const G4bool pLocatedOnEdge,
00083 G4ThreeVector& localPoint );
00084
00085 virtual G4double ComputeStep( const G4ThreeVector& globalPoint,
00086 const G4ThreeVector& globalDirection,
00087 const G4double currentProposedStepLength,
00088 G4double& newSafety,
00089 G4NavigationHistory& history,
00090 G4bool& validExitNormal,
00091 G4ThreeVector& exitNormal,
00092 G4bool& exiting,
00093 G4bool& entering,
00094 G4VPhysicalVolume *(*pBlockedPhysical),
00095 G4int& blockedReplicaNo );
00096
00097 virtual G4double ComputeSafety( const G4ThreeVector& globalpoint,
00098 const G4NavigationHistory& history,
00099 const G4double pMaxLength=DBL_MAX );
00100
00101 inline G4int GetVerboseLevel() const;
00102 void SetVerboseLevel(G4int level);
00103
00104
00105
00106 inline void CheckMode(G4bool mode);
00107
00108
00109
00110
00111 inline void EnableBestSafety( G4bool flag= false );
00112
00113
00114 protected:
00115
00116 G4double ComputeVoxelSafety( const G4ThreeVector& localPoint ) const;
00117 G4bool LocateNextVoxel( const G4ThreeVector& localPoint,
00118 const G4ThreeVector& localDirection,
00119 const G4double currentStep );
00120
00121 G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
00122 const G4ThreeVector& localPoint ) const;
00123
00124 private:
00125
00126 void PreComputeStepLog (const G4VPhysicalVolume* motherPhysical,
00127 G4double motherSafety,
00128 const G4ThreeVector& localPoint);
00129 void AlongComputeStepLog(const G4VSolid* sampleSolid,
00130 const G4ThreeVector& samplePoint,
00131 const G4ThreeVector& sampleDirection,
00132 const G4ThreeVector& localDirection,
00133 G4double sampleSafety,
00134 G4double sampleStep);
00135 void PostComputeStepLog (const G4VSolid* motherSolid,
00136 const G4ThreeVector& localPoint,
00137 const G4ThreeVector& localDirection,
00138 G4double motherStep,
00139 G4double motherSafety);
00140 void ComputeSafetyLog (const G4VSolid* solid,
00141 const G4ThreeVector& point,
00142 G4double safety,
00143 G4bool banner);
00144 inline void PrintDaughterLog (const G4VSolid* sampleSolid,
00145 const G4ThreeVector& samplePoint,
00146 G4double sampleSafety,
00147 G4double sampleStep);
00148 protected:
00149
00150 G4BlockingList fBList;
00151
00152
00153
00154
00155
00156
00157 G4int fVoxelDepth;
00158
00159
00160
00161 std::vector<EAxis> fVoxelAxisStack;
00162
00163
00164 std::vector<G4int> fVoxelNoSlicesStack;
00165
00166
00167 std::vector<G4double> fVoxelSliceWidthStack;
00168
00169
00170 std::vector<G4int> fVoxelNodeNoStack;
00171
00172
00173 std::vector<G4SmartVoxelHeader*> fVoxelHeaderStack;
00174
00175
00176 G4SmartVoxelNode* fVoxelNode;
00177
00178
00179
00180
00181
00182
00183 G4VoxelSafety *fpVoxelSafety;
00184
00185
00186 G4bool fCheck;
00187 G4bool fBestSafety;
00188
00189 G4NavigationLogger* fLogger;
00190
00191 };
00192
00193 #include "G4VoxelNavigation.icc"
00194
00195 #endif