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 /* 27 * G4ITNavigatorState2.cc 28 * 29 * Created on: 25 févr. 2014 30 * Author: kara 31 */ 32 33 #include "G4ITNavigator.hh" 34 //#include "G4ITNavigator2.hh" 35 36 // !> 37 38 G4ITNavigator2 ::G4NavigatorState::G4NavigatorState() 39 { 40 ResetState(); 41 } 42 43 void G4ITNavigator2::G4NavigatorState::ResetStack() 44 { 45 fHistory.Reset(); 46 } 47 48 void G4ITNavigator2::G4NavigatorState::ResetState() 49 { 50 fCalculatedExitNormal = false; 51 fChangedGrandMotherRefFrame = false; 52 fLastTriedStepComputation = false; 53 fWasLimitedByGeometry = false; 54 fEntering = false; 55 fExiting = false; 56 fLocatedOnEdge = false; 57 fLastStepWasZero = false; 58 fEnteredDaughter = false; 59 fExitedMother = false; 60 fPushed = false; 61 62 fValidExitNormal = false; 63 fExitNormal = G4ThreeVector(0, 0, 0); 64 65 fPreviousSftOrigin = G4ThreeVector(0, 0, 0); 66 fPreviousSafety = 0.0; 67 68 fNumberZeroSteps = 0; 69 70 fStepEndPoint = G4ThreeVector(kInfinity, kInfinity, kInfinity); 71 fLastStepEndPointLocal = G4ThreeVector(kInfinity, kInfinity, kInfinity); 72 73 fBlockedPhysicalVolume = nullptr; 74 fBlockedReplicaNo = -1; 75 76 fLastLocatedPointLocal = G4ThreeVector(kInfinity, -kInfinity, 0.0); 77 fLocatedOutsideWorld = false; 78 } 79 80 G4ITNavigator2 ::G4NavigatorState::G4NavigatorState(const G4NavigatorState& rhs) 81 { 82 fExitNormal = rhs.fExitNormal; 83 fValidExitNormal = rhs.fValidExitNormal; 84 fExiting = rhs.fExiting; 85 fEntering = rhs.fEntering; 86 87 fBlockedPhysicalVolume = rhs.fBlockedPhysicalVolume; 88 fBlockedReplicaNo = rhs.fBlockedReplicaNo, 89 90 fLastStepWasZero = rhs.fLastStepWasZero; 91 92 fLocatedOutsideWorld = rhs.fLocatedOutsideWorld; 93 fLastLocatedPointLocal = rhs.fLastLocatedPointLocal; 94 fEnteredDaughter = rhs.fEnteredDaughter; 95 fExitedMother = rhs.fExitedMother; 96 fWasLimitedByGeometry = rhs.fWasLimitedByGeometry; 97 98 fPreviousSftOrigin = rhs.fPreviousSftOrigin; 99 fPreviousSafety = rhs.fPreviousSafety; 100 101 fLastTriedStepComputation = rhs.fLastTriedStepComputation; 102 fChangedGrandMotherRefFrame = rhs.fChangedGrandMotherRefFrame; 103 fCalculatedExitNormal = rhs.fCalculatedExitNormal; 104 105 fNumberZeroSteps = rhs.fNumberZeroSteps; 106 fLocatedOnEdge = rhs.fLocatedOnEdge; 107 fPushed = rhs.fPushed; 108 fNumberZeroSteps = rhs.fNumberZeroSteps; 109 } 110 111 G4ITNavigator2::G4NavigatorState& 112 G4ITNavigator2::G4NavigatorState::operator=(const G4NavigatorState& rhs) 113 { 114 if (this == &rhs) return *this; 115 fExitNormal = rhs.fExitNormal; 116 fValidExitNormal = rhs.fValidExitNormal; 117 fExiting = rhs.fExiting; 118 fEntering = rhs.fEntering; 119 120 fBlockedPhysicalVolume = rhs.fBlockedPhysicalVolume; 121 fBlockedReplicaNo = rhs.fBlockedReplicaNo; 122 fCalculatedExitNormal = rhs.fCalculatedExitNormal; 123 124 fLastStepWasZero = rhs.fLastStepWasZero; 125 fLastTriedStepComputation = rhs.fLastTriedStepComputation; 126 fChangedGrandMotherRefFrame = rhs.fChangedGrandMotherRefFrame; 127 128 fPreviousSftOrigin = rhs.fPreviousSftOrigin; 129 fPreviousSafety = rhs.fPreviousSafety; 130 fNumberZeroSteps = rhs.fNumberZeroSteps; 131 fLocatedOnEdge = rhs.fLocatedOnEdge; 132 fWasLimitedByGeometry = rhs.fWasLimitedByGeometry; 133 fPushed = rhs.fPushed; 134 fNumberZeroSteps = rhs.fNumberZeroSteps; 135 fEnteredDaughter = rhs.fEnteredDaughter; 136 fExitedMother = rhs.fExitedMother; 137 138 fLastLocatedPointLocal = rhs.fLastLocatedPointLocal; 139 fLocatedOutsideWorld = rhs.fLocatedOutsideWorld; 140 141 return *this; 142 } 143 144 G4ITNavigator2 ::G4SaveNavigatorState::G4SaveNavigatorState() 145 { 146 147 sWasLimitedByGeometry = false; 148 sEntering = false; 149 sExiting = false; 150 sLastStepWasZero = 0; 151 sEnteredDaughter = false; 152 sExitedMother = false; 153 154 155 sValidExitNormal = false; 156 sExitNormal = G4ThreeVector(0, 0, 0); 157 158 sPreviousSftOrigin = G4ThreeVector(0, 0, 0); 159 sPreviousSafety = 0.0; 160 161 // sLocatedOnEdge = false; 162 // sPushed = false; 163 // sNumberZeroSteps = 0; 164 165 spBlockedPhysicalVolume = nullptr; 166 sBlockedReplicaNo = -1; 167 168 sLastLocatedPointLocal = G4ThreeVector(kInfinity, -kInfinity, 0.0); 169 sLocatedOutsideWorld = false; 170 } 171 172 G4ITNavigator2 ::G4SaveNavigatorState::G4SaveNavigatorState(G4NavigatorState* rhs) 173 { 174 sExitNormal = rhs->fExitNormal; 175 sValidExitNormal = rhs->fValidExitNormal; 176 sExiting = rhs->fExiting; 177 sEntering = rhs->fEntering; 178 179 spBlockedPhysicalVolume = rhs->fBlockedPhysicalVolume; 180 sBlockedReplicaNo = rhs->fBlockedReplicaNo; 181 182 sLastStepWasZero = static_cast<G4int>(rhs->fLastStepWasZero); 183 184 sPreviousSftOrigin = rhs->fPreviousSftOrigin; 185 sPreviousSafety = rhs->fPreviousSafety; 186 187 sWasLimitedByGeometry = rhs->fWasLimitedByGeometry; 188 189 // sLocatedOnEdge = rhs->fLocatedOnEdge; 190 // sPushed = rhs->fPushed; 191 // sNumberZeroSteps = rhs->fNumberZeroSteps; 192 193 sEnteredDaughter = rhs->fEnteredDaughter; 194 sExitedMother = rhs->fExitedMother; 195 196 sLastLocatedPointLocal = rhs->fLastLocatedPointLocal; 197 sLocatedOutsideWorld = rhs->fLocatedOutsideWorld; 198 } 199 200 G4ITNavigator2::G4NavigatorState& G4ITNavigator2::G4NavigatorState::operator=(const G4SaveNavigatorState& rhs) 201 { 202 fExitNormal = rhs.sExitNormal; 203 fValidExitNormal = rhs.sValidExitNormal; 204 fExiting = rhs.sExiting; 205 fEntering = rhs.sEntering; 206 207 fBlockedPhysicalVolume = rhs.spBlockedPhysicalVolume; 208 fBlockedReplicaNo = rhs.sBlockedReplicaNo; 209 // fCalculatedExitNormal = rhs.sCalculatedExitNormal; 210 211 fLastStepWasZero = (rhs.sLastStepWasZero != 0); 212 // fLastTriedStepComputation =rhs.sLastTriedStepComputation; 213 // fChangedGrandMotherRefFrame = rhs.sChangedGrandMotherRefFrame; 214 215 fPreviousSftOrigin = rhs.sPreviousSftOrigin; 216 fPreviousSafety = rhs.sPreviousSafety; 217 // fNumberZeroSteps = rhs.sNumberZeroSteps; 218 // fLocatedOnEdge = rhs.sLocatedOnEdge; 219 // fPushed = rhs.sPushed; 220 fWasLimitedByGeometry = rhs.sWasLimitedByGeometry; 221 222 fEnteredDaughter = rhs.sEnteredDaughter; 223 fExitedMother = rhs.sExitedMother; 224 225 fLastLocatedPointLocal = rhs.sLastLocatedPointLocal; 226 fLocatedOutsideWorld = rhs.sLocatedOutsideWorld; 227 return *this; 228 } 229