[831] | 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: G4AssemblyTriplet.icc,v 1.2 2006/06/29 18:56:49 gunter Exp $ |
---|
[1228] | 28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[831] | 29 | // |
---|
| 30 | // |
---|
| 31 | // Class G4AssemblyTriplet - inline implementation |
---|
| 32 | // |
---|
| 33 | // ---------------------------------------------------------------------- |
---|
| 34 | |
---|
| 35 | inline |
---|
| 36 | G4AssemblyTriplet::G4AssemblyTriplet() |
---|
| 37 | : fVolume( 0 ), fRotation( 0 ), fAssembly(0), fIsReflection(false) |
---|
| 38 | { |
---|
| 39 | G4ThreeVector v(0.,0.,0.); |
---|
| 40 | fTranslation = v; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | inline |
---|
| 44 | G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume, |
---|
| 45 | G4ThreeVector& translation, |
---|
| 46 | G4RotationMatrix* pRotation, |
---|
| 47 | G4bool isReflection ) |
---|
| 48 | : fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ), |
---|
| 49 | fAssembly( 0 ), fIsReflection(isReflection) |
---|
| 50 | { |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | inline |
---|
| 54 | G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly, |
---|
| 55 | G4ThreeVector& translation, |
---|
| 56 | G4RotationMatrix* pRotation, |
---|
| 57 | G4bool isReflection ) |
---|
| 58 | : fVolume( 0 ), fTranslation( translation ), fRotation( pRotation ), |
---|
| 59 | fAssembly( pAssembly ), fIsReflection(isReflection) |
---|
| 60 | { |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | inline |
---|
| 64 | G4AssemblyTriplet::G4AssemblyTriplet( const G4AssemblyTriplet& second ) |
---|
| 65 | { |
---|
| 66 | fVolume = second.GetVolume(); |
---|
| 67 | fRotation = second.GetRotation(); |
---|
| 68 | fTranslation = second.GetTranslation(); |
---|
| 69 | fAssembly = second.GetAssembly(); |
---|
| 70 | fIsReflection = second.IsReflection(); |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | inline |
---|
| 74 | G4AssemblyTriplet::~G4AssemblyTriplet() |
---|
| 75 | { |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | inline |
---|
| 79 | G4LogicalVolume* G4AssemblyTriplet::GetVolume() const |
---|
| 80 | { |
---|
| 81 | return fVolume; |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | inline |
---|
| 85 | void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume ) |
---|
| 86 | { |
---|
| 87 | if ( fAssembly ) |
---|
| 88 | { |
---|
| 89 | G4Exception("G4AssemblyTriplet::SetVolume()", |
---|
| 90 | "IllegalCall", JustWarning, |
---|
| 91 | "There is an assembly already set, it will be ignored."); |
---|
| 92 | } |
---|
| 93 | fVolume = pVolume; |
---|
| 94 | fAssembly = 0; |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | inline |
---|
| 98 | G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const |
---|
| 99 | { |
---|
| 100 | return fAssembly; |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | inline |
---|
| 104 | void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly ) |
---|
| 105 | { |
---|
| 106 | if ( fVolume ) |
---|
| 107 | { |
---|
| 108 | G4Exception("G4AssemblyTriplet::SetAssembly()", |
---|
| 109 | "IllegalCall", JustWarning, |
---|
| 110 | "There is a volume already set, it will be ignored."); |
---|
| 111 | } |
---|
| 112 | fAssembly = pAssembly; |
---|
| 113 | fVolume = 0; |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | inline |
---|
| 117 | G4ThreeVector G4AssemblyTriplet::GetTranslation() const |
---|
| 118 | { |
---|
| 119 | return fTranslation; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | inline |
---|
| 123 | void G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation ) |
---|
| 124 | { |
---|
| 125 | fTranslation = translation; |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | inline |
---|
| 129 | G4RotationMatrix* G4AssemblyTriplet::GetRotation() const |
---|
| 130 | { |
---|
| 131 | return fRotation; |
---|
| 132 | } |
---|
| 133 | |
---|
| 134 | inline |
---|
| 135 | void G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation ) |
---|
| 136 | { |
---|
| 137 | fRotation = pRotation; |
---|
| 138 | } |
---|
| 139 | |
---|
| 140 | inline |
---|
| 141 | G4bool G4AssemblyTriplet::IsReflection() const |
---|
| 142 | { |
---|
| 143 | return fIsReflection; |
---|
| 144 | } |
---|
| 145 | |
---|
| 146 | inline |
---|
| 147 | G4AssemblyTriplet& |
---|
| 148 | G4AssemblyTriplet::operator=( const G4AssemblyTriplet& second ) |
---|
| 149 | { |
---|
| 150 | if( this != &second ) |
---|
| 151 | { |
---|
| 152 | fVolume = second.GetVolume(); |
---|
| 153 | fRotation = second.GetRotation(); |
---|
| 154 | fTranslation = second.GetTranslation(); |
---|
| 155 | fAssembly = second.GetAssembly(); |
---|
| 156 | fIsReflection = second.IsReflection(); |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | return *this; |
---|
| 160 | } |
---|