Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** >> 25 // >> 26 // >> 27 // $Id: G4AssemblyTriplet.icc,v 1.2 2006/06/29 18:56:49 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-01 $ >> 29 // 25 // 30 // 26 // Class G4AssemblyTriplet - inline implementa 31 // Class G4AssemblyTriplet - inline implementation 27 // 32 // 28 // ------------------------------------------- 33 // ---------------------------------------------------------------------- 29 34 30 inline 35 inline 31 G4AssemblyTriplet::G4AssemblyTriplet() 36 G4AssemblyTriplet::G4AssemblyTriplet() >> 37 : fVolume( 0 ), fRotation( 0 ), fAssembly(0), fIsReflection(false) 32 { 38 { 33 G4ThreeVector v(0.,0.,0.); 39 G4ThreeVector v(0.,0.,0.); 34 fTranslation = v; 40 fTranslation = v; 35 } 41 } 36 42 37 inline 43 inline 38 G4AssemblyTriplet::G4AssemblyTriplet( G4Logica 44 G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume, 39 G4ThreeV 45 G4ThreeVector& translation, 40 G4Rotati 46 G4RotationMatrix* pRotation, 41 G4bool i 47 G4bool isReflection ) 42 : fVolume( pVolume ), fTranslation( translat 48 : fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ), 43 fIsReflection(isReflection) << 49 fAssembly( 0 ), fIsReflection(isReflection) 44 { 50 { 45 } 51 } 46 52 47 inline 53 inline 48 G4AssemblyTriplet::G4AssemblyTriplet( G4Assemb 54 G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly, 49 G4ThreeV 55 G4ThreeVector& translation, 50 G4Rotati 56 G4RotationMatrix* pRotation, 51 G4bool i 57 G4bool isReflection ) 52 : fTranslation( translation ), fRotation( pR << 58 : fVolume( 0 ), fTranslation( translation ), fRotation( pRotation ), 53 fAssembly( pAssembly ), fIsReflection(isRe 59 fAssembly( pAssembly ), fIsReflection(isReflection) 54 { 60 { 55 } 61 } 56 62 57 inline 63 inline 58 G4AssemblyTriplet::G4AssemblyTriplet( const G4 << 64 G4AssemblyTriplet::G4AssemblyTriplet( const G4AssemblyTriplet& second ) 59 { 65 { 60 fVolume = scopy.GetVolume(); << 66 fVolume = second.GetVolume(); 61 fRotation = scopy.GetRotation(); << 67 fRotation = second.GetRotation(); 62 fTranslation = scopy.GetTranslation(); << 68 fTranslation = second.GetTranslation(); 63 fAssembly = scopy.GetAssembly(); << 69 fAssembly = second.GetAssembly(); 64 fIsReflection = scopy.IsReflection(); << 70 fIsReflection = second.IsReflection(); 65 } 71 } 66 72 67 inline 73 inline 68 G4AssemblyTriplet::~G4AssemblyTriplet() = defa << 74 G4AssemblyTriplet::~G4AssemblyTriplet() >> 75 { >> 76 } 69 77 70 inline 78 inline 71 G4LogicalVolume* G4AssemblyTriplet::GetVolume( 79 G4LogicalVolume* G4AssemblyTriplet::GetVolume() const 72 { 80 { 73 return fVolume; 81 return fVolume; 74 } 82 } 75 83 76 inline 84 inline 77 void G4AssemblyTriplet::SetVolume( G4LogicalVo 85 void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume ) 78 { 86 { 79 if ( fAssembly != nullptr ) << 87 if ( fAssembly ) 80 { 88 { 81 G4Exception("G4AssemblyTriplet::SetVolume( 89 G4Exception("G4AssemblyTriplet::SetVolume()", 82 "GeomVol1001", JustWarning, << 90 "IllegalCall", JustWarning, 83 "There is an assembly already 91 "There is an assembly already set, it will be ignored."); 84 } 92 } 85 fVolume = pVolume; 93 fVolume = pVolume; 86 fAssembly = nullptr; << 94 fAssembly = 0; 87 } 95 } 88 96 89 inline 97 inline 90 G4AssemblyVolume* G4AssemblyTriplet::GetAssemb 98 G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const 91 { 99 { 92 return fAssembly; 100 return fAssembly; 93 } 101 } 94 102 95 inline 103 inline 96 void G4AssemblyTriplet::SetAssembly( G4Assembl 104 void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly ) 97 { 105 { 98 if ( fVolume != nullptr ) << 106 if ( fVolume ) 99 { 107 { 100 G4Exception("G4AssemblyTriplet::SetAssembl 108 G4Exception("G4AssemblyTriplet::SetAssembly()", 101 "GeomVol1001", JustWarning, << 109 "IllegalCall", JustWarning, 102 "There is a volume already set 110 "There is a volume already set, it will be ignored."); 103 } 111 } 104 fAssembly = pAssembly; 112 fAssembly = pAssembly; 105 fVolume = nullptr; << 113 fVolume = 0; 106 } 114 } 107 115 108 inline 116 inline 109 G4ThreeVector G4AssemblyTriplet::GetTranslatio 117 G4ThreeVector G4AssemblyTriplet::GetTranslation() const 110 { 118 { 111 return fTranslation; 119 return fTranslation; 112 } 120 } 113 121 114 inline 122 inline 115 void G4AssemblyTriplet::SetTranslation( G4Thre 123 void G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation ) 116 { 124 { 117 fTranslation = translation; 125 fTranslation = translation; 118 } 126 } 119 127 120 inline 128 inline 121 G4RotationMatrix* G4AssemblyTriplet::GetRotati 129 G4RotationMatrix* G4AssemblyTriplet::GetRotation() const 122 { 130 { 123 return fRotation; 131 return fRotation; 124 } 132 } 125 133 126 inline 134 inline 127 void G4AssemblyTriplet::SetRotation( G4Rotatio 135 void G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation ) 128 { 136 { 129 fRotation = pRotation; 137 fRotation = pRotation; 130 } 138 } 131 139 132 inline 140 inline 133 G4bool G4AssemblyTriplet::IsReflection() const 141 G4bool G4AssemblyTriplet::IsReflection() const 134 { 142 { 135 return fIsReflection; 143 return fIsReflection; 136 } 144 } 137 145 138 inline 146 inline 139 G4AssemblyTriplet& 147 G4AssemblyTriplet& 140 G4AssemblyTriplet::operator=( const G4Assembly << 148 G4AssemblyTriplet::operator=( const G4AssemblyTriplet& second ) 141 { 149 { 142 if( this != &scopy ) << 150 if( this != &second ) 143 { 151 { 144 fVolume = scopy.GetVolume(); << 152 fVolume = second.GetVolume(); 145 fRotation = scopy.GetRotation(); << 153 fRotation = second.GetRotation(); 146 fTranslation = scopy.GetTranslation(); << 154 fTranslation = second.GetTranslation(); 147 fAssembly = scopy.GetAssembly(); << 155 fAssembly = second.GetAssembly(); 148 fIsReflection = scopy.IsReflection(); << 156 fIsReflection = second.IsReflection(); 149 } 157 } 150 158 151 return *this; 159 return *this; 152 } 160 } 153 161